SchemaFormBuilder
+ * encounters an error building a form.
+ *
+ * @author Brian Dueck
+ */
+public class FormBuilderException
+ extends Exception
+{
+
+ /**
+ * Creates a new instance of FormBuilderException
without detail message.
+ */
+ public FormBuilderException() { }
+
+ /**
+ * Constructs an instance of FormBuilderException
with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public FormBuilderException(String msg)
+ {
+ super(msg);
+ }
+
+ /**
+ * Constructs an instance of FormBuilderException
with the specified root exception.
+ *
+ * @param x The root exception.
+ */
+ public FormBuilderException(Exception x)
+ {
+ super(x);
+ }
+}
diff --git a/source/java/org/alfresco/web/templating/xforms/schemabuilder/AbstractSchemaFormBuilder.java b/source/java/org/alfresco/web/templating/xforms/SchemaFormBuilder.java
similarity index 73%
rename from source/java/org/alfresco/web/templating/xforms/schemabuilder/AbstractSchemaFormBuilder.java
rename to source/java/org/alfresco/web/templating/xforms/SchemaFormBuilder.java
index 793f75974c..6c2b46c0e2 100644
--- a/source/java/org/alfresco/web/templating/xforms/schemabuilder/AbstractSchemaFormBuilder.java
+++ b/source/java/org/alfresco/web/templating/xforms/SchemaFormBuilder.java
@@ -14,37 +14,28 @@
* language governing permissions and limitations under the
* License.
*/
-package org.alfresco.web.templating.xforms.schemabuilder;
+package org.alfresco.web.templating.xforms;
-import org.apache.commons.jxpath.JXPathContext;
-import org.apache.commons.jxpath.Pointer;
-import org.apache.xerces.xs.*;
-import org.chiba.xml.util.DOMUtil;
-import org.chiba.xml.xforms.NamespaceCtx;
-import org.w3c.dom.*;
-import org.w3c.dom.ls.*;
-import org.w3c.dom.bootstrap.DOMImplementationRegistry;
-import org.xml.sax.InputSource;
-import org.alfresco.web.templating.*;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.*;
import java.io.File;
import java.io.IOException;
import java.io.StringWriter;
import java.util.*;
-
-/*
- * Search for TODO for things remaining to-do in this implementation.
- *
- * TODO: Support configuration mechanism to allow properties to be set without programming.
- * TODO: i18n/l10n of messages, hints, captions. Possibly leverage org.chiba.i18n classes.
- * TODO: When Chiba supports itemset, use schema keyref and key constraints for validation.
- * TODO: Support namespaces in instance documents. Currently can't do this due to Chiba bugs.
- * TODO: Place default values for list and enumeration types at the beginning of the item list.
- *
- */
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.*;
+import org.alfresco.web.templating.*;
+import org.apache.commons.jxpath.JXPathContext;
+import org.apache.commons.jxpath.Pointer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.xerces.xs.*;
+import org.chiba.xml.util.DOMUtil;
+import org.chiba.xml.xforms.NamespaceCtx;
+import org.w3c.dom.*;
+import org.w3c.dom.bootstrap.DOMImplementationRegistry;
+import org.w3c.dom.ls.*;
+import org.xml.sax.InputSource;
/**
* An abstract implementation of the SchemaFormBuilder interface allowing
@@ -54,10 +45,9 @@ import java.util.*;
* required interface methods (createXXX, startXXX, and endXXX methods).
*
* @author $Author: unl $
- * @version $Id: AbstractSchemaFormBuilder.java,v 1.25 2005/03/29 14:12:06 unl Exp $
*/
-public abstract class AbstractSchemaFormBuilder
- implements SchemaFormBuilder {
+public class SchemaFormBuilder
+{
////////////////////////////////////////////////////////////////////////////
@@ -95,6 +85,160 @@ public abstract class AbstractSchemaFormBuilder
}
};
+ ////////////////////////////////////////////////////////////////////////////
+
+ public static class Occurs
+ {
+ public final static int UNBOUNDED = -1;
+
+ public final int minimum;
+ public final int maximum;
+
+ public Occurs(final XSParticle particle)
+ {
+ if (particle == null)
+ {
+ this.minimum = 1;
+ this.maximum = 1;
+ }
+ else
+ {
+ this.minimum = particle.getMinOccurs();
+ this.maximum = (particle.getMaxOccursUnbounded()
+ ? Occurs.UNBOUNDED
+ : particle.getMaxOccurs());
+ }
+ }
+
+ public Occurs(final int minimum)
+ {
+ this(minimum, UNBOUNDED);
+ }
+
+ public Occurs(final int minimum, final int maximum)
+ {
+ this.minimum = minimum;
+ this.maximum = maximum;
+ }
+
+ public boolean isUnbounded()
+ {
+ return this.maximum == UNBOUNDED;
+ }
+
+ public String toString()
+ {
+ return "minimum=" + minimum + ", maximum=" + maximum;
+ }
+ }
+
+ ////////////////////////////////////////////////////////////////////////////
+
+ public final static Log LOGGER =
+ LogFactory.getLog(SchemaFormBuilder.class);
+
+ /**
+ * XMLSchema Namespace declaration
+ */
+ public static final String XMLSCHEMA_NS =
+ "http://www.w3.org/2001/XMLSchema";
+
+ /**
+ * XMLSchema prefix
+ */
+ public static final String XMLSCHEMA_NS_PREFIX = "xs:";
+
+ /**
+ * XMLSchema Instance Namespace declaration
+ */
+ public static final String XMLSCHEMA_INSTANCE_NS =
+ "http://www.w3.org/2001/XMLSchema-instance";
+
+ /**
+ * XMLSchema instance prefix
+ */
+ public static final String XMLSCHEMA_INSTANCE_NS_PREFIX = "xsi:";
+
+ /**
+ * XMLNS Namespace declaration.
+ */
+ public static final String XMLNS_NAMESPACE_URI =
+ "http://www.w3.org/2000/xmlns/";
+
+ /**
+ * XML Namespace declaration
+ */
+ public static final String XML_NAMESPACE_URI =
+ "http://www.w3.org/XML/1998/namespace";
+
+ /**
+ * XForms namespace declaration.
+ */
+ public static final String XFORMS_NS =
+ "http://www.w3.org/2002/xforms";
+
+ /**
+ * XForms prefix
+ */
+ public static final String XFORMS_NS_PREFIX = "xforms:";
+
+ /**
+ * Chiba namespace declaration.
+ */
+ public static final String CHIBA_NS =
+ "http://chiba.sourceforge.net/xforms";
+
+ /**
+ * Chiba prefix
+ */
+ public static final String CHIBA_NS_PREFIX = "chiba:";
+
+ /**
+ * XLink namespace declaration.
+ */
+ public static final String XLINK_NS = "http://www.w3.org/1999/xlink";
+
+ /**
+ * Xlink prefix
+ */
+ public static final String XLINK_NS_PREFIX = "xlink:";
+
+ /**
+ * XML Events namsepace declaration.
+ */
+ public static final String XMLEVENTS_NS = "http://www.w3.org/2001/xml-events";
+
+ /**
+ * XML Events prefix
+ */
+ public static final String XMLEVENTS_NS_PREFIX = "ev:";
+
+ /**
+ * Prossible values of the "@method" on the "submission" element
+ */
+ public static final String SUBMIT_METHOD_POST = "post";
+
+ /**
+ * __UNDOCUMENTED__
+ */
+ public static final String SUBMIT_METHOD_PUT = "put";
+
+ /**
+ * __UNDOCUMENTED__
+ */
+ public static final String SUBMIT_METHOD_GET = "get";
+
+ /**
+ * __UNDOCUMENTED__
+ */
+ public static final String SUBMIT_METHOD_FORM_DATA_POST = "form-data-post";
+
+ /**
+ * __UNDOCUMENTED__
+ */
+ public static final String SUBMIT_METHOD_URLENCODED_POST =
+ "urlencoded-post";
+
private static final String PROPERTY_PREFIX =
"http://www.chiba.org/properties/schemaFormBuilder/";
/**
@@ -161,30 +305,10 @@ public abstract class AbstractSchemaFormBuilder
"compact";
private static final String DEFAULT_LONG_LIST_MAX_SIZE = "6";
- /**
- * __UNDOCUMENTED__
- */
- protected Document _instanceDocument;
-
- /**
- * __UNDOCUMENTED__
- */
- protected String _action;
-
- /**
- * __UNDOCUMENTED__
- */
- protected String _submitMethod;
-
- /**
- * __UNDOCUMENTED__
- */
- protected String _base;
-
- /**
- * __UNDOCUMENTED__
- */
- protected WrapperElementsBuilder _wrapper = new XHTMLWrapperElementsBuilder();
+ private final String action;
+ private final String submitMethod;
+ private final String base;
+ protected WrapperElementsBuilder wrapper = new XHTMLWrapperElementsBuilder();
/**
* generic counter -> replaced by an hashMap with:
@@ -194,7 +318,6 @@ public abstract class AbstractSchemaFormBuilder
private HashMap counter;
private final Properties properties = new Properties();
private String targetNamespace;
-
private final Map namespacePrefixes = new HashMap();
// typeTree
@@ -209,7 +332,7 @@ public abstract class AbstractSchemaFormBuilder
new TreeMapSchemaFormBuilder
encounters an
- * error building a form.
- *
- * @author Brian Dueck
- * @version $Id: FormBuilderException.java,v 1.4 2005/01/31 22:49:31 joernt Exp $
- */
-public class FormBuilderException extends java.lang.Exception {
- private Exception cause = null;
-
- /**
- * Creates a new instance of FormBuilderException
without detail message.
- */
- public FormBuilderException() {
- }
-
- /**
- * Constructs an instance of FormBuilderException
with the specified detail message.
- *
- * @param msg the detail message.
- */
- public FormBuilderException(String msg) {
- super(msg);
- }
-
- /**
- * Constructs an instance of FormBuilderException
with the specified root exception.
- *
- * @param x The root exception.
- */
- public FormBuilderException(Exception x) {
- //THIS DOES NOT WORK WITH JDK 1.3 CAUSE THIS IS NEW IN JDK 1.4
- //super(x);
- super(x.getMessage());
- }
-}
-
-
-/*
- $Log: FormBuilderException.java,v $
- Revision 1.4 2005/01/31 22:49:31 joernt
- added copyright notice
-
- Revision 1.3 2004/08/15 14:14:07 joernt
- preparing release...
- -reformatted sources to fix mixture of tabs and spaces
- -optimized imports on all files
-
- Revision 1.2 2003/10/02 15:15:49 joernt
- applied chiba jalopy settings to whole src tree
-
- Revision 1.1 2003/07/12 12:22:48 joernt
- package refactoring: moved from xforms.builder
- Revision 1.1.1.1 2003/05/23 14:54:08 unl
- no message
- Revision 1.2 2003/02/19 09:09:15 soframel
- print the exception's message
- Revision 1.1 2002/12/11 14:50:42 soframel
- transferred the Schema2XForms generator from chiba2 to chiba1
- Revision 1.3 2002/06/11 17:13:03 joernt
- commented out jdk 1.3 incompatible constructor-impl
- Revision 1.2 2002/06/11 14:06:31 joernt
- commented out the jdk 1.4 constructor
- Revision 1.1 2002/05/22 22:24:34 joernt
- Brian's initial version of schema2xforms builder
- */
diff --git a/source/java/org/alfresco/web/templating/xforms/schemabuilder/SchemaFormBuilder.java b/source/java/org/alfresco/web/templating/xforms/schemabuilder/SchemaFormBuilder.java
deleted file mode 100644
index b9860f2d56..0000000000
--- a/source/java/org/alfresco/web/templating/xforms/schemabuilder/SchemaFormBuilder.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*
- * Copyright (C) 2005 Alfresco, Inc.
- *
- * Licensed under the Mozilla Public License version 1.1
- * with a permitted attribution clause. You may obtain a
- * copy of the License at
- *
- * http://www.alfresco.org/legal/license.txt
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the specific
- * language governing permissions and limitations under the
- * License.
- */
-package org.alfresco.web.templating.xforms.schemabuilder;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.xerces.xs.*;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import javax.xml.transform.Source;
-import java.util.Properties;
-
-import org.alfresco.web.templating.*;
-
-/**
- * An object that implements this interface can build an XForm that conforms to
- * the elements and attributes declared in an XML Schema.
- *
- * @author Brian Dueck
- * @version $Id: SchemaFormBuilder.java,v 1.16 2005/02/10 13:24:57 joernt Exp $
- */
-public interface SchemaFormBuilder
-{
-
- ////////////////////////////////////////////////////////////////////////////
-
- public static class Occurs
- {
- public final static int UNBOUNDED = -1;
-
- public final int minimum;
- public final int maximum;
-
- public Occurs(final XSParticle particle)
- {
- if (particle == null)
- {
- this.minimum = 1;
- this.maximum = 1;
- }
- else
- {
- this.minimum = particle.getMinOccurs();
- this.maximum = (particle.getMaxOccursUnbounded()
- ? Occurs.UNBOUNDED
- : particle.getMaxOccurs());
- }
- }
-
- public Occurs(final int minimum)
- {
- this(minimum, UNBOUNDED);
- }
-
- public Occurs(final int minimum, final int maximum)
- {
- this.minimum = minimum;
- this.maximum = maximum;
- }
-
- public boolean isUnbounded()
- {
- return this.maximum == UNBOUNDED;
- }
-
- public String toString()
- {
- return "minimum=" + minimum + ", maximum=" + maximum;
- }
- }
-
- ////////////////////////////////////////////////////////////////////////////
-
- public final static Log LOGGER =
- LogFactory.getLog(SchemaFormBuilder.class);
-
- /**
- * XMLSchema Instance Namespace declaration
- */
- public static final String XMLSCHEMA_INSTANCE_NS =
- "http://www.w3.org/2001/XMLSchema-instance";
-
- /**
- * XMLSchema instance prefix
- */
- public static final String XMLSCHEMA_INSTANCE_NS_PREFIX = "xsi:";
-
- /**
- * XMLNS Namespace declaration.
- */
- public static final String XMLNS_NAMESPACE_URI =
- "http://www.w3.org/2000/xmlns/";
-
- /**
- * XML Namespace declaration
- */
- public static final String XML_NAMESPACE_URI =
- "http://www.w3.org/XML/1998/namespace";
-
- /**
- * XForms namespace declaration.
- */
- public static final String XFORMS_NS =
- "http://www.w3.org/2002/xforms";
-
- /**
- * XForms prefix
- */
- public static final String XFORMS_NS_PREFIX = "xforms:";
-
- /**
- * Chiba namespace declaration.
- */
- public static final String CHIBA_NS =
- "http://chiba.sourceforge.net/xforms";
-
- /**
- * Chiba prefix
- */
- public static final String CHIBA_NS_PREFIX = "chiba:";
-
- /**
- * XLink namespace declaration.
- */
- public static final String XLINK_NS = "http://www.w3.org/1999/xlink";
-
- /**
- * Xlink prefix
- */
- public static final String XLINK_NS_PREFIX = "xlink:";
-
- /**
- * XML Events namsepace declaration.
- */
- public static final String XMLEVENTS_NS = "http://www.w3.org/2001/xml-events";
-
- /**
- * XML Events prefix
- */
- public static final String XMLEVENTS_NS_PREFIX = "ev:";
-
- /**
- * Prossible values of the "@method" on the "submission" element
- */
- public static final String SUBMIT_METHOD_POST = "post";
-
- /**
- * __UNDOCUMENTED__
- */
- public static final String SUBMIT_METHOD_PUT = "put";
-
- /**
- * __UNDOCUMENTED__
- */
- public static final String SUBMIT_METHOD_GET = "get";
-
- /**
- * __UNDOCUMENTED__
- */
- public static final String SUBMIT_METHOD_FORM_DATA_POST = "form-data-post";
-
- /**
- * __UNDOCUMENTED__
- */
- public static final String SUBMIT_METHOD_URLENCODED_POST =
- "urlencoded-post";
-
- /**
- * Get the current set of properties used by implementations of SchemaFormBuilder.
- *
- * @return The list of properties.
- */
- public Properties getProperties();
-
- /**
- * Sets the property to the specified value. If the property exists, its value is overwritten.
- *
- * @param key The implementation defined property key.
- * @param value The value for the property.
- */
- public void setProperty(String key, String value);
-
- /**
- * Gets the value for the specified property.
- *
- * @param key The implementation defined property key.
- * @return The property value if found, or null if the property cannot be located.
- */
- public String getProperty(String key);
-
- /**
- * Gets the value for the specified property, with a default if the property cannot be located.
- *
- * @param key The implementation defined property key.
- * @param defaultValue This value will be returned if the property does not exists.
- * @return The property value if found, or defaultValue if the property cannot be located.
- */
- public String getProperty(String key, String defaultValue);
-
-
- /**
- * Generate the XForm based on a user supplied XML Schema.
- *
- * @param inputURI The document source for the XML Schema.
- * @return The Document containing the XForm.
- * @throws org.chiba.tools.schemabuilder.FormBuilderException
- * If an error occurs building the XForm.
- */
- public Document buildForm(final TemplateType tt)
- throws FormBuilderException;
-
- /**
- * Creates a caption for the provided text extracted from the XML Schema.
- * The implementation is responsible for reformatting the provided string to make it
- * suitable to be displayed to users of the XForm. This typically includes translating
- * XML tag name style identifiers (e.g. customerStreetAddress) into more reader friendly
- * captions (e.g. Customer Street Address).
- *
- * @param text The string value to be reformatted for use as a caption.
- * @return The caption.
- */
- public String createCaption(String text);
-
- /**
- * Creates a caption for the provided XML Schema attribute.
- * The implementation is responsible for providing an appropriate caption
- * suitable to be displayed to users of the XForm. This typically includes translating
- * XML tag name style identifiers (e.g. customerStreetAddress) into more reader friendly
- * captions (e.g. Customer Street Address).
- *
- * @param attribute The XML schema attribute for which a caption is required.
- * @return The caption.
- */
- public String createCaption(XSAttributeDeclaration attribute);
-
- /**
- * Creates a caption for the provided XML Schema element.
- * The implementation is responsible for providing an appropriate caption
- * suitable to be displayed to users of the XForm. This typically includes translating
- * XML tag name style identifiers (e.g. customerStreetAddress) into more reader friendly
- * captions (e.g. Customer Street Address).
- *
- * @param element The XML schema element for which a caption is required.
- * @return The caption.
- */
- public String createCaption(XSElementDeclaration element);
-
- /**
- * Creates a form control for an XML Schema any type.
- *
- * This method is called when the form builder determines a form control is required for
- * an any type.
- * The implementation of this method is responsible for creating an XML element of the
- * appropriate type to receive a value for controlType. The caller is responsible
- * for adding the returned element to the form and setting caption, bind, and other
- * standard elements and attributes.
- *
- * @param xForm The XForm document.
- * @param controlType The XML Schema type for which the form control is to be created.
- * @return The element for the form control.
- */
- public Element createControlForAnyType(Document xForm,
- String caption,
- XSTypeDefinition controlType);
-
- /**
- * Creates a form control for an XML Schema simple atomic type.
- *
- * This method is called when the form builder determines a form control is required for
- * an atomic type.
- * The implementation of this method is responsible for creating an XML element of the
- * appropriate type to receive a value for controlType. The caller is responsible
- * for adding the returned element to the form and setting caption, bind, and other
- * standard elements and attributes.
- *
- * @param xForm The XForm document.
- * @param controlType The XML Schema type for which the form control is to be created.
- * @return The element for the form control.
- */
- public Element createControlForAtomicType(Document xForm,
- String caption,
- XSSimpleTypeDefinition controlType);
-
- /**
- * Creates a form control for an XML Schema simple type restricted by an enumeration.
- * This method is called when the form builder determines a form control is required for
- * an enumerated type.
- * The implementation of this method is responsible for creating an XML element of the
- * appropriate type to receive a value for controlType. The caller is responsible
- * for adding the returned element to the form and setting caption, bind, and other
- * standard elements and attributes.
- *
- * @param xForm The XForm document.
- * @param controlType The XML Schema type for which the form control is to be created.
- * @param caption The caption for the form control. The caller The purpose of providing the caption
- * is to permit the implementation to add a [Select1 .... ] message that involves the caption.
- * @param bindElement The bind element for this control. The purpose of providing the bind element
- * is to permit the implementation to add a isValid attribute to the bind element that prevents
- * the [Select1 .... ] item from being selected.
- * @return The element for the form control.
- */
- public Element createControlForEnumerationType(Document xForm,
- XSSimpleTypeDefinition controlType,
- String caption,
- Element bindElement);
-
- /**
- * Creates a form control for an XML Schema simple list type.
- *
- * This method is called when the form builder determines a form control is required for
- * a list type.
- * The implementation of this method is responsible for creating an XML element of the
- * appropriate type to receive a value for controlType. The caller is responsible
- * for adding the returned element to the form and setting caption, bind, and other
- * standard elements and attributes.
- *
- * @param xForm The XForm document.
- * @param listType The XML Schema list type for which the form control is to be created.
- * @param caption The caption for the form control. The caller The purpose of providing the caption
- * is to permit the implementation to add a [Select1 .... ] message that involves the caption.
- * @param bindElement The bind element for this control. The purpose of providing the bind element
- * is to permit the implementation to add a isValid attribute to the bind element that prevents
- * the [Select1 .... ] item from being selected.
- * @return The element for the form control.
- */
- public Element createControlForListType(Document xForm,
- XSSimpleTypeDefinition listType,
- String caption,
- Element bindElement);
-
- /**
- * Creates a hint XML Schema annotated node (AttributeDecl or ElementDecl).
- * The implementation is responsible for providing an xforms:hint element for the
- * specified schemaNode suitable to be dsipalayed to users of the XForm. The caller
- * is responsible for adding the returned element to the form.
- * This typically includes extracting documentation from the element/attribute's
- * annotation/documentation elements and/or extracting the same information from the
- * element/attribute's type annotation/documentation.
- *
- * @param schemaNode The string value to be reformatted for use as a caption.
- * @return The xforms:hint element. If a null value is returned a hint is not added.
- */
- public Element createHint(Document xForm, XSObject schemaNode);
-
- /**
- * This method is invoked after the form builder is finished creating and processing
- * a bind element. Implementations may choose to use this method to add/inspect/modify
- * the bindElement prior to the builder moving onto the next bind element.
- *
- * @param bindElement The bind element being processed.
- */
- public void endBindElement(Element bindElement);
-
- /**
- * This method is invoked after the form builder is finished creating and processing
- * a form control. Implementations may choose to use this method to add/inspect/modify
- * the controlElement prior to the builder moving onto the next control.
- *
- * @param controlElement The form control element that was created.
- * @param controlType The XML Schema type for which controlElement was created.
- */
- public void endFormControl(Element controlElement,
- XSTypeDefinition controlType,
- Occurs occurs);
- /**
- * __UNDOCUMENTED__
- *
- * @param groupElement __UNDOCUMENTED__
- */
- public void endFormGroup(Element groupElement,
- XSTypeDefinition controlType,
- Occurs occurs,
- Element modelSection);
-
- /**
- * Reset the SchemaFormBuilder to default values.
- */
- public void reset();
-
- /**
- * This method is invoked after an xforms:bind element is created for the specified SimpleType.
- * The implementation is responsible for setting setting any/all bind attributes
- * except for id and ref - these have been automatically set
- * by the caller (and should not be touched by implementation of startBindElement)
- * prior to invoking startBindElement.
- * The caller automatically adds the returned element to the model section of
- * the form.
- *
- * @param bindElement The bindElement being processed.
- * @param controlType XML Schema type of the element/attribute this bind is for.
- * @param minOccurs The minimum number of occurences for this element/attribute.
- * @param maxOccurs The maximum number of occurences for this element/attribute.
- * @return The bind Element to use in the XForm - bindElement or a replacement.
- */
- public Element startBindElement(Element bindElement,
- XSModel schema,
- XSTypeDefinition controlType,
- Occurs occurs);
-
- /**
- * This method is invoked after the form builder creates a form control
- * via a createControlForXXX() method but prior to decorating the form control
- * with common attributes such as a caption, hint, help text elements,
- * bind attributes, etc.
- * The returned element is used in the XForm in place of controlElement.
- * Implementations may choose to use this method to substitute controlElement
- * with a different element, or perform any other processing on controlElement
- * prior to it being added to the form.
- *
- * @param controlElement The form control element that was created.
- * @param controlType The XML Schema type for which controlElement was created.
- * @return The Element to use in the XForm - controlElement or a replacement.
- */
- public Element startFormControl(Element controlElement,
- XSTypeDefinition controlType);
-
- /**
- * This method is invoked after an xforms:group element is created for the specified
- * ElementDecl. A group is created whenever an element is encountered in the XML Schema
- * that contains other elements and attributes (complex types or mixed content types).
- * The caller automatically adds the returned element to the XForm.
- *
- * @param groupElement The groupElement being processed.
- * @param schemaElement The schemaElement for the group.
- * @return The group Element to use in the XForm - groupElement or a replacement. If a null
- * value is returned, the group is not created.
- */
- public Element startFormGroup(Element groupElement,
- XSElementDeclaration schemaElement);
-}
diff --git a/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/CompanyFooterBean.java b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/CompanyFooterBean.java
new file mode 100644
index 0000000000..e12e102d11
--- /dev/null
+++ b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/CompanyFooterBean.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2005 Alfresco, Inc.
+ *
+ * Licensed under the Mozilla Public License version 1.1
+ * with a permitted attribution clause. You may obtain a
+ * copy of the License at
+ *
+ * http://www.alfresco.org/legal/license.txt
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the
+ * License.
+ */
+package org.alfresco.web.pr;
+
+public class CompanyFooterBean
+{
+ private final String name;
+ private final String href;
+
+ public CompanyFooterBean(final String name,
+ final String href)
+ {
+ this.name = name;
+ this.href = href;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+
+ public String getHref()
+ {
+ return this.href;
+ }
+}
\ No newline at end of file
diff --git a/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/PressReleaseBean.java b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/PressReleaseBean.java
new file mode 100644
index 0000000000..150b51839c
--- /dev/null
+++ b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/PressReleaseBean.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2005 Alfresco, Inc.
+ *
+ * Licensed under the Mozilla Public License version 1.1
+ * with a permitted attribution clause. You may obtain a
+ * copy of the License at
+ *
+ * http://www.alfresco.org/legal/license.txt
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the
+ * License.
+ */
+package org.alfresco.web.pr;
+
+import java.util.Date;
+
+public class PressReleaseBean
+{
+ private final String title;
+ private final String theAbstract;
+ private final Date launchDate;
+ private final String href;
+
+ public PressReleaseBean(final String title,
+ final String theAbstract,
+ final Date launchDate,
+ final String href)
+ {
+ this.title = title;
+ this.theAbstract = theAbstract;
+ this.launchDate = launchDate;
+ this.href = href;
+ }
+
+ public String getTitle()
+ {
+ return this.title;
+ }
+
+ public String getAbstract()
+ {
+ return this.theAbstract;
+ }
+
+ public Date getLaunchDate()
+ {
+ return this.launchDate;
+ }
+
+ public String getHref()
+ {
+ return this.href;
+ }
+}
\ No newline at end of file
diff --git a/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/Util.java b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/Util.java
new file mode 100644
index 0000000000..ec0cdec2da
--- /dev/null
+++ b/source/test-resources/websites/alfresco/ROOT/WEB-INF/classes/org/alfresco/web/pr/Util.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2005 Alfresco, Inc.
+ *
+ * Licensed under the Mozilla Public License version 1.1
+ * with a permitted attribution clause. You may obtain a
+ * copy of the License at
+ *
+ * http://www.alfresco.org/legal/license.txt
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the specific
+ * language governing permissions and limitations under the
+ * License.
+ */
+package org.alfresco.web.pr;
+
+import javax.servlet.*;
+import javax.servlet.http.*;
+import java.io.*;
+import java.util.*;
+import org.alfresco.jndi.*;
+import org.alfresco.repo.avm.AVMRemote;
+import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
+import org.w3c.dom.*;
+import javax.xml.parsers.*;
+import java.text.*;
+
+public class Util
+{
+ public static List<%= DateFormat.getDateInstance(DateFormat.LONG).format(pr.date) %>
<%= pr.theAbstract %>
+<%= DateFormat.getDateInstance(DateFormat.LONG).format(pr.getLaunchDate()) %>
<%= pr.getAbstract() %>
<% } %> diff --git a/source/test-resources/xforms/demos/press-release/company-footer.xsd b/source/test-resources/xforms/demos/press-release/company-footer.xsd index 7601d0b4a8..0be0ab4d9b 100644 --- a/source/test-resources/xforms/demos/press-release/company-footer.xsd +++ b/source/test-resources/xforms/demos/press-release/company-footer.xsd @@ -1,8 +1,10 @@