%page args="module"/> <%# Copyright (C) 2009-2012 Splunk Inc. All Rights Reserved. import os import splunk import sys import re sys.path.append( os.path.join("..", "..", "..", "bin") ) from LookupFileEditor import getCapabilities4User, getLookupFile # Get cherry key session_key = cherrypy.session.get('sessionKey') # Get cherry username user = cherrypy.session['user']['name'] args = cherrypy.serving.request.params messages = [] # Below are the variables we will try to populate namespace = args.get("namespace", None) lookup_file = args.get("lookup_file", None) lookup_name = args.get("lookup_name", None) owner = args.get("owner", None) path_description = args.get("path", None) if path_description is not None: split_path = path_description.split('/') if len(split_path) == 2: namespace, lookup_file = split_path # If we got a lookup name but not a file, then get the lookup file from the transform name if lookup_name and not lookup_file: lookup_file = getLookupFile(lookup_name, namespace, session_key) # Get capabilities capabilities = getCapabilities4User(user, session_key) # Test capabilities insufficient_permissions = False if lookup_file is None: is_new = True else: is_new = False # Get the module params title_new = module['params'].get('titleNew' , "New Lookup Table File") title_edit = module['params'].get('titleEdit', "Edit Lookup Table File") list_view = module['params'].get('listView' , "lookup_list") if title_new is None or title_new == '': title_new = "New Lookup File" if title_edit is None or title_edit == '': title_edit = "Edit Lookup File" try: # Get the URL to redirect to redirect = None # Get the form action URL form_action = make_url(["module", "system", "Splunk.Module.LookupFileEditor", "render"]); # Get the app name app = APP['id'] except splunk.AuthorizationFailed: insufficient_permissions = True %> <%namespace name="lib" file="//lib.html" import="*"/> <%namespace name="helpers" file="//view/_helpers.html" import="*"/> % if insufficient_permissions:
% else: % if splunk.getReleaseVersion().startswith("5."): % endif % if is_new:Right-click the table cells for more editing options
The requested lookup file does not exist. |