Changeset 4493 for exist


Ignore:
Timestamp:
26/11/08 13:27:14 (11 years ago)
Author:
cbyrom
Message:

Add new keyword to avoid setting up the eXist DB unless explicitly requested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • exist/trunk/python/ndgUtils/models/existdbclient.py

    r4490 r4493  
    2121class eXistDBClient: 
    2222     
    23     def __init__(self, configFile = None, eXistDBHostname = None, loadCollectionData=False): 
     23    def __init__(self, configFile = None, eXistDBHostname = None, \ 
     24                 loadCollectionData=False, setUpDB=False): 
    2425        ''' 
    2526        Initialise a connection to the eXistDB 
     27        @keyword configFile: config file to use in setting up DB 
     28        @keyword existDBHostname: name of eXist DB to use - if not specified, the first 
     29        host in the config file is used 
     30        @keyword loadCollectionData: preload info on all the eXist collections, if True (default False) 
     31        @keyword setUpDB: if True, create the basic collection structure and ingest the 
     32        atom schemas.  Default is False.  
    2633        ''' 
    2734        logging.info("Initialising connection to eXist DB") 
     
    4754        self.xmldb = ndg_eXist(**inputs) 
    4855         
    49         # set up any collections required - NB, if these already exist they won't cause any files to be lost 
    50         self.__setUpEXistAtomCollections() 
    51          
    52         # add the schema required for atom validation 
    53         self.__addAtomSchema() 
     56        if setUpDB: 
     57            # set up any collections required - NB, if these already exist they won't cause any files to be lost 
     58            self.__setUpEXistAtomCollections() 
     59             
     60            # add the schema required for atom validation 
     61            self.__addAtomSchema() 
    5462         
    5563        self.collections = None 
Note: See TracChangeset for help on using the changeset viewer.