|
Oracle® Application Server XML Java API Reference 10g Release 3 (10.1.3) B28238-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.xml.xsql.XSQLActionHandlerImpl
Base Implementation of XSQLActionHandler that can be extended to create your own custom handlers.
Includes a set of useful helper methods.
NOTE: If you extend this class and override the init() method, make sure to call:
super.init(env,e);
Constructor Summary | |
XSQLActionHandlerImpl() |
Method Summary | |
protected void |
addResultElement(Node rootNode, java.lang.String elementName, java.lang.String content) Convenience method to add a single element with text content as the result of your action handler. |
protected void |
appendCopyOfSecondaryDocument(Node rootNode, Document d) Convenience method to append a copy of the entire content of one XML document to another. |
protected void |
appendSecondaryDocument(Node rootNode, Document d) Convenience method to append the entire content of one XML document to another. |
protected java.lang.String |
firstColumnOfFirstRow(Node rootNode, java.lang.String statement) Convenience method to return the first column value of the first row of a SQL statement as a String. |
protected java.lang.String[] |
firstNColumnsOfFirstRow(Node rootNode, java.lang.String statement, int n) Convenience method to return the first column value of the first row of a SQL statement as a String. |
protected Element |
getActionElement() Return the DOM Element representing the current XSQL action element in the XSQL page being processed. |
protected java.lang.String |
getActionElementContent() Convenience method to return the first (normalized) text content of the action element, with all parameter values subsituted automatically. |
protected java.lang.String |
getAttribute(java.lang.String attrname, Element e) Convenience method to get the value of an attribute by name the actionElement or some sub-element. |
protected java.lang.String |
getAttributeAllowingParam(java.lang.String attrname, Element e) Convenience method to get the value of an attribute by name the actionElement or some sub-element. |
protected int |
getBindVariableCount() |
protected int |
getDefaultFetchSize() Convenience method to return default row prefetch size |
protected java.lang.String |
getDefaultOWAFetchStyle() |
protected XSQLPageRequest |
getPageRequest() Get XSQL Page Request object for the request being processed |
protected void |
handleBindVariables(java.sql.PreparedStatement stmt) |
protected void |
handleBindVariables(java.sql.PreparedStatement stmt, int slotsUsed) |
void |
init(XSQLPageRequest env, Element e) Initialize the Action Handler |
protected void |
reportError(Node rootNode, java.lang.String message) Convenience method to report an error in the action handler as a standard <xsql-error> element. |
protected void |
reportErrorIncludingStatement(Node rootNode, java.lang.String statement, int ErrorCode, java.lang.String message) Convenience method to report an error in the action handler (including the offending SQL statement and error code) as a standard * <xsql-error> element. |
protected void |
reportErrorIncludingStatement(Node rootNode, java.lang.String statement, java.lang.String message) Convenience method to report an error in the action handler (including the offending SQL statement) as a standard <xsql-error> element. |
protected void |
reportFatalError(java.lang.String message) Report a fatal error message using the standard XSQL Page Processor error reporting mechanism. |
protected void |
reportMissingAttribute(Node rootNode, java.lang.String attrname) Convenience method to report an error for a missing attribute in the action handler as a standard <xsql-error> element. |
protected void |
reportStatus(Node rootNode, java.lang.String statusAttr, java.lang.String message) Convenience method to report a status in the action handler as a standard <xsql-status> element. |
protected boolean |
requiredConnectionProvided(Node rootNode) Convenience method to check whether the current page has specified a (database) connection. |
protected void |
setErrorStatusParamIfPresent() |
protected java.lang.String |
valueOfXPathInPostedXML(java.lang.String xpath) Convenience method to return the value of any XPath expression against the posted XML document. |
protected java.lang.String |
variableValue(java.lang.String varName, Element e) Convenience method to return the value of a parameter variable. |
protected java.lang.String[] |
variableValues(java.lang.String varName, Element e) Convenience method to return the value of a parameter variable that might have multiple values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.xml.xsql.XSQLActionHandler |
handleAction |
Constructor Detail |
public XSQLActionHandlerImpl()
Method Detail |
protected XSQLPageRequest getPageRequest()
protected Element getActionElement()
public void init(XSQLPageRequest env, Element e)
XSQLActionHandler
init
in interface XSQLActionHandler
env
- XSQLPageRequest objecte
- DOM element representing the Action Element being handledprotected void reportFatalError(java.lang.String message) throws java.sql.SQLException
To report a fatal error in your action handler, call this method then throw a java.sql.SQLException with an appropriate error message.
Reporting a fatal error stops page processing and reports the error to the requestor.
message
- Fatal error message stringjava.sql.SQLException
protected void reportErrorIncludingStatement(Node rootNode, java.lang.String statement, java.lang.String message)
rootNode
- Root node of generated document fragmentstatement
- SQL Statement in errormessage
- Error message stringprotected void reportErrorIncludingStatement(Node rootNode, java.lang.String statement, int ErrorCode, java.lang.String message)
rootNode
- Root node of generated document fragmentstatement
- SQL Statement in errormessage
- Error message stringprotected void addResultElement(Node rootNode, java.lang.String elementName, java.lang.String content)
rootNode
- Root node of generated document fragmentelementName
- Name of the result element to addcontent
- String to be used as text content of the elementprotected boolean requiredConnectionProvided(Node rootNode)
rootNode
- Root node of generated document fragmentprotected int getDefaultFetchSize()
protected void reportError(Node rootNode, java.lang.String message)
rootNode
- Root node of generated document fragmentmessage
- Error message stringprotected void reportMissingAttribute(Node rootNode, java.lang.String attrname)
rootNode
- Root node of generated document fragmentattrname
- Missing attribute nameprotected void reportStatus(Node rootNode, java.lang.String statusAttr, java.lang.String message)
rootNode
- Root node of generated document fragmentstatusAttr
- Name of status attribute to appear on xsql-status elementmessage
- Error message stringprotected java.lang.String getAttributeAllowingParam(java.lang.String attrname, Element e)
Allows the parameter value to include a reference to another parameter in its value.
e
- DOM Element containing the attributeprotected java.lang.String getAttribute(java.lang.String attrname, Element e)
Treats the attribute value literally, without evaluating parameter references.
e
- DOM Element containing the attributeprotected void appendCopyOfSecondaryDocument(Node rootNode, Document d)
rootNode
- Node to which XML document is to be appendedd
- Secondary DOM Document to copy and appendprotected void appendSecondaryDocument(Node rootNode, Document d)
rootNode
- Node to which XML document is to be appendedd
- Secondary DOM Document to be appendedprotected java.lang.String variableValue(java.lang.String varName, Element e)
varName
- Name of parameter variablee
- DOM Element to use to provide default parameter valuesprotected java.lang.String[] variableValues(java.lang.String varName, Element e)
varName
- Name of parameter variablee
- DOM Element to use to provide default parameter valuesprotected java.lang.String getActionElementContent()
protected java.lang.String firstColumnOfFirstRow(Node rootNode, java.lang.String statement)
protected java.lang.String[] firstNColumnsOfFirstRow(Node rootNode, java.lang.String statement, int n)
protected java.lang.String getDefaultOWAFetchStyle()
protected void handleBindVariables(java.sql.PreparedStatement stmt) throws java.sql.SQLException
java.sql.SQLException
protected void handleBindVariables(java.sql.PreparedStatement stmt, int slotsUsed) throws java.sql.SQLException
java.sql.SQLException
protected int getBindVariableCount() throws java.sql.SQLException
java.sql.SQLException
protected java.lang.String valueOfXPathInPostedXML(java.lang.String xpath) throws XSLException
XSLException
protected void setErrorStatusParamIfPresent()
|
Oracle® Application Server XML Java API Reference 10g Release 3 (10.1.3) B28238-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |