Exemple #1
0
def get_location_info(payload, req): 
    id = payload["id"]
    uid = UR.getUserId(req);
    #SACHA TODO: check I'm allowed to know this
    retval={}
    retval["locations"], retval["html5locations"] = annotations.getLocation(id)
    if "org" in payload:
        annotations.logDirectURL(uid, id, payload["org"])
    return UR.prepare_response(retval)
Exemple #2
0
def get_location_info(payload, req): 
    id = payload["id"]
    uid = UR.getUserId(req);
    #SACHA TODO: check I'm allowed to know this
    retval={}
    retval["locations"], retval["html5locations"] = annotations.getLocation(id)
    if "org" in payload:
        annotations.logDirectURL(uid, id, payload["org"])
    return UR.prepare_response(retval)
Exemple #3
0
def get_comment_info(payload, req): 
    id = int(payload["id"])
    uid = UR.getUserId(req);
    #SACHA TODO: check I'm allowed to know this
    retval={}
    comments = annotations.getComment(id, uid)
    id_location = comments[id]["ID_location"]
    retval["comments"] = {id: {"ID": id, "ID_location": id_location}} #share only what's needed
    #print retval["comments"]
    retval["locations"] , retval["html5locations"] = annotations.getLocation( id_location)
    if "org" in payload:
        annotations.logDirectURL(uid, id, payload["org"])
    return UR.prepare_response(retval)
Exemple #4
0
def get_comment_info(payload, req): 
    id = int(payload["id"])
    uid = UR.getUserId(req);
    #SACHA TODO: check I'm allowed to know this
    retval={}
    comments = annotations.getComment(id, uid)
    id_location = comments[id]["ID_location"]
    retval["comments"] = {id: {"ID": id, "ID_location": id_location}} #share only what's needed
    #print retval["comments"]
    retval["locations"] , retval["html5locations"] = annotations.getLocation( id_location)
    if "org" in payload:
        annotations.logDirectURL(uid, id, payload["org"])
    return UR.prepare_response(retval)