Changeset 5128


Ignore:
Timestamp:
23/03/09 10:30:47 (10 years ago)
Author:
cbyrom
Message:

Adjust atom links when in editor mode to point to the editor instance

  • and correct these when saving the data so that the links actually

point to the browse service + turn of granule delete function when not
in edit mode + remove duplicated inclusion of badc icon + tidy up
config file.

Location:
MILK/trunk/milk_server
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk.config

    r4992 r5128  
    1010# 
    1111# the following is the server on which this browse/discovery instance runs! 
    12 server:         http://localhost 
     12server:         http://localhost:5000 
    1313#server:       http://superglue.badc.rl.ac.uk:8083 
    1414## This is the proxied server root 
     
    2323# 
    2424##!NOTE: These are changed to  reflect the proxy prefix 
    25 #layout:         /ndg-test/layout/ 
    26 #icondir:        /ndg-test/layout/icons/ 
    2725layout:          /layout/ 
    2826icondir:         /layout/icons/ 
     
    3533 
    3634# The following should only be needed for debugging some parts of the code when running on sandboxes behind a firewall 
    37 proxyServer:      http://wwwcache3.rl.ac.uk:8080/ 
     35proxyServer:      http://wwwcache.rl.ac.uk:8080/ 
    3836disclaimer:        
    3937 
     
    6563printer:        %(icondir)sprinter.png 
    6664helpIcon:       %(icondir)shelp.png 
    67 HdrLeftAlt:     %(icondir)s Natural Environment Research Council 
    68 HdrLeftLogo:    %(icondir)sNERC_Logo.gif 
     65HdrLeftAlt:     %(icondir)s British Atmospheric Data Centre 
     66HdrLeftLogo:    %(icondir)sbadc_logo.gif 
    6967navMinus:       %(icondir)snavigate_minus.png 
    7068navPlus:                %(icondir)snavigate_plus.png 
     
    7573[HELP] 
    7674helpFile:       %(layout)shelp.html 
    77  
    78 [ATOM_EDITOR] 
    79 # if set to True, the editor will be available 
    80 enabled: True 
    8175 
    8276[WMC_CLIENT] 
     
    120114# is the NDG identifier. 
    121115#  
    122 local: chinook.badc.rl.ac.uk 
    123 badc.nerc.ac.uk: chinook.badc.rl.ac.uk 
    124 neodc.nerc.ac.uk: chinook.badc.rl.ac.uk 
     116local: bora.badc.rl.ac.uk 
     117badc.nerc.ac.uk: bora.badc.rl.ac.uk 
     118neodc.nerc.ac.uk: bora.badc.rl.ac.uk 
    125119grid.bodc.nerc.ac.uk: grid.bodc.nerc.ac.uk 
    126120ndg.noc.soton.ac.uk: ndg.noc.soton.ac.uk 
     
    323317# Configure the MILK_SERVER framework here 
    324318# 
     319editorOn=False 
     320browseOn=True 
     321discoveryOn=False 
    325322 
    326323# exception_type: whether OGC servers should send a valid ExceptionReport on errors 
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/atomeditorcontroller.py

    r5116 r5128  
    77from ndg.common.src.models.ndgObject import ndgObject 
    88from ndg.common.src.lib.utilities import escapeSpecialCharacters 
     9from ndg.common.src.models.vocabtermdata import VocabTermData as VTD 
    910from milk_server.lib.base import * 
    1011from milk_server.models.ndgdoc import NDGDoc  
     
    166167        logging.debug("Now rendering current template (%s)" %template) 
    167168        html = render("genshi", template) 
     169         
     170        # replace any browse links with to links to editor 
     171        html = html.replace(VTD.BROWSE_SERVER_URL, g.server) 
     172         
    168173        # NB, need html in unicode for for htmlfill.render 
    169174        html = unicode(html, 'utf-8', 'xmlcharrefreplace') 
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/editatom.py

    r5111 r5128  
    552552                    link.rel = rel or "" 
    553553                     
    554                     # adjust href to point to the view, not the edit version 
     554                    # adjust href to point to the browse, not the edit version 
    555555                    link.href = link.href.replace('editAtom', 'view') 
     556                    link.href = link.href.replace(g.server, VTD.BROWSE_SERVER_URL) 
    556557                     
    557558                    logging.debug("Extracted atom info (href:'%s', title:'%s', rel:'%s')" \ 
  • MILK/trunk/milk_server/milk_server/controllers/browse/retrieve.py

    r5022 r5128  
    194194            logging.debug("Rendering output from data model") 
    195195            out = render(model.templateType, model.renderTemplate) 
     196             
     197            # if in atom editor mode, replace any browse links with to links to editor 
     198            if g.atomEditorEnabled: 
     199                out = out.replace(VTD.BROWSE_SERVER_URL, g.server) 
     200             
    196201            logging.debug("- returning rendered data model") 
    197202            return out 
  • MILK/trunk/milk_server/milk_server/templates/atom_editor/atom_editor.html

    r5116 r5128  
    6060                                ${Markup(h.end_form())} 
    6161                                ${Markup(h.form(h.url_for(controller='atom_editor/editatom', action='delete', uri=c.atom.ndgURI)))} 
    62                                         <input py:if="c.atom.isGranule()" name="Delete" type="submit" value="Delete" onclick="return confirmGranuleDelete()" /> 
     62                                        <input py:if="c.atom.isGranule() and g.atomEditorEnabled" name="Delete" type="submit" value="Delete" onclick="return confirmGranuleDelete()" /> 
    6363                                ${Markup(h.end_form())} 
    6464                        <div py:replace="displayErrors()"/> 
  • MILK/trunk/milk_server/milk_server/templates/atom_editor/layout.html

    r5116 r5128  
    2727      <div py:replace="header()"/> 
    2828      ${Markup(c.tbinfo)} 
    29  
    30       <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> 
    3129      <div py:if="g.discoveryEnabled"> 
    3230                  <span py:with="panelTab = select('panelTab/text()')" py:strip=""> 
Note: See TracChangeset for help on using the changeset viewer.