def _populate(self, obj): obj._setObject('site_properties', SimpleItemWithProperties('site_properties')) obj.site_properties.manage_changeProperties( title='Site wide properties') obj.site_properties.manage_addProperty( 'displayPublicationDateInByline', True, 'boolean')
def _populate(self, obj): obj._setObject('site_properties', SimpleItemWithProperties('site_properties')) obj.site_properties.manage_changeProperties( title='Site wide properties') obj.site_properties.manage_addProperty('allowAnonymousViewAbout', True, 'boolean')
def setUp(self): from Products.CMFPlone.interfaces import ISimpleItemWithProperties from Products.GenericSetup.interfaces import ISetupEnviron from Products.GenericSetup.interfaces import IBody provideAdapter(self._getTargetClass(), (ISimpleItemWithProperties, ISetupEnviron), IBody) self._obj = SimpleItemWithProperties('site_properties') self._BODY = _PROPERTYSHEET_XML
def _initObjects(self, node): """Import subobjects""" ## XXX: We could just use the _initObjects() from ## ObjectManagerHelpers except that it looks up the object ## constructor from Products.meta_type and ## SimpleItemWithProperties doesn't get registered there. for child in node.childNodes: if child.nodeName != 'object': continue if child.hasAttribute('deprecated'): continue parent = self.context obj_id = str(child.getAttribute('name')) if obj_id not in parent: parent._setObject(obj_id, SimpleItemWithProperties(obj_id)) if child.hasAttribute('insert-before'): insert_before = child.getAttribute('insert-before') if insert_before == '*': parent.moveObjectsToTop(obj_id) else: try: position = parent.getObjectPosition(insert_before) parent.moveObjectToPosition(obj_id, position) except ValueError: pass elif child.hasAttribute('insert-after'): insert_after = child.getAttribute('insert-after') if insert_after == '*': parent.moveObjectsToBottom(obj_id) else: try: position = parent.getObjectPosition(insert_after) parent.moveObjectToPosition(obj_id, position+1) except ValueError: pass obj = getattr(self.context, obj_id) importer = queryMultiAdapter((obj, self.environ), INode) if importer: importer.node = child
def setUp(self): self._obj = SimpleItemWithProperties('site_properties') self._BODY = _PROPERTYSHEET_XML