Back to index

plone3  3.1.7
Functions | Variables
ATContentTypes.content.schemata Namespace Reference

Functions

def marshall_register
def finalizeATCTSchema

Variables

string __author__ = 'Christian Heimes <tiran@cheimes.de>'
string __docformat__ = 'restructuredtext'
tuple ATContentTypeSchema = BaseSchema.copy()
 required = False,
 languageIndependent = True,
string schemata = 'metadata'
tuple widget
 ATContentTypeBaseSchema = ATContentTypeSchema
tuple relatedItemsField
tuple NextPreviousAwareSchema
tuple __all__ = ('ATContentTypeSchema', 'relatedItemsField',)

Function Documentation

def ATContentTypes.content.schemata.finalizeATCTSchema (   schema,
  folderish = False,
  moveDiscussion = True 
)
Finalizes an ATCT type schema to alter some fields

Definition at line 121 of file schemata.py.

00121 
00122 def finalizeATCTSchema(schema, folderish=False, moveDiscussion=True):
00123     """Finalizes an ATCT type schema to alter some fields
00124     """
00125     schema.moveField('relatedItems', pos='bottom')
00126     if folderish:
00127         schema['relatedItems'].widget.visible['edit'] = 'invisible'
00128     schema.moveField('excludeFromNav', after='allowDiscussion')
00129     if moveDiscussion:
00130         schema.moveField('allowDiscussion', after='relatedItems')
00131 
00132     # Categorization
00133     if schema.has_key('subject'):
00134         schema.changeSchemataForField('subject', 'categorization')
00135     if schema.has_key('relatedItems'):
00136         schema.changeSchemataForField('relatedItems', 'categorization')
00137     if schema.has_key('location'):
00138         schema.changeSchemataForField('location', 'categorization')
00139     if schema.has_key('language'):
00140         schema.changeSchemataForField('language', 'categorization')
00141 
00142     # Dates
00143     if schema.has_key('effectiveDate'):
00144         schema.changeSchemataForField('effectiveDate', 'dates')
00145     if schema.has_key('expirationDate'):
00146         schema.changeSchemataForField('expirationDate', 'dates')    
00147     if schema.has_key('creation_date'):
00148         schema.changeSchemataForField('creation_date', 'dates')    
00149     if schema.has_key('modification_date'):
00150         schema.changeSchemataForField('modification_date', 'dates')    
00151 
00152     # Ownership
00153     if schema.has_key('creators'):
00154         schema.changeSchemataForField('creators', 'ownership')
00155     if schema.has_key('contributors'):
00156         schema.changeSchemataForField('contributors', 'ownership')
00157     if schema.has_key('rights'):
00158         schema.changeSchemataForField('rights', 'ownership')
00159 
00160     # Settings
00161     if schema.has_key('allowDiscussion'):
00162         schema.changeSchemataForField('allowDiscussion', 'settings')
00163     if schema.has_key('excludeFromNav'):
00164         schema.changeSchemataForField('excludeFromNav', 'settings')
00165     if schema.has_key('nextPreviousEnabled'):
00166         schema.changeSchemataForField('nextPreviousEnabled', 'settings')
00167 
00168     marshall_register(schema)
00169     return schema
00170 
00171 # Make sure the base ATCT schema is correctly finalized
00172 finalizeATCTSchema(ATContentTypeSchema)

Here is the call graph for this function:

Definition at line 99 of file schemata.py.

00099 
00100 def marshall_register(schema):
00101     try:
00102         # It's a soft dependency, if not available ignore it.
00103         from Products.Marshall import ControlledMarshaller
00104     except ImportError:
00105         return
00106     # If it's available, then wrap the existing marshaller with a
00107     # ControlledMarshaller.
00108     if not schema.hasLayer('marshall'):
00109         # We are not interested in schemas that don't have a marshaller.
00110         return
00111 
00112     # Get existing marshaller.
00113     marshaller = schema.getLayerImpl('marshall')
00114     # Check if not already wrapped.
00115     if isinstance(marshaller, ControlledMarshaller):
00116         return
00117 
00118     # Wrap into a ControlledMarshaller
00119     marshaller = ControlledMarshaller(marshaller)
00120     schema.registerLayer('marshall', marshaller)

Here is the caller graph for this function:


Variable Documentation

Definition at line 173 of file schemata.py.

string ATContentTypes.content.schemata.__author__ = 'Christian Heimes <tiran@cheimes.de>'

Definition at line 23 of file schemata.py.

string ATContentTypes.content.schemata.__docformat__ = 'restructuredtext'

Definition at line 24 of file schemata.py.

Definition at line 61 of file schemata.py.

Definition at line 38 of file schemata.py.

Definition at line 41 of file schemata.py.

Initial value:
00001 MetadataSchema((
00002     BooleanField('nextPreviousEnabled',
00003         #required = False,
00004         languageIndependent = True,
00005         schemata = 'metadata',
00006         widget = BooleanWidget(
00007             description=_(u'help_nextprevious', default=u'This enables next/previous widget on content items contained in this folder.'),
00008             label = _(u'label_nextprevious', default=u'Enable next previous navigation'),
00009             visible={'view' : 'hidden',
00010                      'edit' : 'visible'},
00011             ),
00012         default_method="getNextPreviousParentValue"
00013         ),
00014     ),)

Definition at line 84 of file schemata.py.

Initial value:
00001 ReferenceField('relatedItems',
00002         relationship = 'relatesTo',
00003         multiValued = True,
00004         isMetadata = True,
00005         languageIndependent = False,
00006         index = 'KeywordIndex',
00007         write_permission = ModifyPortalContent,
00008         widget = ReferenceBrowserWidget(
00009             allow_search = True,
00010             allow_browse = True,
00011             show_indexes = False,
00012             force_close_on_insert = True,
00013             label = _(u'label_related_items', default=u'Related Items'),
00014             description = '',
00015             visible = {'edit' : 'visible', 'view' : 'invisible' }
00016             )
00017         )

Definition at line 63 of file schemata.py.

Definition at line 40 of file schemata.py.

Definition at line 42 of file schemata.py.

Initial value:
00001 BooleanWidget(
00002             description=_(u'help_exclude_from_nav', default=u'If selected, this item will not appear in the navigation tree'),
00003             label = _(u'label_exclude_from_nav', default=u'Exclude from navigation'),
00004             visible={'view' : 'hidden',
00005                      'edit' : 'visible'},
00006             )

Definition at line 43 of file schemata.py.