|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.oclc.da.gdfr.registryprototype.pvt.dbxml.DBXMLCollectionHelper
public class DBXMLCollectionHelper
| Constructor Summary | |
|---|---|
DBXMLCollectionHelper()
Default Constructor Instantiates XPathEvaluator and JarHelper objects |
|
| Method Summary | |
|---|---|
boolean |
addAllIndexesToProfile(StructuredDataObject original)
Parses a template for the given Collection and creates indexes (name/xpath/type) for each element. |
void |
addAttrToProps(java.util.Properties p,
java.lang.String name,
java.lang.String path)
Adds the given name/path pair to the given Properties object. |
boolean |
checkIndexes(StructuredDataObject orig)
Checks to make sure a profile contains the indexes "cql.any" and "srw.serverChoice" |
java.util.Properties |
combineProps(java.util.Properties p1,
java.util.Properties p2)
Merge two Properties Objects, removing duplicate entries |
java.util.Properties |
createCollectionProperties(StructuredDataObject profile)
Generates a Properties object containing all the XPath statements necessary for the Collection. |
java.lang.String |
createDate()
Returns an ISO formated date string of the current time This was taken from the following website: http://www.dpawson.co.uk/relaxng/schema/datetime.html#d674e136 |
java.lang.String |
encodeIdentifier(java.lang.String id)
URL encodes the given resourceID's item label. |
Query |
encodeItemLabel(Query query)
|
java.lang.String |
encodeLabel(java.lang.String query,
java.lang.String index)
|
java.lang.String |
formNameFromPath(java.lang.String path)
Forms and attribute name from a given XPath. |
java.lang.String |
getAttrAsText(StructuredDataObject obj,
java.lang.String attr)
Makes a call to getAttr(attr) on the provide BasicStructuredObject and returns the text of the result |
java.lang.String |
getFileAsString(java.lang.String location)
Reads a file from Classpath and returns contents as a String |
java.lang.String |
getIndexPath(java.lang.String index)
Return the path of an index |
java.util.Properties |
getIndexProps(StructuredDataObject profile)
Create Properties containing index names/xPath pairs |
java.lang.String |
getIndexType(java.lang.String index)
Return the type of an index |
java.lang.String |
getNamespacePrefix(java.lang.String name)
Removes a namespace prefix from the given element name |
java.lang.String |
getNodeName(java.lang.String xml)
Returns a node name from a given XML element |
java.lang.String |
getURIAsString(java.lang.String location)
Reads a URI and returns the contents as a String |
java.lang.String |
inputStreamToString(java.io.InputStream stream)
Converts and InputStream to a String |
boolean |
isComparableType(java.lang.String type)
Determines if the given type is comparable with one of the following operators: {=, >, <, <=, >=, <>} |
boolean |
isImported(CollectionItem item)
Determines if a CollectionItem has been harvested/imported |
java.lang.String |
stripTags(java.lang.String element)
Strips XML tags off an XML element |
java.lang.String |
stripTextFromPath(java.lang.String path)
Removes /text() from the end of an XPath expression |
CollectionItem |
updateSAMLVersion(CollectionItem item)
Incoming IWSADeposit records that are updated via the UI contain a SAML Assertion. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DBXMLCollectionHelper()
| Method Detail |
|---|
public boolean addAllIndexesToProfile(StructuredDataObject original)
throws RegistryException
original - Collection Profile to add indexes to
RegistryException
public void addAttrToProps(java.util.Properties p,
java.lang.String name,
java.lang.String path)
p - name - path -
public boolean checkIndexes(StructuredDataObject orig)
throws RegistryException
orig - The profile to examine
RegistryException
public java.util.Properties combineProps(java.util.Properties p1,
java.util.Properties p2)
p1 - First Propertiesp2 - Second Properties
public java.util.Properties createCollectionProperties(StructuredDataObject profile)
throws RegistryException
Collection.
The object is expected to conform to the profile schema
profile - The profile of the Collection
RegistryExceptionpublic java.lang.String createDate()
public java.lang.String encodeIdentifier(java.lang.String id)
id -
public Query encodeItemLabel(Query query)
public java.lang.String encodeLabel(java.lang.String query,
java.lang.String index)
public java.lang.String formNameFromPath(java.lang.String path)
path - String representing an XPath
public java.lang.String getIndexPath(java.lang.String index)
index - String of the form public java.lang.String getIndexType(java.lang.String index)
index - String of the form
public java.util.Properties getIndexProps(StructuredDataObject profile)
throws RegistryException
profile - The profile to get indexes from
RegistryExceptionpublic java.lang.String getFileAsString(java.lang.String location)
location - The path to the file on the Classpath
public java.lang.String getNodeName(java.lang.String xml)
node -
public java.lang.String getNamespacePrefix(java.lang.String name)
name -
public java.lang.String getURIAsString(java.lang.String location)
location - The URI to read
public java.lang.String inputStreamToString(java.io.InputStream stream)
stream -
public boolean isImported(CollectionItem item)
item -
public boolean isComparableType(java.lang.String type)
type - The type to examine
public java.lang.String getAttrAsText(StructuredDataObject obj,
java.lang.String attr)
obj - Object to get fromattr - Attribute name to get
public java.lang.String stripTextFromPath(java.lang.String path)
path -
public java.lang.String stripTags(java.lang.String element)
element - XML element with opening/closing tags
public CollectionItem updateSAMLVersion(CollectionItem item)
item -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||