public final class Fetch extends AbstractXmlNode
<fetch> is used to asynchronously fetch content
identified by the attributes of the <fetch>. The
fetched content may either be a CCXML document, or script content. Content
that has been acquired using <fetch> is accessible
through other elements defined by CCXML. Execution returns from the element
immediately, and the CCXML application can continue on while the platform
works to fetch the identified resource. When the fetch request has been
completed, an event is generated against the session that initiated the
fetch. The event is one of fetch.done, which indicates that the identified
content was fetched successfully, or error.fetch, indicative of a failure to
fetch the requested content. Note that even if content is successfully
fetched, errors in processing fetched content (for instance, a CCXML document
with a syntax error) may result in an error.fetch being thrown.
The fetch request is local to the session that initiated the
<fetch>, and is referenced through a unique identifier
generated by the CCXML platform. The application may obtain the unique
identifier for a fetch request by providing an ECMAScript left-hand-side
expression in the fetchid attribute when the fetch is performed. The fetch
identifier can also be obtained as a property of the fetch.done event. The
application uses the fetch identifier in any CCXML elements that reference
fetched content, currently <goto> and
<script>.
Fetched content has a lifetime that is limited to that of the document in
which it is fetched. Therefore, following a transition to a new CCXML
document using <goto>, content fetched in the scope of
the current document is no longer accessible. Note that this should not be
taken to preclude platform-level optimizations or caching of resources that
are fetched multiple times.
The use of <fetch> to obtain content does not compel the
application to make use of that content. However, it is wasteful of system
resources to fetch resources that are not used. Platforms are responsible for
clearing out unused fetch resources, and may impose limits on the resources
that can be fetched by a single session.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTRIBUTE_ENCTYPE
An ECMAScript expression which returns a character string that indicates
the media encoding type of the submitted document (when the value of the
method is "post").
|
static java.lang.String |
ATTRIBUTE_FETCHID
An ECMAScript left hand side expression evaluating to a previously
defined variable.
|
static java.lang.String |
ATTRIBUTE_MAXAGE
The character string returned is interpreted as a time interval.
|
static java.lang.String |
ATTRIBUTE_MAXSTALE
The character string returned is interpreted as a time interval.
|
static java.lang.String |
ATTRIBUTE_METHOD
An ECMAScript expression which returns a character string that indicates
the HTTP method to use.
|
static java.lang.String |
ATTRIBUTE_NAMELIST
A list of zero or more whitespace separated CCXML variable names.
|
protected static java.util.ArrayList<java.lang.String> |
ATTRIBUTE_NAMES
Supported attribute names for this node.
|
static java.lang.String |
ATTRIBUTE_NEXT
An ECMAScript expression which returns the URI of the resource to be
fetched.
|
static java.lang.String |
ATTRIBUTE_TIMEOUT
The character string returned is interpreted as a time interval.
|
static java.lang.String |
ATTRIBUTE_TYPE
An ECMAScript expression which returns a character string that specifies
the MIME type of the fetched content.
|
static java.lang.String |
TAG_NAME
Name of the tag.
|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE| Constructor and Description |
|---|
Fetch()
Construct a new fetch object without a node.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canContainChild(java.lang.String tagName)
Can the specified sub-tag be contained within this node?
|
java.util.Collection<java.lang.String> |
getAttributeNames()
Returns a collection of permitted attribute names for the node.
|
java.lang.String |
getEnctype()
Retrieve the enctype attribute.
|
java.lang.String |
getFetchid()
Retrieve the fetchid attribute.
|
java.lang.String |
getMaxage()
Retrieve the maxage attribute.
|
java.lang.String |
getMaxstale()
Retrieve the maxstale attribute.
|
java.lang.String |
getMethod()
Retrieve the method attribute.
|
java.lang.String |
getNamelist()
Retrieve the namelist attribute.
|
java.lang.String |
getNext()
Retrieve the next attribute.
|
java.lang.String |
getTagName()
Get the name of the tag for the derived node.
|
java.lang.String |
getTimeout()
Retrieve the timeout attribute.
|
java.lang.String |
getType()
Retrieve the type attribute.
|
XmlNode |
newInstance(org.w3c.dom.Node n,
XmlNodeFactory<? extends XmlNode> factory)
Create a new instance for the given node.
|
void |
setEnctype(java.lang.String enctype)
Set the enctype attribute.
|
void |
setFetchid(java.lang.String fetchid)
Set the fetchid attribute.
|
void |
setMaxage(java.lang.String maxage)
Set the maxage attribute.
|
void |
setMaxstale(java.lang.String maxstale)
Set the maxstale attribute.
|
void |
setMethod(java.lang.String method)
Set the method attribute.
|
void |
setNamelist(java.lang.String namelist)
Set the namelist attribute.
|
void |
setNext(java.lang.String next)
Set the next attribute.
|
void |
setTimeout(java.lang.String timeout)
Set the timeout attribute.
|
void |
setType(java.lang.String type)
Set the type attribute.
|
addChild, addChild, appendChild, appendChild, appendDeepClone, cloneNode, compareDocumentPosition, equals, getAttribute, getAttributes, getBaseURI, getChildNodes, getChildNodes, getChildren, getDefinedAttributeNames, getFeature, getFirstChild, getFirstLevelTextContent, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeFactory, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getOwnerXmlDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttribute, hasAttributes, hasChildNodes, hashCode, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setAttribute, setNodeValue, setPrefix, setTextContent, setUserData, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddChild, getAttribute, getChildNodes, getChildren, getNode, setAttributeappendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserDatapublic static final java.lang.String TAG_NAME
public static final java.lang.String ATTRIBUTE_ENCTYPE
public static final java.lang.String ATTRIBUTE_FETCHID
public static final java.lang.String ATTRIBUTE_MAXAGE
public static final java.lang.String ATTRIBUTE_MAXSTALE
public static final java.lang.String ATTRIBUTE_METHOD
public static final java.lang.String ATTRIBUTE_NAMELIST
public static final java.lang.String ATTRIBUTE_NEXT
public static final java.lang.String ATTRIBUTE_TIMEOUT
public static final java.lang.String ATTRIBUTE_TYPE
protected static final java.util.ArrayList<java.lang.String> ATTRIBUTE_NAMES
public Fetch()
This is necessary for the node factory.
CcxmlNodeFactorypublic java.lang.String getTagName()
public XmlNode newInstance(org.w3c.dom.Node n, XmlNodeFactory<? extends XmlNode> factory)
Each XmlNode can serve as a prototype in a
XmlNodeFactory to produce a collection of
child nodes. Factories can then use the prototype pattern to
produce new nodes.
n - The node to encapsulate.factory - the factroy that calls this method.XmlNodeFactorypublic java.lang.String getEnctype()
ATTRIBUTE_ENCTYPEpublic void setEnctype(java.lang.String enctype)
enctype - Value of the enctype attribute.ATTRIBUTE_ENCTYPEpublic java.lang.String getFetchid()
ATTRIBUTE_FETCHIDpublic void setFetchid(java.lang.String fetchid)
fetchid - Value of the fetchid attribute.ATTRIBUTE_FETCHIDpublic java.lang.String getMaxage()
ATTRIBUTE_MAXAGEpublic void setMaxage(java.lang.String maxage)
maxage - Value of the maxage attribute.ATTRIBUTE_MAXAGEpublic java.lang.String getMaxstale()
ATTRIBUTE_MAXSTALEpublic void setMaxstale(java.lang.String maxstale)
maxstale - Value of the maxstale attribute.ATTRIBUTE_MAXSTALEpublic java.lang.String getMethod()
ATTRIBUTE_METHODpublic void setMethod(java.lang.String method)
method - Value of the method attribute.ATTRIBUTE_METHODpublic java.lang.String getNamelist()
ATTRIBUTE_NAMELISTpublic void setNamelist(java.lang.String namelist)
namelist - Value of the namelist attribute.ATTRIBUTE_NAMELISTpublic java.lang.String getNext()
ATTRIBUTE_NEXTpublic void setNext(java.lang.String next)
next - Value of the next attribute.ATTRIBUTE_NEXTpublic java.lang.String getTimeout()
ATTRIBUTE_TIMEOUTpublic void setTimeout(java.lang.String timeout)
timeout - Value of the timeout attribute.ATTRIBUTE_TIMEOUTpublic java.lang.String getType()
ATTRIBUTE_TYPEpublic void setType(java.lang.String type)
type - Value of the type attribute.ATTRIBUTE_TYPEprotected boolean canContainChild(java.lang.String tagName)
canContainChild in class AbstractXmlNodetagName - Name of child.public java.util.Collection<java.lang.String> getAttributeNames()
getAttributeNames in interface XmlNodegetAttributeNames in class AbstractXmlNode