Ignore:
Timestamp:
18/05/09 10:22:56 (11 years ago)
Author:
cbyrom
Message:

Add new controller, feeds, to centralise all feed creation code. Add
new template, feed_creator, to allow input form to directly create
atom feed entry. Add general feed to discovery search page - tieing
this to the feed created by feed_creator. Add icons for feed and
include these in the config set up.

Location:
MILK/trunk/milk_server
Files:
4 added
6 edited

Legend:

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

    r5198 r5299  
    2020 
    2121# 
    22 mailserver:       xxxoutbox.rl.ac.uk 
     22mailServer:       xxxoutbox.rl.ac.uk 
    2323metadataMaintainer: b.n.lawrence@rl.ac.uk 
    2424repository:        %(server)s 
     
    5454navPlus:                %(icondir)snavigate_plus.png 
    5555loadingIcon:    %(icondir)sloading.gif 
     56feedIcon:       %(icondir)sfeed-icon-28x28.png 
    5657 
    5758[WMC_CLIENT] 
  • MILK/trunk/milk_server/milk_server/config/milkMiddleware.py

    r5261 r5299  
    77from ndg.common.src.clients.http.vocabserverclient import VocabServerClient 
    88import milk_server.lib.helpers as h 
     9import milk_server.lib.constants as constants 
    910 
    1011class NDGConfigError(Exception):   
     
    4445        self.globals.icons_R=cf.get('RELATED','icon') 
    4546        self.globals.icons_key=cf.get('layout','key') 
     47        self.globals.feedIcon = cf.get('layout','feedIcon') 
     48         
    4649        self.globals.debugModeOn = \ 
    4750            self.__getTrueFalseValue(cf.get('DEFAULT','debug'))  
     
    9497        self.globals.eXistDBCons = {} 
    9598         
     99        self.globals.orderByList = h.options_for_select(constants.ORDER_BY_LIST) 
     100 
    96101        # Security Related 
    97102 
  • MILK/trunk/milk_server/milk_server/config/routing.py

    r5261 r5299  
    3434                controller = 'atom_editor/listatom', action='list', searchData='', \ 
    3535                associatedAtomID='', associatedAtomType='', associationType='') 
    36     map.connect('getFeed', 'getFeed/:feedType', controller = 'atom_editor/listatom', action='getFeed') 
    3736     
    3837    map.connect('viewAssociatedData', 'viewAssociatedData/:type/:uri', controller = 'browse/retrieve', action='viewAssociatedData') 
     
    6463    map.connect('doVocabSearch', controller = 'vocabsearch/vocabsearch', action='doVocabSearch') 
    6564 
     65    # routing for retrieving and adding feeds 
     66    map.connect('getFeed', 'getFeed/:feedType', controller = 'feed', action='getFeed') 
     67    map.connect('createFeedEntry', 'createFeedEntry/:feedType', controller = 'feed', action='createFeedEntry') 
     68    map.connect('addFeedEntry', 'addFeedEntry', controller = 'feed', action='addFeedEntry') 
     69 
    6670    #do this last or else you'll get bizarre behaviour 
    6771    map.connect('default', '',controller='home',action='index') 
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/listatom.py

    r5158 r5299  
    179179        logging.info("Search completed") 
    180180        return results 
    181  
    182  
    183     def getFeed(self, feedType): 
    184         ''' 
    185         Retrieve data from the specified feed type 
    186         @param feedType: type of feed to rertrieve.  Currently supports 
    187         types, editorconstants.DIF_FEED and editorconstants.PUBLISHED_FEED  
    188         @raise ValueError: if unrecognised feed type input 
    189         @return XML doc representing requested feed  
    190         ''' 
    191         logging.info("Retrieving feed for '%s' data" %feedType) 
    192181         
    193         collection = "" 
    194         if feedType == PUBLISHED_FEED: 
    195             collection = dc.ATOM_COLLECTION_PATH + dc.PUBLISHED_COLLECTION_PATH 
    196         elif feedType == DIF_FEED: 
    197             collection = dc.DIF_COLLECTION_PATH  
    198         else: 
    199             raise ValueError("- unrecognised feed type (%s) - currently only support types, '%s' and '%s'" 
    200                              %(feedType, PUBLISHED_FEED, DIF_FEED)) 
    201              
    202          
    203         feed, xml = g.validator._atomClient.feedClient.getAtomFeed(collection, 
    204                                                               proxyServer = g.proxyServer) 
    205          
    206         logging.info("- returning feed") 
    207         response.headers['Content-Type'] = 'application/xml' 
    208         response.write(xml) 
    209          
  • MILK/trunk/milk_server/milk_server/controllers/home.py

    r5261 r5299  
    126126        response.status_code = 400 
    127127        return render("genshi", template) 
     128 
  • MILK/trunk/milk_server/milk_server/templates/browse/discovery_search.html

    r5261 r5299  
    3939        } 
    4040      </script> 
     41          <link rel="alternate" type="application/atom+xml" title="Atom feed for discovery service" href="$g.server/getFeed/discovery"/> 
    4142    </head> 
    4243    <body onload="initOLMapBox()"> 
    4344    <div id="entirepage"> 
    44         <div py:replace="displayErrors()"/> 
    45                 <h3>$c.title</h3> 
     45        <div py:if="c.inputErrors" py:replace="displayErrorDict(c.inputErrors)"/> 
     46                <h3>$c.title <a href="$g.server/getFeed/discovery"><img border="0" src="$g.feedIcon" alt="Atom feed for discovery service" title="Atom feed for discovery service"/></a> </h3> 
    4647        <div class="outer"> 
    4748            <div class="inner"> 
Note: See TracChangeset for help on using the changeset viewer.