Example #1
0
def rating(environ,start_response):
	sql_host = util.fapwsGetSqlHost(environ)
	d = db.DB(sql_host)
	offset = util.fapwsGetParam(environ,"offset",0)
	limit = util.fapwsGetParam(environ,"limit",25)
	fault = util.getFaultTemplate(True)
	util.fapws200OK(start_response,ctypes.TEXT_JAVASCRIPT)
	if(util.checkNulls(fault,offset,limit)): res = json.dumps(fault)
	else: res = services.RatingService().json(d,offset,limit)
	return [res]
Example #2
0
def rating(environ, start_response):
    sql_host = util.fapwsGetSqlHost(environ)
    d = db.DB(sql_host)
    offset = util.fapwsGetParam(environ, "offset", 0)
    limit = util.fapwsGetParam(environ, "limit", 25)
    fault = util.getFaultTemplate(True)
    util.fapws200OK(start_response, ctypes.TEXT_JAVASCRIPT)
    if (util.checkNulls(fault, offset, limit)): res = json.dumps(fault)
    else: res = services.RatingService().json(d, offset, limit)
    return [res]
Example #3
0
def rateTag(environ,start_response):
	sql_host = util.fapwsGetSqlHost(environ)
	d = db.DB(sql_host)
	tagId = util.fapwsGetParam(environ,"tagId")
	rating = util.fapwsGetParam(environ,"rating")
	fault = util.getFaultTemplate(True)
	util.fapws200OK(start_response,ctypes.TEXT_JAVASCRIPT)
	if(util.checkNulls(fault,tagId,rating)): res = json.dumps(fault)
	else: res = services.RateTagService().json(d,tagId,rating)
	return [res]
Example #4
0
def rateTag(environ, start_response):
    sql_host = util.fapwsGetSqlHost(environ)
    d = db.DB(sql_host)
    tagId = util.fapwsGetParam(environ, "tagId")
    rating = util.fapwsGetParam(environ, "rating")
    fault = util.getFaultTemplate(True)
    util.fapws200OK(start_response, ctypes.TEXT_JAVASCRIPT)
    if (util.checkNulls(fault, tagId, rating)): res = json.dumps(fault)
    else: res = services.RateTagService().json(d, tagId, rating)
    return [res]
Example #5
0
def register(environ, start_response):
	sql_host = util.fapwsGetSqlHost(environ)
	d = db.DB(sql_host)
	username = util.fapwsGetParam(environ,"username")
	email = util.fapwsGetParam(environ,"email")
	password = util.fapwsGetParam(environ,"password")
	fault = util.getFaultTemplate(True)
	util.fapws200OK(start_response,ctypes.TEXT_JAVASCRIPT)
	if(util.checkNulls(fault,username,email,password)): res = json.dumps(fault)
	else: res = services.RegisterService().json(d,email,username,password)
	return [res]
Example #6
0
def deleteTag(environ,start_response):
	sql_host = util.fapwsGetSqlHost(environ)
	d = db.DB(sql_host)
	username = util.fapwsGetParam(environ,"username")
	password = util.fapwsGetParam(environ,"password")
	tagId = util.fapwsGetParam(environ,"tagId")
	fault = util.getFaultTemplate(True)
	util.fapws200OK(start_response,ctypes.TEXT_JAVASCRIPT)
	if(util.checkNulls(fault,username,password,tagId)): res = json.dumps(fault)
	else: res = services.DeleteTagService().json(d,tagId,username,password)
	return [res]
Example #7
0
def login(environ, start_response):
	"""
	Login wsgi handler for fapws.
	"""
	sql_host = util.fapwsGetSqlHost(environ)
	d = db.DB(sql_host)
	username = util.fapwsGetParam(environ,"username")
	password = util.fapwsGetParam(environ,"password")
	fault = util.getFaultTemplate(True)
	util.fapws200OK(start_response,ctypes.TEXT_JAVASCRIPT)
	if(util.checkNulls(fault,username,password)): res = json.dumps(fault)
	else: res = services.LoginService().json(d,username,password)
	return [res]
Example #8
0
def login(environ, start_response):
    """
	Login wsgi handler for fapws.
	"""
    sql_host = util.fapwsGetSqlHost(environ)
    d = db.DB(sql_host)
    username = util.fapwsGetParam(environ, "username")
    password = util.fapwsGetParam(environ, "password")
    fault = util.getFaultTemplate(True)
    util.fapws200OK(start_response, ctypes.TEXT_JAVASCRIPT)
    if (util.checkNulls(fault, username, password)): res = json.dumps(fault)
    else: res = services.LoginService().json(d, username, password)
    return [res]
Example #9
0
def register(environ, start_response):
    sql_host = util.fapwsGetSqlHost(environ)
    d = db.DB(sql_host)
    username = util.fapwsGetParam(environ, "username")
    email = util.fapwsGetParam(environ, "email")
    password = util.fapwsGetParam(environ, "password")
    fault = util.getFaultTemplate(True)
    util.fapws200OK(start_response, ctypes.TEXT_JAVASCRIPT)
    if (util.checkNulls(fault, username, email, password)):
        res = json.dumps(fault)
    else:
        res = services.RegisterService().json(d, email, username, password)
    return [res]
Example #10
0
def deleteTag(environ, start_response):
    sql_host = util.fapwsGetSqlHost(environ)
    d = db.DB(sql_host)
    username = util.fapwsGetParam(environ, "username")
    password = util.fapwsGetParam(environ, "password")
    tagId = util.fapwsGetParam(environ, "tagId")
    fault = util.getFaultTemplate(True)
    util.fapws200OK(start_response, ctypes.TEXT_JAVASCRIPT)
    if (util.checkNulls(fault, username, password, tagId)):
        res = json.dumps(fault)
    else:
        res = services.DeleteTagService().json(d, tagId, username, password)
    return [res]
Example #11
0
def listTagsByUser(environ,start_response):
	sql_host = util.fapwsGetSqlHost(environ)
	d = db.DB(sql_host)
	username = util.fapwsGetParam(environ,"username")
	offset = util.fapwsGetParam(environ,"offset",0)
	limit = util.fapwsGetParam(environ,"limit",25)
	if(not offset): offset = 0
	if(not limit): limit = 25
	if(limit and int(limit) > 25 or int(limit) < 5): limit = 25
	fault = util.getFaultTemplate(True)
	util.fapws200OK(start_response,ctypes.TEXT_JAVASCRIPT)
	if(util.checkNulls(fault,username,offset,limit)): res = json.dumps(fault)
	else: res = services.ListTagsByUserService().json(d,username,offset,limit)
	return [res]
Example #12
0
def listTagsByUser(environ, start_response):
    sql_host = util.fapwsGetSqlHost(environ)
    d = db.DB(sql_host)
    username = util.fapwsGetParam(environ, "username")
    offset = util.fapwsGetParam(environ, "offset", 0)
    limit = util.fapwsGetParam(environ, "limit", 25)
    if (not offset): offset = 0
    if (not limit): limit = 25
    if (limit and int(limit) > 25 or int(limit) < 5): limit = 25
    fault = util.getFaultTemplate(True)
    util.fapws200OK(start_response, ctypes.TEXT_JAVASCRIPT)
    if (util.checkNulls(fault, username, offset, limit)):
        res = json.dumps(fault)
    else:
        res = services.ListTagsByUserService().json(d, username, offset, limit)
    return [res]
Example #13
0
def getProfileInfo(environ,start_response):
	sql_host = util.fapwsGetSqlHost(environ)
	d = db.DB(sql_host)
	username = util.fapwsGetParam(environ,"username")
	fault = util.getFaultTemplate(True)
	util.fapws200OK(start_response,ctypes.TEXT_JAVASCRIPT)
	if(util.checkNulls(fault,username)): res = json.dumps(fault)
	else: res = services.GetProfileInfoService().json(d,username)
	return [res]
Example #14
0
def getProfileInfo(environ, start_response):
    sql_host = util.fapwsGetSqlHost(environ)
    d = db.DB(sql_host)
    username = util.fapwsGetParam(environ, "username")
    fault = util.getFaultTemplate(True)
    util.fapws200OK(start_response, ctypes.TEXT_JAVASCRIPT)
    if (util.checkNulls(fault, username)): res = json.dumps(fault)
    else: res = services.GetProfileInfoService().json(d, username)
    return [res]
Example #15
0
def facebook(environ,start_response):
	sql_host = util.fapwsGetSqlHost(environ)
	d = db.DB(sql_host)
	imageName = util.fapwsGetParam(environ,"imageName")
	res = services.FacebookShareService().html(d,imageName)
	return [res]
Example #16
0
def facebook(environ, start_response):
    sql_host = util.fapwsGetSqlHost(environ)
    d = db.DB(sql_host)
    imageName = util.fapwsGetParam(environ, "imageName")
    res = services.FacebookShareService().html(d, imageName)
    return [res]