Ignore:
Timestamp:
18/05/09 10:08:50 (11 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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) 
Note: See TracChangeset for help on using the changeset viewer.