SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
Frequently asked questions -
   frequently answered -
but now for the last time :-)

     Plone Conference 2009
            Budapest

         Andreas Jung
 www.zopyx.com, info@zopyx.com
This talk

•   ...is about frequently asked questions (FAQs)
    on IRC and mailinglists

•   ...is about telling a bit about best practise

•   ...may contain some rant :-)

•   ...and hopefully some good advices
Speaker
•   Python developer since 1992

•   Zope core developer since 2001

•   Zope 2 release-manager

•   Contributor to Zope & Plone

•   Co-funder and 2nd chairman of
    German Zope User Group (DZUG e.V.)

•   Author of various Zope and Plone products

•   www.zopyx.com
Q: How do I install the Plone theme x.y?


  •   A: Google for x.y

  •   A: Check the documentation of x.y on PyPI

  •   A: Read the installation how-to for add-ons on plone.org

  •   A: Buildout:

      •   add x.y to the eggs and zcml options (buildout.cfg)

      •   re-run buildout,

      •   install x.y through Plone control panel
Q: How do I change the Plone logo?


•   A: Google for „plone change logo“

•   A: Customize the logo.pt through
    portal_view_customizations (ZMI)

•   A: Look at the CSSManager add-on
Q: Where is what and why?
         (Browser inspection tools)

•   A: Useful tools:

    •   Gloworm - for inspecting all elements of a Plone site
        (where is what and where is it defined)

    • Firebug - your tool for CSS issues (and other stuff)
    • Your browser - most browsers provide developers
        tools ootb (Opera, Safari) or as add-on (IE, Firefox)
Q: System requirements?


•   A: they are documented within the Plone release notes -
    please read up

     Plone 2.5     Zope 2.8/Zope 2.9       Python 2.4

     Plone 3.X         Zope 2.10           Python 2.4

      Plone 4          Zope 2.12         Python 2.6 (2.5)

•   Please stick with the recommended and tested versions!
Q: where can I find xx.py or
        where is getProperty() defined

•   A: for finding files by name:
    •   find <directory> -name xx.py -ls
    •   search within the Plone sources tree or the eggs
        directory
•   A: for finding files by „prominent“ terms/content
    • grep -r <term> <directory>
    • search within the Plone sources tree or the eggs
      directory
    •   also useful: DocFinderTab
Q: Import of module XX does not work
       within my PythonScript

 •   A: PythonScript are restricted (for security reasons) and
     allow only import of some secure modules
     („untrusted code“)

 •   A: At your own risk:
     use allow_module(), moduleSecurityInfo()

 •   A: use „trusted code“ (unrestricted Python)
     aka browser views or Python code within your policy
     package
Q: Is there a chat/XXX
            product for Plone?

•   A: Google for „plone chat/xxx add-on“

•   A: visit http://plone.org/products and
    type „chat“ into the search field
Q: Does package XXX work
               with Plone 3?

•   A: Read the release notes on the project page on
    plone.org and/or on PyPI

•   A: install it and try it out (especially for unknown add-ons)

•   If you encounter problems with Plone 2.X add-ons:

    •   consult the Plone 3 product migration guide (plone.org)

    •   try to fix the code yourself

    •   consult the package maintainer
Q: Why is there no workflow
            for File and Image?

•   A: images and files are often referenced from other
    documents.

•   A: managing there states individually often breaks usablity

•   A: if you need a workflow for File and Image:

    •   Plone Setup -> Types -> File/Image -> select workflow
Q: I encounter
    „permission denied“ errors on the
      filesystem when starting Plone

•   A: Likely you are working as root or using sudo


•   In 99% of the cases:

    •   there is no need for being root and using sudo

    •   working/installing Plone under a standard user account is
        recommended and usually „good enough“ [tm]

•   Wanna run Plone on port 80 then use a reverse proxy
    (Apache, Squid, Varnish - look at „virtual hosting“)
Q: How do I make
        <strong>a</strong>
properly work in my page template?

•   A: Use the ZPT structure directive

•   A: tal:content=“structure context/someMethod“


•   docs.zope.org -> The Zope 2 Book -> ZPT docs

•   plone.org -> ZPT tutorial
Q: How to avoid Unicode errors?


•   A: Plone 3.X works nicely with Unicode/UTF-8

•   A: it is usually 3rd-party code causing problems

•   A: always access/modify AT-based content through the
    related accessor/mutator methods (getXXX(), setXXX())

•   A: NEVER EVER modify instance attributes directly
    (unless using AT FieldProperty)
Q: How to debug
                 Unicode errors?


•   A: You investigate the traceback where the error occurs

•   A: Read a traceback from the back...the last lines matter

•   A: pdb.set_trace() within the code causing the problem

•   A: figure out the related string causing the problem - this
    usually gives you a good indication where the problem
    (wrong 3rd-party code might come from)

•   http://plone.org/documentation/how-to/using-pdb
Q: I have upload files into Plone.
         Where are they stored
           on the filesystem?

•   A: You can not access uploaded content directly.

•   A: All data is stored within the ZODB (Data.fs)

•   A: You can access Zope/Plone using FTP or WebDAV
Q: How to debug
               Unauthorized errors?


•   A: You google „plone debug unauthorized“

•   A: set verbose-security on within buildout.cfg or
    zope.conf

•   A: VerboseSecurity explains you clearly

    •   why the Unauthorized exception occurs

    •   which permissions/rights are required

    •   which roles/rights you have
Q: How can I get hold of objects
              by path or ID?


•   A: Using Acquisition in Zope

    obj = context.some_id
    obj = getattr(context, some_id)



•   A: Using Path Traversal in Zope

    obj = context.restrictedTraverse(‚/path/to/object‘)
Q: I messed up my site.
             How can I revert?


• A: You tried that on your staging server before going into
   production. So you don‘t care.
• A: You are smart and created a backup of your site before
   messing it up. So you take the backup and don‘t care.
• A:You don‘t know what you are doing, your working
   without staging server and have no backup and like the
   concept of Testing-while-Production?:
  • Undo (Undo-Tab ZMI, Undo Site Action)
  • Backup the ZODB and truncate it step-by-step
Q: How scalable is Plone?


• A: OOFB performance: at most 10 requests/second
• For scalability:
  • caching of anonymous requests (Squid,Varnish)
  • horizontal scaling:
    • throw hardware into your setup
    • use ZEO for any production setup
Q: How do I get most of Plone
       on a multi-core machine?


• A: Python is multi-threaded but can use only one CPU
• A: Spread your load (HTTP requests) over multiple
  ZEO clients behind a load-balancer
• Typical setup for a quad-core machine:
  • one ZEO server
  • one reverse proxy or cache
  • two or more ZEO clients
  • load-balancer
Q: Locked out?

•   A: Google „plone locked out“

•   A: create a new manager:
    bin/zopectl adduser <username> <password>

•   A: create an emergency user using
    zpasswd.py + access file
Q: I modified my template and
         the changes won‘t show up?

•   Best practise: run Zope always in foreground during
    development (bin/zopectl fg)

•   ensure Zope debug-mode is enabled (debug-mode on)

•   plone.reload saves you a lot of restarts and turn-arounds

    •   applies to browser views and templates

    •   applies not changes in Python code in general
Hunting down problems

•   Typical problem patterns:

    •   starting Zope in the background and no response through
        HTTP

    •   strange ComponentLookupError within the error_log

•   Approach the analysis by:

    •   starting Zope in foreground (zopectl fg)

    •   checking your console messages and check your log files

    •   trying to read and understand error messages

•   Error messages won‘t bite you into the nose
If you ask a question


•   First check the mailinglist archives or ask Google

•   Be precise as possible and be verbose
    (but come to the point)

•   Provide reasonable version information

•   Include full tracebacks (from error_log or console)

•   Include reasonable and related code snippets
Keep this under your pillow

• Professional Plone Development by Martin Aspeli
• The Definitive Guide To Plone (PDF online)
• The Zope 2 Book (docs.zope.org)
• The Zope Developers Guide (docs.zope.org)
• http://plonemanual.twinapex.fi/
• http://plone.org/documentation
• http://plonebook.info
• http://docs.zope.org
Questions?

Más contenido relacionado

La actualidad más candente

Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
ericholscher
 
Building a Drupal site with Git
Building a Drupal site with GitBuilding a Drupal site with Git
Building a Drupal site with Git
dirtytactics
 
Postgresql 9.0 HA at LOADAYS 2012
Postgresql 9.0 HA at LOADAYS 2012Postgresql 9.0 HA at LOADAYS 2012
Postgresql 9.0 HA at LOADAYS 2012
Julien Pivotto
 

La actualidad más candente (20)

Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
 
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
Enjoying the Journey from Puppet 3.x to Puppet 4.x (PuppetConf 2016)
 
Virtual Bolt Workshop - April 28, 2020
Virtual Bolt Workshop - April 28, 2020Virtual Bolt Workshop - April 28, 2020
Virtual Bolt Workshop - April 28, 2020
 
Unit testing symfony plugins with php unit
Unit testing symfony plugins with php unitUnit testing symfony plugins with php unit
Unit testing symfony plugins with php unit
 
Puppetizing Your Organization
Puppetizing Your OrganizationPuppetizing Your Organization
Puppetizing Your Organization
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
 
From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
 
Concurrency in Python
Concurrency in PythonConcurrency in Python
Concurrency in Python
 
Joomla Day DK 2012
Joomla Day DK 2012Joomla Day DK 2012
Joomla Day DK 2012
 
Web backends development using Python
Web backends development using PythonWeb backends development using Python
Web backends development using Python
 
Ant vs Phing
Ant vs PhingAnt vs Phing
Ant vs Phing
 
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
 
Automation using-phing
Automation using-phingAutomation using-phing
Automation using-phing
 
Building a Drupal site with Git
Building a Drupal site with GitBuilding a Drupal site with Git
Building a Drupal site with Git
 
Postgresql 9.0 HA at LOADAYS 2012
Postgresql 9.0 HA at LOADAYS 2012Postgresql 9.0 HA at LOADAYS 2012
Postgresql 9.0 HA at LOADAYS 2012
 
David Rey Lessons Learned Updating Content Licensing To Be Plone 3 Compat...
David Rey   Lessons Learned   Updating Content Licensing To Be Plone 3 Compat...David Rey   Lessons Learned   Updating Content Licensing To Be Plone 3 Compat...
David Rey Lessons Learned Updating Content Licensing To Be Plone 3 Compat...
 
Deploying on the cutting edge
Deploying on the cutting edgeDeploying on the cutting edge
Deploying on the cutting edge
 
Gael Le Mignot How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...
Gael Le Mignot   How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...Gael Le Mignot   How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...
Gael Le Mignot How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...
 
Ansible project-deploy
Ansible project-deployAnsible project-deploy
Ansible project-deploy
 

Destacado

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
 

Destacado (20)

State Of Zope Linuxtag 2008
State Of Zope Linuxtag 2008State Of Zope Linuxtag 2008
State Of Zope Linuxtag 2008
 
PyFilesystem
PyFilesystemPyFilesystem
PyFilesystem
 
Pragmatic plone projects
Pragmatic plone projectsPragmatic plone projects
Pragmatic plone projects
 
BRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQLBRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQL
 
Pragmatische Plone Projekte
Pragmatische Plone ProjektePragmatische Plone Projekte
Pragmatische Plone Projekte
 
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
 
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
 
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
 
Pragmatic plone projects
Pragmatic plone projectsPragmatic plone projects
Pragmatic plone projects
 
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...
 
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)
 
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
 
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
 
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 Frequently asked questions answered frequently - but now for the last time

Similar a Frequently asked questions answered frequently - but now for the last time (20)

OWASP 2013 APPSEC USA ZAP Hackathon
OWASP 2013 APPSEC USA ZAP HackathonOWASP 2013 APPSEC USA ZAP Hackathon
OWASP 2013 APPSEC USA ZAP Hackathon
 
Journeys with Transmogrifier and friends or How not to get stuck in the Plone...
Journeys with Transmogrifier and friends or How not to get stuck in the Plone...Journeys with Transmogrifier and friends or How not to get stuck in the Plone...
Journeys with Transmogrifier and friends or How not to get stuck in the Plone...
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...
Philipp Von Weitershausen   Plone Age  Mammoths, Sabers And Caveen   Cant The...Philipp Von Weitershausen   Plone Age  Mammoths, Sabers And Caveen   Cant The...
Philipp Von Weitershausen Plone Age Mammoths, Sabers And Caveen Cant The...
 
Spring Roo Add-On Development & Distribution
Spring Roo Add-On Development & DistributionSpring Roo Add-On Development & Distribution
Spring Roo Add-On Development & Distribution
 
Introducing OWASP OWTF Workshop BruCon 2012
Introducing OWASP OWTF Workshop BruCon 2012Introducing OWASP OWTF Workshop BruCon 2012
Introducing OWASP OWTF Workshop BruCon 2012
 
BathCamp #32 - CMS Smackdown! - Plone
BathCamp #32 - CMS Smackdown! - PloneBathCamp #32 - CMS Smackdown! - Plone
BathCamp #32 - CMS Smackdown! - Plone
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind Plone
 
Debugging Your Plone Site
Debugging Your Plone SiteDebugging Your Plone Site
Debugging Your Plone Site
 
Oenology
OenologyOenology
Oenology
 
Plone api
Plone apiPlone api
Plone api
 
Automated Acceptance Testing from Scratch
Automated Acceptance Testing from ScratchAutomated Acceptance Testing from Scratch
Automated Acceptance Testing from Scratch
 
Drupal Presentation for CapitalCamp 2011: Features Driven Development
Drupal Presentation for CapitalCamp 2011: Features Driven DevelopmentDrupal Presentation for CapitalCamp 2011: Features Driven Development
Drupal Presentation for CapitalCamp 2011: Features Driven Development
 
Writing Your First Plugin
Writing Your First PluginWriting Your First Plugin
Writing Your First Plugin
 
OptView2 - C++ on Sea 2022
OptView2 - C++ on Sea 2022OptView2 - C++ on Sea 2022
OptView2 - C++ on Sea 2022
 
Neo4j Training Cypher
Neo4j Training CypherNeo4j Training Cypher
Neo4j Training Cypher
 
Avalon Media System Version 1.0 Webinar
Avalon Media System Version 1.0 WebinarAvalon Media System Version 1.0 Webinar
Avalon Media System Version 1.0 Webinar
 
LVPHP.org
LVPHP.orgLVPHP.org
LVPHP.org
 
A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
 

Más de Andreas Jung

Más de Andreas Jung (18)

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
 
zopyx.plone migration - Plone Hochschultagung 2013
zopyx.plone migration - Plone Hochschultagung 2013zopyx.plone migration - Plone Hochschultagung 2013
zopyx.plone migration - Plone Hochschultagung 2013
 

Frequently asked questions answered frequently - but now for the last time

  • 1. Frequently asked questions - frequently answered - but now for the last time :-) Plone Conference 2009 Budapest Andreas Jung www.zopyx.com, info@zopyx.com
  • 2. This talk • ...is about frequently asked questions (FAQs) on IRC and mailinglists • ...is about telling a bit about best practise • ...may contain some rant :-) • ...and hopefully some good advices
  • 3. Speaker • Python developer since 1992 • Zope core developer since 2001 • Zope 2 release-manager • Contributor to Zope & Plone • Co-funder and 2nd chairman of German Zope User Group (DZUG e.V.) • Author of various Zope and Plone products • www.zopyx.com
  • 4. Q: How do I install the Plone theme x.y? • A: Google for x.y • A: Check the documentation of x.y on PyPI • A: Read the installation how-to for add-ons on plone.org • A: Buildout: • add x.y to the eggs and zcml options (buildout.cfg) • re-run buildout, • install x.y through Plone control panel
  • 5. Q: How do I change the Plone logo? • A: Google for „plone change logo“ • A: Customize the logo.pt through portal_view_customizations (ZMI) • A: Look at the CSSManager add-on
  • 6. Q: Where is what and why? (Browser inspection tools) • A: Useful tools: • Gloworm - for inspecting all elements of a Plone site (where is what and where is it defined) • Firebug - your tool for CSS issues (and other stuff) • Your browser - most browsers provide developers tools ootb (Opera, Safari) or as add-on (IE, Firefox)
  • 7. Q: System requirements? • A: they are documented within the Plone release notes - please read up Plone 2.5 Zope 2.8/Zope 2.9 Python 2.4 Plone 3.X Zope 2.10 Python 2.4 Plone 4 Zope 2.12 Python 2.6 (2.5) • Please stick with the recommended and tested versions!
  • 8. Q: where can I find xx.py or where is getProperty() defined • A: for finding files by name: • find <directory> -name xx.py -ls • search within the Plone sources tree or the eggs directory • A: for finding files by „prominent“ terms/content • grep -r <term> <directory> • search within the Plone sources tree or the eggs directory • also useful: DocFinderTab
  • 9. Q: Import of module XX does not work within my PythonScript • A: PythonScript are restricted (for security reasons) and allow only import of some secure modules („untrusted code“) • A: At your own risk: use allow_module(), moduleSecurityInfo() • A: use „trusted code“ (unrestricted Python) aka browser views or Python code within your policy package
  • 10. Q: Is there a chat/XXX product for Plone? • A: Google for „plone chat/xxx add-on“ • A: visit http://plone.org/products and type „chat“ into the search field
  • 11. Q: Does package XXX work with Plone 3? • A: Read the release notes on the project page on plone.org and/or on PyPI • A: install it and try it out (especially for unknown add-ons) • If you encounter problems with Plone 2.X add-ons: • consult the Plone 3 product migration guide (plone.org) • try to fix the code yourself • consult the package maintainer
  • 12. Q: Why is there no workflow for File and Image? • A: images and files are often referenced from other documents. • A: managing there states individually often breaks usablity • A: if you need a workflow for File and Image: • Plone Setup -> Types -> File/Image -> select workflow
  • 13. Q: I encounter „permission denied“ errors on the filesystem when starting Plone • A: Likely you are working as root or using sudo • In 99% of the cases: • there is no need for being root and using sudo • working/installing Plone under a standard user account is recommended and usually „good enough“ [tm] • Wanna run Plone on port 80 then use a reverse proxy (Apache, Squid, Varnish - look at „virtual hosting“)
  • 14. Q: How do I make <strong>a</strong> properly work in my page template? • A: Use the ZPT structure directive • A: tal:content=“structure context/someMethod“ • docs.zope.org -> The Zope 2 Book -> ZPT docs • plone.org -> ZPT tutorial
  • 15. Q: How to avoid Unicode errors? • A: Plone 3.X works nicely with Unicode/UTF-8 • A: it is usually 3rd-party code causing problems • A: always access/modify AT-based content through the related accessor/mutator methods (getXXX(), setXXX()) • A: NEVER EVER modify instance attributes directly (unless using AT FieldProperty)
  • 16. Q: How to debug Unicode errors? • A: You investigate the traceback where the error occurs • A: Read a traceback from the back...the last lines matter • A: pdb.set_trace() within the code causing the problem • A: figure out the related string causing the problem - this usually gives you a good indication where the problem (wrong 3rd-party code might come from) • http://plone.org/documentation/how-to/using-pdb
  • 17. Q: I have upload files into Plone. Where are they stored on the filesystem? • A: You can not access uploaded content directly. • A: All data is stored within the ZODB (Data.fs) • A: You can access Zope/Plone using FTP or WebDAV
  • 18. Q: How to debug Unauthorized errors? • A: You google „plone debug unauthorized“ • A: set verbose-security on within buildout.cfg or zope.conf • A: VerboseSecurity explains you clearly • why the Unauthorized exception occurs • which permissions/rights are required • which roles/rights you have
  • 19. Q: How can I get hold of objects by path or ID? • A: Using Acquisition in Zope obj = context.some_id obj = getattr(context, some_id) • A: Using Path Traversal in Zope obj = context.restrictedTraverse(‚/path/to/object‘)
  • 20. Q: I messed up my site. How can I revert? • A: You tried that on your staging server before going into production. So you don‘t care. • A: You are smart and created a backup of your site before messing it up. So you take the backup and don‘t care. • A:You don‘t know what you are doing, your working without staging server and have no backup and like the concept of Testing-while-Production?: • Undo (Undo-Tab ZMI, Undo Site Action) • Backup the ZODB and truncate it step-by-step
  • 21. Q: How scalable is Plone? • A: OOFB performance: at most 10 requests/second • For scalability: • caching of anonymous requests (Squid,Varnish) • horizontal scaling: • throw hardware into your setup • use ZEO for any production setup
  • 22. Q: How do I get most of Plone on a multi-core machine? • A: Python is multi-threaded but can use only one CPU • A: Spread your load (HTTP requests) over multiple ZEO clients behind a load-balancer • Typical setup for a quad-core machine: • one ZEO server • one reverse proxy or cache • two or more ZEO clients • load-balancer
  • 23. Q: Locked out? • A: Google „plone locked out“ • A: create a new manager: bin/zopectl adduser <username> <password> • A: create an emergency user using zpasswd.py + access file
  • 24. Q: I modified my template and the changes won‘t show up? • Best practise: run Zope always in foreground during development (bin/zopectl fg) • ensure Zope debug-mode is enabled (debug-mode on) • plone.reload saves you a lot of restarts and turn-arounds • applies to browser views and templates • applies not changes in Python code in general
  • 25. Hunting down problems • Typical problem patterns: • starting Zope in the background and no response through HTTP • strange ComponentLookupError within the error_log • Approach the analysis by: • starting Zope in foreground (zopectl fg) • checking your console messages and check your log files • trying to read and understand error messages • Error messages won‘t bite you into the nose
  • 26. If you ask a question • First check the mailinglist archives or ask Google • Be precise as possible and be verbose (but come to the point) • Provide reasonable version information • Include full tracebacks (from error_log or console) • Include reasonable and related code snippets
  • 27. Keep this under your pillow • Professional Plone Development by Martin Aspeli • The Definitive Guide To Plone (PDF online) • The Zope 2 Book (docs.zope.org) • The Zope Developers Guide (docs.zope.org) • http://plonemanual.twinapex.fi/ • http://plone.org/documentation • http://plonebook.info • http://docs.zope.org