You are previewing Plone 3 Products Development Cookbook.
O'Reilly logo
Plone 3 Products Development Cookbook

Book Description

70 simple but incredibly effective recipes for creating your own feature rich, modern Plone add-on products by diving into its development framework

  • Create custom content types, add utilities, and internationalize your applications using Plone products

  • Manage site installation, configuration, and customization with code instead of manual actions that are likely to be forgotten

  • Guarantee your code operation and performance by including automatic testing and caching techniques

  • Part of Packt's Cookbook series: Each recipe is a carefully organized sequence of instructions to complete the task as efficiently as possible.

  • In Detail

    The Plone Content Management System is one of the best open source CMS, because by using Plone's development framework you can extend its functionality according to the specific requirements of your website. The Plone framework has lots of components that can be used to create add-ons or extensions called Plone Products. You can optimize your site for improved usability, accessibility, and security by creating custom Plone products.

    This book covers recipes that will help you create custom Plone Products and implement them on your website. Every topic covered in this book is accompanied by essential fundamentals and step-by-step explanation that will help you understand it better. With the help of this book you will be able to create custom Plone products that are well suited for your website.

    You can read the whole book or just pick recipes relevant for you; cross references help you understand the recipes even if you do not read them in order.

    If you work through the book in order, you will start by setting up an example project of a news website that will be developed throughout the book. You will learn about all of the necessary tools a Plone developer must have before starting any project. You will develop the website further by detecting problems and debugging them. You will be able to modify code on-the-fly or get help on how to do some tasks by installing and using special tools such as IPython, ipdb, and PDBDebugMode. You will then create a new content type, based on an existing one, and wrap the final product into a Python egg.

    You will set up automated testing to prevent errors in code that have evolved in the development stage. You will use paster to automatically create a new custom content type from scratch. You will improve the performance of your application by creating lightweight content types and following other recipes covered in this book. Key features such as usability, internationalization, accessibility and security are covered to make sure that your development and customizations will be at the level of Plone core and its most remarkable add-on products.

    You will improve your user interface by creating simple client-side visual changes and server-side manipulation of objects. You will learn to create and manage portlets by using Portlet manager and customize your website by modifying third-party products. Finally you will learn to communicate with an external non-Python-based system and make your products available for future use.

    Get solutions to easily create and manage Plone add-on products to make your site better, smarter, more usable, and more secure along with a brief explanation of common use cases

    Table of Contents

    1. Plone 3 Products Development Cookbook
      1. Plone 3 Products Development Cookbook
      2. Credits
      3. About the Authors
      4. About the Reviewers
      5. Preface
        1. What this book covers
        2. Our Plone development project
          1. A short note about the course of the book
          2. Customer requirements
        3. What you need for this book
        4. Who this book is for
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Errata
          2. Piracy
          3. Questions
      6. 1. Getting Started
        1. Introduction
        2. Installing Python on Linux
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Installing Plone on Linux
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Installing Plone on Windows
          1. How to do it...
          2. See also
        5. Checking out code from a version control system
          1. How to do it...
          2. How it works...
          3. There’s more...
        6. Creating a Plone site
          1. How to do it...
          2. How it works...
          3. There’s more...
          4. See also
      7. 2. Using Development Tools
        1. Introduction
            1. Changing debug mode parameter in configuration file
            2. Running Zope instance in foreground mode
        2. Accessing an IPython powered shell
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        3. Taking advantage of an enhanced interactive Python debugger with ipdb
          1. How to do it...
          2. How it works...
        4. Discovering Zope/Plone APIs and docstrings with DocFinderTab
          1. How to do it...
          2. How it works...
          3. There's more...
        5. Opening an online Python shell on Plone using Clouseau
          1. How to do it...
          2. There's more...
        6. Debugging Zope exceptions with PDBDebug Mode
          1. How to do it...
          2. See also
        7. Applying code changes on-the-fly using plone.reload
          1. How to do it...
          2. How it works...
          3. There's more...
      8. 3. Creating Content Types with ArchGenXML
        1. Introduction
        2. Installing ArchGenXML
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Configuring ArgoUML
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Creating a model
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Generating code
          1. How to do it...
          2. There's more...
          3. See also
        6. Customizing generated code
          1. Getting ready
          2. How to do it...
            1. How it works...
            2. See also
        7. Installing the product
          1. How to do it...
          2. How it works...
        8. Automatically installing products in your Zope instance
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
      9. 4. Prevent Bugs through Testing
        1. Introduction
          1. Glossary
        2. Working with paster-generated test suites
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. Unit test DocFileSuite
            2. Running tests
            3. Unit test DocTestSuite
            4. Integration test ZopeDocFileSuite using PloneTestCase
            5. Functional test
          4. See also
        3. Creating a test suite with ArchGenXML
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Creating doctests with iPython
          1. Getting ready
          2. How to do it...
        5. Zope functional testing
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Using Selenium functional tests
          1. Getting ready
          2. How to do it...
          3. There's more...
            1. Further reading
            2. Installing Selenium RC and IDE
            3. Organizing packages
            4. Debugging tests
          4. See also
      10. 5. Creating a Custom Content Type with Paster
        1. Introduction
        2. Creating an Archetypes product with paster
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Adding a content type into a product
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Changing the base class in paster content types
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        5. Adding fields to a content type
          1. Getting started
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Adding a custom validator to a content type
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        7. Modifying the view of a content type with jQuery
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      11. 6. Creating Lightweight Content Types
        1. Introduction
        2. Creating a product package structure
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. Creating a folderish content type
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Creating the user interface for Zope 3 content types
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Creating content types with Dexterity
          1. How to do it...
          2. How it works...
          3. See also
      12. 7. Improving Product Performance
        1. Introduction
        2. Installing CacheFu with a policy product
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Improving performance by tweaking expensive code
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Testing server load and benchmarking our code
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Bench configuration file
            2. Running the bench
            3. Further reading
          5. See also
      13. 8. Internationalization
        1. Introduction
        2. Adding i18ndude support to ArchGenXML
          1. How to do it...
          2. How it works...
          3. See also
        3. Installing i18ndude standalone
          1. How to do it...
          2. See also
        4. Using i18ndude
          1. Getting started
          2. How to do it...
          3. There's more...
          4. See also
        5. Using Placeless Translation Services for i18n support
          1. How to do it...
          2. See also
        6. Using zope.i18n approach
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
        7. Overriding others' translations
          1. How to do it...
        8. Using i18n with ArchGenXML
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Modifying an existing field's label
          5. See also
        9. Using i18n with paster-created products
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        10. Adding i18n support to any product
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        11. Translating content
          1. Getting started
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        12. Setting language options
          1. Getting ready
          2. How to do it...
          3. There's more...
          4. See also
      14. 9. Adding Security to your Products
        1. Introduction
        2. Creating a new permission
          1. Getting started
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Adding a new role
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Automatic roles
            2. Local roles
          5. See also
        4. Adding user groups
          1. How to do it...
          2. How it works...
          3. See also
        5. Testing security customizations
          1. How to do it...
        6. Protecting operations with permissions
          1. How to do it...
          2. How it works...
          3. There's more...
            1. Adding security restrictions to Dexterity content types
            2. Testing restricted operations
            3. Checking paster and ArchGenXML permissions
          4. See also
        7. Managing security with workflows
          1. How to do it...
          2. There's more...
          3. See also
        8. Adding configuration options in Plone control panel
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      15. 10. Improving User Interface with KSS
        1. Introduction
        2. Preparing a form to take full advantage of KSS
          1. Getting started
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Changing end user pages with client-side KSS
          1. How to do it...
          2. How it works...
            1. Manipulating DOM elements on document load
            2. Dynamically adding user interactions
          3. There's more...
          4. See also
        4. Submitting data via AJAX
          1. How to do it...
          2. How it works...
            1. Replacing standard button's behavior
            2. Server side KSS actions
          3. There's more...
          4. See also
      16. 11. Creating Portlets
        1. Introduction
        2. Creating a portlet package
          1. Getting ready
          2. How to do it...
          3. How it works...
            1. Portlet component configuration file
            2. Portlet module
            3. GenericSetup import step
          4. See also
        3. Customizing a new portlet according to our requirements
          1. How to do it...
          2. How it works...
          3. See also
        4. Testing portlets
          1. How to do it...
          2. How it works...
          3. See also
        5. Assigning portlets automatically
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Assigning portlets programmatically
            2. Portlet managers
          5. See also
      17. 12. Extending Third-Party Products
        1. Introduction
        2. Using skin layers
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Overriding Zope 3 components
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Customizing Zope 3 browser templates and files
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
            1. z3c.jbot and skin layers
            2. Understanding browserlayer
          5. See also
        5. Subscribing to others' events
          1. How to do it...
          2. How it works...
          3. See also
        6. Using the ZCA to extend a third-party product: Collage
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also
      18. 13. Interacting with other Systems: XML-RPC
        1. Introduction
        2. Creating a configuration form
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Registering a local utility
          1. How to do it...
          2. How it works...
          3. See also
        4. Registering a global utility
          1. Getting started
          2. How to do it...
          3. How it works...
          4. There's more...
            1. Changing the look of the form
            2. Named utilities
            3. Installing OpenX
            4. Further reading
      19. 14. Getting our Products ready for Production
        1. Introduction
        2. Installing and configuring an egg repository
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more
          5. See also
        3. Submitting products to an egg repository
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more
            1. Changing the package version number
            2. An alternative method to submit your package
          5. See also
        4. Writing a production buildout
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more
            1. Configuring a web server
            2. Using or not using buildout.cfg
            3. Production buildouts for Windows
          5. See also
      20. A. Creating a Policy Product
        1. Creating a policy product
          1. How to do it...
          2. How it works...
          3. There's more...
          4. See also