Changeset 5296


Ignore:
Timestamp:
18/05/09 10:08:50 (10 years ago)
Author:
cbyrom
Message:

Extend feed client code to allow setting of author data on generic
feed entries + add setting up of discovery feed as standard feed
setup + extend tests.

Location:
ndgCommon/trunk/ndg/common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist/dbconstants.py

    r5184 r5296  
    3131 
    3232PROVIDER_FEED_PATH = ATOM_COLLECTION_PATH + "providerFeeds/" 
     33 
    3334SCHEMAS_COLLECTION_PATH = ATOM_COLLECTION_PATH + "schemas" 
    3435# collection for storing misc files - e.g. the org data snippets 
     
    3637CITATIONS_COLLECTION_PATH = ATOM_COLLECTION_PATH + "citations" 
    3738CORRECTIONS_COLLECTION_PATH = ATOM_COLLECTION_PATH + "corrections" 
     39DISCOVERY_FEED_PATH = "/db/discoveryFeed/" 
     40 
    3841EXIST_CONFIG_PATH = "/db/system/config/" 
    3942 
  • ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist/feedclient.py

    r5215 r5296  
    3535    CITATIONS_FEED_TITLE = 'Citations data received by Trackback mechanism' 
    3636    CORRECTIONS_FEED_TITLE = 'Corrections data submitted by atom editor users' 
     37    DISCOVERY_FEED_TITLE = 'Discovery service information' 
    3738    DIF_ENTRY_TITLE = 'DIF Record' 
    3839     
     
    126127        self.createAtomFeed(dc.CITATIONS_COLLECTION_PATH, 
    127128                            self.CITATIONS_FEED_TITLE) 
     129         
     130        self.createAtomFeed(dc.DISCOVERY_FEED_PATH, 
     131                            self.DISCOVERY_FEED_TITLE) 
     132         
    128133 
    129134 
     
    230235         
    231236 
    232     def createGenericFeedEntry(self, title, summary, path): 
     237    def createGenericFeedEntry(self, authorName, title, summary, path): 
    233238        ''' 
    234239        Add an entry to the specified collection (which should already have a 
    235240        feed set up on it) - with details of the corrections data submitted by 
    236241        users of the atom editor 
     242        @param authorName: Name of author of the feed entry 
    237243        @param title: title to give the feed entry 
    238244        @param summary: content to add to the summary element 
     
    241247        entryXML = '<?xml version="1.0" ?>\ 
    242248<entry xmlns="http://www.w3.org/2005/Atom">\ 
     249<author><name>%s</name></author>\ 
    243250<title>%s</title>\ 
    244251<content>%s</content>\ 
    245 </entry>' %(escape(title), escape(summary)) 
     252</entry>' %(escape(authorName), escape(title), escape(summary)) 
    246253        logging.info("Adding corrections data to atom feed") 
    247254        self.__postEditAtomFeed(path, entryXML) 
  • ndgCommon/trunk/ndg/common/unittests/clients/xmldb/eXist/testfeedclient.py

    r5130 r5296  
    5454            self.assertTrue(feed.feed.has_key('links')) 
    5555            entriesNo = len(feed.entries) 
    56             self.feedClient.createGenericFeedEntry('some title info', 
     56            self.feedClient.createGenericFeedEntry('test author', 
     57                                                   'some title info', 
    5758                                                   'some body info', 
    5859                                                   self.VALID_COLLECTION_PATH) 
Note: See TracChangeset for help on using the changeset viewer.