|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.common.searchservice.searchlibrary.resultset.helpers.RSXMLHelper
public class RSXMLHelper
Helper class used by ResultSet to create
and manipulate xml files / content
| Constructor Summary | |
|---|---|
RSXMLHelper()
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RSXMLHelper()
| Method Detail |
|---|
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 storage
filename - 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 results
java.lang.Exception - An unrecoverable for the operation error occured
public 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 storage
filename - 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 string
java.lang.Exception - An unrecoverable for the operation error occurred
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 storage
filename - 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 results
java.lang.Exception - An unrecoverable for the operation error occured
public static void updateProperties(java.lang.String headName,
java.lang.String[] properties)
throws java.lang.Exception
headName - the name of the head fileproperties - the properties
java.lang.Exception - An unrecoverable for the operation error occured
public static void updateProperties(java.lang.String headName,
java.lang.String serializedProps)
throws java.lang.Exception
headName - the name of the head fileserializedProps - the serialized properties
java.lang.Exception - An unrecoverable for the operation error occured
public 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 in
java.lang.Exception - An unrecoverable for the operation error occured
public static org.w3c.dom.Document getDocument(java.lang.String filename)
throws java.lang.Exception
filename - The file name to parse
java.lang.Exception - An unrecoverable for the operation error occured
public 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 add
java.lang.Exception - An unrecoverable for the operation error occured
public 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 add
java.lang.Exception - An unrecoverable for the operation error occurred
public 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 retrieve
java.lang.Exception - An unrecoverable for the operation error occured
public 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 retrieved
public static boolean getDataFlow(org.w3c.dom.Document dom)
throws java.lang.Exception
dom - The document to retrieve the document from
true if the results are proiduced on demand,false otherwise
java.lang.Exception - The link value could not be retrieved
public static int getAccess(org.w3c.dom.Document dom)
throws java.lang.Exception
dom - The document to retrieve the document from
int access window
java.lang.Exception - The link value could not be retrieved
public static java.lang.String retrieveCustomProperties(org.w3c.dom.Document dom)
throws java.lang.Exception
dom - The DOM object containing the head part
java.lang.Exception - An unrecoverable for the operation error occured
public 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 evaluated
java.lang.Exception - An unrecoverable for the operation error occured
public 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 avaluated
true if the evaluation returned result, false otherwise
java.lang.Exception - An unrecoverable for the operation error occured
public 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 expression
java.lang.Exception - An unrecoverable for the operation error occured
public 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 output
java.lang.Exception - An unrecoverable for the operation error has occured
public 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 output
java.lang.Exception - An unrecoverable for the operation error has occured
public static boolean getForward(org.w3c.dom.Document dom)
throws java.lang.Exception
dom - The document to retrieve the document from
boolean boolean window
java.lang.Exception - The value could not be retrieved
public 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 forward
java.lang.Exception - Something went wrong
public static java.util.Date getExpireDate(org.w3c.dom.Document dom)
throws java.lang.Exception
dom - The document to retrieve the document from
boolean boolean window
java.lang.Exception - The value could not be retrieved
public 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 date
java.lang.Exception - The value could not be retrieved
public static java.lang.String getEncKey(org.w3c.dom.Document dom)
throws java.lang.Exception
dom - The document to retrieve the document from
java.lang.Exception - An error occurred
public static java.lang.String getPublicKey(org.w3c.dom.Document dom)
throws java.lang.Exception
dom - The document to retrieve the document from
java.lang.Exception - An error occurred
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||