def addedEPublicationFolder(context, event): def queryForStates(*args): return [ {'i': 'portal_type', 'o': 'plone.app.querystring.operation.selection.is', 'v': ['edeposit.content.epublication']}, {'i': 'review_state', 'o': 'plone.app.querystring.operation.selection.is', 'v': args}, {'i': 'path', 'o': 'plone.app.querystring.operation.string.relativePath', 'v': '../'} ] portal = api.portal.get() collections = [ dict( contexts=[context], name = "ePublications-in-declarating", title=_(u"ePublications in declaring"), query= queryForStates('declaration') ), dict( contexts=[context], name = "ePublications-waiting-for-approving", title = _(u"ePublications waiting for preparing of acquisition"), query= queryForStates('waitingForApproving') ), dict( contexts=[context], name = "ePublications-with-errors", title = _(u"ePublications with errors"), query = queryForStates('declarationWithError') ), dict( contexts=[context], name = "ePublications-for-RIV-review", title = _(u"ePublications waiting for RIV to be reviewed"), query = [ {'i': 'portal_type', 'o': 'plone.app.querystring.operation.selection.is', 'v': ['edeposit.content.epublication']}, {'i':'offerToRIV', 'o': 'plone.app.querystring.operation.selection.is', 'v': [True]}, ] ) ] return for collection in collections: for folder in collection['contexts']: name = collection['name'] name in folder.keys() or \ folder.invokeFactory('Collection', name, title=collection['title'], query=collection['query'], )
def added(context,event): """When an object is added, create collection for simple list of authors """ context.invokeFactory('Collection','authors', title=_(u"Review of authors"), query=[{'i': 'portal_type', 'o': 'plone.app.querystring.operation.selection.is', 'v': ['edeposit.content.author',]}, {'i': 'path', 'o': 'plone.app.querystring.operation.string.relativePath', 'v': '../'} ], sort_on = 'created', sort_reversed = False, ) context.invokeFactory('Collection','original-files', title="Soubory s originály", query=[{'i': 'portal_type', 'o': 'plone.app.querystring.operation.selection.is', 'v': ['edeposit.content.originalfile',] }, {'i': 'path', 'o': 'plone.app.querystring.operation.string.relativePath', 'v': '../'} ], sort_on = 'created', sort_reversed = False, ) pass
def handleAdd(self, action): print "handle add" data, errors = self.extractData() if errors: self.status = self.formErrorsMessage return if (not data['IOriginalFile.isbn'] and not data['IOriginalFile.generated_isbn']) or \ (data['IOriginalFile.isbn'] and data['IOriginalFileí.geerat,d_isbn']): raise ActionExecutionError(Invalid(u"Zadejte prosím ISBN, nebo vyberte \"Přidělit ISBN agenturou\".")) obj = self.createAndAdd(data) if obj is not None: # mark only as finished if we get the new object and not # other submitting self._finishedAdd = getattr(self,'submitAgain',False) == False IStatusMessage(self.request).addStatusMessage(_(u"Item created"), "info") wft = api.portal.get_tool('portal_workflow') wft.doActionFor(self.new_object, 'submitDeclaration', comment='handled automatically')
def title(self): """This property is used to give the title of the portlet in the "manage portlets" screen. """ return _(u"Add EPublication")
def title(self): """This property is used to give the title of the portlet in the "manage portlets" screen. """ return _(u"Waiting For Aleph")
def title(self): return _(u"Technical Metadata")
def title(self): """This property is used to give the title of the portlet in the "manage portlets" screen. """ return _(u"ISBN Subject Validation")
def title(self): """This property is used to give the title of the portlet in the "manage portlets" screen. """ return _(u"Add OriginalFile")
def title(self): """This property is used to give the title of the portlet in the "manage portlets" screen. """ return _(u"Authors Portlet")
def title(self): return _(u"Original File External Links")
def title(self): """This property is used to give the title of the portlet in the "manage portlets" screen. """ return _(u"ISBN Generation Links Portlet")
def title(self): return _(u"OriginalFiles Links")