Changeset 4697 for exist


Ignore:
Timestamp:
22/12/08 12:18:38 (10 years ago)
Author:
cbyrom
Message:

Add delete function to atom editor to delete granule atoms - together
with warning messages beforehand and result pop up messages afterwards.
Adjust granulite to expose the delete functions publicly.

Location:
exist/trunk/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/lib/granulite.py

    r4696 r4697  
    381381        ''' 
    382382        logging.info("Removing granule info from data entities") 
    383  
    384383        logging.info("Retrieving data entities with references to granule") 
    385384        self._atom.lookupAssociatedData(VTD.DE_TERM, self._eXist.xmldb, \ 
     
    401400        ''' 
    402401        logging.debug("Retrieving data entity atom - to update associated granule info") 
    403         doc = self._eXist.getAtom('dataent_' + dataEntityID) 
     402#        doc = self._eXist.getAtom('dataent_' + dataEntityID) 
     403        doc = self._eXist.getAtom(dataEntityID) 
    404404        logging.debug("DE retrieved") 
    405405        de = Atom.Atom(xmlString=str(doc)) 
     
    582582        if self._deleteMode: 
    583583            logging.info("In delete mode - deleting granule atom and any references") 
    584             self.__deleteGranuleAndDEReferences() 
     584            self.deleteGranuleAndDEReferences() 
    585585             
    586586        else: 
     
    607607                logging.error(sys.exc_info()) 
    608608                logging.error("Will now roll back changes to granule atom to leave system in original state") 
    609                 self.__deleteGranuleAndDEReferences() 
     609                self.deleteGranuleAndDEReferences() 
    610610 
    611611                # if the atom existed before, restore it and recreate the old DE links 
     
    618618 
    619619 
    620     def __deleteGranuleAndDEReferences(self): 
     620    def deleteGranuleAndDEReferences(self): 
    621621        ''' 
    622622        Delete the granule atom and any references in data entities to it 
  • exist/trunk/python/ndgutilstests/testdata/example.granulite

    r4641 r4697  
    1 cdml_file:: 
     1#cdml_file:: 
    22# Note, CDML files are used by the script to generate CSML files  
    33# (which are stored alongside the CDML file) - so you cannot  
     
    55../testdata/test_cdml_hadgem1_aecan-apa.xml | test_hadgem1_dataset | time0 
    66 
    7 #csml_file:: 
    8 csml_famous_control_month-edit.xml 
     7csml_file:: 
     8csml_famous_control_month.xml 
    99 
    1010data_entity_id:: 
    1111# use format: local id | provider id 
    1212# NB, can specify multiple entities, on new lines, to link the granule to 
    13 AAOE | badc.nerc.ac.uk 
    14 cloudmap | badc.nerc.ac.uk 
     13testAAOE | badc.nerc.ac.uk 
     14testcloudmap | badc.nerc.ac.uk 
    1515 
    1616granule_info:: 
Note: See TracChangeset for help on using the changeset viewer.