Exemple #1
0
 def addOrganizer(self, contextUid, id, description=''):
     context = self._getObject(contextUid)
     context.manage_addOrganizer(id)
     if id.startswith("/"):
         organizer = context.getOrganizer(id)
     else:
         organizer = context._getOb(id)
     organizer.description = description
     return IOrganizerInfo(organizer)
Exemple #2
0
 def addOrganizer(self, contextUid, id, description=''):
     context = self._getObject(contextUid)
     context.manage_addOrganizer(id)
     if id.startswith("/"):
         organizer = context.getOrganizer(id)
     else:
         # call prepId for each segment.
         id = '/'.join(context.prepId(s) for s in id.split('/'))
         organizer = context._getOb(id)
     organizer.description = description
     return IOrganizerInfo(organizer)
Exemple #3
0
    def addOrganizer(self, contextUid, id, description='', properties=None):
        if not properties:
            properties = {}

        properties["description"] = description

        context = self._getObject(contextUid)
        context.manage_addOrganizer(id, properties=properties)
        if id.startswith("/"):
            organizer = context.getOrganizer(id)
        else:
            # call prepId for each segment.
            id = '/'.join(context.prepId(s) for s in id.split('/'))
            organizer = context._getOb(id)
        return IOrganizerInfo(organizer)
Exemple #4
0
    def moveOrganizer(self, targetUid, organizerUid):
        """
        Will move the organizerUid to be underneath the targetUid.

        @param string targetUid: unique id of where we want
        to move the organizer
        @param string organizerUid: unique id of the ogranizer we are moving
        """

        organizer = self._getObject(organizerUid)
        parent = organizer.getPrimaryParent()
        parent.moveOrganizer(targetUid, [organizer.id])
        target = self._getObject(targetUid)
        # reindex all the devices under the organizer
        for dev in parent.getSubDevices():
            dev.index_object()
            notify(IndexingEvent(dev, 'path'))
        return IOrganizerInfo(target._getOb(organizer.id))
Exemple #5
0
    def moveOrganizer(self, targetUid, organizerUid):
        """
        Will move the organizerUid to be underneath the targetUid.

        @param string targetUid: unique id of where we want
        to move the organizer
        @param string organizerUid: unique id of the ogranizer we are moving
        """
        organizer = self._getObject(organizerUid)
        parent = organizer.getPrimaryParent()
        parent.moveOrganizer(targetUid, [organizer.id])
        target = self._getObject(targetUid)
        # Get a list of the organizer's child objects to reindex
        childObjects = []
        if isinstance(organizer, DeviceOrganizer):
            childObjects = organizer.getSubDevices()
        elif isinstance(organizer, ComponentOrganizer):
            childObjects = organizer.getSubComponents()

        for dev in childObjects:
            dev.index_object()
            notify(IndexingEvent(dev, 'path'))
        return IOrganizerInfo(target._getOb(organizer.id))