Ejemplo n.º 1
0
def hydroshare(request):
    utilities.viewer_counter(request)
    # if use_hs_client_helper:
	 #    hs = get_oauth_hs(request)
    # else:
    #     hs = getOAuthHS(request)
    context = {}
    return render(request, 'timeseries_viewer/home.html', context)
Ejemplo n.º 2
0
def home(request):
    """
    Controller for the app home page.
    """
    # temp_dir = utilities.get_workspace()
    # print temp_dir
    # temp_dir = temp_dir[:-24]
    # print temp_dir
    utilities.viewer_counter(request)
    context = {}
    return render(request, 'script_viewer/home.html', context)
Ejemplo n.º 3
0
def home(request):
    ids=[]
    meta =[]
    source=[]
    quality=[]
    method=[]
    sourceid=[]
    try: #Check to see if request if from CUAHSI. For data validation
        request_url = request.META['HTTP_REFERER']
    except:
        request_url ="test"
    data = request.META['QUERY_STRING']#stores all values in the query string
    data = data.encode(encoding ='UTF-8')#encodes the data string to avoid having unicode character in string
    data  =data.split('&')
    for e in data:
        s= e.split('=')
        meta.append(s)
    for e in meta:
        print e
        if e[0] == 'Source':
            source.append(e[1])
        if e[0] == 'WofUri':
            ids.append(e[1])
        if e[0] == 'QCLID':
            quality.append(e[1])
        if e[0] == 'MethodId':
            method.append(e[1])
        if e[0] == 'SourceId':
            sourceid.append(e[1])

    utilities.viewer_counter(request)
    #the parametes passed from CUAHSI are stored in a hidden div on the home page so that the js file is able to read them
    context = {'source':source,
               'cuahsi_ids':ids,
               'quality':quality,
               'method':method,
               'sourceid':sourceid,
               }
    return render(request, 'timeseries_viewer/home.html', context)