Example #1
0
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
Example #2
0
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
Example #3
0
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)
Example #4
0
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)
Example #5
0
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)
Example #6
0
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)
Example #7
0
File: API.py Project: idoerg/BioDIG
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)
Example #8
0
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)
Example #9
0
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)
Example #10
0
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
Example #11
0
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
Example #12
0
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()
Example #13
0
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)
Example #14
0
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()