xmldb_command (version 0.1, Feb 17 2002)
index
/home/parag/workspace/samgrid/V7/JIMSUITE/xmldb_client/src/python/xmldb_command.py

This python script is command line xmldb client

 
Modules
       
sys

 
Classes
       
xmldb.xmldb
xmldb_command

 
class xmldb_command(xmldb.xmldb)
    This class provides API for command-line xmldb
 
  Methods defined here:
CheckOptions(self, elements)
If the options are valid
InvokeApi(self, command)
If the options are valid
PrintApiVersion(self)
Print the API Version and API Name
PrintDefault(self)
Default print script
PrintHelp(self, element=None)
Print Help for commands
__init__(self)
This class initialize variables
isURL(self)
Check if a URL is provided by the user
setURL(self, url)
Set if url is provided by user

Data and other attributes defined here:
XmldbCommandException = <class xmldb_command.XmldbCommandException>

Methods inherited from xmldb.xmldb:
AppendToDocument(self, collection, name, Xpath, appendstring)
Paeend arbitary xml string to a document
 
collection   - Collection name
Xpath        - XPath to parent tag 
sppendstring - XML String to append
return Update status
CreateCollection(self, collection, name, filer=None)
Create a Collection
 
collection -  Collection Context
name - Collection Name to be created
filer - Specific filer. Default HashFiler
return collection list
CreateIndexer(self, collection, name, pattern)
Create a Indexer for a Collection
 
collection -  Collection Name
name - Indexer name to be created
pattern -
Pattern          Description
========         =============
elem             The value of the named element
elem@attr        The value of the attribute for the named element
*                The value of all elements
*@attr           The value of the named attribute for all elements
elem@*           The value of all attributes for the named element
*@*              The value of all attributes for all elements        
return Operation status
GetApiVersion(self)
Print the API Name and API Version of the software
 
return API Name_Version
GetCollectionCount(self, collection)
Get the Collection count in a given Collection
 
collection -  Collection Name
return Collection count
GetDocument(self, collection, name)
Get a  document 
 
collection -  collection 
name - Name (or) Key associated with the document
return Document string
NOW deprecated !!! use GetResource instead
GetDocumentCount(self, collection)
Get the Document count in a given Collection
 
collection -  Collection Name
return Collection count
GetResource(self, collection, name)
Get a  document 
 
collection -  collection 
name - Name (or) Key associated with the document
return Document string
GetServerVersion(self)
Print the Server Version 
 
result = self.xdbServer.run ({"message":"GetServerVersion"})
return Server version
GetUrl(self)
Retrieves current url of the XML DB server
InsertDocument(self, collection, name, document)
Insert document in a Collection
 
collection -  Collection 
name - Name (or) Key associated with the document
document - Document String
return Status of the operation
IsCollection(self, collection)
Returns positive if a collection exist
 
collection - Collection Name
return 1 if collection exist (or) 0 otherwise
IsDocument(self, collection, document)
Returns positive if a document exist in the collection
 
collection - Collection Name
document - Name of the document
return 1 if document exist (or) 0 otherwise
ListCollections(self, collection)
List of the Collections
 
collection -  Collection Context
return list of collections
ListDocuments(self, collection)
List of Documents 
 
collection -  Collection context
return list of Documents
ListIndexers(self, collection)
List the Indexers in a given Collection
 
collection -  Collection Name
return List of Indexers
Query(self, collection, type, query, name=None, namespaces={})
Query (or) Update a document (or) collection
 
collection -  Collection
type - XPath (or) XUpdate
query - Query String for XPath type and Modification string for XUpdate
name - Name (or) Key associated with the document; None - if query is for a collection
namespaces - 
return Query result
QueryCollection(self, collection, query)
Query a collection
 
collection -  Collection name
query - XPath query
return Query result
QueryDocument(self, collection, name, query)
Query a document
 
collection -  Collection name
name - Name (or) Key associated with the document
query - XPath query
return Query result
RemoveCollection(self, collection, name)
Delete a Collection
 
collection -  Collection Context
name - Collection Name to be deleted
return Status of operation
RemoveDocument(self, collection, name)
Delete document in a Collection
 
collection -  Collection 
name - Name (or) Key associated with the document
return Status of the operation
RemoveIndexer(self, collection, name)
Remove a Indexer for a Collection
 
collection -  Collection Name
name - Indexer name to be deleted
return Operation status
UpdateCollection(self, collection, mod_string)
Update a collection
 
collection -  Collection name
mod_string - XUpdate Modification String
return Update status
UpdateDocument(self, collection, name, mod_string)
Update a document
 
collection -  Collection name
name - Name (or) Key associated with the document
mod_string - XUpdate Modification String
return Update status

Data and other attributes inherited from xmldb.xmldb:
XmldbException = <class xmldb.XmldbException>

 
Data
        __author__ = 'Vijay Murthi <murthi@fnal.gov>'
__date__ = ' Feb 17 2002'
__version__ = '0.1'

 
Author
        Vijay Murthi <murthi@fnal.gov>