コード例 #1
0
ファイル: objects.py プロジェクト: robrowill/roboearthDB
def submitForm(request):
    """ show form to submit new object description """
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/login")

    return render_to_response('submitObject.html',
                              roboearth.webpage_values(request))
コード例 #2
0
ファイル: users.py プロジェクト: robrowill/roboearthDB
def registerForm(request, error=False):
    """ show form to register new user """
    if request.user.is_authenticated():
        return HttpResponseRedirect("/")

    values = {'error' : error}
    return render_to_response('register.html', roboearth.webpage_values(request,values))
コード例 #3
0
ファイル: objects.py プロジェクト: Aerobota/roboearthDB
    def output(objects, query, semantic):
        template = loader.get_template('showObject.html')
        values = {'Objects' : objects,
                  'is_auth' : request.user.is_authenticated(),
                  'Query' : query,
                  'Semantic' : semantic}

        return render_to_response('showObject.html', roboearth.webpage_values(request,values))
コード例 #4
0
ファイル: users.py プロジェクト: robrowill/roboearthDB
def loginForm(request, error=False):
    """ show login form """
    if request.user.is_authenticated():
        return HttpResponseRedirect("/")

    values = {'error' : error}
    
    return render_to_response('login.html', roboearth.webpage_values(request,values))
コード例 #5
0
ファイル: views.py プロジェクト: robrowill/roboearthDB
def success(request, nextPage='/'):
    """ page for successful operations:

    nextPage : which page should be shown after the success notice
    """
    template = loader.get_template('successMessage.html')
    webpage_values = Context(
        roboearth.webpage_values(request, {'nextPage': nextPage}))
    return template.render(webpage_values)
コード例 #6
0
ファイル: robots.py プロジェクト: robrowill/roboearthDB
def submitForm(request):
    """ show form to submit new robot locations """
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/login")

    values = {}  #'Environments' : hbase_op.list_all("Environments")}

    return render_to_response('submitRobot.html',
                              roboearth.webpage_values(request, values))
コード例 #7
0
ファイル: views.py プロジェクト: Aerobota/roboearthDB
def success(request, nextPage='/'):
    """ page for successful operations:

    nextPage : which page should be shown after the success notice
    """
    template = loader.get_template('successMessage.html')
    webpage_values = Context(roboearth.webpage_values(request,
                                                      {'nextPage' : nextPage}))
    return template.render(webpage_values)
コード例 #8
0
ファイル: recipes.py プロジェクト: robrowill/roboearthDB
    def output(recipes, query, semantic):
        values = {
            'Recipes': recipes,
            'is_auth': request.user.is_authenticated(),
            'Query': query,
            'Semantic': semantic
        }

        return render_to_response('showRecipe.html',
                                  roboearth.webpage_values(request, values))
コード例 #9
0
ファイル: robots.py プロジェクト: robrowill/roboearthDB
    def output(robots):
        template = loader.get_template('showRobot.html')
        values = {
            'Robots': robots,
            'is_auth': request.user.is_authenticated(),
            'my_robots': True
        }

        return render_to_response('showRobot.html',
                                  roboearth.webpage_values(request, values))
コード例 #10
0
ファイル: objects.py プロジェクト: robrowill/roboearthDB
    def output(objects, query, semantic):
        template = loader.get_template('showObject.html')
        values = {
            'Objects': objects,
            'is_auth': request.user.is_authenticated(),
            'Query': query,
            'Semantic': semantic
        }

        return render_to_response('showObject.html',
                                  roboearth.webpage_values(request, values))
コード例 #11
0
ファイル: users.py プロジェクト: robrowill/roboearthDB
def newsfeed(request):
    """ show the newsfeed from a specific user
    """
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/login")

    values = {'Domain' : roboearth.DOMAIN,
                      'news' : transaction.getNewsfeed(request.user.username),
                      }

    return render_to_response('newsfeed.html', roboearth.webpage_values(request,values))
コード例 #12
0
ファイル: users.py プロジェクト: robrowill/roboearthDB
def profile(request):
    """ show the profil of the authenticated user """
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/")

    template = loader.get_template('profile.html')
    values = {'username' : request.user.username,
              'email' : request.user.email,
              'api_key' : api_keys.objects.get(pk=request.user.username).key}

    return render_to_response('profile.html', roboearth.webpage_values(request,values))
コード例 #13
0
ファイル: views.py プロジェクト: Aerobota/roboearthDB
def dbContent(request):
    """ DEPRECIATED: show the complete content of the database
    """
    
    try:
        template = loader.get_template('showDBcontent.html')
        webpage_values = Context(roboearth.webpage_values(request,
                                                          {'Recipes' : recipes.get(numOfVersions=3),
                                                           'Objects' : objects.get(numOfVersions=3)}))
        return HttpResponse(template.render(webpage_values))
    except roboearth.DBException, err:
        return HttpResponse(error(request, errorType=2, errorMessage=err.__str__()))
コード例 #14
0
ファイル: users.py プロジェクト: robrowill/roboearthDB
def subscriptions(request):
    """ show all subscriptions of a user
    """
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/login")

    try:
        values = {'Domain' : roboearth.DOMAIN,
                  'Subscriptions' : transaction.getSubscriptions(username=request.user.username),
                  }

        return render_to_response('subscriptions.html', roboearth.webpage_values(request,values))
    except Exception, err:
        return HttpResponse(views.error(request, nextPage="/", errorType=2, errorMessage=err.__str__()))
コード例 #15
0
ファイル: views.py プロジェクト: Aerobota/roboearthDB
def deleteEntity(request):
    """ get called for delete operations, expected data: table and rowKey
    """
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/login")

    if request.user.username != request.POST['author']:
        return HttpResponse(error(request, errorType=0, errorMessage="User not allowed to delete " + request.POST['rowKey']))

    webpage_values = roboearth.webpage_values(request,
                                              {'table' : request.POST['table'],
                                               'binary' : '0',
                                               'row_key' : request.POST['rowKey']})
    
    return render_to_response('confirmDeleteRequest.html', webpage_values)
コード例 #16
0
ファイル: views.py プロジェクト: Aerobota/roboearthDB
def error(request, nextPage='/', errorType=0, errorMessage=""):
    """ show error page:

    nextPage : what page should be shown after the error notice

    errorType : "0" -> "unknown error", "1" -> "data not valid", "2" -> "hadoop error"

    errorMessage : the message of the error notice
    """
    template = loader.get_template('errorMessage.html')
    webpage_values = Context(roboearth.webpage_values(request,
                                                      {'nextPage' : nextPage,
                                                       'errorType' : roboearth.ERROR_TYPES[errorType],
                                                       'errorMessage' : errorMessage}))
    return template.render(webpage_values)
コード例 #17
0
ファイル: views.py プロジェクト: robrowill/roboearthDB
def dbContent(request):
    """ DEPRECIATED: show the complete content of the database
    """

    try:
        template = loader.get_template('showDBcontent.html')
        webpage_values = Context(
            roboearth.webpage_values(
                request, {
                    'Recipes': recipes.get(numOfVersions=3),
                    'Objects': objects.get(numOfVersions=3)
                }))
        return HttpResponse(template.render(webpage_values))
    except roboearth.DBException, err:
        return HttpResponse(
            error(request, errorType=2, errorMessage=err.__str__()))
コード例 #18
0
ファイル: users.py プロジェクト: robrowill/roboearthDB
def manage(request):
    """ admin view to manage registered users """
    if not request.user.is_authenticated() or request.user.is_superuser==False:
        return HttpResponseRedirect("/")

    users = User.objects.all()
    users_list = list()
    for u in users:
        users_list.append({'username' : u.username,
                           'first_name' : u.first_name,
                           'last_name' : u.last_name,
                           'email' : u.email,
                           'is_active' : u.is_active,
                           'is_superuser' : u.is_superuser})
        
    values = {'Users' : users_list}

    return render_to_response('manage.html', roboearth.webpage_values(request,values))
コード例 #19
0
ファイル: views.py プロジェクト: robrowill/roboearthDB
def error(request, nextPage='/', errorType=0, errorMessage=""):
    """ show error page:

    nextPage : what page should be shown after the error notice

    errorType : "0" -> "unknown error", "1" -> "data not valid", "2" -> "hadoop error"

    errorMessage : the message of the error notice
    """
    template = loader.get_template('errorMessage.html')
    webpage_values = Context(
        roboearth.webpage_values(
            request, {
                'nextPage': nextPage,
                'errorType': roboearth.ERROR_TYPES[errorType],
                'errorMessage': errorMessage
            }))
    return template.render(webpage_values)
コード例 #20
0
ファイル: views.py プロジェクト: robrowill/roboearthDB
def deleteEntity(request):
    """ get called for delete operations, expected data: table and rowKey
    """
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/login")

    if request.user.username != request.POST['author']:
        return HttpResponse(
            error(request,
                  errorType=0,
                  errorMessage="User not allowed to delete " +
                  request.POST['rowKey']))

    webpage_values = roboearth.webpage_values(
        request, {
            'table': request.POST['table'],
            'binary': '0',
            'row_key': request.POST['rowKey']
        })

    return render_to_response('confirmDeleteRequest.html', webpage_values)
コード例 #21
0
ファイル: serql.py プロジェクト: Aerobota/roboearthDB
 def output(result, query):
     template = loader.get_template('serql.html')
     values = {'query' : query,
               'result' : result}
 
     return render_to_response('serql.html', roboearth.webpage_values(request,values))
コード例 #22
0
ファイル: recipes.py プロジェクト: rapyuta/roboearthDB
def submitForm(request):
    """ show form to submit new action recipes """
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/login")

    return render_to_response("submitRecipe.html", roboearth.webpage_values(request))
コード例 #23
0
ファイル: views.py プロジェクト: Aerobota/roboearthDB
def documentation(request):
    """ show documentation page for the REST-API """
    template = loader.get_template('documentation.html')
    webpage_values = Context(roboearth.webpage_values(request))
    
    return HttpResponse(template.render(webpage_values))
コード例 #24
0
ファイル: views.py プロジェクト: Aerobota/roboearthDB
def startPage(request):
    """ show start page """
    template = loader.get_template('index.html')
    webpage_values = Context(roboearth.webpage_values(request))
    
    return template.render(webpage_values)
コード例 #25
0
ファイル: environments.py プロジェクト: robrowill/roboearthDB
def requestForm(request):
    """ show form to request environment """
    return render_to_response('requestEnvironment.html',
                              roboearth.webpage_values(request))
コード例 #26
0
ファイル: recipes.py プロジェクト: robrowill/roboearthDB
def requestForm(request):
    """ show form to request action recipes """
    return render_to_response('requestRecipe.html',
                              roboearth.webpage_values(request))
コード例 #27
0
ファイル: serql.py プロジェクト: Aerobota/roboearthDB
def serql(request):
    """ show the web page to execute serql queries """   
    return render_to_response('serql.html', roboearth.webpage_values(request))
コード例 #28
0
ファイル: views.py プロジェクト: Aerobota/roboearthDB
def about(request):
    """ show general information about RoboEarth """
    template = loader.get_template('about.html')
    webpage_values = Context(roboearth.webpage_values(request))
    
    return HttpResponse(template.render(webpage_values))
コード例 #29
0
ファイル: environments.py プロジェクト: Aerobota/roboearthDB
def requestForm(request):
    """ show form to request environment """
    return render_to_response('requestEnvironment.html', roboearth.webpage_values(request))
コード例 #30
0
ファイル: views.py プロジェクト: robrowill/roboearthDB
def about(request):
    """ show general information about RoboEarth """
    template = loader.get_template('about.html')
    webpage_values = Context(roboearth.webpage_values(request))

    return HttpResponse(template.render(webpage_values))
コード例 #31
0
ファイル: views.py プロジェクト: robrowill/roboearthDB
def startPage(request):
    """ show start page """
    template = loader.get_template('index.html')
    webpage_values = Context(roboearth.webpage_values(request))

    return template.render(webpage_values)
コード例 #32
0
ファイル: recipes.py プロジェクト: rapyuta/roboearthDB
    def output(recipes, query, semantic):
        values = {"Recipes": recipes, "is_auth": request.user.is_authenticated(), "Query": query, "Semantic": semantic}

        return render_to_response("showRecipe.html", roboearth.webpage_values(request, values))
コード例 #33
0
ファイル: objects.py プロジェクト: Aerobota/roboearthDB
def submitForm(request):
    """ show form to submit new object description """
    if not request.user.is_authenticated():
        return HttpResponseRedirect("/login")
    
    return render_to_response('submitObject.html', roboearth.webpage_values(request))
コード例 #34
0
ファイル: views.py プロジェクト: robrowill/roboearthDB
def documentation(request):
    """ show documentation page for the REST-API """
    template = loader.get_template('documentation.html')
    webpage_values = Context(roboearth.webpage_values(request))

    return HttpResponse(template.render(webpage_values))
コード例 #35
0
ファイル: recipes.py プロジェクト: rapyuta/roboearthDB
def requestForm(request):
    """ show form to request action recipes """
    return render_to_response("requestRecipe.html", roboearth.webpage_values(request))
コード例 #36
0
ファイル: robots.py プロジェクト: robrowill/roboearthDB
def requestForm(request):
    """ show form to request robot location """
    return render_to_response('requestRobot.html',
                              roboearth.webpage_values(request))
コード例 #37
0
ファイル: serql.py プロジェクト: robrowill/roboearthDB
def serql(request):
    """ show the web page to execute serql queries """
    return render_to_response('serql.html', roboearth.webpage_values(request))
コード例 #38
0
ファイル: users.py プロジェクト: robrowill/roboearthDB
def created(request):
    """ user account successful created """
    if request.user.is_authenticated():
        return HttpResponseRedirect("/")

    return render_to_response('registration_finished.html', roboearth.webpage_values(request))
コード例 #39
0
ファイル: serql.py プロジェクト: robrowill/roboearthDB
    def output(result, query):
        template = loader.get_template('serql.html')
        values = {'query': query, 'result': result}

        return render_to_response('serql.html',
                                  roboearth.webpage_values(request, values))
コード例 #40
0
ファイル: objects.py プロジェクト: robrowill/roboearthDB
def requestForm(request):
    """ show form to request object description """
    return render_to_response('requestObject.html',
                              roboearth.webpage_values(request))
コード例 #41
0
ファイル: objects.py プロジェクト: Aerobota/roboearthDB
def requestForm(request):
    """ show form to request object description """
    return render_to_response('requestObject.html', roboearth.webpage_values(request))