Exemplo n.º 1
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setResource(params)
     self._file = self._target = l.getObject()
     #        if not isinstance(self._file, LocalFile):
     #            raise MaKaCError("No file found, %s found instead"%type(self._file))
     self._conf = self._file.getConference()
Exemplo n.º 2
0
    def _checkParams(self):

        try:
            SessionBase._checkParams(self)

            l = locators.WebLocator()
            l.setSlot(self._params)
            self._slot = self._target = l.getObject()
            self._session = self._slot.getSession()
            self._conf = self._session.getConference()


#        self._session = self._target
#
#        try:
#            self._slot = self._target = self._session.getSlotById(self._params["slot"])
#            if self._target == None:
#                raise ServiceError("ERR-S3", "Invalid slot id.")
#        except ServiceError, e:
#            raise
#        except Exception, e:
#           raise ServiceError("ERR-S3", "Invalid slot id.",inner=str(e))
        except Exception, e:
            raise ServiceError("ERR-S3",
                               "Invalid slot id.%s" % self._params,
                               inner=str(e))
Exemplo n.º 3
0
 def _checkParams( self, params ):
     l = locators.WebLocator()
     l.setSlot( params )
     self._slot = self._target = l.getObject()
     self._session = self._slot.getSession()
     self._conf = self._session.getConference()
     self._setMenuStatus(params)
Exemplo n.º 4
0
    def _checkParams(self):
        try:
            l = locators.WebLocator()

            self._material = None
            self._conf = None

            l.setMaterial(self._params, 0)
            self._target = l.getObject()

            #if isinstance(self._target, conference.Material):
            self._material = self._target
            self._conf = self._target.getConference()
            if self._conf == None:
                self._categ = self._target
            else:
                self._categ = self._conf.getOwner()

            ## TODO: remove this, since material/resource creation
            ## doesn't come through this method

            ## if isinstance(self._target, conference.Category):
            ##     self._categ = self._target
            ## else:
            ##     self._conf = self._target.getConference()

            ## if self._conf == None:
            ##     self._categ=self._target.getCategory()

        except Exception, e:
            raise ServiceError("ERR-M0", str(e))
Exemplo n.º 5
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setResource(params)
     self._link = self._target = l.getObject()
     self._conf = self._link.getConference()
     if self._conf == None:
         self._categ = self._link.getCategory()
Exemplo n.º 6
0
 def _checkParams( self, params ):
     l = locators.WebLocator()
     l.setSubContribution( params )
     self._subContrib = self._target = l.getObject()        
     self._contrib = self._subContrib.getParent()
     self._conf = self._contrib.getConference()
     self._setMenuStatus(params)
Exemplo n.º 7
0
    def _getParams(self):
        super(FileHook, self)._getParams()

        self._event = self._pathParams['event']
        self._session = self._pathParams['session']
        self._contrib = self._pathParams['contrib']
        self._subcontrib = self._pathParams['subcontrib']
        self._material = self._pathParams['material']
        self._res = self._pathParams['res']

        self._params = {
            'confId': self._event,
            'sessionId': self._session,
            'contribId': self._contrib,
            'subContId': self._subcontrib,
            'materialId': self._material,
            'resId': self._res
        }

        import MaKaC.webinterface.locators as locators
        l = locators.WebLocator()
        try:
            l.setResource(self._params)
            self._file = l.getObject()
        except (KeyError, AttributeError):
            raise HTTPAPIError("File not found", 404)
Exemplo n.º 8
0
    def _checkParams(self):
        """
        Checks the materialId, and retrieves the material using it
        """

        self._material = None
        self._conf = None

        l = locators.WebLocator()

        try:

            l.setResource(self._params, 0)
            self._target = l.getObject()

            if isinstance(self._target, conference.Resource):
                self._resource = self._target
                self._material = self._target.getOwner()

            if isinstance(self._target, conference.Material):
                self._material = self._target

            if isinstance(self._target, conference.Category):
                self._categ = self._target
            else:
                self._conf = self._target.getConference()

            if self._conf == None:
                self._categ = self._target.getCategory()

        except Exception, e:
            raise ServiceError("ERR-M0", str(e))
Exemplo n.º 9
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setAbstract(params)
     self._abstract = self._target = l.getObject()
     if self._abstract is None:
         raise MaKaCError(
             _("The abstract you are trying to access does not exist"))
     self._conf = self._abstract.getOwner().getOwner()
Exemplo n.º 10
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setTrack(params)
     self._track = self._target = l.getObject()
     self._conf = self._track.getConference()
     self._subTrack = None
     if params.has_key("subTrackId"):
         self._subTrack = self._track.getSubTrackById(params["subTrackId"])
Exemplo n.º 11
0
 def _checkParams(self):
     try:
         l = locators.WebLocator()
         l.setCategory(self._params)
         self._target = self._categ = l.getObject()
     except:
         #raise ServiceError("ERR-E4", "Invalid category id.")
         self._target = self._categ = conference.CategoryManager().getRoot()
Exemplo n.º 12
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setSubContribution(params)
     self._target = l.getObject()
     self._conf = self._target.getConference()
     params["days"] = params.get("day", "all")
     if params.get("day", None) is not None:
         del params["day"]
Exemplo n.º 13
0
 def _checkParams( self, params ):
     l = locators.WebLocator()
     l.setMaterial( params )
     self._material = self._target = l.getObject()
     if self._material is None:
         raise MaKaCError( _("The material you are trying to access does not exist or was removed"))
     self._conf = self._material.getConference()
     if self._conf == None:
         self._categ=self._material.getCategory()  
     self._setMenuStatus(params)
Exemplo n.º 14
0
 def _checkParams( self, params ):
     l = locators.WebLocator()
     l.setResource( params )
     self._file = self._target = l.getObject()
     if not isinstance(self._file, LocalFile):
         raise MaKaCError("No file found, %s found instead"%type(self._file))
     self._conf = self._file.getConference()
     if self._conf == None:
         self._categ = self._file.getCategory()
     self._setMenuStatus(params)
Exemplo n.º 15
0
 def _checkParams(self,params):
     l = locators.WebLocator()
     l.setContribution( params )
     self._contrib=l.getObject()
     self._conf=self._contrib.getConference()
     self._target=self._session=self._contrib.getSession()
     RHSessionModCoordinationBase._checkParams(self,params)
     self._action=""
     if params.has_key("OK"):
         self._action="GO"
     elif params.has_key("CANCEL"):
         self._action="CANCEL"
     self._sortBy=params.get("sortBy","")
Exemplo n.º 16
0
    def _checkParams(self, params):
        l = locators.WebLocator()
        l.setMaterial(params)
        self._material = self._target = l.getObject()
        if self._material is None:
            raise NotFoundError(_(
                "The material you are trying to access does not exist or was removed"
            ).format("<strong>{}</strong>".format(params['confId'])),
                                title=_("Resource not found"))

        self._conf = self._material.getConference()
        if self._conf is None:
            self._categ = self._material.getCategory()
Exemplo n.º 17
0
 def _checkParams(self,params):
     #RHSessionModifBase._checkParams(self,params)
     self._check = int(params.get("check",1))
     self._moveEntries = int(params.get("moveEntries",0))
     l = locators.WebLocator()
     l.setContribution( params )
     self._contrib=l.getObject()
     self._conf=self._contrib.getConference()
     self._target=self._session=self._contrib.getSession()
     self._action=""
     if params.has_key("OK"):
         self._action="GO"
     elif params.has_key("CANCEL"):
         self._action="CANCEL"
Exemplo n.º 18
0
    def create(self, req, params):

        l = locators.WebLocator()

        try:
            l.setCategory(params)
            return RHSearchCategory(req)
        except:
            try:
                l.setConference(params)
                return RHSearchConference(req)
            except:
                # fallback - root category search page
                params['categId'] = [0]
                return RHSearchCategory(req)
Exemplo n.º 19
0
    def _checkParams( self ):

        try:
            conferenceServices.ConferenceBase._checkParams(self)

            l = locators.WebLocator()
            l.setSession( self._params )
            self._session = self._target = l.getObject()
            self._conf = self._session.getConference()

#        self._conf = self._target
#
#        try:
#            self._session = self._target = self._conf.getSessionById(self._params["session"])
#            if self._target == None:
#                raise ServiceError("ERR-S4", "Invalid session id.")
#        except:
#            raise ServiceError("ERR-S4", "Invalid session id.")
        except Exception, e:
            raise ServiceError("ERR-S4", "Invalid session id.")
Exemplo n.º 20
0
    def _checkParams(self):
        ProtectedModificationService._checkParams(self)

        pm = ParameterManager(self._params)

        l = locators.WebLocator()

        # TODO: This chain could (should) be repalced by a more generic
        # locator, something like:
        # l.setParams(self._params)
        # l.getObject() # retrieves whatever object has been extracted

        # will check cotnribution and session as well, as fallback cases
        l.setSubContribution(self._params, 0)
        # will check if it is compiling minutes
        self._compile = self._params.get("compile", False)

        self._target = l.getObject()

        # TODO: change str to some kind of html sanitization
        self._text = pm.extract("value", pType=str, allowEmpty=True)
Exemplo n.º 21
0
    def _checkParams(self):
        try:
            l = locators.WebLocator()

            self._material = None
            self._conf = None

            l.setMaterial(self._params, 0)
            self._target = l.getObject()

            if isinstance(self._target, conference.Material):
                self._material = self._target

            if isinstance(self._target, conference.Category):
                self._categ = self._target
            else:
                self._conf = self._target.getConference()

            if self._conf == None:
                self._categ = self._target.getCategory()

        except Exception, e:
            raise ServiceError("ERR-M0", str(e))
Exemplo n.º 22
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setConference(params)
     self._conf = self._target = l.getObject()
     ContextManager.set("currentConference", self._conf)
Exemplo n.º 23
0
 def _checkParams( self, params ):
     l = locators.WebLocator()
     l.setConference( params )
     self._conf = self._target = l.getObject()
     self._setMenuStatus(params)
Exemplo n.º 24
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setSubContribution(params)
     self._target = l.getObject()
     RHAddMaterialBase._checkParams(self, params)
Exemplo n.º 25
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setAlarm(params)
     self._alarm = self._target = l.getObject()
     self._conf = self._alarm.getConference()
Exemplo n.º 26
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setTrack(params)
     self._track = self._target = l.getObject()
     self._conf = self._track.getConference()
Exemplo n.º 27
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setContribution(params)
     self._target = l.getObject()
     self._conf = self._target.getConference()
Exemplo n.º 28
0
 def _checkParams(self, params):
     l = locators.WebLocator()
     l.setConference(params)
     self._target = l.getObject()
     RHAddMaterialBase._checkParams(self, params)
Exemplo n.º 29
0
    def _checkParams(self):
        l = locators.WebLocator()

        l.setMaterial(self._params, 0)
        self._target = l.getObject()