org.inria.ns.reflex.modules.io
Class RequestAction

java.lang.Object
  extended by org.inria.ns.reflex.processor.core.AbstractAction
      extended by org.inria.ns.reflex.processor.core.AbstractSetAction
          extended by org.inria.ns.reflex.modules.io.RequestAction
All Implemented Interfaces:
Computable, Executable, Presentable, NamespaceContextFactory

public class RequestAction
extends AbstractSetAction

<io:request> is an action that submit requests to an XML Native Database.

The XND must have a driver compliant with the XML:DB API ; this driver must be registered to the XML:DB DatabaseManager.

The "type" of request is the name of the XML:DB service to invoke that must implement the XML:DB XPathQueryService interface.

The request may accept parameters (<xcl:param>). According to the XML:DB driver, various parameters may be set (they are called "properties" in XML:DB).

Author:
Philippe Poulard
See Also:
SetParameterAction, DatabaseManager, XPathQueryService

Nested Class Summary
 
Nested classes/interfaces inherited from class org.inria.ns.reflex.processor.core.AbstractAction
AbstractAction.ParameterAdapter, AbstractAction.UselessAction
 
Field Summary
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractSetAction
NO_VALUE
 
Fields inherited from class org.inria.ns.reflex.processor.core.AbstractAction
actions, parent, processorInstance
 
Constructor Summary
RequestAction(Expression connect, EvaluableExpression query, String type, String version, EvaluableExpression style, Element element, AbstractAction parent)
          Create a new instance of RequestAction.
 
Method Summary
 Object getComputedValue(DataSet dataSet)
          Return the computed value of the property, by submitting a query.
static AbstractAction unmarshal(AbstractAction parent, Element element)
          Unmarshaller for RequestAction.
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractSetAction
addProperty, getComputedName, getName, getValue, runAction, scope, unmarshalScope
 
Methods inherited from class org.inria.ns.reflex.processor.core.AbstractAction
addAction, addFallbackAction, createContext, getCanonicalPath, getFallbackAction, getLocalFallbackAction, getLogger, getNamespaceContext, getNode, getParent, recover, recover, removeFallbackAction, reorganize, run, runActions, toPrettyString, toPrettyString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequestAction

public RequestAction(Expression connect,
                     EvaluableExpression query,
                     String type,
                     String version,
                     EvaluableExpression style,
                     Element element,
                     AbstractAction parent)
              throws XMLException
Create a new instance of RequestAction.

Parameters:
connect - The connection to the database, as an Expression.
query - The query, as an Expression.
type - The type of query, used to retrieve the XML:DB service.
version - The version of the query service, used to retrieve the XML:DB service. Pass "1.0" if you don't know.
style - The style of the result : tree, stream, xml, or as-is (default).
element - The element from which the action has been unmarshalled. Used for namespace prefix resolution when performing XPath expressions.
parent - The action depending from.
Throws:
XMLException
Method Detail

unmarshal

public static AbstractAction unmarshal(AbstractAction parent,
                                       Element element)
                                throws XMLException
Unmarshaller for RequestAction.

Parameters:
parent - The action depending from
element - The XML element to unmarshall.
Returns:
The RequestAction created.
Throws:
UnmarshalException - When the element and its content is not those expected.
XMLException

getComputedValue

public Object getComputedValue(DataSet dataSet)
                        throws ExecutionException,
                               XPathException
Return the computed value of the property, by submitting a query.

Specified by:
getComputedValue in interface Computable
Specified by:
getComputedValue in class AbstractSetAction
Parameters:
dataSet - The set of datas used when the name is computed.
Returns:
The computed value of the property.
Throws:
ExecutionException - If the computation can't be performed.
XPathException