Example #1
0
    def updateResourceKeywords(self):
        resourceId = util.try_f(int, self.request('resource_id'))

        if (not self.user or not self.user.isResourceOwner(resourceId)): 
            log.error("*** resource edit attempt without ownership, resource id %s" % resourceId)
            return False

        keywords = ' '.join([word.strip() for word in self.request('keywords').split(',')]) if not util.strNullOrEmpty(self.request('keywords')) else None
        
        return mProjectResource.updateProjectResourceTextData(self.db, resourceId, 'keywords', keywords)
Example #2
0
    def updateResourceAddress(self):
        resourceId = util.try_f(int, self.request('resource_id'))

        if (not self.user or not self.user.isResourceOwner(resourceId)): 
            log.error("*** resource edit attempt without ownership, resource id %s" % resourceId)
            return False

        address = self.request('address')
        
        if (address):
            return mProjectResource.updateProjectResourceTextData(self.db, resourceId, 'physical_address', address)
        else:
            log.error("*** resource edit attempt without address, resource id %s" % resourceId)
            return False
Example #3
0
    def updateResourceContactEmail(self):
        resourceId = util.try_f(int, self.request('resource_id'))

        if (not self.user or not self.user.isResourceOwner(resourceId)): 
            log.error("*** resource edit attempt without ownership, resource id %s" % resourceId)
            return False

        email = self.request('contactemail')
        
        if (email):
            return mProjectResource.updateProjectResourceTextData(self.db, resourceId, 'contact_email', email)
        else:
            log.error("*** resource edit attempt without email, resource id %s" % resourceId)
            return False
Example #4
0
    def updateResourceUrl(self):
        resourceId = util.try_f(int, self.request('resource_id'))

        if (not self.user or not self.user.isResourceOwner(resourceId)): 
            log.error("*** resource edit attempt without ownership, resource id %s" % resourceId)
            return False

        url = self.request('url')
        
        if (url):
            return mProjectResource.updateProjectResourceTextData(self.db, resourceId, 'url', util.makeUrlAbsolute(url))
        else:
            log.error("*** resource edit attempt without url, resource id %s" % resourceId)
            return False
Example #5
0
    def updateResourceDescription(self):
        resourceId = util.try_f(int, self.request('resource_id'))

        if (not self.user or not self.user.isResourceOwner(resourceId)): 
            log.error("*** resource edit attempt without ownership, resource id %s" % resourceId)
            return False

        description = self.request('description')
        
        if (description):
            return mProjectResource.updateProjectResourceTextData(self.db, resourceId, 'description', description)
        else:
            log.error("*** resource edit attempt without description, resource id %s" % resourceId)
            return False
Example #6
0
    def updateResourceKeywords(self):
        resourceId = util.try_f(int, self.request('resource_id'))

        if (not self.user or not self.user.isResourceOwner(resourceId)):
            log.error(
                "*** resource edit attempt without ownership, resource id %s" %
                resourceId)
            return False

        keywords = ' '.join([
            word.strip() for word in self.request('keywords').split(',')
        ]) if not util.strNullOrEmpty(self.request('keywords')) else None

        return mProjectResource.updateProjectResourceTextData(
            self.db, resourceId, 'keywords', keywords)
Example #7
0
    def updateResourceUrl(self):
        resourceId = util.try_f(int, self.request('resource_id'))

        if (not self.user or not self.user.isResourceOwner(resourceId)):
            log.error(
                "*** resource edit attempt without ownership, resource id %s" %
                resourceId)
            return False

        url = self.request('url')

        if (url):
            return mProjectResource.updateProjectResourceTextData(
                self.db, resourceId, 'url', util.makeUrlAbsolute(url))
        else:
            log.error("*** resource edit attempt without url, resource id %s" %
                      resourceId)
            return False
Example #8
0
    def updateResourceAddress(self):
        resourceId = util.try_f(int, self.request('resource_id'))

        if (not self.user or not self.user.isResourceOwner(resourceId)):
            log.error(
                "*** resource edit attempt without ownership, resource id %s" %
                resourceId)
            return False

        address = self.request('address')

        if (address):
            return mProjectResource.updateProjectResourceTextData(
                self.db, resourceId, 'physical_address', address)
        else:
            log.error(
                "*** resource edit attempt without address, resource id %s" %
                resourceId)
            return False
Example #9
0
    def updateResourceContactEmail(self):
        resourceId = util.try_f(int, self.request('resource_id'))

        if (not self.user or not self.user.isResourceOwner(resourceId)):
            log.error(
                "*** resource edit attempt without ownership, resource id %s" %
                resourceId)
            return False

        email = self.request('contactemail')

        if (email):
            return mProjectResource.updateProjectResourceTextData(
                self.db, resourceId, 'contact_email', email)
        else:
            log.error(
                "*** resource edit attempt without email, resource id %s" %
                resourceId)
            return False
Example #10
0
    def updateResourceDescription(self):
        resourceId = util.try_f(int, self.request('resource_id'))

        if (not self.user or not self.user.isResourceOwner(resourceId)):
            log.error(
                "*** resource edit attempt without ownership, resource id %s" %
                resourceId)
            return False

        description = self.request('description')

        if (description):
            return mProjectResource.updateProjectResourceTextData(
                self.db, resourceId, 'description', description)
        else:
            log.error(
                "*** resource edit attempt without description, resource id %s"
                % resourceId)
            return False