SlideShare una empresa de Scribd logo
1 de 29
Pragmatic Plone Projects

       PyCON –DE 2012
           Leipzig

           Andreas Jung
            ZOPYX Ltd.
   www.zopyx.com, info@zopyx.com
Speaker
• long-time Python, Zope,
  Plone developer and contributor
• Lead developer and principal consultant of
  ZOPYX Limited
   – Zope, Python, Pyramid, Plone projects
   – large portals, intranet, internet, extranet applications
   – Electronic Publishing
   – complex domain-specific applications
This talk is about

• practical hints surviving your next
  Plone project

• best practices

• lessons learned from our last
  larger Plone project
Relaunch weishaupt.de
• Weishaupt:
   – major vendor of heating systems
   – 480 M€ revenue
• Large company portal on top of Plone 4.2
• Phase 1:
   – implementation and DE content
   – 4 months
• Phase 2:
   – 20 subsidaries
   – more than 20 language combinations
weishaupt.de
weishaupt.de
weishaupt.de
weishaupt.de
weishaupt.de
Project constraints (1/3)

There is no real-world project with

• unlimited budget

• unlimited human resources

• unlimited time
Project constraints (2/3)

            Resources




   Budget               Time
Project constraints (3/3)

Conclusions

• usually impossible finding the
  „perfect“ solution

• the „perfect“ solution is „mission impossible“
Getting things done
• within a reasonable time-frame

• on budget

• with the available human resources
Common customizations
• Bugs in Plone and 3rd-party packages
  are all around you
• Particular behavior of Plone or 3rd-party
  packages is a common project requirement
• What must be usually customized:
  – Python code (browser views, skin scripts)
  – Resources (browser view templates, JS, CSS)
Where to fix things?
• Package maintainer (Plone and 3rd-party) love
   – bug reports
   – bug fixes
   – contributions
• Stuff on Github: Fork & Pull request
• SVN repositories: svn branch & svn merge
   – check if the package is maintained
   – ask the maintainer for merging your changes or merge yourself
   – move packages to Github if appropriate
Where and how to
              customize things?
• Is your required change of interest for the public?
   – fork on Github
   – branch in SVN
   – speak with the package maintainers

• Your change satisfies an absurd customer
  request?
   – keep it for yourself.
(Monkey) Patching Python code
• Monkey patching:
  „dynamic modifications of a class or module at runtime“
  (Source: Wikipedia)

• MP in general should be considered evil and bad-style
• MP may have side-effects
• Use MP carefully (and only when you know what you are
  doing)
Monkey patching in Python
        Original (foo.py)             Patched version (my_foo.py)

class Foo:                  def my_bar(self):
                              return 43
  def bar(self):
      return 42             from foo import Foo
                            Foo.bar = my_bar

                            # or (needed in some situations)

                            Foo.bar.func_code = my_bar.func_code
Monkey patching Plone
                         collective.monkeypatcher (patches.zcml)
ZCML-level configuration of patching   <configure...>
                                          <include package="collective.monkeypatcher" />
information:                              <monkey:patch
• module-level patches                       description="ISE-42: OFS.Image.tag()"
• class-level patches                        class="Products.CMFCore.FSImage.FSImage"
                                             original="tag"
                                             replacement=".patches.tag"
                                             />
                                       </configure>




                   collective.monkeypatcherpanel (patches.zcml)
Patching resources (1/2) –
                        overrides.zcml
      • Standard mechanism for overriding configuration
           settings introduced through a different package
      • overrides.zcml is an optional ZCML configuration file

     Products.PloneGlossary (configure.zcml)                my.package (overrides.zcml)
<configure..>                                    <configure..>
 <browser:page                                    <browser:page
     name="glossary_main_page“                        name="glossary_main_page"
   for="Products.PloneGlossary.IPloneGlossary"      for="Products.PloneGlossary.IPloneGlossary"
     class=".pages.GlossaryMainPage"                  class=".glossary.GlossaryView“
     permission="zope2.View“ />                       permission="zope2.View“ />
</configure>                                     </configure>
Patching resources (2/2) – z3c.jbot
• z3c.jbot allows you to override resources of other
     packages inside your own policy package
• Limited to .pt, .cpt, .js?!
Configuration: <browser:jbot directory=“overrides“ />

Existing template: plone.app.search/plone/app/search/search.pt

Customization: your.package/your/package/overrides/plone.app.search.search.pt

Links
•    http://blog.keul.it/2011/06/z3cjbot-magical-with-your-skins.html
•    http://pypi.python.org/pypi/z3c.jbot
Unconfigure
                    resource configurations
   • Sometimes you just don‘t want or need ZCML
        configurations introduced by other packages
   • z3c.unconfigure is your friend
           some.package(configure.zcml)                   my.package (configure.zcml)
<configure..>                                   <configure..>
 <browser:page                                   <include package="z3c.unconfigure"
     name="glossary_main_page“                         file="meta.zcml" />
  for="Products.PloneGlossary.IPloneGlossary"    <unconfigure>
     class=".pages.GlossaryMainPage"               <browser:page
     permission="zope2.View“ />                       name="glossary_main_page“
</configure>                                      for="Products.PloneGlossary.IPloneGlossary"
                                                      class=".glossary.GlossaryView“
                                                      permission="zope2.View“ />
                                                 </unconfigure>
                                                </configure>
Extending schemas
Plone comes with two content-type systems
• Archetypes (old-style)
   – use archetypes.schemaextender
   – modify any AT-based content-type
      (modifying fields, adding fields)
   – SchemaExtender, SchemaModifier
• Dexterity (new-style)
   – Dexterity introduces „behaviors“
   – „A behavior is a re-usable aspect of an object that can be enabled or
      disabled without changing the component registry“
      (Source: Dexterity developer manual)
Keep your designer happy

   Implementing CSS styles
requires representative content



 http://localhost:8080/@@new-site?content=1
Auto-generated content
Predefined sample content
• Write a browser view
   – creating a Plone site with policy package + add-ons
   – installing the basic site-structure
   – creating example content for each content-type, content-
     listing etc
• use http://lorempixel.com/600/400 ...
• look at loremipsum, collective.loremipsum or
  zopyx.ipsumplone
Predefined sample content
• Throw your sandbox/Plone working site away
  as often as possible
• sometimes I created 30-40 new Plone sites per day
• Pragmatic side-effect
   – the content fixture code can be used as unit test where all
     your content-types and site-infrastructure is created and
     tested in one run
   – not the best solution but it works reasonably well
Some good hints
• Never ever perform customizations in-place in
  existing 3rd-party packages. NEVER!!!
• Customizations always belong into your own
  policy package.
• Local customizations of 3rd-party package will
  be lost with the next version of customized
  package.
Questions?

Más contenido relacionado

La actualidad más candente

Vinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress siteVinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress site
wpnepal
 
Sanjip Shah: Internationalizing and Localizing WordPress Themes
Sanjip Shah: Internationalizing and Localizing  WordPress ThemesSanjip Shah: Internationalizing and Localizing  WordPress Themes
Sanjip Shah: Internationalizing and Localizing WordPress Themes
wpnepal
 
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Michael Pirnat
 

La actualidad más candente (20)

Unleashing Creative Freedom with MODX (2015-07-21 @ PHP FRL)
Unleashing Creative Freedom with MODX (2015-07-21 @ PHP FRL)Unleashing Creative Freedom with MODX (2015-07-21 @ PHP FRL)
Unleashing Creative Freedom with MODX (2015-07-21 @ PHP FRL)
 
Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)
Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)
Unleashing Creative Freedom with MODX (2015-09-03 at GroningenPHP)
 
Caching basics in PHP
Caching basics in PHPCaching basics in PHP
Caching basics in PHP
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme System
 
Get Django, Get Hired - An opinionated guide to getting the best job, for the...
Get Django, Get Hired - An opinionated guide to getting the best job, for the...Get Django, Get Hired - An opinionated guide to getting the best job, for the...
Get Django, Get Hired - An opinionated guide to getting the best job, for the...
 
Vinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress siteVinay Paudel: Optimizing and Speeding up a WordPress site
Vinay Paudel: Optimizing and Speeding up a WordPress site
 
Plugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGemsPlugin-based software design with Ruby and RubyGems
Plugin-based software design with Ruby and RubyGems
 
JRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing WorldJRuby with Java Code in Data Processing World
JRuby with Java Code in Data Processing World
 
Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)
 
Sanjip Shah: Internationalizing and Localizing WordPress Themes
Sanjip Shah: Internationalizing and Localizing  WordPress ThemesSanjip Shah: Internationalizing and Localizing  WordPress Themes
Sanjip Shah: Internationalizing and Localizing WordPress Themes
 
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and ScaleITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
ITT 2015 - Simon Stewart - Building Android Apps at Speed and Scale
 
Django
DjangoDjango
Django
 
CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009CouchDB for Web Applications - Erlang Factory London 2009
CouchDB for Web Applications - Erlang Factory London 2009
 
Class 1 - World Wide Web Introduction
Class 1 - World Wide Web IntroductionClass 1 - World Wide Web Introduction
Class 1 - World Wide Web Introduction
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Unleashing Creative Freedom with MODX (2015-09-08 at PHPAmersfoort)
Unleashing Creative Freedom with MODX (2015-09-08 at PHPAmersfoort)Unleashing Creative Freedom with MODX (2015-09-08 at PHPAmersfoort)
Unleashing Creative Freedom with MODX (2015-09-08 at PHPAmersfoort)
 
Solr Recipes
Solr RecipesSolr Recipes
Solr Recipes
 
Memcached Study
Memcached StudyMemcached Study
Memcached Study
 
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
 
Hadoop 24/7
Hadoop 24/7Hadoop 24/7
Hadoop 24/7
 

Destacado

Making Py Pi Sux Less Key
Making Py Pi Sux Less KeyMaking Py Pi Sux Less Key
Making Py Pi Sux Less Key
Andreas Jung
 
Frequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last timeFrequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last time
Andreas Jung
 
Produce & Publish Authoring Environment World Plone Day 2010 - Berlin
Produce & Publish Authoring Environment World Plone Day 2010 - BerlinProduce & Publish Authoring Environment World Plone Day 2010 - Berlin
Produce & Publish Authoring Environment World Plone Day 2010 - Berlin
Andreas Jung
 
Konfigurationsgesteuerte Buildouts Dzug 2008
Konfigurationsgesteuerte Buildouts   Dzug 2008Konfigurationsgesteuerte Buildouts   Dzug 2008
Konfigurationsgesteuerte Buildouts Dzug 2008
Andreas Jung
 

Destacado (20)

Making Py Pi Sux Less Key
Making Py Pi Sux Less KeyMaking Py Pi Sux Less Key
Making Py Pi Sux Less Key
 
XML Director - the technical foundation of onkopedia.com
XML Director - the technical foundation of onkopedia.comXML Director - the technical foundation of onkopedia.com
XML Director - the technical foundation of onkopedia.com
 
Onkopedia - Ein medizinisches Leitlinienportal auf dem Weg zu XML-basierten P...
Onkopedia - Ein medizinisches Leitlinienportal auf dem Weg zu XML-basierten P...Onkopedia - Ein medizinisches Leitlinienportal auf dem Weg zu XML-basierten P...
Onkopedia - Ein medizinisches Leitlinienportal auf dem Weg zu XML-basierten P...
 
State Of Zope Linuxtag 2008
State Of Zope Linuxtag 2008State Of Zope Linuxtag 2008
State Of Zope Linuxtag 2008
 
Integration of Plone with eXist-db
Integration of Plone with eXist-dbIntegration of Plone with eXist-db
Integration of Plone with eXist-db
 
Plone Integration with eXist-db - Structured Content rocks
Plone Integration with eXist-db - Structured Content rocksPlone Integration with eXist-db - Structured Content rocks
Plone Integration with eXist-db - Structured Content rocks
 
Frequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last timeFrequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last time
 
Plone4Universities
Plone4UniversitiesPlone4Universities
Plone4Universities
 
Producing high-quality documents with Plone
Producing high-quality documents with PloneProducing high-quality documents with Plone
Producing high-quality documents with Plone
 
BRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQLBRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQL
 
Produce & Publish Authoring Environment World Plone Day 2010 - Berlin
Produce & Publish Authoring Environment World Plone Day 2010 - BerlinProduce & Publish Authoring Environment World Plone Day 2010 - Berlin
Produce & Publish Authoring Environment World Plone Day 2010 - Berlin
 
Building bridges - Plone Conference 2015 Bucharest
Building bridges   - Plone Conference 2015 BucharestBuilding bridges   - Plone Conference 2015 Bucharest
Building bridges - Plone Conference 2015 Bucharest
 
Produce & Publish Authoring Environment V 2.0 (english version)
Produce & Publish Authoring Environment V 2.0 (english version)Produce & Publish Authoring Environment V 2.0 (english version)
Produce & Publish Authoring Environment V 2.0 (english version)
 
CSS Paged Media - A review of tools and techniques
CSS Paged Media - A review of tools and techniquesCSS Paged Media - A review of tools and techniques
CSS Paged Media - A review of tools and techniques
 
Python mongo db-training-europython-2011
Python mongo db-training-europython-2011Python mongo db-training-europython-2011
Python mongo db-training-europython-2011
 
Why Plone Will Die
Why Plone Will DieWhy Plone Will Die
Why Plone Will Die
 
Why we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL DatabaseWhy we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL Database
 
Konfigurationsgesteuerte Buildouts Dzug 2008
Konfigurationsgesteuerte Buildouts   Dzug 2008Konfigurationsgesteuerte Buildouts   Dzug 2008
Konfigurationsgesteuerte Buildouts Dzug 2008
 
zopyx.plone migration - Plone Hochschultagung 2013
zopyx.plone migration - Plone Hochschultagung 2013zopyx.plone migration - Plone Hochschultagung 2013
zopyx.plone migration - Plone Hochschultagung 2013
 
Onkopedia - ein medizinisches Fachportal auf Basis von Plone
Onkopedia  - ein medizinisches Fachportal auf Basis von PloneOnkopedia  - ein medizinisches Fachportal auf Basis von Plone
Onkopedia - ein medizinisches Fachportal auf Basis von Plone
 

Similar a Pragmatische Plone Projekte

IzPack at LyonJUG'11
IzPack at LyonJUG'11IzPack at LyonJUG'11
IzPack at LyonJUG'11
julien.ponge
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
Drupalcon Paris
 
DevHub 3 - Composer plus Magento
DevHub 3 - Composer plus MagentoDevHub 3 - Composer plus Magento
DevHub 3 - Composer plus Magento
Magento Dev
 

Similar a Pragmatische Plone Projekte (20)

Building Content Types with Dexterity
Building Content Types with DexterityBuilding Content Types with Dexterity
Building Content Types with Dexterity
 
Strategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringStrategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoring
 
David Convent - Theme It Yourself
David Convent - Theme It YourselfDavid Convent - Theme It Yourself
David Convent - Theme It Yourself
 
Upgrading a Plone 3 Theme for Plone 4: Beyond the Basics
Upgrading a Plone 3 Theme for Plone 4: Beyond the BasicsUpgrading a Plone 3 Theme for Plone 4: Beyond the Basics
Upgrading a Plone 3 Theme for Plone 4: Beyond the Basics
 
PowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue KidPowerShell - Be A Cool Blue Kid
PowerShell - Be A Cool Blue Kid
 
Hibernate java and_oracle
Hibernate java and_oracleHibernate java and_oracle
Hibernate java and_oracle
 
IzPack at LyonJUG'11
IzPack at LyonJUG'11IzPack at LyonJUG'11
IzPack at LyonJUG'11
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC Deployments
 
Automation using Puppet 3
Automation using Puppet 3 Automation using Puppet 3
Automation using Puppet 3
 
Build Python CMS The Plone Way
Build Python CMS The Plone WayBuild Python CMS The Plone Way
Build Python CMS The Plone Way
 
Flamingo Carotene
Flamingo CaroteneFlamingo Carotene
Flamingo Carotene
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
Joomla plugin & module develpment - Presented at Sydney JUG 09/04/2013
 
Python import mechanism
Python import mechanismPython import mechanism
Python import mechanism
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
Setting up Puppet at Colruyt
Setting up Puppet at ColruytSetting up Puppet at Colruyt
Setting up Puppet at Colruyt
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
 
DevHub 3 - Composer plus Magento
DevHub 3 - Composer plus MagentoDevHub 3 - Composer plus Magento
DevHub 3 - Composer plus Magento
 
Tools and Process for Streamlining Mac Deployment
Tools and Process for Streamlining Mac DeploymentTools and Process for Streamlining Mac Deployment
Tools and Process for Streamlining Mac Deployment
 

Más de Andreas Jung

Más de Andreas Jung (17)

State of PrintCSS - MarkupUK 2023.pdf
State of PrintCSS - MarkupUK 2023.pdfState of PrintCSS - MarkupUK 2023.pdf
State of PrintCSS - MarkupUK 2023.pdf
 
Typesense Plone Integration Plone Conference 2022 Namur
Typesense Plone Integration Plone Conference 2022 NamurTypesense Plone Integration Plone Conference 2022 Namur
Typesense Plone Integration Plone Conference 2022 Namur
 
Onkopedia - Plone Tagung 2020 Dresden
Onkopedia - Plone Tagung 2020 DresdenOnkopedia - Plone Tagung 2020 Dresden
Onkopedia - Plone Tagung 2020 Dresden
 
PrintCSS W3C workshop at XMLPrague 2020
PrintCSS W3C workshop at XMLPrague 2020PrintCSS W3C workshop at XMLPrague 2020
PrintCSS W3C workshop at XMLPrague 2020
 
PrintCSS workshop XMLPrague 2020
PrintCSS workshop XMLPrague 2020PrintCSS workshop XMLPrague 2020
PrintCSS workshop XMLPrague 2020
 
Plone 5.2 migration at University Ghent, Belgium
Plone 5.2 migration at University Ghent, BelgiumPlone 5.2 migration at University Ghent, Belgium
Plone 5.2 migration at University Ghent, Belgium
 
Back to the future - Plone 5.2 und Python 3 Migration am Beispiel Onkopedia
Back to the future - Plone 5.2 und Python 3 Migration am Beispiel OnkopediaBack to the future - Plone 5.2 und Python 3 Migration am Beispiel Onkopedia
Back to the future - Plone 5.2 und Python 3 Migration am Beispiel Onkopedia
 
Plone migrations using plone.restapi
Plone migrations using plone.restapiPlone migrations using plone.restapi
Plone migrations using plone.restapi
 
Plone Migrationen mit Plone REST API
Plone Migrationen mit Plone REST APIPlone Migrationen mit Plone REST API
Plone Migrationen mit Plone REST API
 
Plone im Einsatz bei der Universität des Saarländes als Shop-System und Gefah...
Plone im Einsatz bei der Universität des Saarländes als Shop-System und Gefah...Plone im Einsatz bei der Universität des Saarländes als Shop-System und Gefah...
Plone im Einsatz bei der Universität des Saarländes als Shop-System und Gefah...
 
Generierung von PDF aus XML/HTML mit PrintCSS
Generierung von PDF aus XML/HTML mit PrintCSSGenerierung von PDF aus XML/HTML mit PrintCSS
Generierung von PDF aus XML/HTML mit PrintCSS
 
Creating Content Together - Plone Integration with SMASHDOCs
Creating Content Together - Plone Integration with SMASHDOCsCreating Content Together - Plone Integration with SMASHDOCs
Creating Content Together - Plone Integration with SMASHDOCs
 
Creating Content Together - Plone Integration with SMASHDOCs
Creating Content Together - Plone Integration with SMASHDOCsCreating Content Together - Plone Integration with SMASHDOCs
Creating Content Together - Plone Integration with SMASHDOCs
 
The Plone and The Blockchain
The Plone and The BlockchainThe Plone and The Blockchain
The Plone and The Blockchain
 
Content Gemeinsam Erstellen: Integration Plone mit SMASHDOCs
Content Gemeinsam Erstellen: Integration Plone mit SMASHDOCsContent Gemeinsam Erstellen: Integration Plone mit SMASHDOCs
Content Gemeinsam Erstellen: Integration Plone mit SMASHDOCs
 
PDF Generierung mit XML/HTML und CSS - was die Tools können und was nicht.
PDF Generierung mit XML/HTML und CSS - was die Tools können und was nicht.PDF Generierung mit XML/HTML und CSS - was die Tools können und was nicht.
PDF Generierung mit XML/HTML und CSS - was die Tools können und was nicht.
 
Produce & Publish Cloud Edition
Produce & Publish Cloud EditionProduce & Publish Cloud Edition
Produce & Publish Cloud Edition
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Pragmatische Plone Projekte

  • 1. Pragmatic Plone Projects PyCON –DE 2012 Leipzig Andreas Jung ZOPYX Ltd. www.zopyx.com, info@zopyx.com
  • 2. Speaker • long-time Python, Zope, Plone developer and contributor • Lead developer and principal consultant of ZOPYX Limited – Zope, Python, Pyramid, Plone projects – large portals, intranet, internet, extranet applications – Electronic Publishing – complex domain-specific applications
  • 3. This talk is about • practical hints surviving your next Plone project • best practices • lessons learned from our last larger Plone project
  • 4. Relaunch weishaupt.de • Weishaupt: – major vendor of heating systems – 480 M€ revenue • Large company portal on top of Plone 4.2 • Phase 1: – implementation and DE content – 4 months • Phase 2: – 20 subsidaries – more than 20 language combinations
  • 10. Project constraints (1/3) There is no real-world project with • unlimited budget • unlimited human resources • unlimited time
  • 11. Project constraints (2/3) Resources Budget Time
  • 12. Project constraints (3/3) Conclusions • usually impossible finding the „perfect“ solution • the „perfect“ solution is „mission impossible“
  • 13. Getting things done • within a reasonable time-frame • on budget • with the available human resources
  • 14. Common customizations • Bugs in Plone and 3rd-party packages are all around you • Particular behavior of Plone or 3rd-party packages is a common project requirement • What must be usually customized: – Python code (browser views, skin scripts) – Resources (browser view templates, JS, CSS)
  • 15. Where to fix things? • Package maintainer (Plone and 3rd-party) love – bug reports – bug fixes – contributions • Stuff on Github: Fork & Pull request • SVN repositories: svn branch & svn merge – check if the package is maintained – ask the maintainer for merging your changes or merge yourself – move packages to Github if appropriate
  • 16. Where and how to customize things? • Is your required change of interest for the public? – fork on Github – branch in SVN – speak with the package maintainers • Your change satisfies an absurd customer request? – keep it for yourself.
  • 17. (Monkey) Patching Python code • Monkey patching: „dynamic modifications of a class or module at runtime“ (Source: Wikipedia) • MP in general should be considered evil and bad-style • MP may have side-effects • Use MP carefully (and only when you know what you are doing)
  • 18. Monkey patching in Python Original (foo.py) Patched version (my_foo.py) class Foo: def my_bar(self): return 43 def bar(self): return 42 from foo import Foo Foo.bar = my_bar # or (needed in some situations) Foo.bar.func_code = my_bar.func_code
  • 19. Monkey patching Plone collective.monkeypatcher (patches.zcml) ZCML-level configuration of patching <configure...> <include package="collective.monkeypatcher" /> information: <monkey:patch • module-level patches description="ISE-42: OFS.Image.tag()" • class-level patches class="Products.CMFCore.FSImage.FSImage" original="tag" replacement=".patches.tag" /> </configure> collective.monkeypatcherpanel (patches.zcml)
  • 20. Patching resources (1/2) – overrides.zcml • Standard mechanism for overriding configuration settings introduced through a different package • overrides.zcml is an optional ZCML configuration file Products.PloneGlossary (configure.zcml) my.package (overrides.zcml) <configure..> <configure..> <browser:page <browser:page name="glossary_main_page“ name="glossary_main_page" for="Products.PloneGlossary.IPloneGlossary" for="Products.PloneGlossary.IPloneGlossary" class=".pages.GlossaryMainPage" class=".glossary.GlossaryView“ permission="zope2.View“ /> permission="zope2.View“ /> </configure> </configure>
  • 21. Patching resources (2/2) – z3c.jbot • z3c.jbot allows you to override resources of other packages inside your own policy package • Limited to .pt, .cpt, .js?! Configuration: <browser:jbot directory=“overrides“ /> Existing template: plone.app.search/plone/app/search/search.pt Customization: your.package/your/package/overrides/plone.app.search.search.pt Links • http://blog.keul.it/2011/06/z3cjbot-magical-with-your-skins.html • http://pypi.python.org/pypi/z3c.jbot
  • 22. Unconfigure resource configurations • Sometimes you just don‘t want or need ZCML configurations introduced by other packages • z3c.unconfigure is your friend some.package(configure.zcml) my.package (configure.zcml) <configure..> <configure..> <browser:page <include package="z3c.unconfigure" name="glossary_main_page“ file="meta.zcml" /> for="Products.PloneGlossary.IPloneGlossary" <unconfigure> class=".pages.GlossaryMainPage" <browser:page permission="zope2.View“ /> name="glossary_main_page“ </configure> for="Products.PloneGlossary.IPloneGlossary" class=".glossary.GlossaryView“ permission="zope2.View“ /> </unconfigure> </configure>
  • 23. Extending schemas Plone comes with two content-type systems • Archetypes (old-style) – use archetypes.schemaextender – modify any AT-based content-type (modifying fields, adding fields) – SchemaExtender, SchemaModifier • Dexterity (new-style) – Dexterity introduces „behaviors“ – „A behavior is a re-usable aspect of an object that can be enabled or disabled without changing the component registry“ (Source: Dexterity developer manual)
  • 24. Keep your designer happy Implementing CSS styles requires representative content http://localhost:8080/@@new-site?content=1
  • 26. Predefined sample content • Write a browser view – creating a Plone site with policy package + add-ons – installing the basic site-structure – creating example content for each content-type, content- listing etc • use http://lorempixel.com/600/400 ... • look at loremipsum, collective.loremipsum or zopyx.ipsumplone
  • 27. Predefined sample content • Throw your sandbox/Plone working site away as often as possible • sometimes I created 30-40 new Plone sites per day • Pragmatic side-effect – the content fixture code can be used as unit test where all your content-types and site-infrastructure is created and tested in one run – not the best solution but it works reasonably well
  • 28. Some good hints • Never ever perform customizations in-place in existing 3rd-party packages. NEVER!!! • Customizations always belong into your own policy package. • Local customizations of 3rd-party package will be lost with the next version of customized package.