Example #1
0
 def appendHistoryEntry(self, entryText):
     """
     append an text entry to the history
     """
     newEntry = Entry(entryText, self, level=u"info")
     newEntry.setObjVersion(self.ikRevision)
     self.history.append(newEntry)
Example #2
0
 def appendHistoryEntry(self,
                        entryText,
                        level=u"info",
                        request=None,
                        withAuthor=False,
                        dontCount=False):
     """
     append an text entry to the history
     """
     if withAuthor and request is not None:
         principalId = request.principal.id.split('.')[1]
         pau_utility = queryUtility(IAuthentication)
         if pau_utility.has_key('principals'):
             internalPrincipal = pau_utility['principals'][principalId]
         if pau_utility.has_key('LDAPAuthentication'):
             ldapAuth = pau_utility[u'LDAPAuthentication']
             internalPrincipal = ldapAuth.principalInfo(\
                                        ldapAuth.prefix+principalId)
         entryText = u'%s (%s)' % (entryText, internalPrincipal.title)
     lastEntry = self.history.get()[-1]
     if not dontCount and entryText == lastEntry.getText():
         lastEntry.appendRepeatCounter()
         lastEntry._p_changed = 1
     else:
         newEntry = Entry(entryText, self, level)
         newEntry.setObjVersion(self.ikRevision)
         self.history.append(newEntry)
     self._p_changed = 1
Example #3
0
 def appendHistoryEntry(self, entryText, level=u"info"):
     """
     append an text entry to the history
     """
     lastEntry = self.history.get()[-1]
     if entryText == lastEntry.getText():
         lastEntry.appendRepeatCounter()
         lastEntry._p_changed = 1
     else:
         newEntry = Entry(entryText, self, level)
         newEntry.setObjVersion(self.ikRevision)
         self.history.append(newEntry)
     self._p_changed = 1
Example #4
0
 def logIntoEvent(self, oidEventObject, logEntry):
     if self.has_key(oidEventObject):
         eventObject = self[oidEventObject]
         if eventObject.logAllEvents:
             newEntry = Entry(logEntry, eventObject, level=u"info")
             eventObject.history.append(newEntry)
             eventObject._p_changed = True
Example #5
0
 def __post_init__(self, **data):
     """
     triggerd after constructor has been finished
     """
     newEntry = Entry(u"Object created", self, level=u"info")
     newEntry.setObjVersion(self.ikRevision)
     self.history.append(newEntry)
     self.connectToEventXbar()
     newEntry = Entry(u"Object connected to event crossbar",
                      self,
                      level=u"info")
     newEntry.setObjVersion(self.ikRevision)
     self.history.append(newEntry)
Example #6
0
 def __post_init__(self, **data):
     """
     triggerd after constructor has been finished
     """
     newEntry = Entry(u"Object created", self, level=u"info")
     newEntry.setObjVersion(self.ikRevision)
     self.history.append(newEntry)
     self.connectToEventXbar()
     newEntry = Entry(u"Object connected to event crossbar", self, level=u"info")
     newEntry.setObjVersion(self.ikRevision)
     self.history.append(newEntry)
     dc = IZopeDublinCore(self, None)
     if dc is not None:
         now = datetime.now(pytz.utc)
         dc.created = now
         dc.modified = now
Example #7
0
 def _importAllData_Step0(self, metaData):
     """imports a list of meta-attribute-dict
     """
     print "############ meta :"
     if metaData.has_key('ikRevision'):
         self.ikRevision = metaData['ikRevision']
     if metaData.has_key('events'):
         for eventEntry in metaData['events']:
             print "Event-Entry: ", eventEntry
             newEntry = Entry(eventEntry, self)
             self.history.append(newEntry)
     try:
         #ISlave['objectID'].readonly = False
         for attrName, attrVal in metaData.items():
             print "attr:  %s = %s" % (attrName, attrVal)
             #newObj.__setattr__(i, msgObj['listAttr'][i])
     finally:
         pass
         #ISlave['objectID'].readonly = True
     pass