XForms Processor Manual

Michael Lipp


Table of Contents

1. Introduction
2. Architecture
2.1. The XForms Processor
2.2. Embedding in Cocoon
2.2.1. The SetupTransformer
2.2.2. The PrepareTransformer
2.2.3. The ProcessAction
2.2.4. The ReplayGenerator
2.2.5. The SubmissionStreamer
2.3. Embedding as Applet
A. Deploying the sample WAR
A.1. Configuring JBoss
A.2. Deploying
A.3. Invoking
B. Compiling the sources
B.1. Environment
B.2. Building the libraries
B.3. Building the sample WAR
C. Installation As Cocoon Extension
C.1. Fixing Cocoon
C.2. Integrating the XForms processor
D. Javadoc
D.1. Package de.mnl.xformsproc
D.1.1. Interface de.mnl.xformsproc.­Processor
D.1.2. Interface de.mnl.xformsproc.­Binding
D.1.3. Interface de.mnl.xformsproc.­Constants
D.1.4. Interface de.mnl.xformsproc.­Enumerable­Namespace­Context
D.1.5. Interface de.mnl.xformsproc.­Model
D.1.6. Class de.mnl.xformsproc.­Binding­Attrs
D.1.7. Class de.mnl.xformsproc.­Binding­Impl
D.1.8. Class de.mnl.xformsproc.­Default­Processor
D.1.9. Class de.mnl.xformsproc.­Model­Impl
D.1.10. Class de.mnl.xformsproc.­Namespace­Stack
D.1.11. Class de.mnl.xformsproc.­Submission
D.1.12. Class de.mnl.xformsproc.­Util
D.1.13. Class de.mnl.xformsproc.­X­M­L11­Char
D.1.14. Class de.mnl.xformsproc.­Invalid­Selection­Exception
D.2. Package de.mnl.aacxforms
D.2.1. Interface de.mnl.aacxforms.­Constants
D.2.2. Class de.mnl.aacxforms.­Setup­Transformer
D.2.3. Class de.mnl.aacxforms.­Prepare­Transformer
D.2.4. Class de.mnl.aacxforms.­Process­Action
D.2.5. Class de.mnl.aacxforms.­Replay­Generator
D.2.6. Class de.mnl.aacxforms.­Submission­Streamer
D.2.7. Class de.mnl.aacxforms.­D­O­M­Builder
D.2.8. Class de.mnl.aacxforms.­Page­Context
D.2.9. Class de.mnl.aacxforms.­S­A­X­Normalizer
D.2.10. Class de.mnl.aacxforms.­Submission­Reader
D.2.11. Class de.mnl.aacxforms.­Util
E. GNU General Public License
E.1. Preamble
E.2. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
E.2.1. Section 0
E.2.2. Section 1
E.2.3. Section 2
E.2.4. Section 3
E.2.5. Section 4
E.2.6. Section 5
E.2.7. Section 6
E.2.8. Section 7
E.2.9. Section 8
E.2.10. Section 9
E.2.11. Section 10
E.2.12. NO WARRANTY
E.2.13. Section 12
F. Notes

Chapter 1. Introduction

...

Chapter 2. Architecture

...

2.1. The XForms Processor

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.

2.2. Embedding in Cocoon

The Cocoon environment for the XForms processor consists of several sitemap components.

2.2.1. The SetupTransformer

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.­Setup­Transformer”).

2.2.2. The PrepareTransformer

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.

2.2.3. The ProcessAction

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.

2.2.4. The ReplayGenerator

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.

2.2.5. The SubmissionStreamer

This generator is the simplest way to process submissions in the Cocoon context. It streams the submitted data to the next component in the sitemap, ignoring any action attribues in the XForms submission element.

2.3. Embedding as Applet

...

Appendix A. Deploying the sample WAR

Table of Contents

A.1. Configuring JBoss
A.2. Deploying
A.3. Invoking

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.

A.1. Configuring JBoss

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".

A.2. Deploying

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.

A.3. Invoking

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.

Appendix B. Compiling the sources

This appendix describes how you can compile the project yourself.

B.1. Environment

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 1
|  |
|  +-- saxpath.jar 2
|  |
|  +--. cocoon-2.0.4 3
|     |
|     +-- cocoon-2.0.4.jar
|     |
|     +-- All libraries used by cocoon
|     |
|     +-- ...
|     .
|     .
|     .
|
+--. build (created by ant) 4
|
+--. dist (created by ant) 5
	

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).

1

Corresponds to jaxen-jar = ../../lib/jaxen-full.jar

2

Corresponds to saxpath-jar = ../../lib/saxpath.jar

3

Corresponds to cocoon-lib-dir = ../../lib/cocoon-2.0.4

4

Corresponds to build-root = ../../build. This is the root of temporary directories created during build.

5

Corresponds to dist-root = ../../dist. After a successful build, this directory contains the files of the binary distribution.

B.2. Building the libraries

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”.

B.3. Building the sample WAR

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”.

Appendix C. Installation As Cocoon Extension

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.

C.1. Fixing Cocoon

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.

C.2. Integrating the XForms processor

  • 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

Appendix D. Javadoc

D.1. Package de.mnl.xformsproc

This package implements an XForms processor as a component that can be used in various environment.

D.1.1. Interface de.mnl.xformsproc.­Processor

Syntax

public interface Processor

Description

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.

D.1.1.1. Methods

addModel(Element)

public void addModel(org.w3c.dom.Element model);

Add a model.

Parameters: 

model

the model.

models()

public java.util.Map models();

Returns the known models.

Returns: the known models.

modelIds()

public java.util.Collection modelIds();

Returns the known model Ids.

Returns: the known model ids.

start()

public void start();

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)”).

modelById(String)

public Model modelById(java.lang.String id);

Returns the model with the given id or null if no such model exists.

Parameters: 

id

the model id.

Returns: the model or null.

getBinding(BindingAttrs)

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: 

attrs

the binding attributes.

Returns: the binding.

Throws: 

InvalidSelectionException

if the binding is invalid.

getBinding(Element)

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: 

element

the element.

Returns: the binding.

Throws: 

InvalidSelectionException

if the binding is invalid.

registerControl(Element)

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: 

control

the control.

Throws: 

IllegalArgumentException

if the given element is not an xforms control.

registerAction(Element)

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: 

actionElement

the Element that describes the xforms action.

Throws: 

IllegalArgumentException

if the given element is not an xforms action.

activatedMessageActions()

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.

clear()

public void clear();

Clears the list of activated message actions and the submission (see Section D.1.1.1, “submission()”), if any.

submission()

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.

D.1.2. Interface de.mnl.xformsproc.­Binding

Syntax

public interface Binding

Description

This interface defines a named or anonymous binding.

D.1.2.1. Methods

id()

public java.lang.String id();

Returns the binding id.

Returns: the binding id or null if it is an anonymous binding.

boundNodes()

public java.util.List boundNodes()
    throws InvalidSelectionException;

Return the nodes references by this binding.

Returns: the referenced nodes.

Throws: 

InvalidSelectionException

if no value can be selected.

boundNode()

public org.w3c.dom.Node boundNode()
    throws InvalidSelectionException;

Return the first (or only) node references by this binding.

Returns: the referenced node.

Throws: 

InvalidSelectionException

if no value can be selected.

getValue()

public java.lang.String getValue()
    throws InvalidSelectionException;

Get the value referenced by this binding.

Returns: the selected value.

Throws: 

InvalidSelectionException

if no value can be selected.

setValue(String)

public void setValue(java.lang.String val)
    throws InvalidSelectionException;

Set the value referenced by this binding.

Parameters: 

val

the new value.

Throws: 

InvalidSelectionException

if no value can be selected.

D.1.3. Interface de.mnl.xformsproc.­Constants

Syntax

public interface Constants

Description

This interface defines ...

D.1.4. Interface de.mnl.xformsproc.­Enumerable­Namespace­Context

Syntax

public interface EnumerableNamespaceContext

Description

This interface an additional method for NamespaceContext that allows querying the known prefixes.

D.1.4.1. Methods

prefixes()

public java.util.Iterator prefixes();

Return an iterator over the known prefixes.

Returns: the iterator.

D.1.5. Interface de.mnl.xformsproc.­Model

Syntax

public interface Model

Description

This interface defines the internal view of the xforms model.

D.1.5.1. Methods

id()

public java.lang.String id();

Returns the model id.

Returns: the model id or the empty string if the model has no id.

instanceDocument(String)

public org.w3c.dom.Document instanceDocument(java.lang.String id);

Return the instance document with the given id.

Parameters: 

id

the id. if id == null the first (default) instance of the model is returned.

Returns: the document.

modelDocument(boolean)

public org.w3c.dom.Document modelDocument(boolean updated);

Returns the document that was used to build this model.

Parameters: 

updated

if true, returns a copy of the model with the instance data is replaced with the current instance documents.

Returns: the model Document.

bindings()

public java.util.Collection bindings();

Return the Bindings defined in this model.

Returns: the bindings.

submissionById(String)

public org.w3c.dom.Element submissionById(java.lang.String id)
    throws InvalidSelectionException;

Return the Submission with the given id.

Parameters: 

id

the id.

Returns: the submission.

Throws: 

InvalidSelectionException

if no submission with the given id exists.

D.1.6. Class de.mnl.xformsproc.­Binding­Attrs

Syntax

public class BindingAttrs

java.lang.Object | +--de.mnl.xformsproc.BindingAttrs

Description

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.

D.1.6.1. Constructors

BindingAttrs(EnumerableNamespaceContext, List)

public BindingAttrs(EnumerableNamespaceContext nsc,
                    java.util.List attrs);

Creates a new BindingAttrs object with the attributes initialized from the given parsed attributes.

Parameters: 

nsc

the namespace context for evaluating the binding expression. This parameter is copied.

attrs

the parsed attributes.

D.1.6.2. Methods

knownNamespaces()

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.

bindingAttrs()

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.

equals(Object)

public boolean equals(java.lang.Object o);

Verifies if the given object equals this, i.e. all attributes are equal.

Parameters: 

o

the object to compare with.

Returns: true if the given object is equal to this one.

hashCode()

public int hashCode();

Calculate a hash code value for this object.

Returns: the hash code.

toString()

public java.lang.String toString();

Return a string representation for debugging purposes.

Returns: a string representation.

D.1.7. Class de.mnl.xformsproc.­Binding­Impl

Syntax

public class BindingImpl

java.lang.Object | +--de.mnl.xformsproc.BindingImpl

Description

This class implements the connection to one or more instance data node(s).

D.1.7.1. Methods

id()

public java.lang.String id();

Returns the binding id.

Returns: the binding id.

boundModel()

public ModelImpl boundModel()
    throws InvalidSelectionException;

Return the model this binding relates to.

Returns: the context model.

Throws: 

InvalidSelectionException

if no model can be selected.

boundNodes()

public java.util.List boundNodes()
    throws InvalidSelectionException;

Return the nodes references by these binding attributes.

Returns: the referenced nodes.

Throws: 

InvalidSelectionException

if no value can be selected.

boundNode()

public org.w3c.dom.Node boundNode()
    throws InvalidSelectionException;

Return the first (or only) node references by these binding attributes.

Returns: the referenced node.

Throws: 

InvalidSelectionException

if no value can be selected.

getValue()

public java.lang.String getValue()
    throws InvalidSelectionException;

Get the value referenced by this binding.

Returns: the selected value.

Throws: 

InvalidSelectionException

if no value can be selected.

setValue(String)

public void setValue(java.lang.String val)
    throws InvalidSelectionException;

Set the value referenced by this binding.

Parameters: 

val

the new value.

Throws: 

InvalidSelectionException

if no value can be selected.

D.1.8. Class de.mnl.xformsproc.­Default­Processor

Syntax

public class DefaultProcessor

java.lang.Object | +--de.mnl.xformsproc.DefaultProcessor

Description

This class provides ...

D.1.8.1. Constructors

DefaultProcessor(Logger)

public DefaultProcessor(org.apache.log.Logger logger);

Creates an instance of DefaultProcessor with all attributes initialized to default and given values.

Parameters: 

logger

a logger.

D.1.8.2. Methods

logger()

public org.apache.log.Logger logger();

Return a logger.

Returns: the logger.

addModel(Element)

public void addModel(org.w3c.dom.Element model);

Add a model.

Parameters: 

model

the model.

models()

public java.util.Map models();

Returns the known models.

Returns: the known models.

modelIds()

public java.util.Collection modelIds();

Returns the known model Ids.

Returns: the known model ids.

modelById(String)

public Model modelById(java.lang.String id);

Returns the model with the given id or null if no such model exists.

Parameters: 

id

the model id.

Returns: the model or null.

getBinding(BindingAttrs)

public Binding getBinding(BindingAttrs attrs)
    throws InvalidSelectionException;

Return the Binding corresponding to the given binding attributes.

Parameters: 

attrs

the binding attributes.

Returns: the binding.

Throws: 

InvalidSelectionException

if the binding is invalid.

getBinding(Element)

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: 

element

the element.

Returns: the binding.

Throws: 

InvalidSelectionException

if the binding is invalid.

start()

public void start();

registerControl(Element)

public void registerControl(org.w3c.dom.Element control)
    throws java.lang.IllegalArgumentException;

registerAction(Element)

public void registerAction(org.w3c.dom.Element actionElement)
    throws java.lang.IllegalArgumentException;

activatedMessageActions()

public java.util.List activatedMessageActions();

addAttributedMessageAction(Element)

public void addAttributedMessageAction(org.w3c.dom.Element act);

Register an xforms message action element that has to be cleared before next processing.

Parameters: 

act

the xforms action element.

clear()

public void clear();

submission()

public Submission submission();

setSubmission(Submission)

public void setSubmission(Submission submission);

Set the submission.

Parameters: 

submission

the new submission.

D.1.9. Class de.mnl.xformsproc.­Model­Impl

Syntax

public class ModelImpl

java.lang.Object | +--de.mnl.xformsproc.ModelImpl

Description

Implementation of an xforms model.

D.1.9.1. Methods

id()

public java.lang.String id();

Returns the model id.

Returns: the model id.

instanceDocument(String)

public org.w3c.dom.Document instanceDocument(java.lang.String id);

Return the instance document with the given id.

Parameters: 

id

the id. if id == null the first (default) instance of the model is returned.

Returns: the document.

modelDocument(boolean)

public org.w3c.dom.Document modelDocument(boolean updated);

Returns the document that was used to build this model.

Parameters: 

updated

if true, the instance data is replaced with the current instance documents.

Returns: the model Document.

dispatchModelEvent(String, boolean, boolean)

public void dispatchModelEvent(java.lang.String type,
                               boolean canBubble,
                               boolean cancelable);

Dispatch the given event to the model root.

Parameters: 

type

the event type.

canBubble

if it can bubble.

cancelable

if it can be canceled.

bindings()

public java.util.Collection bindings();

Return the Bindings defined in this model.

Returns: the bindings.

submissionById(String)

public org.w3c.dom.Element submissionById(java.lang.String id)
    throws InvalidSelectionException;

Return the Submission with the given id.

Parameters: 

id

the id.

Returns: the submission.

Throws: 

InvalidSelectionException

if no submission with the given id exists.

registerControl(Element)

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: 

control

the control.

equals(Object)

public boolean equals(java.lang.Object o);

Two models are equal if their ids are equal.

Parameters: 

o

the object to compare with.

Returns: true if the objects are equal.

hashCode()

public int hashCode();

Use the id's hash code.

Returns: a hash code.

toString()

public java.lang.String toString();

Retrieve a String representation of this object

Returns: a String representation of this object.

D.1.10. Class de.mnl.xformsproc.­Namespace­Stack

Syntax

public class NamespaceStack

java.lang.Object | +--de.mnl.xformsproc.NamespaceStack

Description

This class provides a namespace stack.

D.1.10.1. Constructors

NamespaceStack()

public NamespaceStack();

D.1.10.2. Methods

push(String, String, boolean)

public void push(java.lang.String prefix,
                 java.lang.String uri,
                 boolean pending);

Register a new namespace.

Parameters: 

prefix

the prefix.

uri

the uri.

pending

mark as pending.

push(String, String)

public void push(java.lang.String prefix,
                 java.lang.String uri);

Register a new namespace.

Parameters: 

prefix

the prefix.

uri

the uri.

pop(String)

public void pop(java.lang.String prefix);

Unregister a namespace.

Parameters: 

prefix

the prefix.

sendPending(ContentHandler)

public void sendPending(org.xml.sax.ContentHandler hdlr)
    throws org.xml.sax.SAXException;

Send (and clear) pending mappings.

Parameters: 

hdlr

the handler pending namespaces are to be sent to.

Throws: 

SAXException

id the hdlr throws an exception.

clearPending()

public void clearPending();

Clear pending mappings.

translateNamespacePrefixToUri(String)

public java.lang.String translateNamespacePrefixToUri(java.lang.String prefix);

Translate the provided namespace prefix into the matching bound namespace URI.

Parameters: 

prefix

the prefix.

Returns: the URI.

findPrefixForUri(String)

public java.lang.String findPrefixForUri(java.lang.String uri);

Find the prefix in effect for the given URI.

Parameters: 

uri

the uri.

Returns: the prefix.

prefixes()

public java.util.Iterator prefixes();

Return an iterator over the known prefixes.

Returns: the iterator.

D.1.11. Class de.mnl.xformsproc.­Submission

Syntax

public class Submission

java.lang.Object | +--de.mnl.xformsproc.Submission

Description

This class provides all data needed to execute a submission.

D.1.11.1. Constructors

Submission(String, String, Node)

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: 

action

the destination URI for submitting instance data.

method

specifies the protocol to be used.

submissionRoot

the root of the DOM tree to be submitted.

D.1.11.2. Methods

action()

public java.lang.String action();

Return the action URI.

Returns: the action URI.

method()

public java.lang.String method();

Return the method.

Returns: the action URI.

submissionRoot()

public org.w3c.dom.Node submissionRoot();

Return the root of the data to be submitted.

Returns: the root element.

D.1.12. Class de.mnl.xformsproc.­Util

Syntax

public class Util

java.lang.Object | +--de.mnl.xformsproc.Util

Description

This class provides some utility methods.

D.1.12.1. Constructors

Util()

public Util();

D.1.12.2. Methods

knownNamespaces(Node)

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: 

node

the node.

Returns: all namespaces declared at the given node or one of its parents as NamespaceContext.

controlElements()

public static java.util.Collection controlElements();

Return the local names of the xforms control elements

Returns: a list of ids.

actionElements()

public static java.util.Collection actionElements();

Return the local names of the xforms action elements.

Returns: a list of ids.

toString(Element)

public static java.lang.String toString(org.w3c.dom.Element el);

Return nice representation of an Element for debugging purposes.

Parameters: 

el

the element.

Returns: the string representation.

toString(Event)

public static java.lang.String toString(org.w3c.dom.events.Event ev);

Return nice representation of an Event for debugging purposes.

Parameters: 

ev

the event.

Returns: the string representation.

D.1.13. Class de.mnl.xformsproc.­X­M­L11­Char

Syntax

public class XML11Char

java.lang.Object | +--de.mnl.xformsproc.XML11Char

Description

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.

D.1.13.1. Constructors

XML11Char()

public XML11Char();

D.1.13.2. Methods

isXML11Space(int)

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: 

c

The character to check.

isXML11Valid(int)

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: 

c

The character to check.

isXML11Invalid(int)

public static boolean isXML11Invalid(int c);

Returns true if the specified character is invalid.

Parameters: 

c

The character to check.

isXML11ValidLiteral(int)

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: 

c

The character to check.

isXML11Content(int)

public static boolean isXML11Content(int c);

Returns true if the specified character can be considered content.

Parameters: 

c

The character to check.

isXML11NameStart(int)

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: 

c

The character to check.

isXML11Name(int)

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: 

c

The character to check.

isXML11NCNameStart(int)

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: 

c

The character to check.

isXML11NCName(int)

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: 

c

The character to check.

isXML11ValidName(String)

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: 

name

string to check

Returns: true if name is a valid Name

isXML11ValidNCName(String)

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: 

name

string to check

Returns: true if name is a valid NCName

isXML11ValidNmtoken(String)

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: 

nmtoken

string to check

Returns: true if nmtoken is a valid Nmtoken

D.1.14. Class de.mnl.xformsproc.­Invalid­Selection­Exception

Syntax

public class InvalidSelectionException

java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--de.mnl.xformsproc.InvalidSelectionException

Description

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.

D.1.14.1. Constructors

InvalidSelectionException(String)

public InvalidSelectionException(java.lang.String msg);

Creates an instance of InvalidSelectionException with the given message.

Parameters: 

msg

the message.

D.2. Package de.mnl.aacxforms

D.2.1. Interface de.mnl.aacxforms.­Constants

Syntax

public interface Constants

Description

This interface defines ...

D.2.2. Class de.mnl.aacxforms.­Setup­Transformer

Syntax

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

Description

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

D.2.2.1. Constructors

SetupTransformer()

public SetupTransformer();

Creates an instance of SetupTransformer with all attributes initialized to default values.

D.2.2.2. Methods

compose(ComponentManager)

public void compose(org.apache.avalon.framework.component.ComponentManager componentManager);

Receive the component manager.

Parameters: 

componentManager

the component manager.

setup(SourceResolver, Map, String, Parameters)

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: 

resolver

The current SourceResolver

objectModel

The objectModel of the environment.

src

The value of the src attribute in the sitemap.

par

The parameters from the sitemap.

Throws: 

ProcessingException

if an error occurs.

SAXException

if an error occurs.

IOException

if an error occurs.

recycle()

public void recycle();

Recycle the generator by removing references.

setDocumentLocator(Locator)

public void setDocumentLocator(org.xml.sax.Locator locator);

Receive an object for locating the origin of SAX document events.

Parameters: 

locator

An object that can return the location of any SAX document event.

startDocument()

public void startDocument()
    throws org.xml.sax.SAXException;

Receive notification of the beginning of a document.

Throws: 

SAXException

not thrown.

endDocument()

public void endDocument()
    throws org.xml.sax.SAXException;

Receive notification of the end of a document.

Throws: 

SAXException

not thrown.

startPrefixMapping(String, String)

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: 

prefix

The Namespace prefix being declared.

uri

The Namespace URI the prefix is mapped to.

Throws: 

SAXException

not thrown.

endPrefixMapping(String)

public void endPrefixMapping(java.lang.String prefix)
    throws org.xml.sax.SAXException;

End the scope of a prefix-URI mapping.

Parameters: 

prefix

The prefix that was being mapping.

Throws: 

SAXException

not thrown.

startElement(String, String, String, Attributes)

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: 

uri

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

loc

The local name (without prefix), or the empty string if Namespace processing is not being performed.

raw

The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.

a

The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.

Throws: 

SAXException

not thrown.

endElement(String, String, String)

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: 

uri

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

loc

The local name (without prefix), or the empty string if Namespace processing is not being performed.

raw

The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.

Throws: 

SAXException

not thrown.

characters(char[], int, int)

public void characters(char[] c,
                       int start,
                       int len)
    throws org.xml.sax.SAXException;

Receive notification of character data.

Parameters: 

c

The characters from the XML document.

start

The start position in the array.

len

The number of characters to read from the array.

Throws: 

SAXException

not thrown.

ignorableWhitespace(char[], int, int)

public void ignorableWhitespace(char[] c,
                                int start,
                                int len)
    throws org.xml.sax.SAXException;

Receive notification of ignorable whitespace in element content.

Parameters: 

c

The characters from the XML document.

start

The start position in the array.

len

The number of characters to read from the array.

Throws: 

SAXException

not thrown.

processingInstruction(String, String)

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
    throws org.xml.sax.SAXException;

Receive notification of a processing instruction.

Parameters: 

target

The processing instruction target.

data

The processing instruction data, or null if none was supplied.

Throws: 

SAXException

not thrown.

skippedEntity(String)

public void skippedEntity(java.lang.String name)
    throws org.xml.sax.SAXException;

Receive notification of a skipped entity.

Parameters: 

name

The name of the skipped entity. If it is a parameter entity, the name will begin with '%'.

Throws: 

SAXException

not thrown.

startDTD(String, String, String)

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: 

name

The document type name.

publicId

The declared public identifier for the external DTD subset, or null if none was declared.

systemId

The declared system identifier for the external DTD subset, or null if none was declared.

Throws: 

SAXException

not thrown.

endDTD()

public void endDTD()
    throws org.xml.sax.SAXException;

Report the end of DTD declarations.

Throws: 

SAXException

not thrown.

startEntity(String)

public void startEntity(java.lang.String name)
    throws org.xml.sax.SAXException;

Report the beginning of an entity.

Parameters: 

name

The name of the entity. If it is a parameter entity, the name will begin with '%'.

Throws: 

SAXException

not thrown.

endEntity(String)

public void endEntity(java.lang.String name)
    throws org.xml.sax.SAXException;

Report the end of an entity.

Parameters: 

name

The name of the entity that is ending.

Throws: 

SAXException

not thrown.

startCDATA()

public void startCDATA()
    throws org.xml.sax.SAXException;

Report the start of a CDATA section.

Throws: 

SAXException

not thrown.

endCDATA()

public void endCDATA()
    throws org.xml.sax.SAXException;

Report the end of a CDATA section.

Throws: 

SAXException

not thrown.

comment(char[], int, int)

public void comment(char[] ch,
                    int start,
                    int len)
    throws org.xml.sax.SAXException;

Report an XML comment anywhere in the document.

Parameters: 

ch

An array holding the characters in the comment.

start

The starting position in the array.

len

The number of characters to use from the array.

Throws: 

SAXException

not thrown.

D.2.3. Class de.mnl.aacxforms.­Prepare­Transformer

Syntax

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

Description

This transformer enhances the XForms controls with additional information like read-only state, value etc.

D.2.3.1. Constructors

PrepareTransformer()

public PrepareTransformer();

Creates an instance of PrepareTransformer with all attributes initialized to default values.

D.2.3.2. Methods

configure(Configuration)

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: 

configuration

the configuratopn

Throws: 

ConfigurationException

not thrown by this implementation

setup(SourceResolver, Map, String, Parameters)

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: 

resolver

The current SourceResolver

objectModel

The objectModel of the environment.

src

The value of the src attribute in the sitemap.

par

The parameters from the sitemap.

Throws: 

ProcessingException

if an error occurs.

SAXException

if an error occurs.

IOException

if an error occurs.

recycle()

public void recycle();

Recycle the generator by removing references.

compose(ComponentManager)

public void compose(org.apache.avalon.framework.component.ComponentManager manager);

Set the current ComponentManager instance used by this Composable.

Parameters: 

manager

the manager.

dispose()

public void dispose();

Disposable Interface.

setDocumentLocator(Locator)

public void setDocumentLocator(org.xml.sax.Locator locator);

Receive an object for locating the origin of SAX document events.

Parameters: 

locator

An object that can return the location of any SAX document event.

startDocument()

public void startDocument()
    throws org.xml.sax.SAXException;

Receive notification of the beginning of a document.

Throws: 

SAXException

only if thrown by super class.

endDocument()

public void endDocument()
    throws org.xml.sax.SAXException;

Receive notification of the end of a document.

Throws: 

SAXException

not thrown.

startPrefixMapping(String, String)

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
    throws org.xml.sax.SAXException;

Start prefix mapping.

Parameters: 

prefix

the prefix.

uri

the uri.

Throws: 

SAXException

if an error occurs.

endPrefixMapping(String)

public void endPrefixMapping(java.lang.String prefix)
    throws org.xml.sax.SAXException;

End prefix mapping.

Parameters: 

prefix

the prefix.

Throws: 

SAXException

if an error occurs.

startElement(String, String, String, Attributes)

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: 

uri

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

loc

The local name (without prefix), or the empty string if Namespace processing is not being performed.

raw

The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.

a

The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.

Throws: 

SAXException

only if thrown by super class.

endElement(String, String, String)

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: 

uri

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

loc

The local name (without prefix), or the empty string if Namespace processing is not being performed.

raw

The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.

Throws: 

SAXException

not thrown.

characters(char[], int, int)

public void characters(char[] c,
                       int start,
                       int len)
    throws org.xml.sax.SAXException;

Receive notification of character data.

Parameters: 

c

The characters from the XML document.

start

The start position in the array.

len

The number of characters to read from the array.

Throws: 

SAXException

not thrown.

ignorableWhitespace(char[], int, int)

public void ignorableWhitespace(char[] c,
                                int start,
                                int len)
    throws org.xml.sax.SAXException;

Receive notification of ignorable whitespace in element content.

Parameters: 

c

The characters from the XML document.

start

The start position in the array.

len

The number of characters to read from the array.

Throws: 

SAXException

not thrown.

processingInstruction(String, String)

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
    throws org.xml.sax.SAXException;

Receive notification of a processing instruction.

Parameters: 

target

The processing instruction target.

data

The processing instruction data, or null if none was supplied.

Throws: 

SAXException

not thrown.

skippedEntity(String)

public void skippedEntity(java.lang.String name)
    throws org.xml.sax.SAXException;

Receive notification of a skipped entity.

Parameters: 

name

The name of the skipped entity. If it is a parameter entity, the name will begin with '%'.

Throws: 

SAXException

not thrown.

startDTD(String, String, String)

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: 

name

The document type name.

publicId

The declared public identifier for the external DTD subset, or null if none was declared.

systemId

The declared system identifier for the external DTD subset, or null if none was declared.

Throws: 

SAXException

not thrown.

endDTD()

public void endDTD()
    throws org.xml.sax.SAXException;

Report the end of DTD declarations.

Throws: 

SAXException

not thrown.

startEntity(String)

public void startEntity(java.lang.String name)
    throws org.xml.sax.SAXException;

Report the beginning of an entity.

Parameters: 

name

The name of the entity. If it is a parameter entity, the name will begin with '%'.

Throws: 

SAXException

not thrown.

endEntity(String)

public void endEntity(java.lang.String name)
    throws org.xml.sax.SAXException;

Report the end of an entity.

Parameters: 

name

The name of the entity that is ending.

Throws: 

SAXException

not thrown.

startCDATA()

public void startCDATA()
    throws org.xml.sax.SAXException;

Report the start of a CDATA section.

Throws: 

SAXException

not thrown.

endCDATA()

public void endCDATA()
    throws org.xml.sax.SAXException;

Report the end of a CDATA section.

Throws: 

SAXException

not thrown.

comment(char[], int, int)

public void comment(char[] ch,
                    int start,
                    int len)
    throws org.xml.sax.SAXException;

Report an XML comment anywhere in the document.

Parameters: 

ch

An array holding the characters in the comment.

start

The starting position in the array.

len

The number of characters to use from the array.

Throws: 

SAXException

not thrown.

D.2.4. Class de.mnl.aacxforms.­Process­Action

Syntax

public class ProcessAction

java.lang.Object | +--de.mnl.aacxforms.ProcessAction

Description

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.

D.2.4.1. Constructors

ProcessAction()

public ProcessAction();

Creates an instance of ProcessAction with all attributes initialized to default values.

D.2.4.2. Methods

act(Redirector, SourceResolver, Map, String, Parameters)

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: 

redirector

the interface of the redirector .

resolver

the SourceResolver in charge.

objectModel

the Map with object of the calling environment which can be used to select values this controller may need (i.e. Request, Response).

source

a source String to the Action.

params

the Parameters for this invocation

Returns: an empty Map.

Throws: 

Exception

if an error occurs.

D.2.5. Class de.mnl.aacxforms.­Replay­Generator

Syntax

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

Description

This class provides ...

D.2.5.1. Constructors

ReplayGenerator()

public ReplayGenerator();

Creates an instance of ReplayGenerator with all attributes initialized to default values.

D.2.5.2. Methods

setup(SourceResolver, Map, String, Parameters)

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: 

resolver

The current SourceResolver

objectModel

The objectModel of the environment.

src

The value of the src attribute in the sitemap.

par

The parameters from the sitemap.

Throws: 

ProcessingException

if an error occurs.

SAXException

if an error occurs.

IOException

if an error occurs.

recycle()

public void recycle();

Recycle the generator by removing references.

compose(ComponentManager)

public void compose(org.apache.avalon.framework.component.ComponentManager componentManager);

Receive the component manager.

Parameters: 

componentManager

the component manager.

generate()

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.­Setup­Transformer”) using the modified model.

Throws: 

IOException

if an error occurs.

SAXException

if an error occurs.

ProcessingException

if an error occurs.

D.2.6. Class de.mnl.aacxforms.­Submission­Streamer

Syntax

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

Description

This class provides ...

D.2.6.1. Constructors

SubmissionStreamer()

public SubmissionStreamer();

Creates an instance of SubmissionStreamer with all attributes initialized to default values.

D.2.6.2. Methods

generate()

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: 

IOException

if an error occurs.

SAXException

if an error occurs.

ProcessingException

if an error occurs.

D.2.7. Class de.mnl.aacxforms.­D­O­M­Builder

Syntax

public class DOMBuilder

java.lang.Object | +--de.mnl.aacxforms.DOMBuilder

Description

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.

D.2.7.1. Constructors

DOMBuilder(Document, Node)

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: 

doc

Root document

node

Current node

DOMBuilder(Document, DocumentFragment)

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: 

doc

Root document

docFrag

Document fragment

DOMBuilder(Document)

public DOMBuilder(org.w3c.dom.Document doc);

DOMBuilder instance constructor... it will add the DOM nodes to the document.

Parameters: 

doc

Root document

DOMBuilder()

public DOMBuilder();

DOMBuilder instance constructor... it will add the DOM nodes to a new document.

D.2.7.2. Methods

getDocument()

public org.w3c.dom.Document getDocument();

Return the document used.

Returns: The document.

getRootNode()

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

getCurrentNode()

public org.w3c.dom.Node getCurrentNode();

Get the node currently being processed.

Returns: the current node being processed

append(Node)

protected void append(org.w3c.dom.Node newNode)
    throws org.xml.sax.SAXException;

Append a node to the current container.

Parameters: 

newNode

New node to append

Throws: 

SAXException

inherited from interface, not thrown.

setDocumentLocator(Locator)

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: 

locator

An object that can return the location of any SAX document event.

startDocument()

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: 

SAXException

inherited from interface, not thrown.

endDocument()

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: 

SAXException

inherited from interface, not thrown.

startElement(String, String, String, Attributes)

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: 

ns

The namespace of the node

localName

The local part of the qualified name

name

The element name.

atts

The attributes attached to the element, if any.

Throws: 

SAXException

inherited from interface, not thrown.

endElement(String, String, String)

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: 

ns

the namespace of the element

localName

The local part of the qualified name of the element

name

The element name

Throws: 

SAXException

inherited from interface, not thrown.

setIDAttribute(String, Element)

public void setIDAttribute(java.lang.String id,
                           org.w3c.dom.Element elem);

Set an ID string to node association in the ID table.

Parameters: 

id

The ID string.

elem

The associated ID.

characters(char[], int, int)

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: 

ch

The characters from the XML document.

start

The start position in the array.

length

The number of characters to read from the array.

Throws: 

SAXException

inherited from interface, not thrown.

charactersRaw(char[], int, int)

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: 

ch

Array containing the characters

start

Index to start of characters in the array

length

Number of characters in the array

Throws: 

SAXException

inherited from interface, not thrown.

startEntity(String)

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: 

name

The name of the entity. If it is a parameter entity, the name will begin with '%'.

Throws: 

SAXException

inherited from interface, not thrown.

endEntity(String)

public void endEntity(java.lang.String name)
    throws org.xml.sax.SAXException;

Report the end of an entity.

Parameters: 

name

The name of the entity that is ending.

Throws: 

SAXException

inherited from interface, not thrown.

entityReference(String)

public void entityReference(java.lang.String name)
    throws org.xml.sax.SAXException;

Receive notivication of a entityReference.

Parameters: 

name

name of the entity reference

Throws: 

SAXException

inherited from interface, not thrown.

ignorableWhitespace(char[], int, int)

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: 

ch

The characters from the XML document.

start

The start position in the array.

length

The number of characters to read from the array.

Throws: 

SAXException

inherited from interface, not thrown.

processingInstruction(String, String)

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: 

target

The processing instruction target.

data

The processing instruction data, or null if none was supplied.

Throws: 

SAXException

inherited from interface, not thrown.

comment(char[], int, int)

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: 

ch

An array holding the characters in the comment.

start

The starting position in the array.

length

The number of characters to use from the array.

Throws: 

SAXException

inherited from interface, not thrown.

startCDATA()

public void startCDATA()
    throws org.xml.sax.SAXException;

Report the start of a CDATA section.

endCDATA()

public void endCDATA()
    throws org.xml.sax.SAXException;

Report the end of a CDATA section.

cdata(char[], int, int)

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: 

ch

The characters from the XML document.

start

The start position in the array.

length

The number of characters to read from the array.

Throws: 

SAXException

inherited from interface, not thrown.

startDTD(String, String, String)

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: 

name

The document type name.

publicId

The declared public identifier for the external DTD subset, or null if none was declared.

systemId

The declared system identifier for the external DTD subset, or null if none was declared.

Throws: 

SAXException

inherited from interface, not thrown.

endDTD()

public void endDTD()
    throws org.xml.sax.SAXException;

Report the end of DTD declarations.

startPrefixMapping(String, String)

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: 

prefix

The Namespace prefix being declared.

uri

The Namespace URI the prefix is mapped to.

Throws: 

SAXException

inherited from interface, not thrown.

endPrefixMapping(String)

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: 

prefix

The prefix that was being mapping.

Throws: 

SAXException

inherited from interface, not thrown.

skippedEntity(String)

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: 

name

The name of the skipped entity. If it is a parameter entity, the name will begin with '%'.

Throws: 

SAXException

inherited from interface, not thrown.

isWhiteSpace(char)

public static boolean isWhiteSpace(char ch);

Returns whether the specified ch conforms to the XML 1.0 definition of whitespace.

Parameters: 

ch

Character to check as XML whitespace.

Returns: true if ch is XML whitespace; otherwise false.

isWhiteSpace(char[], int, int)

public static boolean isWhiteSpace(char[] ch,
                                   int start,
                                   int length);

Tell if the string is whitespace.

Parameters: 

ch

Character array to check as XML whitespace.

start

Start index of characters in the array

length

Number of characters in the array

Returns: True if the characters in the array are XML whitespace; otherwise, false.

D.2.8. Class de.mnl.aacxforms.­Page­Context

Syntax

public class PageContext

java.lang.Object | +--de.mnl.aacxforms.PageContext

Description

This class provides ...

D.2.8.1. Constructors

PageContext(Request, Logger)

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: 

request

the current request.

aLogger

a logger.

D.2.8.2. Methods

id()

public java.lang.String id();

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.

lookup(Session, String)

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: 

session

the session.

id

the id.

Returns: the PageContext

Throws: 

IllegalArgumentException

if no such PageContext exists.

requestURI()

public java.lang.String requestURI();

Return the request URI of the request passed to the constructor.

Returns: the content base.

setPageContent(Document)

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.­Setup­Transformer”) without the models.

Parameters: 

pageContent

the content as Document.

pageContent()

public org.w3c.dom.Document pageContent();

Return the page content.

Returns: the page content.

refId(Object)

public java.lang.String refId(java.lang.Object obj);

Associate an object with a unique id that can be used for requests.

Parameters: 

obj

the object.

Returns: the id.

refId(Object, boolean)

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: 

obj

the object.

persist

if true, the association will not be removed by clearRefIds (see Section D.2.8.2, “clearRefIds()”).

Returns: the id.

resolve(String)

public java.lang.Object resolve(java.lang.String id);

Return the object associated with the given id.

Parameters: 

id

the id.

Returns: the object.

clearRefIds()

public void clearRefIds();

Clear the saved id to object mapping.

getLogger()

public org.apache.log.Logger getLogger();

Get the value of logger.

Returns: value of logger.

setLogger(Logger)

public void setLogger(org.apache.log.Logger newLogger);

Set the value of logger.

Parameters: 

newLogger

value to assign to logger.

D.2.9. Class de.mnl.aacxforms.­S­A­X­Normalizer

Syntax

public class SAXNormalizer

java.lang.Object | +--de.mnl.aacxforms.SAXNormalizer

Description

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.

D.2.9.1. Constructors

SAXNormalizer(ContentHandler, LexicalHandler)

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: 

chndlr

the content handler we forward to.

lhndlr

the lexical handler we forward to.

SAXNormalizer(XMLConsumer)

public SAXNormalizer(org.apache.cocoon.xml.XMLConsumer hndlr);

Creates an instance of SAXNormalizer with all attributes initialized to default values or given.

Parameters: 

hndlr

the handler for both content and lexical events.

D.2.9.2. Methods

setDocumentLocator(Locator)

public void setDocumentLocator(org.xml.sax.Locator locator);

Receive an object for locating the origin of SAX document events.

Parameters: 

locator

An object that can return the location of any SAX document event.

startDocument()

public void startDocument()
    throws org.xml.sax.SAXException;

Receive notification of the beginning of a document.

Throws: 

SAXException

only if thrown by super class.

endDocument()

public void endDocument()
    throws org.xml.sax.SAXException;

Receive notification of the end of a document.

Throws: 

SAXException

not thrown.

startPrefixMapping(String, String)

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
    throws org.xml.sax.SAXException;

Start prefix mapping.

Parameters: 

prefix

the prefix.

uri

the uri.

Throws: 

SAXException

if an error occurs.

endPrefixMapping(String)

public void endPrefixMapping(java.lang.String prefix)
    throws org.xml.sax.SAXException;

End prefix mapping.

Parameters: 

prefix

the prefix.

Throws: 

SAXException

if an error occurs.

startElement(String, String, String, Attributes)

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: 

uri

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

loc

The local name (without prefix), or the empty string if Namespace processing is not being performed.

raw

The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.

a

The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.

Throws: 

SAXException

only if thrown by super class.

endElement(String, String, String)

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: 

uri

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

loc

The local name (without prefix), or the empty string if Namespace processing is not being performed.

raw

The raw XML 1.0 name (with prefix), or the empty string if raw names are not available.

Throws: 

SAXException

not thrown.

characters(char[], int, int)

public void characters(char[] c,
                       int start,
                       int len)
    throws org.xml.sax.SAXException;

Receive notification of character data.

Parameters: 

c

The characters from the XML document.

start

The start position in the array.

len

The number of characters to read from the array.

Throws: 

SAXException

not thrown.

ignorableWhitespace(char[], int, int)

public void ignorableWhitespace(char[] c,
                                int start,
                                int len)
    throws org.xml.sax.SAXException;

Receive notification of ignorable whitespace in element content.

Parameters: 

c

The characters from the XML document.

start

The start position in the array.

len

The number of characters to read from the array.

Throws: 

SAXException

not thrown.

processingInstruction(String, String)

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
    throws org.xml.sax.SAXException;

Receive notification of a processing instruction.

Parameters: 

target

The processing instruction target.

data

The processing instruction data, or null if none was supplied.

Throws: 

SAXException

not thrown.

skippedEntity(String)

public void skippedEntity(java.lang.String name)
    throws org.xml.sax.SAXException;

Receive notification of a skipped entity.

Parameters: 

name

The name of the skipped entity. If it is a parameter entity, the name will begin with '%'.

Throws: 

SAXException

not thrown.

startDTD(String, String, String)

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: 

name

The document type name.

publicId

The declared public identifier for the external DTD subset, or null if none was declared.

systemId

The declared system identifier for the external DTD subset, or null if none was declared.

Throws: 

SAXException

not thrown.

endDTD()

public void endDTD()
    throws org.xml.sax.SAXException;

Report the end of DTD declarations.

Throws: 

SAXException

not thrown.

startEntity(String)

public void startEntity(java.lang.String name)
    throws org.xml.sax.SAXException;

Report the beginning of an entity.

Parameters: 

name

The name of the entity. If it is a parameter entity, the name will begin with '%'.

Throws: 

SAXException

not thrown.

endEntity(String)

public void endEntity(java.lang.String name)
    throws org.xml.sax.SAXException;

Report the end of an entity.

Parameters: 

name

The name of the entity that is ending.

Throws: 

SAXException

not thrown.

startCDATA()

public void startCDATA()
    throws org.xml.sax.SAXException;

Report the start of a CDATA section.

Throws: 

SAXException

not thrown.

endCDATA()

public void endCDATA()
    throws org.xml.sax.SAXException;

Report the end of a CDATA section.

Throws: 

SAXException

not thrown.

comment(char[], int, int)

public void comment(char[] ch,
                    int start,
                    int len)
    throws org.xml.sax.SAXException;

Report an XML comment anywhere in the document.

Parameters: 

ch

An array holding the characters in the comment.

start

The starting position in the array.

len

The number of characters to use from the array.

Throws: 

SAXException

not thrown.

D.2.10. Class de.mnl.aacxforms.­Submission­Reader

Syntax

public class SubmissionReader

java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.reading.AbstractReader | +--de.mnl.aacxforms.SubmissionReader

Description

This class provides ...

D.2.10.1. Constructors

SubmissionReader()

public SubmissionReader();

Creates an instance of SubmissionReader with all attributes initialized to default values.

D.2.10.2. Methods

setup(SourceResolver, Map, String, Parameters)

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: 

resolver

The current SourceResolver

objectModel

The objectModel of the environment.

src

The value of the src attribute in the sitemap.

par

The parameters from the sitemap.

Throws: 

ProcessingException

if an error occurs.

SAXException

if an error occurs.

IOException

if an error occurs.

recycle()

public void recycle();

Recycle the generator by removing references.

generate()

public void generate()
    throws java.io.IOException, org.apache.cocoon.ProcessingException;

Generates the requested resource.

Throws: 

IOException

if an error occurs.

ProcessingException

if an error occurs.

getMimeType()

public java.lang.String getMimeType();

Returns the mime-type of the resource in process.

Returns: the mime type or null.

D.2.11. Class de.mnl.aacxforms.­Util

Syntax

public class Util

java.lang.Object | +--de.mnl.xformsproc.Util | +--de.mnl.aacxforms.Util

Description

This class provides some utility methods.

D.2.11.1. Constructors

Util()

public Util();

D.2.11.2. Methods

namedElements()

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.

logDOMTree(Logger, String, Node)

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: 

logger

the logger.

title

a title line for the output.

root

tree's root.

Appendix E. GNU General Public License

Version 2, June 1991

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.

E.1. Preamble

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:

  1. copyright the software, and

  2. 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.

E.2. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

E.2.1. Section 0

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.

E.2.2. Section 1

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.

E.2.3. Section 2

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:

  1. You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.

  2. 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.

  3. 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.

    Exception:

    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.

E.2.4. Section 3

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:

  1. 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,

  2. 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,

  3. 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.

E.2.5. Section 4

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.

E.2.6. Section 5

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.

E.2.7. Section 6

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.

E.2.8. Section 7

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.

E.2.9. Section 8

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.

E.2.10. Section 9

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.

E.2.11. Section 10

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.

E.2.12. NO WARRANTY

Section 11

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.

E.2.13. Section 12

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.

Appendix F. Notes

  • This product includes software developed by the Apache Software Foundation (http://www.apache.org/).