public class RSXMLHelper
extends java.lang.Object
ResultSet
to create
and manipulate xml files / contentConstructor and Description |
---|
RSXMLHelper() |
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Document |
addCustomProperty(org.w3c.dom.Document dom,
PropertyElementBase prop)
Adds the provided property to the respective placeholder in the provided DOM representation of the
head part
|
static void |
createHead(java.lang.String filename,
java.lang.String next,
java.lang.String[] properties,
boolean dataFlow)
Creates an XML representation of a
ResultSet
head part and persists it to storage |
static void |
createHead(java.lang.String filename,
java.lang.String next,
java.lang.String[] properties,
boolean dataFlow,
int access,
boolean forward,
java.util.Date date,
java.lang.String pkey,
java.lang.String encryptedkey,
java.lang.String allprops)
Creates an XML representation of a
ResultSet
head part and persists it to storage |
static void |
createHead(java.lang.String filename,
java.lang.String next,
java.lang.String properties,
boolean dataFlow)
Creates an XML representation of a
ResultSet
head part and persists it to storage |
static java.lang.String |
executeQueryOnDocument(org.w3c.dom.Document dom,
java.lang.String xPath)
Evaluates the provided xPath and returns a serialization of the results
|
static boolean |
executeQueryOnResults(java.lang.String result,
java.lang.String xPath)
Perofmors the provided xPath expression on the serialized xml string provided.
|
static java.util.Vector<java.lang.Integer> |
executeQueryOnResultsFile(java.lang.String filename,
java.lang.String xPath)
evaluates the provided xPath expression against the content of the provided file and returns
the indexes of the results that the evaluation returned results
|
static int |
getAccess(org.w3c.dom.Document dom)
Returns whether or not the RS is populated with results access
|
static boolean |
getDataFlow(org.w3c.dom.Document dom)
Returns whether or not the RS is populated with results on demand
|
static org.w3c.dom.Document |
getDocument(java.lang.String filename)
Retrieves the DOM object parsing the content of the provided file
|
static java.lang.String |
getEncKey(org.w3c.dom.Document dom)
Get the encryption key
|
static java.util.Date |
getExpireDate(org.w3c.dom.Document dom)
Returns whether or not the RS is populated with results forward
|
static boolean |
getForward(org.w3c.dom.Document dom)
Returns whether or not the RS is populated with results forward
|
static java.lang.String |
getLink(org.w3c.dom.Document dom,
java.lang.String which)
Retrieves the previous or nect link the provided document has
|
static java.util.Vector<java.lang.String> |
getProperties(org.w3c.dom.Document dom,
java.lang.String type)
Retrives the properties with the specified type from the DOM object representing a head part
|
static java.lang.String |
getPublicKey(org.w3c.dom.Document dom)
Get the public key
|
static void |
persistDocument(org.w3c.dom.Document dom,
java.lang.String filename)
Persists the provided DOM object in a file wholse filename is provided
|
static java.lang.String |
retrieveCustomProperties(org.w3c.dom.Document dom)
Retrives the serialized version of the CustomPropertied that are contained in the Head part DOM object
|
static org.w3c.dom.Document |
setExpireDate(org.w3c.dom.Document dom,
java.util.Date date)
Returns if the RS is populated with results forward
|
static org.w3c.dom.Document |
setForward(org.w3c.dom.Document dom,
boolean forward)
Set forward only access to this RS
|
static void |
transform(java.lang.String xslt,
java.lang.String source,
java.lang.String target)
Performs a xslt transformation to the input file and dumpt the out put to a new file
|
static void |
transform(javax.xml.transform.Templates xslt,
java.lang.String source,
java.lang.String target)
Performs a xslt transformation to the input file and dumpt the out put to a new file
|
static org.w3c.dom.Document |
updateAccessCounter(org.w3c.dom.Document dom,
int newaccess)
Adds the provided property to the respective place holder in the provided DOM representation of the
head part
|
static void |
updateProperties(java.lang.String headName,
java.lang.String serializedProps)
Overrides existing custom properties and updates them
|
static void |
updateProperties(java.lang.String headName,
java.lang.String[] properties)
Overrides existing custom properties and updates them
|
public static void createHead(java.lang.String filename, java.lang.String next, java.lang.String[] properties, boolean dataFlow) throws java.lang.Exception
ResultSet
head part and persists it to storagefilename
- The name of the file that must be created to store the created head partnext
- The name of the file that will hold the next header in the chainproperties
- The properties the head should havedataFlow
- Whether or not the RS supports on demand production or resultsjava.lang.Exception
- An unrecoverable for the operation error occuredpublic static void createHead(java.lang.String filename, java.lang.String next, java.lang.String[] properties, boolean dataFlow, int access, boolean forward, java.util.Date date, java.lang.String pkey, java.lang.String encryptedkey, java.lang.String allprops) throws java.lang.Exception
ResultSet
head part and persists it to storagefilename
- The name of the file that must be created to store the created head partnext
- The name of the file that will hold the next header in the chainproperties
- The properties the head should havedataFlow
- Whether or not the RS supports on demand production or resultsaccess
- access leasingforward
- is forward only property enabled?date
- time leasingpkey
- private keyencryptedkey
- encrypted keyallprops
- all properties in a stringjava.lang.Exception
- An unrecoverable for the operation error occurredpublic static void createHead(java.lang.String filename, java.lang.String next, java.lang.String properties, boolean dataFlow) throws java.lang.Exception
ResultSet
head part and persists it to storagefilename
- The name of the file that must be created to store the created head partnext
- The name of the file that will hold the next header in the chainproperties
- The serialized properties the head should havedataFlow
- Whether or not the RS supports on demand production or resultsjava.lang.Exception
- An unrecoverable for the operation error occuredpublic static void updateProperties(java.lang.String headName, java.lang.String[] properties) throws java.lang.Exception
headName
- the name of the head fileproperties
- the propertiesjava.lang.Exception
- An unrecoverable for the operation error occuredpublic static void updateProperties(java.lang.String headName, java.lang.String serializedProps) throws java.lang.Exception
headName
- the name of the head fileserializedProps
- the serialized propertiesjava.lang.Exception
- An unrecoverable for the operation error occuredpublic static void persistDocument(org.w3c.dom.Document dom, java.lang.String filename) throws java.lang.Exception
dom
- The DOM object to persistfilename
- The filename to place the serialization injava.lang.Exception
- An unrecoverable for the operation error occuredpublic static org.w3c.dom.Document getDocument(java.lang.String filename) throws java.lang.Exception
filename
- The file name to parsejava.lang.Exception
- An unrecoverable for the operation error occuredpublic static org.w3c.dom.Document addCustomProperty(org.w3c.dom.Document dom, PropertyElementBase prop) throws java.lang.Exception
dom
- The DOM object representing the head partprop
- The property to addjava.lang.Exception
- An unrecoverable for the operation error occuredpublic static org.w3c.dom.Document updateAccessCounter(org.w3c.dom.Document dom, int newaccess) throws java.lang.Exception
dom
- The DOM object representing the head partnewaccess
- The property to addjava.lang.Exception
- An unrecoverable for the operation error occurredpublic static java.util.Vector<java.lang.String> getProperties(org.w3c.dom.Document dom, java.lang.String type) throws java.lang.Exception
dom
- The DOM object containing the Head contenttype
- The type of properties to retrievejava.lang.Exception
- An unrecoverable for the operation error occuredpublic static java.lang.String getLink(org.w3c.dom.Document dom, java.lang.String which) throws java.lang.Exception
dom
- The document to retrieve the document fromwhich
- RSConstants.nextLink
or RSConstants.previousLink
java.lang.Exception
- The link value could not be retrievedpublic static boolean getDataFlow(org.w3c.dom.Document dom) throws java.lang.Exception
dom
- The document to retrieve the document fromtrue
if the results are proiduced on demand,false
otherwisejava.lang.Exception
- The link value could not be retrievedpublic static int getAccess(org.w3c.dom.Document dom) throws java.lang.Exception
dom
- The document to retrieve the document fromint
access windowjava.lang.Exception
- The link value could not be retrievedpublic static java.lang.String retrieveCustomProperties(org.w3c.dom.Document dom) throws java.lang.Exception
dom
- The DOM object containing the head partjava.lang.Exception
- An unrecoverable for the operation error occuredpublic static java.lang.String executeQueryOnDocument(org.w3c.dom.Document dom, java.lang.String xPath) throws java.lang.Exception
dom
- The document to usexPath
- The xPath to be evaluatedjava.lang.Exception
- An unrecoverable for the operation error occuredpublic static boolean executeQueryOnResults(java.lang.String result, java.lang.String xPath) throws java.lang.Exception
result
- The xml serialization to evaluate the expression againstxPath
- The expression to be avaluatedtrue
if the evaluation returned result, false
otherwisejava.lang.Exception
- An unrecoverable for the operation error occuredpublic static java.util.Vector<java.lang.Integer> executeQueryOnResultsFile(java.lang.String filename, java.lang.String xPath) throws java.lang.Exception
filename
- The file whose results must be iterated overxPath
- The xpath expressionjava.lang.Exception
- An unrecoverable for the operation error occuredpublic static void transform(java.lang.String xslt, java.lang.String source, java.lang.String target) throws java.lang.Exception
xslt
- The XSLT transformation to applysource
- The source file to transformtarget
- The target file to place the outputjava.lang.Exception
- An unrecoverable for the operation error has occuredpublic static void transform(javax.xml.transform.Templates xslt, java.lang.String source, java.lang.String target) throws java.lang.Exception
xslt
- The XSLT transformation to applysource
- The source file to transformtarget
- The target file to place the outputjava.lang.Exception
- An unrecoverable for the operation error has occuredpublic static boolean getForward(org.w3c.dom.Document dom) throws java.lang.Exception
dom
- The document to retrieve the document fromboolean
boolean windowjava.lang.Exception
- The value could not be retrievedpublic static org.w3c.dom.Document setForward(org.w3c.dom.Document dom, boolean forward) throws java.lang.Exception
dom
- the dom of the headerforward
- the flag to set for forwardjava.lang.Exception
- Something went wrongpublic static java.util.Date getExpireDate(org.w3c.dom.Document dom) throws java.lang.Exception
dom
- The document to retrieve the document fromboolean
boolean windowjava.lang.Exception
- The value could not be retrievedpublic static org.w3c.dom.Document setExpireDate(org.w3c.dom.Document dom, java.util.Date date) throws java.lang.Exception
dom
- The document to retrieve the document fromdate
- the expire datejava.lang.Exception
- The value could not be retrievedpublic static java.lang.String getEncKey(org.w3c.dom.Document dom) throws java.lang.Exception
dom
- The document to retrieve the document fromjava.lang.Exception
- An error occurredpublic static java.lang.String getPublicKey(org.w3c.dom.Document dom) throws java.lang.Exception
dom
- The document to retrieve the document fromjava.lang.Exception
- An error occurred