def add_workspace_collections(ob, event): types = [ ('features', 'Feature'), ('places', 'Place'), ('metadata', 'PositionalAccuracy'), ] states = ['drafting', 'pending', 'published'] wsuid = ob.UID() for name, tname in types: tid = ob.invokeFactory( 'Workspace Collection', id=name, title=name.capitalize() ) topic = ob[tid] initTypeTopic(topic, tname, wsuid) for s in states: sid = topic.invokeFactory( 'Workspace Collection', id=s, title=s.capitalize() ) subtopic = topic[sid] initStateTopic(subtopic, sid, wsuid, True) for s in states: sid = ob.invokeFactory( 'Workspace Collection', id=s, title=s.capitalize() ) topic = ob[sid] initStateTopic(topic, s, wsuid) for name, tname in types: tid = topic.invokeFactory( 'Workspace Collection', id=name, title=name.capitalize() ) subtopic = topic[tid] initTypeTopic(subtopic, tname, wsuid, True) ob.plone_utils.addPortalMessage(_(u'Adding a positional accuracy assessment is a good way to begin.'))
portal_type = "Workspace Collection" @property def members(self): for brain in self.queryCatalog(): yield brain.getObject() WorkspaceSchema = folder.ATFolderSchema.copy() + atapi.Schema(( atapi.TextField('text', required=False, searchable=True, storage=atapi.AnnotationStorage(), validators=('isTidyHtmlWithCleanup',), default_output_type='text/x-html-safe', widget=atapi.RichWidget(label=_(u"Descriptive text"), description=_(u""), rows=25, allow_file_upload=False), ), )) WorkspaceSchema['title'].storage = atapi.AnnotationStorage() WorkspaceSchema['description'].storage = atapi.AnnotationStorage() finalizeATCTSchema(WorkspaceSchema, folderish=True, moveDiscussion=False) class Workspace(folder.ATFolder): """Collects content so their workflow states can be changed in bulk.
from pleiades.workspace.interfaces import IWorkspaceFolder from pleiades.workspace.config import PROJECTNAME from pleiades.workspace.i18n import WorkspaceMessageFactory as _ from Products.PleiadesEntity.content.PlaceContainer import PlaceContainer WorkspaceFolderSchema = folder.ATFolderSchema.copy() + atapi.Schema( (atapi.TextField( 'text', required=False, searchable=True, storage=atapi.AnnotationStorage(), validators=('isTidyHtmlWithCleanup', ), default_output_type='text/x-html-safe', widget=atapi.RichWidget( label=_(u"Descriptive text"), description=_(u""), rows=25, allow_file_upload=False), ), )) WorkspaceFolderSchema['title'].storage = atapi.AnnotationStorage() WorkspaceFolderSchema['description'].storage = atapi.AnnotationStorage() finalizeATCTSchema(WorkspaceFolderSchema, folderish=True, moveDiscussion=False) class WorkspaceFolder(folder.ATFolder): """Contains multiple workspaces """ implements(IWorkspaceFolder)