public class RepositoryUtils
extends java.lang.Object
Constructor and Description |
---|
RepositoryUtils(DDSServicesToolkit ddsServicesToolkit)
Constructor for the RepositoryUtils object
|
RepositoryUtils(java.lang.String baseUrl)
Constructor for the RepositoryUtils object
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
checkForErrorResponse(org.dom4j.Document doc) |
protected CollectionInfo |
getCollectionInfo(java.lang.String collection)
Gets the collectionInfo instance for the specified collection
|
java.util.List |
getCollectionInfos()
Gets the collectionInfos attribute of the RepositoryUtils object
|
java.util.List |
getCollectionKeys()
Returns a List of collection keys (e.g., "dcc") defined in the repository.
|
protected int |
getIntAtPath(org.dom4j.Node baseElement,
java.lang.String relativePath)
Gets the integer value of the node located at relativePath from given baseElement.
|
java.util.Map |
getItemRecordMap(CollectionInfo collectionInfo,
int startOffset,
int numReturns)
Returns an itemRecordMap for the specified collection, startOffset and batchSize
|
java.util.Map |
getItemRecordMap(java.lang.String collection)
Gets a mapping of recordIds to itemRecords (as Documents) for the specified collection
|
java.util.Collection |
getItemRecords(CollectionInfo collectionInfo,
int startOffset,
int numReturns)
Gets a batch of itemRecords
|
java.util.Collection |
getItemRecords(java.lang.String collection)
Returns the itemRecords of the specified collection as dom4j.Documents
|
TermsInfo |
getTermsInfoForFields(java.lang.String[] fields)
Get terms data for one or more fields in a DDS repository index.
|
DDSServicesToolkit |
getToolKit() |
protected java.lang.String |
getValueAtPath(org.dom4j.Node baseElement,
java.lang.String relativePath)
Gets the textual value of the node located at relativePath from given baseElement.
|
static void |
main(java.lang.String[] args)
The main program for the RepositoryUtils class
|
protected java.lang.String |
subElementValue(org.dom4j.Element parent,
java.lang.String childTagName)
Gets the text value of the specified child of a given parent element.
|
public RepositoryUtils(java.lang.String baseUrl)
baseUrl
- DDSWebservice baseUrl (e.g., "http://www.dlese.org/dds/services/ddsws1-1")public RepositoryUtils(DDSServicesToolkit ddsServicesToolkit)
ddsServicesToolkit
- A DDSServicesToolkitpublic DDSServicesToolkit getToolKit()
public java.util.Map getItemRecordMap(java.lang.String collection) throws java.lang.Exception
collection
- collection key (e.g., "dcc")java.lang.Exception
- if the itemRecordMap cannot be constructedpublic java.util.Map getItemRecordMap(CollectionInfo collectionInfo, int startOffset, int numReturns) throws java.lang.Exception
NOTE: to search over all records,
collectionInfo
- NOT YET DOCUMENTEDstartOffset
- NOT YET DOCUMENTEDnumReturns
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDpublic java.lang.String[] checkForErrorResponse(org.dom4j.Document doc)
public java.util.Collection getItemRecords(java.lang.String collection) throws java.lang.Exception
collection
- collection key ("dcc")java.lang.Exception
- Description of the Exceptionpublic java.util.Collection getItemRecords(CollectionInfo collectionInfo, int startOffset, int numReturns) throws java.lang.Exception
collectionInfo
- NOT YET DOCUMENTEDstartOffset
- NOT YET DOCUMENTEDnumReturns
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDpublic java.util.List getCollectionKeys() throws java.lang.Exception
java.lang.Exception
- NOT YET DOCUMENTEDpublic java.util.List getCollectionInfos() throws java.lang.Exception
java.lang.Exception
- Description of the Exceptionprotected CollectionInfo getCollectionInfo(java.lang.String collection) throws java.lang.Exception
collection
- collection key (e.g., "dcc")java.lang.Exception
- NOT YET DOCUMENTEDprotected java.lang.String getValueAtPath(org.dom4j.Node baseElement, java.lang.String relativePath) throws java.lang.Exception
baseElement
- Description of the ParameterrelativePath
- Description of the Parameterjava.lang.Exception
- if there is no node at relativePath from baseElementprotected int getIntAtPath(org.dom4j.Node baseElement, java.lang.String relativePath) throws java.lang.Exception
baseElement
- Description of the ParameterrelativePath
- Description of the Parameterjava.lang.Exception
- if there is no node at relativePath from baseElement, or if the value found is not
an integerprotected java.lang.String subElementValue(org.dom4j.Element parent, java.lang.String childTagName)
parent
- Element whose child element supplies the textchildTagName
- tagName of child elementpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- The command line argumentsjava.lang.Exception
- NOT YET DOCUMENTEDpublic TermsInfo getTermsInfoForFields(java.lang.String[] fields) throws DDSServiceErrorResponseException, java.lang.Exception
fields
- One or more fields to get terms data forDDSServiceErrorResponseException
- If service errorjava.lang.Exception
- If other error