public interface XmlResource extends XmlResourceBase
XmlResource
interface represents an Xml Resource. An Xml Resource is used
to read and write Xml documents to or from the file system, remote systems etc, and to provide
additional services to process Xml documents.
Modifier and Type | Method and Description |
---|---|
void |
read()
Issues a read request to the default adapter of the XML Resource.
|
void |
read(java.lang.String adapterName)
Issues a read request to the adapter specified by
adapterName on the XML Resource. |
void |
write()
Issues a write request to the default adapter of the XML Resource.
|
void |
write(java.lang.String adapterName)
Issues a write request to the adapter specified by
adapterName on the XML Resource. |
call, call, fetch, getDocument, setDocument, update
getElementName, getElementType
void read() throws com.ebasetech.xi.exceptions.FormRuntimeException
After the read request is processed, the fetch()
method is called internally - this transfers any non-tabular field data
from the resource to mapped form fields.
If the resource is mapped to tables in the form, any table data should be transferred to the form after
invoking this method using the fetchTable()
method on the relevant tables.
Javascript example (read an XML document from file):
// call the file adapter to load an XML document resources.PARAMS_XML.read(); // load the PARAMETERS table from the XML document tables.PARAMETERS.fetchTable();
com.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurs during executionread(String)
void read(java.lang.String adapterName) throws com.ebasetech.xi.exceptions.FormRuntimeException
adapterName
on the XML Resource.
Note that different adapters support different methods and not all adapters support this method.
After the read request is processed, the fetch()
method is called internally - this transfers any non-tabular field data
from the resource to mapped form fields.
If the resource is mapped to tables in the form, any table data should be transferred to the form after
invoking this method using the fetchTable()
method on the relevant tables.
Javascript example (read an XML document from file):
// call the file adapter to load an XML document resources.PARAMS_XML.read("FILE1"); // load the PARAMETERS table from the XML document tables.PARAMETERS.fetchTable();
adapterName
- the adapter to be calledcom.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurs during executionread()
void write() throws com.ebasetech.xi.exceptions.FormRuntimeException
Before the write request is processed, the update()
method is called internally - this transfers any non-tabular field data
to the resource from mapped form fields.
If the resource is mapped to tables in the form, resource data must be updated prior to invoking this method; this is done
using the updateTable()
method on all relevant tables.
Javascript example (write a XML document to file):
// update the ORDERS table in the XML document tables.ORDERS.updateTable(); // call the file adapter to write an XML document resources.ORDERS_XML.write();
com.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurs during executionwrite(String)
void write(java.lang.String adapterName) throws com.ebasetech.xi.exceptions.FormRuntimeException
adapterName
on the XML Resource.
Note that different adapters support different methods and not all adapters support this method.
Before the write request is processed, the update()
method is called internally - this transfers any non-tabular field data
to the resource from mapped form fields.
If the resource is mapped to tables in the form, resource data must be updated prior to invoking this method; this is done
using the updateTable()
method on all relevant tables.
Javascript example (write a XML document to file):
// update the ORDERS table in the XML document tables.ORDERS.updateTable(); // call the file adapter to write an XML document resources.ORDERS_XML.write("FILE1");
adapterName
- the adapter to be calledcom.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurs during executionwrite()