コード例 #1
0
 def afterSetUp(self):
     from Products.Archetypes import Field
     from Products.MimetypesRegistry.MimeTypesRegistry import MimeTypesRegistry
     self.folder.mimetypes_registry = MimeTypesRegistry()
     self.folder._setOb('test_object_', BaseContent('test_object_'))
     self.instance = self.folder._getOb('test_object_')
     self.field = Field.FileField('file')
     self.factory = self.field.content_class
コード例 #2
0
    def manage_afterAdd(self, item, container):
        """
        """
        BaseContent.manage_afterAdd(self, item, container)
        
        wtool = getToolByName(self, 'portal_workflow')
        assignments = self.contentValues(filter = {'Creator': item.Creator()})
        if assignments:
            for a in assignments:
                if a != self:
                    wf = wtool.getWorkflowsFor(a)[0]
                    if wf.isActionSupported(a, 'supersede'):
                        wtool.doActionFor(a, 'supersede',
                                          comment='Superseded by %s'
                                          % self.getId())

        self.sendNotificationEmail()
コード例 #3
0
    def manage_afterAdd(self, item, container):
        """
        """
        BaseContent.manage_afterAdd(self, item, container)

        wtool = getToolByName(self, 'portal_workflow')
        assignments = self.contentValues(filter={'Creator': item.Creator()})
        if assignments:
            for a in assignments:
                if a != self:
                    wf = wtool.getWorkflowsFor(a)[0]
                    if wf.isActionSupported(a, 'supersede'):
                        wtool.doActionFor(a,
                                          'supersede',
                                          comment='Superseded by %s' %
                                          self.getId())

        self.sendNotificationEmail()
コード例 #4
0
 def afterSetUp(self):
     from Products.Archetypes import Field
     from Products.MimetypesRegistry.MimeTypesRegistry import MimeTypesRegistry
     from Products.PortalTransforms.TransformTool import TransformTool
     self.folder.mimetypes_registry = MimeTypesRegistry()
     self.folder.portal_transforms = TransformTool()
     self.folder._setOb('test_object_', BaseContent('test_object_'))
     self.instance = self.folder._getOb('test_object_')
     self.field = Field.TextField('file')
     self.factory = self.field.content_class
コード例 #5
0
 def __init__(self, id=None):
     """
     Tool-constructors have no id argument, the id is fixed
     """
     BaseContent.__init__(self, 'ecab_utils')
     self.setTitle('')
コード例 #6
0
 def __init__(self, id=None):
     """Tool-constructors have no id argument, the id is fixed
     """
     BaseContent.__init__(self, config.ECS_NAME)
     self.setTitle("")
コード例 #7
0
 def manage_beforeDelete(self, item, container):
     I18NBaseObject.manage_beforeDelete(self, item, container)
     BaseContent.manage_beforeDelete(self, item, container)
コード例 #8
0
 def manage_beforeDelete(self, item, container):
     I18NBaseObject.manage_beforeDelete(self, item, container)
     BaseContent.manage_beforeDelete(self, item, container)
コード例 #9
0
 def __init__(self, oid, **kwargs):
     BaseContent.__init__(self, oid, **kwargs)
     self.firstname = ''
     self.lastname = ''
コード例 #10
0
 def __init__(self, id=None):
     """
     Tool-constructors have no id argument, the id is fixed
     """
     BaseContent.__init__(self, 'ecab_utils')
     self.setTitle('')