Beispiel #1
0
 def getObject(self):
     if not self.__confId:
         return None
     obj = conference.ConferenceHolder().getById(self.__confId)
     if obj is None:
         raise errors.NoReportError(
             "The event you are trying to access does not exist or has been deleted"
         )
     if self.__notifTplId:
         obj = obj.getAbstractMgr().getNotificationTplById(
             self.__notifTplId)
         return obj
     if self.__trackId:
         obj = obj.getTrackById(self.__trackId)
         return obj
     if self.__abstractId:
         obj = obj.getAbstractMgr().getAbstractById(self.__abstractId)
         if obj == None:
             raise errors.NoReportError(
                 "The abstract you are trying to access does not exist or has been deleted"
             )
         if self.__resId:
             return obj.getAttachmentById(self.__resId)
     if not self.__materialId:
         return obj
Beispiel #2
0
 def getObject(self):
     if self.__categId:
         if not conference.CategoryManager().hasKey(self.__categId):
             raise errors.NoReportError(
                 _("There is no category with id '%s', or it has been deleted"
                   ) % self.__categId)
         obj = conference.CategoryManager().getById(self.__categId)
         if self.__materialId is not None or self.__resId is not None:
             return None  # obsolete - attachments don't use WebLocator
         return obj
     if not self.__confId:
         return None
     obj = conference.ConferenceHolder().getById(self.__confId)
     if obj is None:
         raise errors.NoReportError(
             "The event you are trying to access does not exist or has been deleted"
         )
     if self.__notifTplId:
         obj = obj.getAbstractMgr().getNotificationTplById(
             self.__notifTplId)
         return obj
     if self.__trackId:
         obj = obj.getTrackById(self.__trackId)
         return obj
     if self.__abstractId:
         obj = obj.getAbstractMgr().getAbstractById(self.__abstractId)
         if obj == None:
             raise errors.NoReportError(
                 "The abstract you are trying to access does not exist or has been deleted"
             )
         if self.__resId:
             return obj.getAttachmentById(self.__resId)
     if not self.__materialId:
         return obj
Beispiel #3
0
 def getObject(self):
     """
     """
     if self.__categId:
         if not conference.CategoryManager().hasKey(self.__categId):
             raise errors.NoReportError(
                 _("There is no category with id '%s', or it has been deleted"
                   ) % self.__categId)
         obj = conference.CategoryManager().getById(self.__categId)
         if self.__materialId is not None or self.__resId is not None:
             return None  # obsolete - attachments don't use WebLocator
         return obj
     if not self.__confId:
         return None
     obj = conference.ConferenceHolder().getById(self.__confId)
     if obj is None:
         raise errors.NoReportError(
             "The event you are trying to access does not exist or has been deleted"
         )
     if self.__notifTplId:
         obj = obj.getAbstractMgr().getNotificationTplById(
             self.__notifTplId)
         return obj
     if self.__trackId:
         obj = obj.getTrackById(self.__trackId)
         return obj
     if self.__contribTypeId:
         obj = obj.getContribTypeById(self.__contribTypeId)
         return obj
     if self.__abstractId:
         obj = obj.getAbstractMgr().getAbstractById(self.__abstractId)
         if obj == None:
             raise errors.NoReportError(
                 "The abstract you are trying to access does not exist or has been deleted"
             )
         if self.__resId:
             return obj.getAttachmentById(self.__resId)
     if self.__sessionId:
         obj = obj.getSessionById(self.__sessionId)
         if obj == None:
             raise errors.NoReportError(
                 "The session you are trying to access does not exist or has been deleted"
             )
     if self.__slotId:
         obj = obj.getSlotById(self.__slotId)
     if self.__contribId:
         obj = obj.getContributionById(self.__contribId)
         if obj == None:
             raise errors.NoReportError(
                 _("The contribution you are trying to access does not exist or has been deleted"
                   ))
     if self.__reviewId:
         #obj must be a Contribution
         obj = obj.getReviewManager().getReviewById(self.__reviewId)
         if obj == None:
             raise errors.NoReportError(
                 "The review you are tring to access does not exist or has been deleted"
             )
     if self.__subContribId and self.__contribId:
         obj = obj.getSubContributionById(self.__subContribId)
         if obj == None:
             raise errors.NoReportError(
                 "The subcontribution you are trying to access does not exist or has been deleted"
             )
     if not self.__materialId:
         return obj
     assert self.__materialId == 'reviewing'
     mat = reviewing_factory_get(obj)
     if mat is None or self.__resId is None:
         return mat
     return mat.getResourceById(self.__resId)
Beispiel #4
0
 def getObject(self):
     """
     """
     if self.__resvID:
         from MaKaC.rb_location import CrossLocationQueries, Location
         obj = CrossLocationQueries.getReservations(
             resvID=self.__resvID, location=self.__location)
         return obj
     if self.__roomID:
         from MaKaC.rb_location import CrossLocationQueries, Location
         obj = CrossLocationQueries.getRooms(roomID=self.__roomID,
                                             location=self.__location)
         return obj
     if self.__categId:
         if not conference.CategoryManager().hasKey(self.__categId):
             raise errors.NoReportError(
                 _("There is no category with id '%s', or it has been deleted"
                   ) % self.__categId)
         obj = conference.CategoryManager().getById(self.__categId)
         if self.__materialId:
             obj = obj.getMaterialById(self.__materialId)
         if self.__resId:
             obj = obj.getResourceById(self.__resId)
         return obj
     if not self.__confId:
         return None
     obj = conference.ConferenceHolder().getById(self.__confId)
     if obj == None:
         raise errors.NoReportError(
             "The event you are trying to access does not exist or has been deleted"
         )
     fr = materialFactories.ConfMFRegistry
     if self.__notifTplId:
         obj = obj.getAbstractMgr().getNotificationTplById(
             self.__notifTplId)
         return obj
     if self.__alarmId:
         obj = obj.getAlarmById(self.__alarmId)
         return obj
     if self.__trackId:
         obj = obj.getTrackById(self.__trackId)
         return obj
     if self.__menuLinkId:
         obj = obj.getDisplayMgr().getMenu().getLinkById(self.__menuLinkId)
         return obj
     if self.__contribTypeId:
         obj = obj.getContribTypeById(self.__contribTypeId)
         return obj
     if self.__abstractId:
         obj = obj.getAbstractMgr().getAbstractById(self.__abstractId)
         if obj == None:
             raise errors.NoReportError(
                 "The abstract you are trying to access does not exist or has been deleted"
             )
         if self.__resId:
             return obj.getAttachmentById(self.__resId)
     if self.__registrantId:
         obj = obj.getRegistrantById(self.__registrantId)
         if obj == None:
             raise errors.NoReportError(
                 "The registrant you are trying to access does not exist or has been deleted"
             )
         if self.__resId:
             return obj.getAttachmentById(self.__resId)
     if self.__sessionId:
         obj = obj.getSessionById(self.__sessionId)
         fr = materialFactories.SessionMFRegistry
         if obj == None:
             raise errors.NoReportError(
                 "The session you are trying to access does not exist or has been deleted"
             )
     if self.__slotId:
         obj = obj.getSlotById(self.__slotId)
     if self.__contribId:
         obj = obj.getContributionById(self.__contribId)
         fr = materialFactories.ContribMFRegistry
         if obj == None:
             raise errors.NoReportError(
                 "The contribution you are trying to access does not exist or has been deleted"
             )
     if self.__reviewId:
         #obj must be a Contribution
         obj = obj.getReviewManager().getReviewById(self.__reviewId)
         if obj == None:
             raise errors.NoReportError(
                 "The review you are tring to access does not exist or has been deleted"
             )
     if self.__subContribId and self.__contribId:
         obj = obj.getSubContributionById(self.__subContribId)
         fr = materialFactories.ContribMFRegistry
         if obj == None:
             raise errors.NoReportError(
                 "The subcontribution you are trying to access does not exist or has been deleted"
             )
     if not self.__materialId:
         return obj
     #first we check if it refers to a special type of material
     mat = None
     f = fr.getById(self.__materialId)
     if f:
         mat = f.get(obj)
     if not mat:
         mat = obj.getMaterialById(self.__materialId)
     if not self.__resId:
         return mat
     return mat.getResourceById(self.__resId)