Changeset 4850


Ignore:
Timestamp:
20/01/09 14:37:32 (11 years ago)
Author:
cbyrom
Message:

Fix issue with atoms being deleted upon failed content validation +
adjust feed entry content.

Location:
ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist
Files:
2 edited

Legend:

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

    r4843 r4850  
    173173        ''' 
    174174        logging.info("Validating atom, '%s' against schemata in eXist" %atomPath) 
     175        # path to temp file, if we create one 
     176        tempAtomPath = None 
    175177        try: 
    176178            if atom: 
     
    179181                self.createEXistFile(atom.toPrettyXML(), \ 
    180182                                     atom.getDefaultCollectionPath(), fileName) 
    181                 atomPath = atom.getDefaultCollectionPath() + fileName 
     183                tempAtomPath = atom.getDefaultCollectionPath() + fileName 
    182184                 
    183             validationQuery = 'validation:validate-report("' + atomPath + \ 
     185            validationQuery = 'validation:validate-report("' + tempAtomPath + \ 
    184186                '", xs:anyURI("' + self.AtomSchema + '"))' 
    185187            logging.debug("Running validation, '%s'" %validationQuery) 
     
    195197            errorMessage = "Error encountered whilst validating atom: '%s'" %e.message 
    196198 
    197         if atom: 
     199        if tempAtomPath: 
    198200            logging.info("Deleting temporary file in eXist") 
    199             self.deleteEXistFile(atomPath) 
     201            self.deleteEXistFile(tempAtomPath) 
    200202 
    201203        if errorMessage: 
     
    795797            self.createCollections([collectionPath]) 
    796798            self.feedClient.createAtomFeed(collectionPath, 
    797                                            self.feedClient.PROVIDERLEVEL_DIF_FEED_TITLE %providerID + '/') 
     799                                           self.feedClient.PROVIDERLEVEL_DIF_FEED_TITLE %providerID) 
    798800        logging.info("DIF document created and stored") 
    799801 
  • ndgCommon/trunk/ndg/common/src/clients/xmldb/eXist/existdbfeedclient.py

    r4828 r4850  
    2626    ENTITYLEVEL_ATOM_FEED_TITLE = 'Moles %s Atom Data' 
    2727    DEPLOYMENTS_ATOM_FEED_TITLE = 'Deployments Data (activities/observation stations/data production tools)' 
    28     PROVIDERLEVEL_ATOM_FEED_TITLE = 'Moles Atom Data - for provider, %s' 
    29     PROVIDERLEVEL_DIF_FEED_TITLE = 'Moles Atom Data - for provider, %s' 
     28    PROVIDER_SUFFIX = ' - for provider, %s' 
     29    PROVIDERLEVEL_ATOM_FEED_TITLE = TOPLEVEL_ATOM_FEED_TITLE + PROVIDER_SUFFIX 
     30    PROVIDERLEVEL_DIF_FEED_TITLE = TOPLEVEL_DIF_FEED_TITLE + PROVIDER_SUFFIX 
    3031    DIF_ENTRY_TITLE = 'DIF Record' 
    3132     
Note: See TracChangeset for help on using the changeset viewer.