Changeset 5539 for TI01-discovery


Ignore:
Timestamp:
30/07/09 17:42:26 (10 years ago)
Author:
sdonegan
Message:

adjusted to correct dodgy urls caused by mod_wsgi install in links

Location:
TI01-discovery/trunk/OAIInfoEditor
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/trunk/OAIInfoEditor/editor.config

    r5470 r5539  
    33# - see toplevel README.txt file for config instructions 
    44# 
     5[DEFAULT] 
     6baseurl:        /oai-editor-info 
     7 
     8 
    59[SERVERS] 
    610# 
    711# the following is the server on which this browse/discovery instance runs! 
    8 server:         http://localhost:5000 
     12server:         http://localhost:5000%(baseurl)s 
    913 
    1014# SMTP server for sending mails - notifying when harvests have been ran 
     
    2226harvestDir: harvestData 
    2327 
    24  
    2528[layout] 
    26 layout:          /layout/ 
    27 icondir:         /layout/icons/ 
     29layout:          %(baseurl)s/layout/ 
     30icondir:         %(baseurl)s/layout/icons/ 
    2831 
    2932ndgLink:        http://ndg.nerc.ac.uk/ 
     
    3538loadingIcon:    %(icondir)sloading.gif 
    3639 
     40yuiJavascript:  %(layout)sjs/yui/build/yui/yui-min.js 
     41toggleJavascript: %(layout)sjs/toggleDiv.js 
    3742ndgJavascript:  %(layout)sndgJavascript.js 
    38 xslt:           http://zonda3.badc.rl.ac.uk/public/testconvert.xsl 
     43styleCss: %(layout)slayout/style/oai_editor_style.css  
     44baseStyleCss: %(layout)slayout/style/base_style.css 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/config/oiemiddleware.py

    r5470 r5539  
    2929       
    3030        self.globals=g 
     31        self.globals.baseUrl = cf.get('DEFAULT', 'baseurl') 
     32         
    3133        self.globals.ndgLink=cf.get('layout','ndgLink','http://ndg.nerc.ac.uk') 
    3234        self.globals.ndgImage=cf.get('layout','ndgImage',None) 
     
    3638        self.globals.pageLogo="bodcHdr" 
    3739        self.globals.disclaimer=cf.get('default','disclaimer') 
    38         self.globals.xslt=cf.get('layout','xslt','') 
    3940        self.globals.xmlIcon=cf.get('layout','XMLicon') 
    4041        self.globals.loadingIcon=cf.get('layout','loadingIcon') 
     42         
     43        self.globals.yuiJavascript = cf.get('layout','yuiJavascript') 
     44        self.globals.toggleJavascript = cf.get('layout','toggleJavascript') 
     45        self.globals.ndgJavascript = cf.get('layout','ndgJavascript') 
     46        self.globals.styleCss = cf.get('layout','styleCss') 
     47        self.globals.baseStyleCss = cf.get('layout','baseStyleCss') 
    4148         
    4249        self.globals.server=cf.get('SERVERS','server','') 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/controllers/edit.py

    r5470 r5539  
    131131        # now, return to the view page 
    132132        homeLink = h.url_for('home') + ADMIN_PARAMETER 
    133         h.redirect_to(homeLink) 
     133        self._redirectSafely(homeLink) 
    134134 
    135135         
     
    166166        if c.user.isAdmin: 
    167167            viewLink += ADMIN_PARAMETER 
    168         h.redirect_to(viewLink) 
     168             
     169        self._redirectSafely(viewLink) 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/controllers/harvest.py

    r5470 r5539  
    4848 
    4949        # now, return to the view page 
    50         h.redirect_to('home') 
     50        self._redirectSafely(c.homeLink) 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/controllers/master.py

    r5466 r5539  
    103103             
    104104        return User(userID, ADMIN_FLAG in request.params and request.params[ADMIN_FLAG] == '1') 
     105        
     106        
     107    def _redirectSafely(self, url): 
     108        ''' 
     109        Redirect ensuring that the path has been properly corrected for base url path 
     110        ''' 
     111        if url.startswith(g.baseUrl): 
     112                        url = url.replace(g.baseUrl, '') 
     113                        logging.debug(" 2222222222222") 
     114                        logging.debug(url) 
     115                         
     116        h.redirect_to(g.server + url) 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/lib/harvester.py

    r5253 r5539  
    5656    # this is the command used to run the java client 
    5757    # NB, the inputs required are, outdir, baseURL and format 
    58     JAVA_COMMAND = 'java %s -cp lib/DLESETools.jar:lib/jdom-b7.jar:lib/xercesImpl.jar:lib/xml-apis.jar org.dlese.dpc.oai.harvester.Harvester %s %s %s' 
    59  
     58    # SJD - wsgi buildout screws up these relative paths, - use absolute for testing 
     59    #JAVA_COMMAND = 'java %s -cp lib/DLESETools.jar:lib/jdom-b7.jar:lib/xercesImpl.jar:lib/xml-apis.jar org.dlese.dpc.oai.harvester.Harvester %s %s %s' 
     60    JAVA_COMMAND = 'java %s -cp /usr/local/ndg-oai-info-editor/lib/DLESETools.jar:/usr/local/ndg-oai-info-editor/lib/jdom-b7.jar:/usr/local/ndg-oai-info-editor/lib/xercesImpl.jar:/usr/local/ndg-oai-info-editor/lib/xml-apis.jar org.dlese.dpc.oai.harvester.Harvester %s %s %s' 
     61     
    6062    def __init__(self, mailServer, outDir = None,  
    6163                  proxyHost = '130.246.135.176', 
     
    127129        harvestCMD = self.__constructHarvestCommand(localHarvestDir, repositoryInfo) 
    128130         
    129         logging.debug(" - using command, '%s'" %harvestCMD) 
     131        logging.info(" - using command, '%s'" %harvestCMD) 
    130132         
    131133        status, message = commands.getstatusoutput(harvestCMD) 
    132134         
    133         logging.debug("Harvest output: '%s'" %message) 
     135        logging.info("Harvest output: '%s'" %message) 
    134136         
    135137        if status or message.find('cannotDisseminateFormat') > -1: 
     
    189191 
    190192        try: 
     193            logging.info("Harvest dir= " + harvestDir + "  data format= " + dataFormat) 
    191194            isSuccess, result = self.ingester.processDataCentre(providerName,  
    192195                                                                harvestDir = harvestDir, 
  • TI01-discovery/trunk/OAIInfoEditor/oai_info_editor/templates/ndgPage.html

    r5466 r5539  
    1010        function is needed to avoid escaping the < character --> 
    1111        ${Markup(h.javascript_include_tag(builtins=True))} 
    12         <script type="text/javascript" src="$g.server/js/toggleDiv.js"/> 
    13         <link media="all, screen" href="$g.server/layout/base_style.css" type="text/css" rel="stylesheet"/> 
     12        <script type="text/javascript" src="$g.toggleJavascript"/> 
     13        <link media="all, screen" href="$g.baseStyleCss" type="text/css" rel="stylesheet"/> 
    1414    </head> 
    1515     
    1616    <div py:def="header()"> 
    1717        <div id="header"/> 
    18         <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> 
    1918    </div> 
    2019     
Note: See TracChangeset for help on using the changeset viewer.