Changeset 5099 for MILK


Ignore:
Timestamp:
11/03/09 17:44:06 (10 years ago)
Author:
cbyrom
Message:

Add new controller and routes to allow the retrieval of the atom
feeds for the DIF and Published data.

Location:
MILK/trunk/milk_server/milk_server
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/config/milkMiddleware.py

    r4992 r5099  
    4646        self.globals.icons_key=cf.get('layout','key') 
    4747        self.globals.debugModeOn = cf.get('DEFAULT','debug') or False 
    48          
     48 
    4949        self.globals.atomEditorEnabled = cf.get('ATOM_EDITOR','enabled') 
    5050 
     
    5757        self.globals.server=cf.get('DEFAULT','server','') 
    5858 
     59        self.globals.proxyServer = cf.get('DEFAULT','proxyServer') 
     60                 
    5961        # for standalone discovery 
    6062        self.globals.standalone=cf.config.getboolean('DISCOVERY','standalone') 
  • MILK/trunk/milk_server/milk_server/config/routing.py

    r5023 r5099  
    3434                controller = 'atom_editor/listatom', action='list', searchData='', \ 
    3535                associatedAtomID='', associatedAtomType='', associationType='') 
     36    map.connect('getFeed', 'getFeed/:feedType', controller = 'atom_editor/listatom', action='getFeed') 
     37     
    3638    map.connect('viewAssociatedData', 'viewAssociatedData/:type/:uri', controller = 'browse/retrieve', action='viewAssociatedData') 
    3739 
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/editorconstants.py

    r4724 r5099  
    2525CSML_OR_CDML_FILE_VALUE = 'csmlOrCdmlFileValue' 
    2626CSML_OR_CDML_FILE_NAME = 'csmlOrCdmlFileName' 
     27 
     28DIF_FEED = "dif" 
     29PUBLISHED_FEED = "published" 
  • MILK/trunk/milk_server/milk_server/controllers/atom_editor/listatom.py

    r4984 r5099  
    1212from editorconstants import * 
    1313import ndg.common.src.lib.htmlUtilities as utils 
     14import ndg.common.src.clients.xmldb.eXist.dbconstants as dc 
    1415from atomeditorcontroller import AtomEditorController 
    1516    
     
    176177        return results 
    177178 
     179 
     180    def getFeed(self, feedType): 
     181        ''' 
     182        Retrieve data from the specified feed type 
     183        @param feedType: type of feed to rertrieve.  Currently supports 
     184        types, editorconstants.DIF_FEED and editorconstants.PUBLISHED_FEED  
     185        @raise ValueError: if unrecognised feed type input 
     186        @return XML doc representing requested feed  
     187        ''' 
     188        logging.info("Retrieving feed for '%s' data" %feedType) 
     189         
     190        collection = "" 
     191        if feedType == PUBLISHED_FEED: 
     192            collection = dc.ATOM_COLLECTION_PATH + dc.PUBLISHED_COLLECTION_PATH 
     193        elif feedType == DIF_FEED: 
     194            collection = dc.DIF_COLLECTION_PATH  
     195        else: 
     196            raise ValueError("- unrecognised feed type (%s) - currently only support types, '%s' and '%s'" 
     197                             %(feedType, PUBLISHED_FEED, DIF_FEED)) 
    178198             
    179199         
     200        feed, xml = g.validator._atomClient.feedClient.getAtomFeed(collection, 
     201                                                              proxyServer = g.proxyServer) 
     202         
     203        logging.info("- returning feed") 
     204        response.headers['Content-Type'] = 'application/xml' 
     205        response.write(xml) 
     206         
  • MILK/trunk/milk_server/milk_server/controllers/browse/discovery.py

    r5076 r5099  
    342342    def semantic(self): 
    343343        self.__setup() 
    344         vs = VS(proxyServer=self.cf.get('DEFAULT','proxyServer')) 
     344        vs = VS(proxyServer = g.proxyServer) 
    345345        if 'searchString' in self.inputs: 
    346346            try: 
Note: See TracChangeset for help on using the changeset viewer.