Changeset 1644


Ignore:
Timestamp:
28/10/06 22:36:12 (13 years ago)
Author:
lawrence
Message:

Modifications for wsgi (and hence fastcgi) compliance in new discovery

Location:
TI07-MOLES/trunk/PythonCode/browse/portal/cgi/browse
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • TI07-MOLES/trunk/PythonCode/browse/portal/cgi/browse/DIF.py

    r1615 r1644  
    77from People import * 
    88from ServiceBinding import ServiceBinding 
    9 from secure import AccessControl 
     9from AccessControl import AccessControl 
    1010from renderEntity import renderEntity 
    1111from ETxmlView import loadET, nsdumb 
  • TI07-MOLES/trunk/PythonCode/browse/portal/cgi/browse/DiscoveryGUI.py

    r1615 r1644  
    44from renderDiscoverySet import renderDiscoverySet 
    55from DiscoveryState import DiscoveryState 
     6from Utilities import myConfig 
    67 
    78class DiscoveryGUI: 
     
    1415    #this can all be embedded in anything else. 
    1516     
    16     def __init__(self,request,config=None): 
     17    def __init__(self,request,configDir=None): 
    1718        ''' Takes a dictionary of variables which have been populated by the cgi (or whatever)  
    1819        handler, and tests them for sanity before handing queries off to the NDG backend xqquery 
     
    2324        self.message='' 
    2425        self.html='' 
    25         self.config=config 
    26         self.serviceFile=self.config.get('services','serviceFile') 
     26        self.configDir=configDir 
     27        self.config=myConfig(configDir+'config.test') 
     28        self.serviceFile=configDir+self.config.get('services','serviceFile') 
    2729         
    2830        #is this simply a blank request for an interface? 
  • TI07-MOLES/trunk/PythonCode/browse/portal/cgi/browse/Utilities.py

    r1615 r1644  
    3737class Request: 
    3838    ''' Holds the request URL etc ''' 
    39     def __init__(self,env,cgi): 
     39    def __init__(self,env,cgi,wsgi=0): 
    4040        ''' Instantiates attributes: 
    4141            env: the environment 
     
    4646                                   env.get('SCRIPT_NAME')) 
    4747        self.baseURL=self.URL 
    48         try: 
    49              self.variables=getURLdict(cgi.FieldStorage()) 
     48        try:     
     49             if wsgi: 
     50                 # in this case we've got it externally 
     51                 self.variables=getURLdict(cgi) 
     52             else: 
     53                 self.variables=getURLdict(cgi.FieldStorage()) 
    5054        except Exception,e: 
    5155            self.variables={'Error':'<p> Error in Request, parseing url [%s]</p>'%self.URL} 
  • TI07-MOLES/trunk/PythonCode/browse/portal/cgi/browse/config.test

    r1615 r1644  
    88[services] 
    99#serviceFile:    /var/www/cgi-bin/browse/serviceMap.config 
    10 serviceFile:     cgi/browse/serviceMap.config 
     10serviceFile:     serviceMap.config 
  • TI07-MOLES/trunk/PythonCode/browse/portal/cgi/browse/secure.py

    r1211 r1644  
    22from NDG.SecurityClient import * 
    33 
    4 class AccessControl: 
    5          
    6         ''' Handle the access control metadata and provide three attributes of the  
    7         access control: exists (existence), status (modified elsewhere for whether 
    8         user can access data), and html (a message about the constraints). ''' 
    9          
    10         def __init__(self,e): 
    11                 if e is None: 
    12                         self.status=1 
    13                         self.exist=0 
    14                         self.html='' 
    15                 else: 
    16                         #for now assume everything with a simplecondition is deny 
    17                         self.html='Need Role: %s'%wrapGetText(e,'dgSecurityCondition/simpleCondition/attrauthRole') 
    18                         self.htmlLong=wrapGetText(e,'dgSecurityCondition/conditionExplanationText') 
    19                         sc='dgSecurityCondition/simpleCondition/' 
    20                         self.SimpleCondition=(wrapGetText(e,sc+'attrauthRole'), 
    21                                               wrapGetText(e,sc+'dgAttributeAuthority')) 
    22                         if self.SimpleCondition==('',''): self.SimpleCondition=None 
    23                         self.status=0 
    24                         self.exist=1 
     4 
    255                 
    266class gateway2NDGsession: 
  • TI07-MOLES/trunk/PythonCode/browse/portal/cgi/browse/stubB.py

    r1317 r1644  
    99from Utilities import * 
    1010from ServiceBinding import * 
    11 from secure import AccessControl 
     11from AccessControl import AccessControl 
    1212from geoUtilities import Bounding 
    1313from People import * 
Note: See TracChangeset for help on using the changeset viewer.