Table of Contents
Table of Contents
...
The XForms processor provides the model manipulation and event handling functionality. It must be complemented with an environment that provides the presentation. The javadoc of the interface (Section D.1.1, “Interface de.mnl.xformsproc.Processor”) describes its usage in detail.
The Cocoon environment for the XForms processor consists of several sitemap components.
The SetupTransformer extract XForms model information from the input and adds it to a newly created processor. It builds a DOM tree from the containing document and registeres the XForms controls with the processor.
Together with some administrative information, the processor and the containing document are saved in the session context. Finally, the transformer outputs the containing document by replaying the DOM tree (Section D.2.2, “Class de.mnl.aacxforms.SetupTransformer”).
This transformer enhances the XForms controls with additional information like read-only state, value etc. This is necessary because a subsequent stylesheet transformation cannot retrieve this information from the model.
Controls that have a value get a name and value extension:
<input xmlns="http://www.w3.org/2002/xforms/cr" xmlns:aac="http://www.mnl.de/2002/10/aac-xforms" aac:name="n1" ...> <extension> <aac:value>123</aac:value> </extension> ... </input>The aac:name must be used as name of generated HTML inputs.
...
After having been processed with the PrepareTransformer, the page is ready to be piped through the stylesheet that prepares display as e.g. HTML.
All form submission from the browser displaying the XForm must be passed through the ProcessAction. The requests are easily recognizable because the must include a parameter xformsProcessContext. This mandatory parameter allows the action to retrieve the XForms processor used to create the page from the session context.
The ProcessAction maps the request parameters to events on the XForms controls which are then processed by the processor.
Depending on the input, the evaluation of events may result in a submission being triggered. In this case, the Submission (Section D.1.11, “Class de.mnl.xformsproc.Submission”) returned by Processor.submission (Section D.1.1.1, “submission()”) is put in the objectModel. The action returns new sitemap parameters causing the nested part of the Cocoon pipeline to be executed. The new sitemap has an entry "submission" that has as value the key of the Submission in the objectModel.
The ReplayGenerator is used if the ProcessAction does not signal that a submission has taken place. It simply replays the containing document and is usually followed in the pipeline by the PrepareTransformer.
The PrepareTransformer generates the output based on the modified (by the ProcessAction) model thus reflecting any inputs from the user.
Table of Contents
The binary distribution includes a sample WAR (lib/aacxforms/xfsamples.war) that should be deployable in most servlet containers that can deploy the vanilla cocoon.war. I am using JBoss, which requires a preparational step.
As pre-configured, JBoss uses the crimson parser. This parser does not implement an up-to-date DOM model and must be replaced with Xerces.
Download Xerces-J 2.2.1. Do not use 2.3.0, it has a bug.
Copy xml-apis.jar and xercesImpl.jar to $JBOSS_HOME/lib.
Start JBoss as "./run.sh -j xerces".
Instructions for deployment depend on the servlet container you use. With JBoss, you simply drop the WAR file into the deploy directory of your server.
After deploying, you should be able to access a sample form using http://localhost:8080/xfsamples/misc.xml. In addition, the sample WAR includes the XForms test suite as http://localhost:8080/xfsamples/Test. As most test cases have no submit trigger, you will have to look at the debug output of your servlet container in order to observe the changes in the models.
Table of Contents
This appendix describes how you can compile the project yourself.
As the projects is small compared to the libraries is needs, the source distribution is not a self contained, buildable tree. Rather, the source tree relies of some resources being available in the environment.
The default environment has the following structure:
. The XForms sandbox | +--. aac-xforms (extracted sources or cvs co) | +--. lib (third party libraries) | | | +-- jaxen-full.jar| | | +-- saxpath.jar
| | | +--. cocoon-2.0.4
| | | +-- cocoon-2.0.4.jar | | | +-- All libraries used by cocoon | | | +-- ... | . | . | . | +--. build (created by ant)
| +--. dist (created by ant)
![]()
The libraries and directories outside the aac-xforms tree may be relocated by creating a file aac-xforms/personal-props/ant.properties. Entries in aac-xforms/personal-props/ant.properties take precedence over entries in aac-xforms/config-props/ant.properties (which should be used as a start).
With the setup above, calling ant with the buildfile aac-xforms/src/de/mnl/aacxforms/build.xml creates the libraries de.mnl.xformsproc.jar and de.mnl.aacxforms.jar in dist/lib/aacxforms. These libraries are needed to setup a Cocoon environment as described in Section C.2, “Integrating the XForms processor”.
Calling ant with the buildfile aac-xforms/src/de/mnl/aacxforms/build.xml creates the libraries de.mnl.xformsproc.jar and de.mnl.aacxforms.jar in dist/lib/aacxforms. These libraries are needed to setup a Cocoon environment as described in Section C.2, “Integrating the XForms processor”.
Table of Contents
The sections following describe the integration of the XForms implementation in the cocoon sample file coccon.war. These instructions have been tested with cocoon-2.0.4 and deployment on jboss-3.0.6. Note that only the servlet container of JBoss (Jetty) is used. I'm using JBoss because I have a JBoss installation on my machine anyway. You should be able to do the deployment in any environment in which Cocoon can be deployed. If you are using JBoss, you must prepare it as described in Section A.1, “Configuring JBoss”
The instructions assume that you have a base knowledge about Cocoon and JBoss.
As distributed, cocoon.war (from version 2.0.4) dos not work because of a bug in the sitemap compiler.
Unpack cocoon.war into a tempory directory: "cd $CTMP; jar xf $COCOON-DIST/cocoon.war".
Edit $CTMP/WEB-INF/cocoon.xconf. Comment out
<sitemap check-reload="yes" class="org.apache.cocoon.sitemap.SitemapManager" file="sitemap.xmap" logger="sitemap" reload-method="synchron"/>and uncomment
<sitemap logger="sitemap"/>
Repack cocoon.war with: "cd $CTMP; jar cf /tmp/cocoon.war".
Deploy cocoon.war and try it as a test.
If you are using JBoss, as I do, comment out the invocation of HSQLDB in $CTMP/WEB-INF/cocoon.xconf.
In order to see the debug output from the xforms processing, you have to modify $CTMP/WEB-INF/logkit.xconf. Add
<category name="xforms" log-level="DEBUG"> <log-target id-ref="core"/> <log-target id-ref="error"/> </category>to the "categories" section. This will insert the messages in the core.log file.
If you want to see the messages also in the console output of JBoss, add
<category name="xforms" log-level="DEBUG"> <log-target id-ref="servlet"/> <log-target id-ref="core"/> <log-target id-ref="error"/> </category>to the "categories" section and
<servlet id="servlet"> <format type="pattern"> %7.7{priority} %5.5{time} [%12.12{category}]: %{message}\n%{throwable} </format> </servlet>to the "targets" section.
Finally, if you want to suppress all the other cocoon debug messages, replace "DEBUG" with "ERROR" for all entries in the categories section (except for the "xforms" category, of course) and add
<category name="cocoon" log-level="ERROR"> <log-target id-ref="core"/> <log-target id-ref="error"/> </category> <category name="root" log-level="ERROR"> <log-target id-ref="core"/> <log-target id-ref="error"/> </category>
Add the new libraries by copying the distributed files de.mnl.xformsproc.jar and de.mnl.aacxforms.jar to $CMTP/WEB-INF/lib. This XForms implementation uses jaxen as XPath library. Download jaxen-full.jar and saxpath.jar from http://jaxen.sourceforge.net and add them to $CMTP/WEB-INF/lib as well.
In some servlet containers (not JBoss) Cocoon seems to have problems to locate the libraries which it needs to run the XSP compiler successfully. For these environments, Cocoon maintans a list of libraries in $CMTP/META-INF/MANIFEST.MF. If you need to, add entries for the new libraries.
Make the new components known to Cocoon. In the sitemap add
<map:generators> ... <map:generator name="xforms-replay" src="de.mnl.aacxforms.ReplayGenerator" logger="xforms.replay" label="xforms-replay"/> <map:generator name="xforms-stream-submission" src="de.mnl.aacxforms.SubmissionStreamer" logger="xforms.stream-submission" label="xforms-stream-submission"/> </map:generators> ... <map:transformers> ... <map:transformer name="xforms-setup" src="de.mnl.aacxforms.SetupTransformer" logger="xforms.setup"/> <map:transformer name="xforms-prepare" src="de.mnl.aacxforms.PrepareTransformer" logger="xforms.prepare"/> </map:transformers> ... <map:readers> ... <map:reader name="submission-reader" src="de.mnl.aacxforms.SubmissionReader" logger="xforms.submission-reader"/> </map:readers>
Add an action for XForms processing.
<map:actions> ... <map:action name="process-xform" src="de.mnl.aacxforms.ProcessAction"/> </map:actions>
Add a pipeline for the XForms samples.
<map:pipelines> <map:pipeline> <!-- Any request with parameter "xformsProcessContext" is a xforms submission. --> <map:match type="request-parameter" pattern="xformsProcessContext"> <map:act type="process-xform" src="{1}"> <map:generate type="xforms-stream-submission"/> <map:act type="request"> <map:transform src="stylesheets/xml2html.xsl"> <map:parameter name="context" value="{context}"/> </map:transform> </map:act> <map:serialize/> </map:act> <map:generate type="xforms-replay" src="{1}"/> <map:transform type="xforms-prepare"/> <map:transform src="xftests/xftests.xsl"/> <map:transform type="encodeURL"/> <map:serialize/> </map:match> <!-- XForms tests. --> <map:match pattern="xftests/*.xml*"> <map:generate src="xftests/{1}.xml"/> <map:transform type="xforms-setup"/> <map:transform type="xforms-prepare"/> <map:transform src="xftests/xftests.xsl"/> <map:transform type="encodeURL"/> <map:serialize/> </map:match> </map:pipeline> ... <map:pipelines>
Finally, copy the files misc.xml, xftests.xsl and xforms-ui.xsl in a new directory $CMTP/xftests. Add your own test files using misc.xml as a starting point.
Re-pack and deploy cocoon.war as described above. You should now be able to invoke the sample as http://localhost:8080/cocoon/xftests/misc.xml
Table of Contents
This package implements an XForms processor as a component that can be used in various environment.
public interface Processor
This interface defines a core XForms processor. It provides the model manipulation and event handling functionality. It must be complemented with an environment that provides the presentation.
An environment using this class must parse the description containing the xforms controls and models. The models are passed to the processor using addModel (see Section D.1.1.1, “addModel(Element)”). They are of no further concern to the environment.
The xforms controls encountered during parsing the document must be registered with the processor using registerControl (see Section D.1.1.1, “registerControl(Element)”). They must be rendered by the environment and the environment must dispatch the specified events to the controls during user interaction. To finalize the setup, the environment must call start (see Section D.1.1.1, “start()”) to bootstrap the processor.
public void addModel(org.w3c.dom.Element model);
Add a model.
Parameters:
the model.
public java.util.Map models();
Returns the known models.
Returns: the known models.
public java.util.Collection modelIds();
Returns the known model Ids.
Returns: the known model ids.
Start the processor. Must be called once after all models have been added (see Section D.1.1.1, “addModel(Element)”) and all controls have been registered (see Section D.1.1.1, “registerControl(Element)”).
public Model modelById(java.lang.String id);
Returns the model with the given id or null if no such model exists.
Parameters:
the model id.
Returns: the model or null.
public Binding getBinding(BindingAttrs attrs)
throws InvalidSelectionException;
Return the Binding corresponding to the given binding attributes. Used by the environment to access the data referenced by the controls.
Parameters:
the binding attributes.
Returns: the binding.
Throws:
if the binding is invalid.
public Binding getBinding(org.w3c.dom.Element element)
throws InvalidSelectionException;
Return the Binding described by the given element. The element must have appropriate binding attributes. Used by the environment to access the data referenced by the controls.
Parameters:
the element.
Returns: the binding.
Throws:
if the binding is invalid.
public void registerControl(org.w3c.dom.Element control)
throws java.lang.IllegalArgumentException;
In order to be able to dispatch and handle events as specified, the processor must know about the controls that reference the model (or models). The environment using the processor must therefore make all XForms controls known by calling this method.
Parameters:
the control.
Throws:
if the given element is not an xforms control.
public void registerAction(org.w3c.dom.Element actionElement)
throws java.lang.IllegalArgumentException;
XForms actions are defined as event handlers. Although they are properly defined as event listeners in the DOM tree, nothing happens by default because the xforms actions are unknown to an XML parser. Actually, providing the action implementation is (to a large amount) what an xforms processor is about.
This method registers the given action element with the processor, thus causing the action to be invoked if the event specified by the action element is received. Note that this method need only be called if the action element is outside the model tree (i.e. in the containing document). The processor implementation registers action elements inside the model automatically. To avoid duplicate invocations, this method will (silently) do nothing if the given element is part of the model tree.
Parameters:
the Element that describes the xforms action.
Throws:
if the given element is not an xforms action.
public java.util.List activatedMessageActions();
Return the list of xforms message actions that have been activated. A message action is activated if it receives the event it is listening for during event processing. Upon receiving the event, the processor evaluates the associated message and stores it as an additional attribue xfp:message (were xfp references the xforms processor namespace).
Returns: a (maybe empty) list of Elements of type xforms:message.
Clears the list of activated message actions and the submission (see Section D.1.1.1, “submission()”), if any.
public Submission submission();
If the processing of events has led to a submission to be activated, this method returns he submission data.
Returns: submission data or null.
public interface Binding
This interface defines a named or anonymous binding.
Returns the binding id.
Returns: the binding id or null if it is an anonymous binding.
public java.util.List boundNodes()
throws InvalidSelectionException;
Return the nodes references by this binding.
Returns: the referenced nodes.
Throws:
if no value can be selected.
public org.w3c.dom.Node boundNode()
throws InvalidSelectionException;
Return the first (or only) node references by this binding.
Returns: the referenced node.
Throws:
if no value can be selected.
public java.lang.String getValue()
throws InvalidSelectionException;
Get the value referenced by this binding.
Returns: the selected value.
Throws:
if no value can be selected.
public void setValue(java.lang.String val)
throws InvalidSelectionException;
Set the value referenced by this binding.
Parameters:
the new value.
Throws:
if no value can be selected.
public interface EnumerableNamespaceContext
This interface an additional method for NamespaceContext that allows querying the known prefixes.
public interface Model
This interface defines the internal view of the xforms model.
Returns the model id.
Returns: the model id or the empty string if the model has no id.
public org.w3c.dom.Document instanceDocument(java.lang.String id);
Return the instance document with the given id.
Parameters:
the id. if id == null the first (default) instance of the model is returned.
Returns: the document.
public org.w3c.dom.Document modelDocument(boolean updated);
Returns the document that was used to build this model.
Parameters:
if true, returns a copy of the model with the instance data is replaced with the current instance documents.
Returns: the model Document.
public java.util.Collection bindings();
Return the Bindings defined in this model.
Returns: the bindings.
public org.w3c.dom.Element submissionById(java.lang.String id)
throws InvalidSelectionException;
Return the Submission with the given id.
Parameters:
the id.
Returns: the submission.
Throws:
if no submission with the given id exists.
public class BindingAttrs
java.lang.Object | +--de.mnl.xformsproc.BindingAttrs
This class combines the attributes used for binding input elements to model data. It is used to save input element bindings in a session context and associate them with unique ids.
public BindingAttrs(EnumerableNamespaceContext nsc,
java.util.List attrs);
Creates a new BindingAttrs object with the attributes initialized from the given parsed attributes.
Parameters:
the namespace context for evaluating the binding expression. This parameter is copied.
the parsed attributes.
public org.jaxen.NamespaceContext knownNamespaces();
Return the namespace context for this binding, i.e. all prefix to URI mappings to be used when evaluating xpath expressions.
The namespace context returned is immutable, i.e. it will never change for a given BindingAttrs object.
Returns: the namespace context.
public org.xml.sax.Attributes[] bindingAttrs();
Return the binding attributes of all binding elements to be used for resolving the binding. Element 0 is the innermost binding element.
The array returned is immutable, i.e. it will never change for a given BindingAttrs object and may thus safely be referenced permanently (but must not be modified, of course).
Returns: the binding attributes.
public boolean equals(java.lang.Object o);
Verifies if the given object equals this, i.e. all attributes are equal.
Parameters:
the object to compare with.
Returns: true if the given object is equal to this one.
Calculate a hash code value for this object.
Returns: the hash code.
public java.lang.String toString();
Return a string representation for debugging purposes.
Returns: a string representation.
public class BindingImpl
java.lang.Object | +--de.mnl.xformsproc.BindingImpl
This class implements the connection to one or more instance data node(s).
Returns the binding id.
Returns: the binding id.
public ModelImpl boundModel()
throws InvalidSelectionException;
Return the model this binding relates to.
Returns: the context model.
Throws:
if no model can be selected.
public java.util.List boundNodes()
throws InvalidSelectionException;
Return the nodes references by these binding attributes.
Returns: the referenced nodes.
Throws:
if no value can be selected.
public org.w3c.dom.Node boundNode()
throws InvalidSelectionException;
Return the first (or only) node references by these binding attributes.
Returns: the referenced node.
Throws:
if no value can be selected.
public java.lang.String getValue()
throws InvalidSelectionException;
Get the value referenced by this binding.
Returns: the selected value.
Throws:
if no value can be selected.
public void setValue(java.lang.String val)
throws InvalidSelectionException;
Set the value referenced by this binding.
Parameters:
the new value.
Throws:
if no value can be selected.
public class DefaultProcessor
java.lang.Object | +--de.mnl.xformsproc.DefaultProcessor
This class provides ...
public DefaultProcessor(org.apache.log.Logger logger);
Creates an instance of DefaultProcessor with all attributes initialized to default and given values.
Parameters:
a logger.
public org.apache.log.Logger logger();
Return a logger.
Returns: the logger.
public void addModel(org.w3c.dom.Element model);
Add a model.
Parameters:
the model.
public java.util.Map models();
Returns the known models.
Returns: the known models.
public java.util.Collection modelIds();
Returns the known model Ids.
Returns: the known model ids.
public Model modelById(java.lang.String id);
Returns the model with the given id or null if no such model exists.
Parameters:
the model id.
Returns: the model or null.
public Binding getBinding(BindingAttrs attrs)
throws InvalidSelectionException;
Return the Binding corresponding to the given binding attributes.
Parameters:
the binding attributes.
Returns: the binding.
Throws:
if the binding is invalid.
public Binding getBinding(org.w3c.dom.Element element)
throws InvalidSelectionException;
Return the Binding described by the given element. The element must have appropriate binding attributes.
Parameters:
the element.
Returns: the binding.
Throws:
if the binding is invalid.
public void registerControl(org.w3c.dom.Element control)
throws java.lang.IllegalArgumentException;
public void registerAction(org.w3c.dom.Element actionElement)
throws java.lang.IllegalArgumentException;
public java.util.List activatedMessageActions();
public void addAttributedMessageAction(org.w3c.dom.Element act);
Register an xforms message action element that has to be cleared before next processing.
Parameters:
the xforms action element.
public Submission submission();
public void setSubmission(Submission submission);
Set the submission.
Parameters:
the new submission.
public class ModelImpl
java.lang.Object | +--de.mnl.xformsproc.ModelImpl
Implementation of an xforms model.
Returns the model id.
Returns: the model id.
public org.w3c.dom.Document instanceDocument(java.lang.String id);
Return the instance document with the given id.
Parameters:
the id. if id == null the first (default) instance of the model is returned.
Returns: the document.
public org.w3c.dom.Document modelDocument(boolean updated);
Returns the document that was used to build this model.
Parameters:
if true, the instance data is replaced with the current instance documents.
Returns: the model Document.
public void dispatchModelEvent(java.lang.String type,
boolean canBubble,
boolean cancelable);
Dispatch the given event to the model root.
Parameters:
the event type.
if it can bubble.
if it can be canceled.
public java.util.Collection bindings();
Return the Bindings defined in this model.
Returns: the bindings.
public org.w3c.dom.Element submissionById(java.lang.String id)
throws InvalidSelectionException;
Return the Submission with the given id.
Parameters:
the id.
Returns: the submission.
Throws:
if no submission with the given id exists.
public void registerControl(org.w3c.dom.Element control);
In order to be able to dispatch and handle events as specified, the model must know about the controls that reference it.
Parameters:
the control.
public boolean equals(java.lang.Object o);
Two models are equal if their ids are equal.
Parameters:
the object to compare with.
Returns: true if the objects are equal.
Use the id's hash code.
Returns: a hash code.
public java.lang.String toString();
Retrieve a String representation of this object
Returns: a String representation of this object.
public class NamespaceStack
java.lang.Object | +--de.mnl.xformsproc.NamespaceStack
This class provides a namespace stack.
public void push(java.lang.String prefix,
java.lang.String uri,
boolean pending);
Register a new namespace.
Parameters:
the prefix.
the uri.
mark as pending.
public void push(java.lang.String prefix,
java.lang.String uri);
Register a new namespace.
Parameters:
the prefix.
the uri.
public void pop(java.lang.String prefix);
Unregister a namespace.
Parameters:
the prefix.
public void sendPending(org.xml.sax.ContentHandler hdlr)
throws org.xml.sax.SAXException;
Send (and clear) pending mappings.
Parameters:
the handler pending namespaces are to be sent to.
Throws:
id the hdlr throws an exception.
Clear pending mappings.
public java.lang.String translateNamespacePrefixToUri(java.lang.String prefix);
Translate the provided namespace prefix into the matching bound namespace URI.
Parameters:
the prefix.
Returns: the URI.
public java.lang.String findPrefixForUri(java.lang.String uri);
Find the prefix in effect for the given URI.
Parameters:
the uri.
Returns: the prefix.
public java.util.Iterator prefixes();
Return an iterator over the known prefixes.
Returns: the iterator.
public class Submission
java.lang.Object | +--de.mnl.xformsproc.Submission
This class provides all data needed to execute a submission.
public Submission(java.lang.String action,
java.lang.String method,
org.w3c.dom.Node submissionRoot);
Creates an instance of Submission with all attributes initialized to default or the given values.
Parameters:
the destination URI for submitting instance data.
specifies the protocol to be used.
the root of the DOM tree to be submitted.
public class Util
java.lang.Object | +--de.mnl.xformsproc.Util
This class provides some utility methods.
public static org.jaxen.NamespaceContext knownNamespaces(org.w3c.dom.Node node);
Return the namespaces known at the given position in the DOM tree as namespace context.
Parameters:
the node.
Returns: all namespaces declared at the given node or one of its parents as NamespaceContext.
public static java.util.Collection controlElements();
Return the local names of the xforms control elements
Returns: a list of ids.
public static java.util.Collection actionElements();
Return the local names of the xforms action elements.
Returns: a list of ids.
public static java.lang.String toString(org.w3c.dom.Element el);
Return nice representation of an Element for debugging purposes.
Parameters:
the element.
Returns: the string representation.
public static java.lang.String toString(org.w3c.dom.events.Event ev);
Return nice representation of an Event for debugging purposes.
Parameters:
the event.
Returns: the string representation.
public class XML11Char
java.lang.Object | +--de.mnl.xformsproc.XML11Char
This class defines the basic properties of characters in XML 1.1. The data in this class can be used to verify that a character is a valid XML 1.1 character or if the character is a space, name start, or name character.
A series of convenience methods are supplied to ease the burden of the developer. Using the character as an index into the XML11CHARS array and applying the appropriate mask flag (e.g. MASK_VALID), yields the same results as calling the convenience methods. There is one exception: check the comments for the isValid method for details.
public static boolean isXML11Space(int c);
Returns true if the specified character is a space character as amdended in the XML 1.1 specification.
Parameters:
The character to check.
public static boolean isXML11Valid(int c);
Returns true if the specified character is valid. This method also checks the surrogate character range from 0x10000 to 0x10FFFF.
If the program chooses to apply the mask directly to the XML11CHARS array, then they are responsible for checking the surrogate character range.
Parameters:
The character to check.
public static boolean isXML11Invalid(int c);
Returns true if the specified character is invalid.
Parameters:
The character to check.
public static boolean isXML11ValidLiteral(int c);
Returns true if the specified character is valid and permitted outside of a character reference. That is, this method will return false for the same set as isXML11Valid, except it also reports false for "control characters".
Parameters:
The character to check.
public static boolean isXML11Content(int c);
Returns true if the specified character can be considered content.
Parameters:
The character to check.
public static boolean isXML11NameStart(int c);
Returns true if the specified character is a valid name start character as defined by production [4] in the XML 1.1 specification.
Parameters:
The character to check.
public static boolean isXML11Name(int c);
Returns true if the specified character is a valid name character as defined by production [4a] in the XML 1.1 specification.
Parameters:
The character to check.
public static boolean isXML11NCNameStart(int c);
Returns true if the specified character is a valid NCName start character as defined by production [4] in Namespaces in XML 1.1 recommendation.
Parameters:
The character to check.
public static boolean isXML11NCName(int c);
Returns true if the specified character is a valid NCName character as defined by production [5] in Namespaces in XML 1.1 recommendation.
Parameters:
The character to check.
public static boolean isXML11ValidName(java.lang.String name);
Check to see if a string is a valid Name according to [5] in the XML 1.1 Recommendation
Parameters:
string to check
Returns: true if name is a valid Name
public static boolean isXML11ValidNCName(java.lang.String ncName);
Check to see if a string is a valid NCName according to [4] from the XML Namespaces 1.1 Recommendation
Parameters:
string to check
Returns: true if name is a valid NCName
public static boolean isXML11ValidNmtoken(java.lang.String nmtoken);
Check to see if a string is a valid Nmtoken according to [7] in the XML 1.1 Recommendation
Parameters:
string to check
Returns: true if nmtoken is a valid Nmtoken
public class InvalidSelectionException
java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--de.mnl.xformsproc.InvalidSelectionException
This exception is thrown by methods in Model (see Section D.1.5, “Interface de.mnl.xformsproc.Model”) if a value selection is not possible based on the given state or arguments.
public class SetupTransformer
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.xml.AbstractXMLProducer | +--org.apache.cocoon.xml.AbstractXMLPipe | +--org.apache.cocoon.transformation.AbstractTransformer | +--de.mnl.aacxforms.SetupTransformer
The SetupTransformer extracts XForms model information from the input and adds it to a newly created processor. It builds a DOM tree from the containing document and registeres the XForms controls with the processor.
Together with some administrative information, the processor and the containing document are saved in the session context. Finally, the transformer outputs the containing document by replaying the DOM tree
Creates an instance of SetupTransformer with all attributes initialized to default values.
public void compose(org.apache.avalon.framework.component.ComponentManager componentManager);
Receive the component manager.
Parameters:
the component manager.
public void setup(org.apache.cocoon.environment.SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters par)
throws org.apache.cocoon.ProcessingException, org.xml.sax.SAXException, java.io.IOException;
Setup the next round. The instance variables are initialised.
Parameters:
The current SourceResolver
The objectModel of the environment.
The value of the src attribute in the sitemap.
The parameters from the sitemap.
Throws:
if an error occurs.
if an error occurs.
if an error occurs.
Recycle the generator by removing references.
public void setDocumentLocator(org.xml.sax.Locator locator);
Receive an object for locating the origin of SAX document events.
Parameters:
An object that can return the location of any SAX document event.
public void startDocument()
throws org.xml.sax.SAXException;
Receive notification of the beginning of a document.
Throws:
not thrown.
public void endDocument()
throws org.xml.sax.SAXException;
Receive notification of the end of a document.
Throws:
not thrown.
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException;
Begin the scope of a prefix-URI Namespace mapping.
Parameters:
The Namespace prefix being declared.
The Namespace URI the prefix is mapped to.
Throws:
not thrown.
public void endPrefixMapping(java.lang.String prefix)
throws org.xml.sax.SAXException;
End the scope of a prefix-URI mapping.
Parameters:
The prefix that was being mapping.
Throws:
not thrown.
public void startElement(java.lang.String uri,
java.lang.String loc,
java.lang.String raw,
org.xml.sax.Attributes a)
throws org.xml.sax.SAXException;
Receive notification of the beginning of an element.
Parameters:
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
The local name (without prefix), or the empty string if Namespace processing is not being performed.
The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
not thrown.
public void endElement(java.lang.String uri,
java.lang.String loc,
java.lang.String raw)
throws org.xml.sax.SAXException;
Receive notification of the end of an element.
Parameters:
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
The local name (without prefix), or the empty string if Namespace processing is not being performed.
The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
Throws:
not thrown.
public void characters(char[] c,
int start,
int len)
throws org.xml.sax.SAXException;
Receive notification of character data.
Parameters:
The characters from the XML document.
The start position in the array.
The number of characters to read from the array.
Throws:
not thrown.
public void ignorableWhitespace(char[] c,
int start,
int len)
throws org.xml.sax.SAXException;
Receive notification of ignorable whitespace in element content.
Parameters:
The characters from the XML document.
The start position in the array.
The number of characters to read from the array.
Throws:
not thrown.
public void processingInstruction(java.lang.String target,
java.lang.String data)
throws org.xml.sax.SAXException;
Receive notification of a processing instruction.
Parameters:
The processing instruction target.
The processing instruction data, or null if none was supplied.
Throws:
not thrown.
public void skippedEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Receive notification of a skipped entity.
Parameters:
The name of the skipped entity. If it is a parameter entity, the name will begin with '%'.
Throws:
not thrown.
public void startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
throws org.xml.sax.SAXException;
Report the start of DTD declarations, if any.
Parameters:
The document type name.
The declared public identifier for the external DTD subset, or null if none was declared.
The declared system identifier for the external DTD subset, or null if none was declared.
Throws:
not thrown.
public void endDTD()
throws org.xml.sax.SAXException;
Report the end of DTD declarations.
Throws:
not thrown.
public void startEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Report the beginning of an entity.
Parameters:
The name of the entity. If it is a parameter entity, the name will begin with '%'.
Throws:
not thrown.
public void endEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Report the end of an entity.
Parameters:
The name of the entity that is ending.
Throws:
not thrown.
public void startCDATA()
throws org.xml.sax.SAXException;
Report the start of a CDATA section.
Throws:
not thrown.
public void endCDATA()
throws org.xml.sax.SAXException;
Report the end of a CDATA section.
Throws:
not thrown.
public void comment(char[] ch,
int start,
int len)
throws org.xml.sax.SAXException;
Report an XML comment anywhere in the document.
Parameters:
An array holding the characters in the comment.
The starting position in the array.
The number of characters to use from the array.
Throws:
not thrown.
public class PrepareTransformer
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.xml.AbstractXMLProducer | +--org.apache.cocoon.xml.AbstractXMLPipe | +--org.apache.cocoon.transformation.AbstractTransformer | +--de.mnl.aacxforms.PrepareTransformer
This transformer enhances the XForms controls with additional information like read-only state, value etc.
Creates an instance of PrepareTransformer with all attributes initialized to default values.
public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException;
Receives the Configuration for the Configurable class. This method is always called after the constructor and before any other method.
Parameters:
the configuratopn
Throws:
not thrown by this implementation
public void setup(org.apache.cocoon.environment.SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters par)
throws org.apache.cocoon.ProcessingException, org.xml.sax.SAXException, java.io.IOException;
Setup the next round. The instance variables are initialised.
Parameters:
The current SourceResolver
The objectModel of the environment.
The value of the src attribute in the sitemap.
The parameters from the sitemap.
Throws:
if an error occurs.
if an error occurs.
if an error occurs.
Recycle the generator by removing references.
public void compose(org.apache.avalon.framework.component.ComponentManager manager);
Set the current ComponentManager instance used by this Composable.
Parameters:
the manager.
Disposable Interface.
public void setDocumentLocator(org.xml.sax.Locator locator);
Receive an object for locating the origin of SAX document events.
Parameters:
An object that can return the location of any SAX document event.
public void startDocument()
throws org.xml.sax.SAXException;
Receive notification of the beginning of a document.
Throws:
only if thrown by super class.
public void endDocument()
throws org.xml.sax.SAXException;
Receive notification of the end of a document.
Throws:
not thrown.
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException;
Start prefix mapping.
Parameters:
the prefix.
the uri.
Throws:
if an error occurs.
public void endPrefixMapping(java.lang.String prefix)
throws org.xml.sax.SAXException;
End prefix mapping.
Parameters:
the prefix.
Throws:
if an error occurs.
public void startElement(java.lang.String uri,
java.lang.String loc,
java.lang.String raw,
org.xml.sax.Attributes a)
throws org.xml.sax.SAXException;
Receive notification of the beginning of an element.
Parameters:
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
The local name (without prefix), or the empty string if Namespace processing is not being performed.
The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
only if thrown by super class.
public void endElement(java.lang.String uri,
java.lang.String loc,
java.lang.String raw)
throws org.xml.sax.SAXException;
Receive notification of the end of an element.
Parameters:
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
The local name (without prefix), or the empty string if Namespace processing is not being performed.
The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
Throws:
not thrown.
public void characters(char[] c,
int start,
int len)
throws org.xml.sax.SAXException;
Receive notification of character data.
Parameters:
The characters from the XML document.
The start position in the array.
The number of characters to read from the array.
Throws:
not thrown.
public void ignorableWhitespace(char[] c,
int start,
int len)
throws org.xml.sax.SAXException;
Receive notification of ignorable whitespace in element content.
Parameters:
The characters from the XML document.
The start position in the array.
The number of characters to read from the array.
Throws:
not thrown.
public void processingInstruction(java.lang.String target,
java.lang.String data)
throws org.xml.sax.SAXException;
Receive notification of a processing instruction.
Parameters:
The processing instruction target.
The processing instruction data, or null if none was supplied.
Throws:
not thrown.
public void skippedEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Receive notification of a skipped entity.
Parameters:
The name of the skipped entity. If it is a parameter entity, the name will begin with '%'.
Throws:
not thrown.
public void startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
throws org.xml.sax.SAXException;
Report the start of DTD declarations, if any.
Parameters:
The document type name.
The declared public identifier for the external DTD subset, or null if none was declared.
The declared system identifier for the external DTD subset, or null if none was declared.
Throws:
not thrown.
public void endDTD()
throws org.xml.sax.SAXException;
Report the end of DTD declarations.
Throws:
not thrown.
public void startEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Report the beginning of an entity.
Parameters:
The name of the entity. If it is a parameter entity, the name will begin with '%'.
Throws:
not thrown.
public void endEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Report the end of an entity.
Parameters:
The name of the entity that is ending.
Throws:
not thrown.
public void startCDATA()
throws org.xml.sax.SAXException;
Report the start of a CDATA section.
Throws:
not thrown.
public void endCDATA()
throws org.xml.sax.SAXException;
Report the end of a CDATA section.
Throws:
not thrown.
public void comment(char[] ch,
int start,
int len)
throws org.xml.sax.SAXException;
Report an XML comment anywhere in the document.
Parameters:
An array holding the characters in the comment.
The starting position in the array.
The number of characters to use from the array.
Throws:
not thrown.
public class ProcessAction
java.lang.Object | +--de.mnl.aacxforms.ProcessAction
The ProcessAction maps the request parameters to events on the XForms controls which are then processed by the processor.
Depending on the input, the evaluation of events may result in a submission being triggered. In this case, the action returns new sitemap parameters causing the nested part of the Cocoon pipeline to be executed.
Creates an instance of ProcessAction with all attributes initialized to default values.
public java.util.Map act(org.apache.cocoon.environment.Redirector redirector,
org.apache.cocoon.environment.SourceResolver resolver,
java.util.Map objectModel,
java.lang.String source,
org.apache.avalon.framework.parameters.Parameters params)
throws java.lang.Exception;
Describe act method here.
Parameters:
the interface of the redirector .
the SourceResolver in charge.
the Map with object of the calling environment which can be used to select values this controller may need (i.e. Request, Response).
a source String to the Action.
the Parameters for this invocation
Returns: an empty Map.
Throws:
if an error occurs.
public class ReplayGenerator
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.xml.AbstractXMLProducer | +--org.apache.cocoon.generation.AbstractGenerator | +--de.mnl.aacxforms.ReplayGenerator
This class provides ...
Creates an instance of ReplayGenerator with all attributes initialized to default values.
public void setup(org.apache.cocoon.environment.SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters par)
throws org.apache.cocoon.ProcessingException, org.xml.sax.SAXException, java.io.IOException;
Setup the next round. The instance variables are initialised. Process the submission, i.e. change the model.
Parameters:
The current SourceResolver
The objectModel of the environment.
The value of the src attribute in the sitemap.
The parameters from the sitemap.
Throws:
if an error occurs.
if an error occurs.
if an error occurs.
Recycle the generator by removing references.
public void compose(org.apache.avalon.framework.component.ComponentManager componentManager);
Receive the component manager.
Parameters:
the component manager.
public void generate()
throws java.io.IOException, org.xml.sax.SAXException, org.apache.cocoon.ProcessingException;
Re-generate the output of the SetupTransformer (see Section D.2.2, “Class de.mnl.aacxforms.SetupTransformer”) using the modified model.
Throws:
if an error occurs.
if an error occurs.
if an error occurs.
public class SubmissionStreamer
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.xml.AbstractXMLProducer | +--org.apache.cocoon.generation.AbstractGenerator | +--de.mnl.aacxforms.SubmissionStreamer
This class provides ...
Creates an instance of SubmissionStreamer with all attributes initialized to default values.
public void generate()
throws java.io.IOException, org.xml.sax.SAXException, org.apache.cocoon.ProcessingException;
Output the submitted xforms data, i.e. the tree associated with the submission left in the object model. Removes the submission from the object model after processing.
Throws:
if an error occurs.
if an error occurs.
if an error occurs.
public class DOMBuilder
java.lang.Object | +--de.mnl.aacxforms.DOMBuilder
This class takes SAX events (in addition to some extra events that SAX doesn't handle yet) and adds the result to a document or document fragment.
public DOMBuilder(org.w3c.dom.Document doc,
org.w3c.dom.Node node);
DOMBuilder instance constructor... it will add the DOM nodes to the document fragment.
Parameters:
Root document
Current node
public DOMBuilder(org.w3c.dom.Document doc,
org.w3c.dom.DocumentFragment docFrag);
DOMBuilder instance constructor... it will add the DOM nodes to the document fragment.
Parameters:
Root document
Document fragment
public DOMBuilder(org.w3c.dom.Document doc);
DOMBuilder instance constructor... it will add the DOM nodes to the document.
Parameters:
Root document
DOMBuilder instance constructor... it will add the DOM nodes to a new document.
public org.w3c.dom.Document getDocument();
Return the document used.
Returns: The document.
public org.w3c.dom.Node getRootNode();
Get the root node of the DOM being created. This is either a Document or a DocumentFragment.
Returns: The root document or document fragment if not null
public org.w3c.dom.Node getCurrentNode();
Get the node currently being processed.
Returns: the current node being processed
protected void append(org.w3c.dom.Node newNode)
throws org.xml.sax.SAXException;
Append a node to the current container.
Parameters:
New node to append
Throws:
inherited from interface, not thrown.
public void setDocumentLocator(org.xml.sax.Locator locator);
Receive an object for locating the origin of SAX document events.
SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the ContentHandler interface.
The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.
Note that the locator will return correct information only during the invocation of the events in this interface. The application should not attempt to use it at any other time.
Parameters:
An object that can return the location of any SAX document event.
public void startDocument()
throws org.xml.sax.SAXException;
Receive notification of the beginning of a document.
The SAX parser will invoke this method only once, before any other methods in this interface or in DTDHandler (except for setDocumentLocator).
Throws:
inherited from interface, not thrown.
public void endDocument()
throws org.xml.sax.SAXException;
Receive notification of the end of a document.
The SAX parser will invoke this method only once, and it will be the last method invoked during the parse. The parser shall not invoke this method until it has either abandoned parsing (because of an unrecoverable error) or reached the end of input.
Throws:
inherited from interface, not thrown.
public void startElement(java.lang.String ns,
java.lang.String localName,
java.lang.String name,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException;
Receive notification of the beginning of an element.
The Parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement() event for every startElement() event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement() event.
If the element name has a namespace prefix, the prefix will still be attached. Note that the attribute list provided will contain only attributes with explicit values (specified or defaulted): #IMPLIED attributes will be omitted.
Parameters:
The namespace of the node
The local part of the qualified name
The element name.
The attributes attached to the element, if any.
Throws:
inherited from interface, not thrown.
public void endElement(java.lang.String ns,
java.lang.String localName,
java.lang.String name)
throws org.xml.sax.SAXException;
Receive notification of the end of an element.
The SAX parser will invoke this method at the end of every element in the XML document; there will be a corresponding startElement() event for every endElement() event (even when the element is empty).
If the element name has a namespace prefix, the prefix will still be attached to the name.
Parameters:
the namespace of the element
The local part of the qualified name of the element
The element name
Throws:
inherited from interface, not thrown.
public void setIDAttribute(java.lang.String id,
org.w3c.dom.Element elem);
Set an ID string to node association in the ID table.
Parameters:
The ID string.
The associated ID.
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException;
Receive notification of character data.
The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the Locator provides useful information.
The application must not attempt to read from the array outside of the specified range.
Note that some parsers will report whitespace using the ignorableWhitespace() method rather than this one (validating parsers must do so).
Parameters:
The characters from the XML document.
The start position in the array.
The number of characters to read from the array.
Throws:
inherited from interface, not thrown.
public void charactersRaw(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException;
If available, when the disable-output-escaping attribute is used, output raw text without escaping. A PI will be inserted in front of the node with the name "lotusxsl-next-is-raw" and a value of "formatter-to-dom".
Parameters:
Array containing the characters
Index to start of characters in the array
Number of characters in the array
Throws:
inherited from interface, not thrown.
public void startEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Report the beginning of an entity. The start and end of the document entity are not reported. The start and end of the external DTD subset are reported using the pseudo-name "[dtd]". All other events must be properly nested within start/end entity events.
Parameters:
The name of the entity. If it is a parameter entity, the name will begin with '%'.
Throws:
inherited from interface, not thrown.
public void endEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Report the end of an entity.
Parameters:
The name of the entity that is ending.
Throws:
inherited from interface, not thrown.
public void entityReference(java.lang.String name)
throws org.xml.sax.SAXException;
Receive notivication of a entityReference.
Parameters:
name of the entity reference
Throws:
inherited from interface, not thrown.
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException;
Receive notification of ignorable whitespace in element content.
Validating Parsers must use this method to report each chunk of ignorable whitespace (see the W3C XML 1.0 recommendation, section 2.10): non-validating parsers may also use this method if they are capable of parsing and using content models.
SAX parsers may return all contiguous whitespace in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the Locator provides useful information.
The application must not attempt to read from the array outside of the specified range.
Parameters:
The characters from the XML document.
The start position in the array.
The number of characters to read from the array.
Throws:
inherited from interface, not thrown.
public void processingInstruction(java.lang.String target,
java.lang.String data)
throws org.xml.sax.SAXException;
Receive notification of a processing instruction.
The Parser will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element.
A SAX parser should never report an XML declaration (XML 1.0, section 2.8) or a text declaration (XML 1.0, section 4.3.1) using this method.
Parameters:
The processing instruction target.
The processing instruction data, or null if none was supplied.
Throws:
inherited from interface, not thrown.
public void comment(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException;
Report an XML comment anywhere in the document. This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read).
Parameters:
An array holding the characters in the comment.
The starting position in the array.
The number of characters to use from the array.
Throws:
inherited from interface, not thrown.
public void startCDATA()
throws org.xml.sax.SAXException;
Report the start of a CDATA section.
public void endCDATA()
throws org.xml.sax.SAXException;
Report the end of a CDATA section.
public void cdata(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException;
Receive notification of cdata.
The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity, so that the Locator provides useful information.
The application must not attempt to read from the array outside of the specified range.
Note that some parsers will report whitespace using the ignorableWhitespace() method rather than this one (validating parsers must do so).
Parameters:
The characters from the XML document.
The start position in the array.
The number of characters to read from the array.
Throws:
inherited from interface, not thrown.
public void startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
throws org.xml.sax.SAXException;
Report the start of DTD declarations, if any. Any declarations are assumed to be in the internal subset unless otherwise indicated.
Parameters:
The document type name.
The declared public identifier for the external DTD subset, or null if none was declared.
The declared system identifier for the external DTD subset, or null if none was declared.
Throws:
inherited from interface, not thrown.
public void endDTD()
throws org.xml.sax.SAXException;
Report the end of DTD declarations.
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException;
Begin the scope of a prefix-URI Namespace mapping.
The information from this event is not necessary for normal Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the http://xml.org/sax/features/namespaces feature is true (the default).
There are cases, however, when applications need to use prefixes in character data or in attribute values, where they cannot safely be expanded automatically; the start/endPrefixMapping event supplies the information to the application to expand prefixes in those contexts itself, if necessary.
Note that start/endPrefixMapping events are not guaranteed to be properly nested relative to each-other: all startPrefixMapping events will occur before the corresponding startElement event, and all endPrefixMapping events will occur after the corresponding endElement event, but their order is not guaranteed.
Parameters:
The Namespace prefix being declared.
The Namespace URI the prefix is mapped to.
Throws:
inherited from interface, not thrown.
public void endPrefixMapping(java.lang.String prefix)
throws org.xml.sax.SAXException;
End the scope of a prefix-URI mapping.
See startPrefixMapping for details. This event will always occur after the corresponding endElement event, but the order of endPrefixMapping events is not otherwise guaranteed.
Parameters:
The prefix that was being mapping.
Throws:
inherited from interface, not thrown.
public void skippedEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Receive notification of a skipped entity.
The Parser will invoke this method once for each entity skipped. Non-validating processors may skip entities if they have not seen the declarations (because, for example, the entity was declared in an external DTD subset). All processors may skip external entities, depending on the values of the http://xml.org/sax/features/external-general-entities and the http://xml.org/sax/features/external-parameter-entities properties.
Parameters:
The name of the skipped entity. If it is a parameter entity, the name will begin with '%'.
Throws:
inherited from interface, not thrown.
public static boolean isWhiteSpace(char ch);
Returns whether the specified ch conforms to the XML 1.0 definition of whitespace.
Parameters:
Character to check as XML whitespace.
Returns: true if ch is XML whitespace; otherwise false.
public static boolean isWhiteSpace(char[] ch,
int start,
int length);
Tell if the string is whitespace.
Parameters:
Character array to check as XML whitespace.
Start index of characters in the array
Number of characters in the array
Returns: True if the characters in the array are XML whitespace; otherwise, false.
public class PageContext
java.lang.Object | +--de.mnl.aacxforms.PageContext
This class provides ...
public PageContext(org.apache.cocoon.environment.Request request,
org.apache.log.Logger aLogger);
Creates an instance of PageContext with all attributes initialized to default values.
Parameters:
the current request.
a logger.
Return the id of this PageContext. May be used as paramter for lookup (see Section D.2.8.2, “lookup(Session, String)”).
Returns: the id.
public static PageContext lookup(org.apache.cocoon.environment.Session session,
java.lang.String id)
throws java.lang.IllegalArgumentException;
Lookup the PageContext with the given id in the given session.
Parameters:
the session.
the id.
Returns: the PageContext
Throws:
if no such PageContext exists.
public java.lang.String requestURI();
Return the request URI of the request passed to the constructor.
Returns: the content base.
public void setPageContent(org.w3c.dom.Document pageContent);
Set the page content, i.e. a representation of the input to SetupTransformer (see Section D.2.2, “Class de.mnl.aacxforms.SetupTransformer”) without the models.
Parameters:
the content as Document.
public org.w3c.dom.Document pageContent();
Return the page content.
Returns: the page content.
public java.lang.String refId(java.lang.Object obj);
Associate an object with a unique id that can be used for requests.
Parameters:
the object.
Returns: the id.
public java.lang.String refId(java.lang.Object obj,
boolean persist);
Associate an object with a unique id that can be used for requests. If persistent, the association will not be removed by clearRefIds (see Section D.2.8.2, “clearRefIds()”).
Parameters:
the object.
if true, the association will not be removed by clearRefIds (see Section D.2.8.2, “clearRefIds()”).
Returns: the id.
public java.lang.Object resolve(java.lang.String id);
Return the object associated with the given id.
Parameters:
the id.
Returns: the object.
Clear the saved id to object mapping.
public org.apache.log.Logger getLogger();
Get the value of logger.
Returns: value of logger.
public void setLogger(org.apache.log.Logger newLogger);
Set the value of logger.
Parameters:
value to assign to logger.
public class SAXNormalizer
java.lang.Object | +--de.mnl.aacxforms.SAXNormalizer
Sax streams produced by e.g. DOM streamers often behave incorrectly with respect to namespaces. This filter fixes streams that do not produce proper startPrefixMapping calls.
public SAXNormalizer(org.xml.sax.ContentHandler chndlr,
org.xml.sax.ext.LexicalHandler lhndlr);
Creates an instance of SAXNormalizer with all attributes initialized to default values or given.
Parameters:
the content handler we forward to.
the lexical handler we forward to.
public SAXNormalizer(org.apache.cocoon.xml.XMLConsumer hndlr);
Creates an instance of SAXNormalizer with all attributes initialized to default values or given.
Parameters:
the handler for both content and lexical events.
public void setDocumentLocator(org.xml.sax.Locator locator);
Receive an object for locating the origin of SAX document events.
Parameters:
An object that can return the location of any SAX document event.
public void startDocument()
throws org.xml.sax.SAXException;
Receive notification of the beginning of a document.
Throws:
only if thrown by super class.
public void endDocument()
throws org.xml.sax.SAXException;
Receive notification of the end of a document.
Throws:
not thrown.
public void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException;
Start prefix mapping.
Parameters:
the prefix.
the uri.
Throws:
if an error occurs.
public void endPrefixMapping(java.lang.String prefix)
throws org.xml.sax.SAXException;
End prefix mapping.
Parameters:
the prefix.
Throws:
if an error occurs.
public void startElement(java.lang.String uri,
java.lang.String loc,
java.lang.String raw,
org.xml.sax.Attributes a)
throws org.xml.sax.SAXException;
Receive notification of the beginning of an element.
Parameters:
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
The local name (without prefix), or the empty string if Namespace processing is not being performed.
The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
Throws:
only if thrown by super class.
public void endElement(java.lang.String uri,
java.lang.String loc,
java.lang.String raw)
throws org.xml.sax.SAXException;
Receive notification of the end of an element.
Parameters:
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
The local name (without prefix), or the empty string if Namespace processing is not being performed.
The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.
Throws:
not thrown.
public void characters(char[] c,
int start,
int len)
throws org.xml.sax.SAXException;
Receive notification of character data.
Parameters:
The characters from the XML document.
The start position in the array.
The number of characters to read from the array.
Throws:
not thrown.
public void ignorableWhitespace(char[] c,
int start,
int len)
throws org.xml.sax.SAXException;
Receive notification of ignorable whitespace in element content.
Parameters:
The characters from the XML document.
The start position in the array.
The number of characters to read from the array.
Throws:
not thrown.
public void processingInstruction(java.lang.String target,
java.lang.String data)
throws org.xml.sax.SAXException;
Receive notification of a processing instruction.
Parameters:
The processing instruction target.
The processing instruction data, or null if none was supplied.
Throws:
not thrown.
public void skippedEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Receive notification of a skipped entity.
Parameters:
The name of the skipped entity. If it is a parameter entity, the name will begin with '%'.
Throws:
not thrown.
public void startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
throws org.xml.sax.SAXException;
Report the start of DTD declarations, if any.
Parameters:
The document type name.
The declared public identifier for the external DTD subset, or null if none was declared.
The declared system identifier for the external DTD subset, or null if none was declared.
Throws:
not thrown.
public void endDTD()
throws org.xml.sax.SAXException;
Report the end of DTD declarations.
Throws:
not thrown.
public void startEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Report the beginning of an entity.
Parameters:
The name of the entity. If it is a parameter entity, the name will begin with '%'.
Throws:
not thrown.
public void endEntity(java.lang.String name)
throws org.xml.sax.SAXException;
Report the end of an entity.
Parameters:
The name of the entity that is ending.
Throws:
not thrown.
public void startCDATA()
throws org.xml.sax.SAXException;
Report the start of a CDATA section.
Throws:
not thrown.
public void endCDATA()
throws org.xml.sax.SAXException;
Report the end of a CDATA section.
Throws:
not thrown.
public void comment(char[] ch,
int start,
int len)
throws org.xml.sax.SAXException;
Report an XML comment anywhere in the document.
Parameters:
An array holding the characters in the comment.
The starting position in the array.
The number of characters to use from the array.
Throws:
not thrown.
public class SubmissionReader
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.reading.AbstractReader | +--de.mnl.aacxforms.SubmissionReader
This class provides ...
Creates an instance of SubmissionReader with all attributes initialized to default values.
public void setup(org.apache.cocoon.environment.SourceResolver resolver,
java.util.Map objectModel,
java.lang.String src,
org.apache.avalon.framework.parameters.Parameters par)
throws org.apache.cocoon.ProcessingException, org.xml.sax.SAXException, java.io.IOException;
Setup the reader. The resource is opened to get an InputStream, the length and the last modification date
Parameters:
The current SourceResolver
The objectModel of the environment.
The value of the src attribute in the sitemap.
The parameters from the sitemap.
Throws:
if an error occurs.
if an error occurs.
if an error occurs.
Recycle the generator by removing references.
public void generate()
throws java.io.IOException, org.apache.cocoon.ProcessingException;
Generates the requested resource.
Throws:
if an error occurs.
if an error occurs.
public java.lang.String getMimeType();
Returns the mime-type of the resource in process.
Returns: the mime type or null.
public class Util
java.lang.Object | +--de.mnl.xformsproc.Util | +--de.mnl.aacxforms.Util
This class provides some utility methods.
public static java.util.Collection namedElements();
Return the local names of the xforms elements that get names and can thus be submitted as parameters.
Returns: a list of ids.
public static void logDOMTree(org.apache.log.Logger logger,
java.lang.String title,
org.w3c.dom.Node root);
Log a DOM tree with level debug.
Parameters:
the logger.
a title line for the output.
tree's root.
Version 2, June 1991
Copyright © 2000 Free Software Foundation, Inc.
Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Table of Contents
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software - to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps:
copyright the software, and
offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a “work based on the Program” means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term “modification”.) Each licensee is addressed as “you”.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License.
If the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
You may copy and distribute the Program (or a work based on it, under Section 2 in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.