def getImageTags(request): renderObj = WebServiceObject() # read in crucial parameters tagGroupKey = request.GET.get('tagGroupId', None) imageKey = request.GET.get('imageId', None) # read in optional parameters and initialize the API offset = Util.getInt(request.GET, 'offset', 0) limit = Util.getInt(request.GET, 'limit', 10) unlimited = request.GET.get('unlimited', False) fields = Util.getDelimitedList(request.GET, 'fields') getAPI = GetAPI(limit, offset, request.user, fields, unlimited) if tagGroupKey: # the key for lookup and the image it is attached to renderObj = getAPI.getTagsByTagGroup(tagGroupKey, isKey=True) elif imageKey: # the key for lookup and the image it is attached to renderObj = getAPI.getTagsByImage(imageKey, isKey=True) else: # get all the tags renderObj = getAPI.getTags() return renderObj
def getQtl(request): imageKey = request.GET.get('pictureID', None) # read in optional parameters and initialize the API fields = Util.getDelimitedList(request.GET, 'fields') getAPI = GetAPI(request.user, fields) return getAPI.getQtl(imageKey)
def getOrganisms(request): # get the list of organisms (base on comma delimited list) organisms = Util.getDelimitedList(request.GET, 'organisms') # optional parameters fields = Util.getDelimitedList(request.GET, 'fields') getAPI = GetAPI(request.user, fields) return getAPI.getOrganisms(organisms)
def getTagGroup(request): # read in crucial parameters tagGroupKey = request.GET.get('id', None) # read in optional parameters and initialize the API fields = Util.getDelimitedList(request.GET, 'fields') getAPI = GetAPI(request.user, fields) if not tagGroupKey: raise Errors.NO_TAG_GROUP_KEY # the key for lookup and the image it is attached to return getAPI.getTagGroup(tagGroupKey)
def getTagGroup(request): # read in crucial parameters tagGroupKey = request.GET.get("id", None) # read in optional parameters and initialize the API fields = Util.getDelimitedList(request.GET, "fields") getAPI = GetAPI(request.user, fields) if not tagGroupKey: raise Errors.NO_TAG_GROUP_KEY # the key for lookup and the image it is attached to return getAPI.getTagGroup(tagGroupKey)
def getGeneLink(request): # read in crucial parameters geneLinkKey = request.GET.get('id', None) # read in optional parameters and initialize the API fields = Util.getDelimitedList(request.GET, 'fields') getAPI = GetAPI(request.user, fields) if not geneLinkKey: raise Errors.NO_GENE_LINK_KEY # the key for lookup and the image it is attached to return getAPI.getGeneLink(geneLinkKey)
def getImageMetadata(request): renderObj = WebServiceObject() if request.GET.has_key('id'): # the key for lookup and the image it is attached to imageKey = request.GET['id'] fields = Util.getDelimitedList(request.GET, 'fields') getAPI = GetAPI(request.user, fields) try: renderObj = getAPI.getImageMetadata(imageKey) except Errors.WebServiceException as e: renderObj.setError(e) else: renderObj.setError(Errors.NO_IMAGE_KEY) return renderObj
def getImageTagGroups(request): # the key for lookup and the image it is attached to imageKey = request.GET.get('imageId', None) offset = Util.getInt(request.GET, 'offset', 0) limit = Util.getInt(request.GET, 'limit', 10) unlimited = request.GET.get('unlimited', False) fields = Util.getDelimitedList(request.GET, 'fields') getAPI = GetAPI(limit, offset, request.user, fields, unlimited) if imageKey: return getAPI.getTagGroupsByImage(imageKey) else: return getAPI.getTagGroups()
def getTag(request): # read in crucial parameters tagKey = request.GET.get('id', None) # read in optional parameters and initialize the API fields = Util.getDelimitedList(request.GET, 'fields') getAPI = GetAPI(request.user, fields) #TEST for debugging - logger logger = logging.getLogger(__name__) logger.error('logger test - ktcho') if not tagKey: raise Errors.NO_TAG_KEY # the key for lookup and the image it is attached to return getAPI.getTag(tagKey)
def getImageMetadata(request): #optional parameters offset = Util.getInt(request.GET, 'offset', 0) limit = Util.getInt(request.GET, 'limit', 10) unlimited = request.GET.get('unlimited', False) fields = Util.getDelimitedList(request.GET, 'fields') getAPI = GetAPI(limit, offset, request.user, fields, unlimited) if request.GET.has_key('by'): by = request.GET['by'] if by == 'organism': # required paramaters organismIds = Util.getDelimitedList(request.GET, 'organismId') return getAPI.getImageMetadataByOrganism(organismIds) else: raise Errors.INVALID_PARAMETER.setCustom('by') else: return getAPI.getImageMetadata()