Latest Updates
www.PACKTPUB.com FREE ONLINE EDITION: Read full chapters online, download free samples from the book and more...
Book Contents Home > Latest Updates

Introduction
1: Plone in Context
2: The Case Study
3: The Development Environment
4: Customization Basics
5: Developing a Site Strategy
6: Security and Workflow
7: Using Add-on Products
8: Creating a Custom Theme
9: Nine Core Concepts of Zope Programming

10: Custom Content Types
11: Standalone Views and Forms
12: Relational Databases
13:
Users and Their Permissions

14: Rich User Interfaces with KSS
15: Next Steps
16: Server Management
17:
Setting Up a Production Server

18: Authenticating with LDAP
19: Looking to the Future
Index


Latest Updates


Free Chapter:

Chapter 2: The Case Study [946 kB PDF]

Code Download

Contact us

 

Date: October 25, 2007

Chapter 10: Custom Content Types

Page 202: Code Corrections

Last three rows of code example:

# This turns a list of title->id pairs into a Zope 3 style
vocabulary return SimpleVocabulary.fronmItems(items)
directlyProvides(CurrentFilmsVocabularyFactory, IVocabularyFactory)

'vocabulary' word should be in comment line, and return have to begin second line, and the last line: directlyProvides(...
should begin with decreased line indentation (out of function body)

def CurrentFilmsVocabularyFactory(context):
    """Vocabulary factory for currently published films
    """
    catalog = getToolByName(context, 'portal_catalog')
    items = [(r.Title, r.UID) for r in
                catalog(object_provides=IFilm.__identifier__,
                        review_state="published",
                        sort_on='sortable_title')]
    # Turns a list of title->id pairs into a Zope 3 style vocabulary
    return SimpleVocabulary.fromItems(items)
directlyProvides(CurrentFilmsVocabularyFactory, IVocabularyFactory)

Notice the changes,

  1. made the comment shorter so that it fits on one line
  2. made sure the second-to-last line starts with 'return'
  3. un-indented the last line so that it's aligned with the outermost "def".

Date: October 23, 2007

Chapter 10: Custom Content Types

Page 229: Code Corrections

On page 229, we have this line:

    >>> browser.open(portal_url + '/login')

This will fail under certain circumstances. A safer version is:

    >>> browser.open(portal_url + '/login_form?came_from=' + portal_url)

Date: October 19, 2007

Chapter 8: Creating a Custom Theme

Page 113: Code Corrections

    ztc.installProduct('optilux.policy', package=True) 
    ztc.installProduct('optilux.theme', package=True)

This should be changed to:

    ztc.installPackage('optilux.policy') 
    ztc.installPackage('optilux.theme')

 

Date: October 4, 2007

Chapter 14: Rich User Interfaces with KSS

The KSS reference in chapter 14 describes the following KSS commands:

  • 'addClassName', with parameter 'name'
  • 'removeClassName', with parameter 'name'
  • 'toggleClass', with parameter 'name'.

In the version of KSS released with Plone 3, the names of the commands and parameters have changed. The correct names and parameters are:

  • 'addClass', with parameter 'value'
  • 'removeClass', with parameter 'value'
  • 'toggleClass', with paramater 'value'.

Page 321: Corrected Code

#showClosedButton:click(show_button) {
    evt-click-preventdefault: true;
    action-client: toggleClass;
    toggleClass-value: hiddenItem;
    action-client: removeClass;
    removeClass-kssSelector: css("#deliverablesTable tr.closed");
    removeClass-value: hiddenItem;
    action-client: setStateVar;
    setStateVar-varname: showHidden;
    setStateVar-value: true;
}
/* At the same time, show the "show" button */
#showClosedButton:click(hide_button) {
    evt-click-preventdefault: true;
    action-client: toggleClass;
    toggleClass-kssSelector: htmlid(hideClosedButton);
    toggleClass-value: hiddenItem;

Page 324: Corrected Table Entries

Action

Parameters

Effect

addClass,
removeClass

value

Add or remove a particular CSS class on the matched node.

toggleClass

value

Toggle (add or remove) the given CSS class on the matched node.

Page 325: Corrected Code

/* At the same time, show the "show" button */
#showClosedButton:click(hide_button) {
    evt-click-preventdefault: true;
    action-client: toggleClass;
    toggleClass-kssSelector: htmlid(hideClosedButton);
    toggleClass-value: hiddenItem;
}
/* The reverse of the above two actions */
    #hideClosedButton:click(hide_button) {
    evt-click-preventdefault: true;
    ...
    action-client: addClass;
    addClass-kssSelector: css("#deliverablesTable tr.closed");
    addClass-value: hiddenItem;
    ...
}

Page 328: Corrected Table Entries

Method

Effect

toggleClass

(selector, classname)

Toggle (add or remove) the given CSS class on the selected node. There are also addClass (selector, value) and removeClass (selector, value).

 

   



Paperback
300 pages
Released: September 2007
ISBN: 1847191983
ISBN 13: 978-1-847191-98-4



 

   




View the book details
on PacktPub.com

 

        
 
[Click for a larger image] [Click for a larger image]            

For more information, please visit www.PacktPub.com
 

This website is owned and maintained by Packt Publishing Ltd, 2007. All rights reserved. Terms and Conditions