From 3aadf4e8da048d9b0675999742d54e307b73b8a1 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Tue, 31 May 2016 16:48:09 +0000 Subject: [PATCH] A slightly modified patch from James Yong for "Autocompletion for Compound Widget" https://issues.apache.org/jira/browse/OFBIZ-7061 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. The following xsd are duplicated to use namespaces site-conf.xsd -> site-conf-ns.xsd widget-form.xsd -> widget-form-ns.xsd widget-screen.xsd -> widget-screen-ns.xsd widget-menu.xsd -> widget-menu-ns.xsd simple-methods.xsd-> simple-methods-ns.xsd For example, in site-conf-ns.xsd, we have the following document level attribute instead of 2. The above schema are used into compound-widgets.xsd so that compound widgets use only one consolidated schema. 3. Update ExampleCompoundWidgets.xml to use the new compound-widgets.xsd. For example ...... the rest 4. Change java code to support reading xml with namespace (i.e. xml for compound widgets) jleroux: I simply replaced tabs by spaces in Java files and removed this commented out line in ExampleCompoundWidgets.xml We decided to duplicate the simple-methods.xsd rather than updating all concerned files. Else we would have to update the attributes at document level for rest of the controllers, menus, forms, simple methods and screens. For example, in controller.xml, we would have to change xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd” to xmlns="http://ofbiz.apache.org/sc” xsi:schemaLocation="http://ofbiz.apache.org/dtds/site-conf-ns.xsd”> But especially we would have to use the same syntax with namespaces prefixes than in ExampleCompoundWidgets.xml (see example above). This can be discussed because with auto-completion it's not a big deal, but could be overwhelming for existing custom projects... James mentionned that "the schema location at compound-widgets.xsd is relative to the project...". I don't see any problems with that. We can keep as is as long as we maintain the relation (ie if the main XSDs are moved). Moreover with the previous addition of compound-widgets.xsd in widget-catalog.xml it seems all things work correctly (eg w/o the new *-ns.xsd yet committed, the auto-completion works well in ExampleCompoundWidgets.xml git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1746302 13f79535-47bb-0310-9956-ffa450edef68 --- .../base/src/org/ofbiz/base/util/UtilXml.java | 65 +- framework/minilang/dtd/simple-methods-ns.xsd | 5171 +++++++++++++++++ .../src/org/ofbiz/minilang/SimpleMethod.java | 2 +- .../ofbiz/minilang/method/otherops/Log.java | 3 +- framework/webapp/dtd/site-conf-ns.xsd | 811 +++ framework/widget/dtd/compound-widgets.xsd | 31 +- framework/widget/dtd/widget-form-ns.xsd | 2144 +++++++ framework/widget/dtd/widget-menu-ns.xsd | 266 + framework/widget/dtd/widget-screen-ns.xsd | 659 +++ framework/widget/dtd/widget-tree-ns.xsd | 251 + .../src/org/ofbiz/widget/WidgetFactory.java | 6 +- .../widget/model/AbstractModelAction.java | 21 +- .../src/org/ofbiz/widget/model/FieldInfo.java | 3 +- .../widget/model/ModelFormFieldBuilder.java | 2 +- .../widget/example/ExampleCompoundWidgets.xml | 188 +- 15 files changed, 9505 insertions(+), 118 deletions(-) create mode 100644 framework/minilang/dtd/simple-methods-ns.xsd create mode 100644 framework/webapp/dtd/site-conf-ns.xsd create mode 100644 framework/widget/dtd/widget-form-ns.xsd create mode 100644 framework/widget/dtd/widget-menu-ns.xsd create mode 100644 framework/widget/dtd/widget-screen-ns.xsd create mode 100644 framework/widget/dtd/widget-tree-ns.xsd diff --git a/framework/base/src/org/ofbiz/base/util/UtilXml.java b/framework/base/src/org/ofbiz/base/util/UtilXml.java index 43fb2b0eb9..a53ed68401 100644 --- a/framework/base/src/org/ofbiz/base/util/UtilXml.java +++ b/framework/base/src/org/ofbiz/base/util/UtilXml.java @@ -59,6 +59,7 @@ import org.w3c.dom.DOMConfiguration; import org.w3c.dom.Document; import org.w3c.dom.DocumentFragment; import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.bootstrap.DOMImplementationRegistry; import org.w3c.dom.ls.DOMImplementationLS; @@ -690,10 +691,10 @@ public class UtilXml { if (node != null) { do { + String nodeName = UtilXml.getNodeNameIgnorePrefix(node); if (node.getNodeType() == Node.ELEMENT_NODE && (childElementName == null || - childElementName.equals(node.getNodeName()))) { + childElementName.equals(nodeName))) { Element childElement = (Element) node; - elements.add(childElement); } } while ((node = node.getNextSibling()) != null); @@ -814,8 +815,12 @@ public class UtilXml { if (node != null) { do { + String nodeName = node.getLocalName(); + if (nodeName == null){ + nodeName = UtilXml.getNodeNameIgnorePrefix(node); + } if (node.getNodeType() == Node.ELEMENT_NODE && (childElementName == null || - childElementName.equals(node.getLocalName() != null ? node.getLocalName() : node.getNodeName()))) { + childElementName.equals(nodeName))) { Element childElement = (Element) node; return childElement; } @@ -1147,5 +1152,59 @@ public class UtilXml { throw new UnsupportedOperationException(); } } + + /** + * get node name without any prefix + * @param node + * @return + */ + public static String getNodeNameIgnorePrefix(Node node){ + if (node==null) return null; + String nodeName = node.getNodeName(); + if (nodeName.contains(":")){ + // remove any possible prefix + nodeName = nodeName.split(":")[1]; + } + return nodeName; + } + + /** + * get tag name without any prefix + * @param node + * @return + */ + public static String getTagNameIgnorePrefix(Element element){ + if (element==null) return null; + String tagName = element.getTagName(); + if (tagName.contains(":")){ + // remove any possible prefix + tagName = tagName.split(":")[1]; + } + return tagName; + } + + /** + * get attribute value ignoring prefix in attribute name + * @param node + * @return + */ + public static String getAttributeValueIgnorePrefix(Element element, String attributeName){ + if (element==null) return ""; + + NamedNodeMap attributes = element.getAttributes(); + if (attributes != null){ + for (int i = 0, size = attributes.getLength(); i < size; i++) + { + Node node = attributes.item(i); + if (node.getNodeType() == Node.ATTRIBUTE_NODE){ + String nodeName = UtilXml.getNodeNameIgnorePrefix(node); + if (nodeName.equals(attributeName)){ + return node.getNodeValue(); + } + } + } + } + return ""; + } } diff --git a/framework/minilang/dtd/simple-methods-ns.xsd b/framework/minilang/dtd/simple-methods-ns.xsd new file mode 100644 index 0000000000..d96e794569 --- /dev/null +++ b/framework/minilang/dtd/simple-methods-ns.xsd @@ -0,0 +1,5171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The name of the field to set. The target of the assignment. + + Required. Attribute type: expression. + + + + + + + + + + + + + The name of the error message list. It will be created if it does not exist. + Defaults to "error_list". + + Optional. Attribute types: constant, ${expression}. + + + + + + + + The Java data type. + + Optional. Attribute type: constant. Attribute must contain a valid Java class name. + + + + + + + + + The comparison operator. The operator describes the l-value compared to the r-value. + + The "contains" operator returns true if the l-value contains the r-value. + This operator does not perform type conversions. + The l-value must be a collection type or a String. A null l-value evaluates to false. + + Required. Attribute type: constant. + + + + + + + + + + + + + + + + + + + + + The comparison operator. The operator describes the l-value compared to the r-value. + + The "contains" operator returns true if the l-value contains the r-value. + This operator does not perform type conversions. + The l-value must be a collection type or a String. A null l-value evaluates to false. + + The "is-null", "is-not-null", and "is-empty" operators + do not require an r-value. Any r-values will be ignored. + + Required. Attribute type: constant. + + + + + + + + + + + + + + + + + + + + + + + + The name of the permission. + The user must belong to a security group that includes this permission. + + Required. Attribute types: constant, ${expression}. + + + + + + + If an action is specified the user can have one of two permissions: the permission + "_ADMIN" or permission + action. + Examples of actions include "_CREATE", "_VIEW", etc. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + An alternate delegator name. When specified, the entity operation will use the + alternate delegator instead of the current delegator. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + The document-level element of Mini-language files. + + + + + + + + + + + + + Contains a block of Mini-language code. + + A simple method can be called in either an event context from the Control + Servlet (or another event) or in a service context through the Service + Engine, or any other component that has access to a service + dispatcher. + + + + + + + + A name (preferably a legal Java identifier) for this method. + This name must be unique for the XML file it is in as it will be used to reference this method externally. + + Required. Attribute type: constant. + + + + + + + A short description of the method - used for documentation. + + Optional. Attribute type: constant. + + + + + + + Require a user login to run this method. Defaults to "true". + + Optional. Attribute type: constant. + + + + + + + Create a transaction if none exists for this thread. Defaults to "true". + + Optional. Attribute type: constant. + + + + + + + The default error return code. Defaults to "error". + + Optional. Attribute type: constant. + + + + + + + The default success return code. Defaults to "success". + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the javax.servlet.ServletRequest object. Defaults to "request". + + Used when the simple method is invoked as an event, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the javax.servlet.ServletResponse object. Defaults to "response". + + Used when the simple method is invoked as an event, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the javax.servlet.http.HttpSession object. Defaults to "session". + + Used when the simple method is invoked as an event, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the event response code. Defaults to "_response_code_". + + Used when the simple method is invoked as an event, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the event error message. Defaults to "_error_message_". + + Used when the simple method is invoked as an event, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the event error message list. Defaults to "_error_message_list_". + + Used when the simple method is invoked as an event, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the event message. Defaults to "_event_message_". + + Used when the simple method is invoked as an event, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the event message list. Defaults to "_event_message_list_". + + Used when the simple method is invoked as an event, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the service response message. Defaults to "responseMessage". + + Used when the simple method is invoked as a service, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the service error message. Defaults to "errorMessage". + + Used when the simple method is invoked as a service, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the service error message list. Defaults to "errorMessageList". + + Used when the simple method is invoked as a service, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the service error message map. Defaults to "errorMessageMap". + + Used when the simple method is invoked as a service, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the service success message. Defaults to "successMessage". + + Used when the simple method is invoked as a service, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + The name of the field containing the service success message list. Defaults to "successMessageList". + + Used when the simple method is invoked as a service, it is ignored otherwise. + + Optional. Attribute type: constant. + + + + + + + + + + + + Adds an error message to an error message list. + + + + + + + + + + + + + + + Adds an error message to the error message list for each condition that evaluates to false. + + + + + + + + The title of the assert operation. The title is used in test reports. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + + Evaluates the specified field, and adds an error message to the error message list if the field's value is not a valid database ID value. + + ], forward-slash [/], back-slash [\].]]> + + + + + + + + + + + The name of the field that contains the ID value to check. + + Required. Attribute type: expression. + + + + + + + + + + + Checks to see if the current user has the specified permission. + If the user does not have the specified permission or if there is no user associated with the context + then the failure message from fail-message or fail-property will be added to the + specified error list. + + Note that this element must be followed by the check-errors element for it to do anything meaningful. + + + + + + + + Declares an alternate permission. Alternate permissions are checked when the primary permission check fails. + + + + + + + + + + + + + + + + + + + + Sets the value of the specified field to null. + + + + + + + + + + + Creates an instance of the specified class. + The string and field sub-elements are passed to the constructor method as arguments in the order they are specified. + A runtime exception will be thrown if the sub-elements do not match the constructor method arguments. + + Deprecated - use the script element. + + + + + + + + + + + + The name of the class to construct an instance of. + + Required. Attribute type: constant. + + + + + + + + + + Declares an error message. + + + + + + + The error message text. + + Required. Attribute type: constant+expr + + + + + + + + + + Declares an error message found in a properties file. + Typically used for internationalized messages. + + + + + + + The name of a properties file on the classpath. + + Required. Attribute type: constant + + + + + + + The property key. + + Required. Attribute type: constant + + + + + + + + + + Declares an environment field to be passed as an argument to an object method call. + + + + + + + The name of the environment field to use. + + Required. Attribute type: expression. + + + + + + + The Java class of the argument. Defaults to "java.lang.String". + It should be the type specified in the method signature, not the type of the object being + passed in. + + Optional. Attribute type: constant. + + + + + + + + + + Appends an object to the specified list. + + Deprecated - use the set element. + + + + + + + The field name of the object to append. The operation does nothing if the field does not exist. + + Required. Attribute type: expression. + + + + + + + The field name of the list that the object will be appended to. + If the list does not exist, one will be created. + + Required. Attribute type: expression. + + + + + + + + + + Copies a field to a servlet request attribute. + Valid only when the simple-method is called as an event, it is ignored otherwise. + + + + + + + The name of the field to copy from. The source of the assignment. + The operation does nothing if the field does not exist. + + Required. Attribute type: expression. + + + + + + + The servlet request attribute name. The target of the assignment. + Defaults to the value of the field attribute. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + Copies a field to a service OUT attribute. + + + + + + + The name of the field to copy from. The source of the assignment. + The operation does nothing if the field does not exist. + + Required. Attribute type: expression. + + + + + + + The name of the result field to set. The target of the assignment. + Defaults to the value of the field attribute. + + Optional. Attribute type: expression. + + + + + + + + + + Copies a field to a servlet session attribute. + Valid only when the simple-method is called as an event, it is ignored otherwise. + + + + + + + The name of the field to copy from. The source of the assignment. + The operation does nothing if the field does not exist. + + Required. Attribute type: expression. + + + + + + + The servlet session attribute name. The target of the assignment. + Defaults to the value of the field attribute. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + Assigns the first (lowest order) entry in a list to a field. + If the list does not exist or is empty, assigns null to a field. + + Deprecated - use the set element. + + + + + + + The name of the field to set. The target of the assignment. + + Required. Attribute type: expression. + + + + + + + The name of the list that contains the object to copy. + + Required. Attribute type: expression. + + + + + + + + + + Copy a list to another list. + + + + + + + Name of the list to copy from. The operation does nothing if the list does not exist. + + Required. Attribute type: expression. + + + + + + + Name of the list to copy to. If the list does not exist, one will be created. + + Required. Attribute type: expression. + + + + + + + + + + Copies a map to another map. + If a target map is not specified, the source map is copied to the current + environment (memory space). + + + + + + + The name of the map to copy from. The operation does nothing if the map does not exist. + + Required. Attribute type: expression. + + + + + + + The name of the map to copy to. If the target map does not exist, one will be created. + If this attribute is empty, the source map will be copied to the current environment. + + Optional. Attribute type: expression. + + + + + + + + + + Sets a field to the current system time. + + + + + + + + The field data type. Defaults to "java.sql.Timestamp". + + Optional. Attribute type: constant. + + + + + + + + + + + + + + + + + + + Sets a field to a java.sql.Date object initialized to the current system time. + Deprecated - use now. + + + + + + + + + + + Sets a field to a java.sql.Timestamp object initialized to the current system time. + Deprecated - use now. + + + + + + + + + + + Declares a field or map key to sort on. + + + + + + + The name of the field or map key to sort on. + + Required. Attribute type: expression. + + + + + + + + + + Sorts a list of maps. Maps are sorted by the keys specified in the order-by sub-elements. + + + + + + + + + + The name of the field containing the list to be sorted. The operation does nothing if the list is not found. + + Required. Attribute type: expression. + + + + + + + + + + Assigns a resource property value to a field. + + + + + + + + The name of a properties resource. Can be a file on the classpath or + a resource defined in the SystemProperty entity. + + Required. Attribute types: constant, ${expression}. + + + + + + + The property key. + + Required. Attribute types: constant, ${expression}. + + + + + + + The default value to use if the specified property value is null or empty. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Suppress property value localization. The user's/system locale will be ignored + when retriving the property value. + Defaults to "false". + + Optional. Attribute type: constant. + + + + + + + The name of an argument list to be used with a formatting string. + The argument list is applied to the property value. + The attribute does nothing if the argument list is not found. + See the java.text.MessageFormat class for more information. + + Optional. Attribute type: expression. + + + + + + + Deprecated - use the arg-list attribute. + + + + + + + + + + Appends a servlet request parameter list to a list. + Valid only when the simple-method is called as an event, it is ignored otherwise. + + + + + + + The servlet request parameter name. All matching parameter values will be added to the list. + + Required. Attribute types: constant, ${expression}. + + + + + + + The name of the field containing the list. If the list does not exist, one will be created. + Defaults to the request-name attribute value. + + Optional. Attribute type: expression. + + + + + + + Deprecated - use the list attribute. + + + + + + + + + + Copies a servlet request attribute to a field. + Valid only when the simple-method is called as an event, it is ignored otherwise. + + + + + + + + The servlet request attribute name. Defaults to the value of field attribute. + + Optional. Attribute types: constant, ${expression}. + + + + + + + A default value to use if the request attribute does not exist. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + Copies a servlet session attribute to a field. + Valid only when the simple-method is called as an HTTP event, it is ignored otherwise. + + + + + + + + The servlet session attribute name. Defaults to the value of the field attribute. + + Optional. Attribute types: constant, ${expression}. + + + + + + + A default value to use if the request attribute does not exist. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + Assigns a field from an expression or script, or from a constant value. Also supports a default value and type conversion. + + + + + + + + An expression or script that returns an object or null. The source of the assignment. + + A script must be prefixed with the script language followed by a colon (":"). + + Required if the value attribute is empty. Attribute types: expression, script. + + + + + + + Deprecated - use the from attribute. + + + + + + + A constant value, or a constant that includes an expression. The source of the assignment. + + Required if the from attribute is empty. Attribute type: constant+expr. + Defaults to java.lang.String data type. + + + + + + + A default value that is used when the from attribute evaluates to null or empty. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Deprecated - use the default attribute. + + + + + + + The Java data type to convert to. "NewList" will create a new java.util.List, "NewMap" will create a new java.util.Map. + Otherwise, the attribute must contain a valid Java class name. + + Optional. Attribute type: constant. + + + + + + + Format to be used for object type conversion. Used when the type attribute is not empty. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Controls if the target field can be set to null when the from attribute evaluates to null. + Defaults to "false". + + Optional. Attribute type: constant. + + + + + + + Controls if the target field can be set to an empty value. The meaning of "empty" depends on the Java data type. + Defaults to "true". + + Optional. Attribute type: constant. + + + + + + + + + + Adjusts a Timestamp by a specified time duration. + + + + + + + + An expression or script that returns an object or null. The source of the assignment. + + A script must be prefixed with the script language followed by a colon (":"). + + Required if the value attribute is empty. Attribute types: expression, script. + + + + + + + Deprecated - use the from attribute. + + + + + + + A constant value, or a constant that includes an expression. The source of the assignment. + + Required if the from attribute is empty. Attribute type: constant+expr. + Defaults to java.lang.String data type. + + + + + + + A default value that is used when the from attribute evaluates to null or empty. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Deprecated - use the default attribute. + + + + + + + Controls if the target field can be set to null when the from attribute evaluates to null. + Defaults to "false". + + Optional. Attribute type: constant. + + + + + + + Add (optionally using +) or subtract (using -) a number of year(s). + If an expression is used, it should evaluate to an integer. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Add (optionally using +) or subtract (using -) a number of month(s). + If an expression is used, it should evaluate to an integer. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Add (optionally using +) or subtract (using -) a number of days(s). + If an expression is used, it should evaluate to an integer. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Add (optionally using +) or subtract (using -) a number of hour(s). + If an expression is used, it should evaluate to an integer. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Add (optionally using +) or subtract (using -) a number of minute(s). + If an expression is used, it should evaluate to an integer. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Add (optionally using +) or subtract (using -) a number of second(s). + If an expression is used, it should evaluate to an integer. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Add (optionally using +) or subtract (using -) a number of millisecond(s). + If an expression is used, it should evaluate to an integer. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Align the adjusted date to the start of a period. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + + + + + + Align the adjusted date to the end of a period. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + + + + + + A locale value (eg: en). The locale selects the calendar to be used for the adjustment. + Defaults to the environment locale. + + Optional. Attribute types: constant, ${expression}. + + + + + + + A time zone value (eg: GMT). + Defaults to the environment time zone. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + Sets the UserLogin entity value to be used for authentication for the rest of the method. + This is mostly used for calling services, etc. + + This element is deprecated. You can pass an alternate UserLogin + entity value to the called service's IN attributes. + + + + + + + The name of the field that contains the UserLogin entity value. + + Required. Attribute type: expression. + + + + + + + + + + Copies elements from a source map that match a service's IN or OUT attributes to a target map. + + + + + + + The name of the service. + + Required. Attribute types: constant, ${expression}. + + + + + + + The map to copy the matching attributes from. + + Required. Attribute type: expression. + + + + + + + The map to copy the matching attributes to. + If the map does not exist, a new one will be created. + + Required. Attribute type: expression. + + + + + + + The service attributes mode - IN or OUT. Defaults to "IN". + + Optional. Attribute type: constant. + + + + + + + + + + + + + + + + Declares a java.lang.String to be passed as an argument to a method call. + The String can be contained in the value attribute and/or in the element body. + The element body text is appended to the value attribute text. + + + + + + + The String text. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + Performs string concatenation and formatting. The operation starts by applying + an argument list (if found) to the string attribute value, the result is + prepended by the prefix attribute value, and the suffix attribute value is + appended to the result. If the string specified in the field attribute exists, + the final result is appended to it, else the field is set to the final result. + + + + + + + The target of the string concatention. + + Required. Attribute type: expression. + + + + + + + The string to append to the field named in the field attribute. + This can be a formatting string that is used with the argument list + specified in the arg-list attribute. + + Required. Attribute types: constant, ${expression}. + + + + + + + The name of an argument list to be used with a formatting string. + The argument list is applied to the string attribute value. + The attribute does nothing if the argument list is not found. + See the java.text.MessageFormat class for more information. + + Optional. Attribute type: expression. + + + + + + + A string that will be prepended to the string attribute value. + + Optional. Attribute types: constant, ${expression}. + + + + + + + A string that will be appended to the string attribute value. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + Adds a string to a list of strings. Deprecated - use the set element. + + + + + + + The string to add to the list specified in the list attribute. + + Required. Attribute types: constant, ${expression}. + + + + + + + List to add the string to. If the list does not exist, one will be created. + + Required. Attribute type: expression. + + + + + + + The name of an argument list to be used with a formatting string. + The argument list is applied to the string attribute value. + The attribute does nothing if the argument list is not found. + See the java.text.MessageFormat class for more information. + + Optional. Attribute type: expression. + + + + + + + Inserts a message above a field (used in conjunction with @fieldErrors FTL macro). + + Optional. Attribute type: constant. + + + + + + + + + + Converts an object to a string. Deprecated - use the set element. + + + + + + + The name of the field containing the object to convert. + The operation does nothing if the object is not found. + + Required. Attribute type: expression. + + + + + + + The format to use for the conversion. + + Optional. Attribute type: constant. + + + + + + + Left-pad the string with the specified number of zeroes. + + Optional. Attribute type: constant. + + + + + + + + + + Copies a property value from a properties file in a ServletContext resource to a field. + Valid only when the simple-method is called as an event, it is ignored otherwise. + + + + + + + + The resource location of the properties file inside the webapp, + and relative to the root of the webapp (can be inside a war file). + An example of this is "/WEB-INF/myprops.properties". + + Required. Attribute types: constant, ${expression}. + + + + + + + The property key. + + Required. Attribute types: constant, ${expression}. + + + + + + + A default value to use if the property value is null or empty. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + + + Combines conditional elements using a boolean AND. + Evaluates to true if all sub-elements evaluate to true. + + + + + + + + + + + Causes script execution to exit the nearest enclosing loop element. + Throws an exception if there is no enclosing looping element. + + + + + + + + Halts script execution if the error message list contains any messages. + The error message list is returned to the calling process. + + + + + + + The error code to return to the calling process. + Defaults to value of the containing simple-method default-error-code attribute. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + + Combines a group of conditional elements into a single logical (true/false) expression. + + + + + + + + + + + Causes script execution to return to the beginning of the nearest enclosing loop element. + Throws an exception if there is no enclosing looping element. + + + + + + + + Contains a block of code to be executed when a condition evaluates to false. + + + + + + + + + + + Contains a condition and a block of code to be evaluated/executed when a parent condition evaluates to false. + This element must contain two sub-elements: condition and then. + If the condition of the parent element evaluates to false, then this element's condition will be evaluated, + and if that condition evaluates to true, then the operations under the then element will be run. + + + + + + + + + + + + + + Performs conditional processing on blocks of code. + This operation specifies combinations of conditions, alternate conditions, + and operations to run based on the evaluation of condition expressions. + + + + + + + + + + + + + + + + + Compares a field to a constant value. + + + + + + + + + + + The name of the field that will be compared. The l-value. + + Required. Attribute type: expression. + + + + + + + + The value that the field will be compared to. The r-value. + + Ignored when the operator attribute equals "is-null", "is-not-null", or "is-empty" - required otherwise. Attribute type: constant+expr. + + + + + + + The Java data type. Both values will be converted to this type before comparison. + Invalid when the operator attribute value is "contains". + + Optional. Attribute type: constant. Attribute must contain a valid Java class name. + + + + + + + Format used for type conversions. Valid only when the type attribute is not empty. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + + Compares a field to another field. + + + + + + + + + + + The name of the field that will be compared. The l-value. + + Required. Attribute type: expression. + + + + + + + + The name of the field that will be compared to the field specified in the field attribute. + The r-value. + + Required. Attribute type: expression. + + + + + + + + Format used for type conversions. Valid only when the type attribute is not empty. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + + Tests if a field is null or empty. + + + + + + + + + + + The name of the field to test. + Object to test must be a collection, string, or a class that implements org.ofbiz.base.lang.IsEmpty. + + Required. Attribute type: expression. + + + + + + + + + + + Tests if the current user has the specified permission. + + + + + + + + + + + + + + + Tests if a field is an instance of a Java class. + The operation will execute its contained block of code if the condition evaluates to true, + otherwise it will execute the block of code in its else sub-element (if one exists). + + + + + + + + + + + The name of the field to test. + + Required. Attribute type: expression. + + + + + + + The name of the class to test for. + + Required. Attribute type: constant. Attribute must contain a valid Java class name. + + + + + + + + + + Tests if a field is not null and not empty. + The operation will execute its contained block of code if the condition evaluates to true, + otherwise it will execute the block of code in its else sub-element (if one exists). + + + + + + + + + + + The name of the field to test. + Object to test must be a collection, string, or a class that implements org.ofbiz.base.lang.IsEmpty. + + Required. Attribute type: expression. + + + + + + + + + + + Tests if a field matches a regular expression. + + + + + + + + + + + The name of the field to test. + The field object will be converted to a string before the test. + An empty string will be used if the field object is not found. + + Required. Attribute type: expression. + + + + + + + The regular expression to test for. + + Required. Attribute types: constant, ${expression}. + + + + + + + + + + + Invokes a Java class static method that returns a boolean value. + + + + + + + + + + + The name of the field to use as the method argument. + The field object will be converted to a string before the method call. + An empty string will be used if the field object is not found. + + Required. Attribute type: expression + + + + + + + The name of the method that will be called to validate the field. + It must be a static method that takes a single String parameter and return a boolean. + + Required. Attribute type: constant + + + + + + + The name of the class that contains the validation method. Defaults to "org.ofbiz.base.util.UtilValidate". + + Optional. Attribute type: constant + + + + + + + + + + Contains a block of code that is executed once for each entry in a collection. + + + + + + + + The name of the field that contains the collection to iterate over. + The operation does nothing if the field is not found. + + Required. Attribute type: expression. + + + + + + + The name of the field that will contain the current collection entry. + + Required. Attribute type: expression. + + + + + + + + + + Contains a block of code that is executed once for each entry in a map. + + + + + + + + The name of the field that contains the map to iterate over. + The operation does nothing if the field is not found. + + Required. Attribute type: expression. + + + + + + + The name of the field that will contain the current map entry key. + + Required. Attribute type: expression. + + + + + + + The name of the field that will contain the current map entry value. + + Required. Attribute type: expression. + + + + + + + + + + Contains a block of code that is executed repeatedly until a maximum count is reached. + + + + + + + + A maximum count expression. Defaults to "0" (zero). + + Required. Attribute types: constant, ${expression}. + + + + + + + The name of the field that will contain the current count. + + Optional. Attribute type: expression. + + + + + + + + + + Inverts a conditional element using a boolean NOT. + Evaluates to true if the sub-element evaluates to false. + + + + + + + + + + + Combines conditional elements using a boolean OR. + Evaluates to true if any sub-element evaluates to true. + + + + + + + + + + + Returns control (execution) to the calling process. + + + + + + + A response code to return to the calling process. Defaults to the + value of the containing simple-method element "default-success-code" attribute. + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + Contains a block of code to be executed when a condition element evaluates to true. + + + + + + + + + + + Contains a block of code that is executed repeatedly while a condition element evaluates to true. + + + + + + + + + + + + + + Combines conditional elements using a boolean XOR. + Evaluates to true if only one sub-element evaluates to true. + + + + + + + + + + + + + The name of the called service's OUT attribute. + + Required. Attribute type: expression. + + + + + + + + + The name of a properties file on the classpath. + + Optional. Attribute type: constant + + + + + + + The property key. + + Optional. Attribute type: constant + + + + + + + + + Executes a BSH script. Deprecated - replace with script. + + The script can be contained in a Java resource, and/or a short + script can be included in the element body. + If a Java resource is specified, and the element body contains a script, + the element body script will be executed after the Java resource script is executed. + + + + + + + A Java resource that contains the script. + + Required if the element body is empty. Attribute type: constant. + + + + + + + + + + Calls a static method on a Java class. Deprecated - replace with script. + + The string and field sub-elements are passed to the method as arguments in the order they are specified. + If the method returns a value, the value will be put in the named field. + + + + + + + + + + + The name of the class containing the static method. + + Required. Attribute type: constant. + + + + + + + The name of the static method to call. + + Required. Attribute type: constant. + + + + + + + The name of the field to put the method return value in. + + Optional. Attribute type: expression. + + + + + + + + + + Invokes a simple map processor. + + An inline map processor can be used by including a simple-map-processor element in the call-map-processor element. + If both an external and an inline map processor are specified, the external + one will be called first, allowing the inline one to override its behavior. + + Map processor messages are added to an error message list. + + + + + + + + + + The name of the field that contains the map to be processed. + + Required. Attribute type: expression. + + + + + + + The name of the field that will receive the processed map. + If the map does not exist, one will be created. + If the map already exists it will be added to in place. + + Required. Attribute type: expression. + + + + + + + The full path and filename on the classpath of the XML file which contains an external map processor to execute. + This is only required if an external map processor is desired. + + Optional. Attribute type: constant. + + + + + + + The name of the external map processor to execute in the specified xml-resource. + This is only required if an external map processor is desired. + + Optional. Attribute type: constant. + + + + + + + + + + + Calls a method on an existing Java object. Deprecated - replace with script. + + The string and field sub-elements are passed to the method as arguments in the order they are specified. + If the method returns a value, the value will be put in the named field. + + + + + + + + + + + The name of the field containing the object to be called. + A runtime exception is thrown if the object is not found. + + Required. Attribute type: expression. + + + + + + + The name of the method to call. + + Required. Attribute type: constant. + + + + + + + The name of the field to put the method return value in. + + Optional. Attribute type: expression. + + + + + + + + + + Invokes a service through the Service Engine. + + + + + + + + Declares a message to prepend to the error message. + The message can be included in the element body or in a Java resource. + + + + + + + + + + Declares a message to append to the error message. + The message can be included in the element body or in a Java resource. + + + + + + + + + + Declares a message to prepend to the success message. + The message can be included in the element body or in a Java resource. + + + + + + + + + + Declares a message to append to the success message. + The message can be included in the element body or in a Java resource. + + + + + + + + + + Declares a message to prepend to any kind of message. + The message can be included in the element body or in a Java resource. + + + + + + + + + + Declares a message to append to any kind of message. + The message can be included in the element body or in a Java resource. + + + + + + + + + + Declares a message to be used when the called service does not return a message. + The message can be included in the element body or in a Java resource. + + + + + + + + + + + + + + + + + + The name of the service to invoke. + + Required. Attribute type: constant, ${expression}. + + + + + + + The name of a field containing a map that will be used for the service's IN parameters. + + Optional. Attribute type: expression. + + + + + + + Include the current UserLogin entity value in the called service's IN parameters. + Defaults to "true". + + Optional. Attribute type: constant. + + + + + + + Halt script execution if the called service returns an error. + Defaults to "true". + + Optional. Attribute type: constant. + + + + + + + The error code returned by the called service. + Defaults to the enclosing simple-method default-error-code attribute value. + + Optional. Attribute type: constant. + + + + + + + The success code returned by the called service. + Defaults to the enclosing simple-method default-success-code attribute value. + + Optional. Attribute type: constant. + + + + + + + Require a new transaction for the called service. + Defaults to "false". + + Optional. Attribute type: constant. + + + + + + + The timeout for the new transaction, in seconds. + Defaults to the value set in the called service definition. + + Optional. Attribute type: constant. + + + + + + + + + + Calls a service asynchronously. No return messages + are used; that doesn't mean no errors will result, but they would just be + system errors like database failures, etc. which all have system error messages. + + + + + + + The name of the service to invoke. + + Required. Attribute type: constant, ${expression}. + + + + + + + The name of a field containing a map that will be used for the service's IN parameters. + + Optional. Attribute type: expression. + + + + + + + Include the current UserLogin entity value in the called service's IN parameters. + Defaults to "true". + + Optional. Attribute type: constant. + + + + + + + + + + Calls another simple-method in the same context as the current one. + The called simple-method will have the same environment as the calling simple-method, + including all environment fields, and either the event or service objects + that the calling simple-method was called with. + + + + + + + + Used when scope="function". Copies the called method fields + to the calling method fields. + + + + + + + + The name of the simple-method to execute in the specified xml-resource, + or in the current XML file if no xml-resource is specified. + + Required. Attribute type: constant. + + + + + + + The full path and filename on the classpath of the XML file which contains an external simple-method to execute. + This is only required if a simple-method in a different file is desired. + + Optional. Attribute type: constant. + + + + + + + The memory scope to use. In an "inline" memory scope, fields declared or modified in the called method + will be reflected back to the calling method - as if the called method was inline. In a "function" memory + scope, fields declared or modified in the called method are local to the called method - they are not + reflected back to the calling method. + + Optional. Attribute type: constant. + + + + + + + + + + + + + + + + Copies the called service's result map to the specified field. + + + + + + + The name of the target field. + + Required. Attribute type: expression. + + + + + + + + + + Copies the called service's OUT attribute to the specified field. + + + + + + + + The name of target field. Defaults to the result-name attribute value. + + Optional. Attribute type: expression. + + + + + + + + + + Copies the called service's OUT attribute to the specified request attribute. + Valid only when the script is run in an event. + + + + + + + + The name of the target request attribute. Defaults to the result-name attribute value. + + Optional. Attribute type: expression. + + + + + + + + + + Copies the called service's OUT attribute to the specified session attribute. + Valid only when the script is run in an event. + + + + + + + + The name of the target session attribute. Defaults to the result-name attribute value. + + Optional. Attribute type: expression. + + + + + + + + + + Copies service OUT attributes from a called service to the calling service's OUT attributes. + This element can also be used to copy the called service OUT attributes to the return result of + a simple-method called as a function. + + Note that the attribute names are somewhat confusing: + "result-name" is the name of the OUT attribute of the called service, and + "service-result-name" is the name of the OUT attribute of the calling service. + In other words, copy the OUT attribute FROM result-name TO service-result-name. + + + + + + + + The name of the calling service's OUT attribute (or function return result). + Defaults to the result-name attribute value. + + Optional. Attribute type: expression. + + + + + + + + + + Runs an external script and/or a short inline script (scriptlet). The scriptlet can be + included in the script attribute or in the element body. + + + + + + + The script location. The location attribute accepts the component:// file location + protocol. Script functions/methods can be invoked by appending a hash (#) and the + function/method name. + + Required if the script attribute is empty. Attribute type: constant. + + + + + + + A short script (scriptlet). Can be used instead of a file. + The script must be prefixed with the script language followed by a colon (":"). + + Required if the location attribute is empty. Attribute type: script. + + + + + + + + + + + + The name of the field that contains a Boolean value specifying whether or not a transaction was begun in the current transaction demarcation. + Defaults to "beganTransaction". + + Optional. Attribute type: expression. + + + + + + + + + The name of the entity to search in. + + Required. Attribute type: constant, ${expression}. + + + + + + + The name of the field that will contain the result list. + + Required. Attribute type: expression. + + + + + + + Filter the result list by the current date. The entity must have "fromDate" and + "thruDate" fields. + Defaults to "false". + + Optional. Attribute type: constant, ${expression}. + + + + + + + Filter the results so that all of them are unique. + Defaults to "false". + + Optional. Attribute type: constant, ${expression}. + + + + + + + Use the entity cache. + Defaults to "false". + + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + Clears entity values from the cache. + Cache clearing is controlled by an optional "map" attribute. + + + + + + + The name of the entity. + + Required. Attribute type: constant, ${expression}. + + + + + + + The name of a field containing a map that will be used to find matching entity values. + If the fields in the map form the full primary key the entry will be removed from the byPrimaryKey cache. + If the map exists but the fields do not include a full primary key the entry will be removed from the byAnd cache. + If no map name is specified the entry will be removed from the all caches. + + Optional. Attribute type: expression. + + + + + + + + + + + Removes all entity values from the cache. + This element should be used sparingly because of the performance impact. + + + + + + + + + + + Creates a copy of an entity value. + + + + + + + The name of the field that contains the entity value to be copied. + The operation does nothing if the entity value is not found. + + Required. Attribute type: expression. + + + + + + + The name of the field that will contain the new entity value. + + Required. Attribute type: expression. + + + + + + + + + + Uses an SQL operator to compare an entity field to a variable or constant value. + + + + + + + The name of the entity field that will be compared. The l-value. + + Required. Attribute type: constant. + + + + + + + The SQL operator. + If set to "between" then the r-value must be a collection that has two entries in it. + If set to "in" or "not-in" then the r-value must be a collection. + Defaults to "equals". + + Required. Attribute type: constant. + + + + + + + + + + + + + + + + + + + + + + The name of an environment field that the entity field will be compared to. The r-value. + + Required if the value attribute is empty. Attribute type: expression. + + + + + + + A constant value that the entity field will be compared to. The r-value. + + Required if the from-field attribute is empty. Attribute types: constant, ${expression}. + + + + + + + Ignore the condition if the r-value is null. + Defaults to "false". + + Optional. Attribute type: constant. + + + + + + + Ignore the condition if the r-value is empty. + Defaults to "false". + + Optional. Attribute type: constant. + + + + + + + Perform a case-insensitive comparison. + Defaults to "false". + + Optional. Attribute type: constant. + + + + + + + Ignore the condition if the r-value evaluates to "true". + Defaults to "false". + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + Uses an SQL operator to combine entity find conditions into a single expression. + You can have condition-list elements under condition-list, for building fairly complex condition trees, + and you can also use condition-object elements at any point. + + + + + + + + + + + + The SQL operator. + Defaults to "and". + + Required. Attribute type: constant. + + + + + + + + + + + + + + + + Declares an environment field (variable) that contains an entity find condition expression object. + + + + + + + The name of the field that contains an entity find condition expression object. + + Required. Attribute type: expression. + + + + + + + + + + Creates a new entity value in the data source. + + + + + + + The name of the field that contains the entity value to be created. + + Required. Attribute type: expression. + + + + + + + Clear the cache. Defaults to "true". + Deprecated - should always be true + Optional. Attribute type: constant. + + + + + + + Store the entity value if it already exists. Defaults to "false". + If set to "false", an error will result if an instance of the entity value exists + in the data source with the same primary key. + + Optional. Attribute type: constant. + + + + + + + + + + Finds a group of entity values by using a set of entity field name/value pairs that are ANDed together. + The name/value pairs used for the search are defined in child elements. + + + + + + + + + + + + + + + + + + + + + Finds a group of entity values by using a condition expression. + + + + + + + + + + + + + + + + + + + + + + + + + + Counts a group of entity values that match a condition expression. + + + + + + + + + + + + + + + Name of entity to count in. + + Required. Attribute type: constant, ${expression}. + + + + + + + Name of the field that will contain the count result. + + Required. Attribute type: expression. + + + + + + + + + + + Load or assert an entity data XML file. The operation can be used in two modes: + "load" or "assert". The "load" mode will load the XML entity data into the database. + The "assert" mode will compare the XML entity data with the database - + any mismatched or missing data will be logged in the error message list. + + + + + + + The location of an XML file to load in database mode or to verify in assert mode. + + Required. Attribute type: constant, ${expression}. + + + + + + + Operation mode: "load" or "assert". Defaults to "load". + + Optional. Attribute type: constant. + + + + + + + + + + + + + Override the current transaction to start a new transaction and load the data with a different timeout. + Valid only when mode="load". + + Optional. Attribute type: constant. + + + + + + + + + + + + Finds a single entity value by using the primary key. + The primary key can be specified in the field-map child elements, or if they are absent, + the primary key will be constructed from matching environment fields. + + + + + + + + + + + Name of the entity to search in. + + Required. Attribute type: constant, ${expression}. + + + + + + + Name of the field that will contain the entity value. + + Required. Attribute type: expression. + + + + + + + Use the entity cache. + Defaults to "false". + + Optional. Attribute type: constant, ${expression}. + + + + + + + Look for all primary key field names in the current context as well as in the parameters map. + Defaults to "true". + + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + + Declares an entity field name/value pair. + + + + + + + Name of the entity field. Defaults to from-field attribute value. + + Required. Attribute type: expression. + + + + + + + The name of an environment field that contains the entity field value. + + Required if the value attribute is empty. Attribute type: expression. + + + + + + + A constant entity field value. + + Required if the from-field attribute is empty. Attribute type: constant+expr. + Defaults to java.lang.String data type. + + + + + + + + + + Filters a list of entity values by the fields in the specified map. + Each entity value in the list will be compared to the specified map, and + if the entity value's fields match the map, the entity value will be copied + to the target list. + + + + + + + The name of the field that contains the list of entity values. + + Required. Attribute type: expression. + + + + + + + The name of the field that contains the map that will be used for the entity field comparison. + + Required. Attribute type: expression. + + + + + + + The name of the field the filtered list will be put into. + Defaults to the value of the list attribute (operation replaces the old list). + + Optional. Attribute type: expression. + + + + + + + + + + Filters a list of entity values by their date-range fields. + Each entity value in the list will be compared to the specified date, and + if the entity value's date-range fields include the date, the entity value + will be copied to the target list. + + + + + + + The name of the field that contains the list of entity values. + + Required. Attribute type: expression. + + + + + + + The name of the field the filtered list will be put into. + Defaults to the value of the list-name attribute (operation replaces the old list). + + Optional. Attribute type: expression. + + + + + + + The name of a field that contains the date object to filter by. + The date object must be a java.sql.Timestamp data type. Defaults to now. + + Optional. Attribute type: expression. + + + + + + + The name of the entity field to use as the beginning date. + Defaults to "fromDate". + + Optional. Attribute type: constant. + + + + + + + The name of the entity field to use as the ending date. + Defaults to "thruDate". + + Optional. Attribute type: constant. + + + + + + + + + + Finds a group of entity values by using a set of entity field name/value pairs that are ANDed together. + The name/value pairs used for the search are contained in a map. + + + + + + + The name of the entity to search in. + + Required. Attribute type: constant, ${expression}. + + + + + + + The name of the field that will contain the list of entity values. + + Required. Attribute type: expression. + + + + + + + The name of the field containing a map that will be used for the search. + The map name/value pairs will be combined using a boolean AND. + All entity values will be found if this attribute is empty. + + Required. Attribute type: expression. + + + + + + + The name of the field containing a list that contains field names that you want the operation to order the results by. + Each entry in the list is a field name. The field name can be preceded by a plus or a minus sign to specify an + ascending or descending sort for that field. The default is ascending sort. + + Optional. Attribute type: expression. + + + + + + + The name of a list or set in the method environment that contains field names to select. + + Optional. Attribute type: expression. + + + + + + + Use the entity cache. + Defaults to "false". Ignored when the use-iterator attribute equals "true". + + Optional. Attribute type: constant, ${expression}. + + + + + + + Use the EntityListIterator when doing the query. + This is much more efficient for large data sets because the results are read incrementaly instead of all at once. + The EntityListIterator must be closed when you are finished, but this is done automatically by the iterate operation. + Defaults to "false". + + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + + Finds a single entity value that is retrieved from the data source by using the primary key. + The primary key used for the search is contained in a map. + + + + + + + The name of the entity to search in. If the primary key map is an entity value, + then the value's entity name can be used instead of this attribute. + + Optional if the entity name comes from the primary key map. Attribute type: constant, ${expression}. + + + + + + + The name of the field that will contain the entity value. + + Required. Attribute type: expression. + + + + + + + The name of the field containing a map that will be used for the search. + + Required. Attribute type: expression. + + + + + + + The name of a list or set in the method environment that contains field names to select. + + Optional. Attribute type: expression. + + + + + + + Use the entity cache. + Defaults to "false". + + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + + Finds entity values that are related to an existing entity value. + + + + + + + The name of the field containing the entity value. + + Required. Attribute type: expression. + + + + + + + The name of the entity value relation to use. + + Required. Attribute type: constant, ${expression}. + + + + + + + The name of the field that will contain the search results list. + + Required. Attribute type: expression. + + + + + + + The name of the field containing a map that will be used for the search. + The map name/value pairs will be combined using a boolean AND. + All entity values will be found if this attribute is empty. + + Optional. Attribute type: expression. + + + + + + + The name of the field containing a list that contains field names that you want the find operation to order the results by. + Each entry in the list is a field name. The field name can be preceded by a plus or a minus sign to specify an + ascending or descending sort for that field. The default is ascending sort. + + Optional. Attribute type: expression. + + + + + + + Use the entity cache. + Defaults to "false". + + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + Finds an entity value that is related to an existing entity value. + + + + + + + The name of the field containing the entity value. + + Required. Attribute type: expression. + + + + + + + The name of the entity value relation to use. + + Required. Attribute types: constant, ${expression}. + + + + + + + The name of the field that will contain the related entity value. + + Required. Attribute type: expression. + + + + + + + Use the entity cache. + Defaults to "false". + + Optional. Attribute types: constant, ${expression}. + + + + + + + + + + A list of conditions that are combined with a boolean AND or OR that are applied to an entity value group. + This element implements the SQL HAVING clause. + + + + + + + + + + + + The boolean operator used to combine conditions. + Defaults to "and". + + + + + + + + + + + + + + + + Constrains an entity find result by specifying a starting index and the number of results to include. + + + + + + + A zero-based starting index. The attribute value must resolve to a non-negative integer. + + Required. Attribute types: constant, ${expression}. + + + + + + + The number of results to include. The attribute value must resolve to a non-negative integer. + + Required. Attribute types: constant, ${expression}. + + + + + + + + + + Constrains an entity find result by specifying a view index and a view size. + Example: view-index=3 and view-size=10 returns results 21 to 30. + + + + + + + A one-based view index. The attribute value must resolve to a non-negative integer. + + Required. Attribute types: constant, ${expression}. + + + + + + + The number of results to view. The attribute value must resolve to a non-negative integer. + + Required. Attribute types: constant, ${expression}. + + + + + + + + + + Generates a sequence string and uses it to update an entity value field. + The sequence is generated by scanning all similar values in the entity and adding + an increment amount to the highest sequence value found. + + This element is typically used to generate sequences for the child entity in a + parent-child relationship - like order items or invoice items. + + + + + + + The name of the field that contains the entity value to update. + + Required. Attribute type: expression. + + + + + + + The name of the entity value field that will receive the sequence string. + + Required. Attribute type: constant, ${expression}. + + + + + + + Left-pad the sequence string with the specified number of zeros. + Defaults to "5". + + Optional. Attribute type: constant, ${expression}. + + + + + + + Sequence increment amount. Defaults to "1". + + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + Creates a new entity value. + The new entity value exists only in memory - it is not persisted in the data source until it is stored. + + + + + + + The entity name. + + Required. Attribute type: constant, ${expression}. + + + + + + + The name of the field that will contain the new entity value. + + Required. Attribute type: expression. + + + + + + + The name of the field that contains a map that is used to initialize the entity value fields. + Map values whose key matches one of the entity value fields will be copied to the corresponding entity value field. + + Optional. Attribute type: expression. + + + + + + + + + + + Performs an in-memory sort of a list of entity values. + + + + + + + The name of the field that contains the list of entity values. + If the source list is not found, the target field will be set to null. + + Required. Attribute type: expression. + + + + + + + The name of the field that contains the list of field names to sort on. + Field names can be preceded by a plus symbol (+) or a minus symbol (-) to specify an ascending or descending sort for that field. + The default is ascending sort. + If the order-by-list is not found the target field will be set to a copy of the source list. + + Required. Attribute type: expression. + + + + + + + The name of the field that will contain the sorted list. Defaults to the field specified + in the list attribute. + + Optional. Attribute type: expression. + + + + + + + + + + Refresh an entity value from the data source. + + + + + + + The name of the field that contains the entity value. + + Required. Attribute type: expression. + + + + + + + Clear the cache. Defaults to "true". + Deprecated - should always be true + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + Removes entity values from the data source. + Uses a map of name/value pairs that will be combined using a boolean AND to constrain the removal. + + + + + + + The name of the entity. + + Required. Attribute type: constant, ${expression}. + + + + + + + The name of the field containing a map that will be used for the constraint. + The map name/value pairs will be combined using a boolean AND. + If the map is missing or empty, then all entity values will be removed. + + Required. Attribute type: expression. + + + + + + + Clear the cache. Defaults to "true". + Deprecated - should always be true + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + + Removes from the data source all entity values in a list. + If an entity value in the list is a complete primary key, then just that entity value will be removed from the database. + If an entity value in the list is not a complete primary key, then all matching entity values will be removed from the database. + + + + + + + The name of the field that contains the list of entity values. + + Required. Attribute type: expression. + + + + + + + Clear the cache. Defaults to "true". + Deprecated - should always be true + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + + Removes entity values from the data source that are related to an existing entity value. + For a one-to-one relationship it will remove a single entity value if it exists, + and for a one-to-many relationship it will remove all related entity values. + + + + + + + The name of the field containing the entity value. + + Required. Attribute type: expression. + + + + + + + The name of the entity value relation to use. + + Required. Attribute type: constant, ${expression}. + + + + + + + Clear the cache. Defaults to "true". + Deprecated - should always be true + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + Removes an entity value from the data source. + + + + + + + The name of the field containing the entity value. + + Required. Attribute type: expression. + + + + + + + Clear the cache. Defaults to "true". + Deprecated - should always be true + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + Declares an entity field to include in the entity operation. + + + + + + + The entity field name. + + Required. Attribute type: constant, ${expression}. + + + + + + + + + + Generates a unique numeric sequence value. Sequence values are unique per sequence name. + + + + + + + The sequence name. In most cases, this is the name of the entity the sequence value + will be used in, but any name can be used. + + Required. Attribute type: constant, ${expression}. + + + + + + + + Sequence stagger maximum. If set to "1" the sequence value will be incremented by 1, + otherwise the sequence value will be incremented by an amount between 1 and the + stagger maximum. Defaults to "1". + + Optional. Attribute type: constant. + + + + + + + Preserve the sequence type - a numeric long. If set to "false" the sequence + value will be converted to a string. Defaults to "false". + + Optional. Attribute type: constant. + + + + + + + + + + + Copies non-PK fields from a map to an entity value. + + + + + + + The name of the field that contains the entity value. + + Required. Attribute type: expression. + + + + + + + The name of the field that contains a map that is used to initialize the entity value non-pk fields. + Map values whose key matches one of the entity value fields will be copied to the entity value. + + Required. Attribute type: expression. + + + + + + + Set entity value fields that are null or empty. + Defaults to "true". + + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + Copies PK fields from a map to an entity value. + + + + + + + The name of the field that contains the entity value. + + Required. Attribute type: expression. + + + + + + + The name of the field that contains a map that is used to initialize the entity value pk fields. + Map values whose key matches one of the entity value fields will be copied to the entity value. + + Required. Attribute type: expression. + + + + + + + Set entity value fields that are null or empty. + Defaults to "true". + + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + Stores in the data source all entity values in a list. + Entity values that do not exist in the data source will be added to the data source. + + + + + + + The name of the field that contains the list of entity values. + + Required. Attribute type: expression. + + + + + + + Clear the cache. Defaults to "true". + Deprecated - should always be true + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + + Stores an entity value in the data source. + + + + + + + The name of the field containing the entity value. + An error will be generated if the entity value does not exist in the data source. + + Required. Attribute type: expression. + + + + + + + Clear the cache. Defaults to "true". + Deprecated - should always be true + Optional. Attribute type: constant, ${expression}. + + + + + + + + + + Begins a transaction if one is not already in place. + + Note that all simple-methods are executed inside a transaction unless + the simple-method is flagged to not use a transaction. + + + + + + + + + + + Commits a transaction that was begun with the transaction-begin element. + Operation does nothing if no transaction was begun. + + + + + + + + + + + Rolls back a transaction that was begun with the transaction-begin element. + If no transaction was begun with the transaction-begin element, a "set rollback only" + operation will be performed - which will force the transaction to rollback regardless + of which method or object is responsible for beginning and ending the transaction. + + + + + + + + + + + Use the EntityListIterator for the entity find operation. + This is much more efficient for large data sets because the results are read incrementaly instead of all at once. + Note that when using this the use-cache setting will be ignored. + Also note that an EntityListIterator must be closed when you are finished, but this is done automatically by the iterate operation. + + + + + + + + + + The logging level to use. + Must be one of the following: "verbose", "timing", "info", "important", "warning", "error", "fatal", "always". + Defaults to "info". + + Required. Attribute type: constant. + + + + + + + + + + + + + + + + + + + + Outputs a log a message. + + + + + + + + The message to log. + + Required. Attribute type: constant+expr. + + + + + + + + + + Logs detailed information on the internal state of its sub-elements, using the specified log level. + + + + + + + + + + + + + + Performs an arithmetic calculation and puts the result in the specified field. + Deprecated - use the set element. + + + + + + + + + + + + Rounding mode for the calculation, primarily for divide operation. + Defaults to "HalfEven". + + Optional. Attribute types: constant, ${expression}. + + + + + + + + Round towards positive infinity. + + + + + + + Round towards negative infinity. + + + + + + + Round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up. + + + + + + + Round towards "nearest neighbor" unless both neighbors are equidistant, in which case round down. + + + + + + + Round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up. + + + + + + + Round towards "nearest neighbor" unless both neighbors are equidistant, in which case round down. + + + + + + + Round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor. + + + + + + + Asserts that the requested operation has an exact result, hence no rounding is necessary. + + + + + + + Convention for variable name for this attribute, in cases where it is determined at run-time. + + + + + + + + + + Initial scale (decimals) to use. Defaults to "2". + + Optional. Attribute types: constant, ${expression}. + + + + + + + Decimal format to use for conversion to string. + + Optional. Attribute types: constant, ${expression}. + + + + + + + Data type of the calculation result. Defaults to "BigDecimal". + + Optional. Attribute type: constant. + + + + + + + + + + + + + + + + + + + + A basic arithmetic operation. + Supports these operations: get, add, subtract, multiply, divide, and negate. + So add, subtract, multiply, and divide are just the basic arithmetic operations. + + + + + + + + + + + The arithmetic operator. Defaults to "add". + + Required. Attribute type: constant. + + + + + + + + Gets the positive value. + + + + + + + + + + + Negates the value. + + + + + + + + + + The name of the field to use. + + Optional. Attribute type: expression. + + + + + + + + + + Declares a numeric constant to be used in the calculation. + + + + + + + A numeric constant. + + Required. Attribute types: constant, ${expression}. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The Simple Map Processor Mini-Language performes two primary tasks: validation and conversion. + It does this in a context of moving values from one Map to another. + The input map will commonly contain Strings, but can contain other object types like + Integer, Long, Float, Double, java.sql.Date, Time, and Timestamp. + + + + + + + + + + + + + + + + + + In addition to dealing with the fields already in the incoming Map you can build Strings and add them to the in-Map before the processing begins with the make-in-string tag. + You can have zero or many make-in-string tags, and they must all come before the process tags. + Inside each make-in-string is a list of snippets to concatenate together to make the final String. + Each snippet can be another field in the in-Map (in-field element), a value from a properties file (property element), or a constant (constant element). + + + + + + + + + + + + + + + + + + Name of one of the incoming fields, or one of the fields in the in-map to add to the string. + + + + + + + + + + + + + Load the value of a property from a resourcebundle properties file, with the given resource + on the classpath, and the name of the property in that file. + + + + + + + + + + + Name of a properties file on the classpath. + + + + + + + Name of the property in the resource attribute file. + + + + + + + + Any simple literal value. + + + + + + + + The process tag is used to contain the operations to be done on the specified field in the in-Map. + It has one required attribute, the field to operate on. + The operations that it contains are: validate-method, compare, compare-field, regexp, not-empty, copy, and convert. + + All process operations tags except copy must contain one of two tags: fail-message or fail-property. + If the operation fails a message is added to the message list that is either the specified fail-message, or the String from the properties file value that is specified in fail-property. + + Messages are collected in List as the Simple Map Processor runs. + If the List is not empty when it completes then something failed in the map processor. + This is done so that all failures will be reported immediately rather than having to fix one failure before another can be discovered. + + All process operations automatically convert the field value and other values from their current type to the type specified for the operation, where applicable. + The ObjectType.simpleTypeConvert method is used to do the conversion. + It supports the following types: String, Double, Float, Long, Integer, Date, Time, and Timestamp. + If the type is not specified String is the default. + + + + + + + + + + + + + + + + + + + + + + The validate-method tag is used to call any static method that accepts a String and returns a boolean. + If the field coming in is not a String it will be converted to a String before calling the method. + The two attributes for this tag are class and method which should contain the fully qualified class name and the method name, respectively. + If the class name is not specified it will default to org.ofbiz.base.util.UtilValidate. + + + + + + + + + + + + + + + + + + The compare tag is used to compare the field value to the value specified in the value attribute. + An operator must be specified to indicate the comparison desired. + Operators available include less, greater, less-equals, greater-equals, equals, not-equals, and contains. + + + + + + + + + + + + + + + + + Literal or flexible string using ${} syntax. + + + + + + + Format based on the type of the object (date,number, etc.). + + + + + + + + The compare-field tag is just like the compare tag except that instead of specifying a value you specify the name of another field in the in-Map to compare the current field to. + + + + + + + + + + + + + + + + + + Format based on the type of the object (date,number, etc.). + + + + + + + + The regexp tag validate the current field against the regular expression specified in the expr attribute of the tag. + Standard Perl style regular expressions are used with the ORO library from Jakarta. + + + + + + + + + + + + + + + + + The not-empty tag verifies that the current field is not empty. + If the field is a String it must not be null and must have a length greater than zero, + otherwise it must simply not be null and you will get the fail-message or fail-property. + + + + + + + + + + + + + The copy operation simply copies the current field value to the out-Map from the in-Map. + There are three optional attributes. + + + + + + + + + + + If a different field name is desired in the out-Map it can be specified in the to-field attribute. + + + + + + + Specify if an existing field in the out-Map should be replaced or not, defaults to true. + If you set it to false then it will look in the out-map, + and if it finds a value of the same name already there it will not copy over top of that value. + + + + + + + + + + + + + Specifies whether or not to set fields that are null or empty. + Defaults to true. + + + + + + + + + + + + + + The convert tag does the same thing as copy except that the type can be converted to the type specified in the type attribute. + The format attribute can be used to specify the format for date/time fields. + These two tags are in addition to all of the the attributes in the copy tag. + + + + + + + + + + + + + + + If no to-field is specified, it is the same as the field on process. + + + + + + + + + + + + + + + + + + + + + + + + Specify if an existing field in the out-Map should be replaced or not, defaults to true. + If you set it to false then it will look in the out-map, + and if it finds a value of the same name already there it will not copy over top of that value. + + + + + + + + + + + + + Specifies whether or not to set fields that are null or empty. + Defaults to true. + + + + + + + + + + + + + Format based on the type of the object (date,number, etc.). + + + + + diff --git a/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java b/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java index ad90a0096a..e6dab0c6c3 100644 --- a/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java +++ b/framework/minilang/src/org/ofbiz/minilang/SimpleMethod.java @@ -229,7 +229,7 @@ public final class SimpleMethod extends MiniLangElement { ArrayList methodOperations = new ArrayList(operationElements.size()); if (UtilValidate.isNotEmpty(operationElements)) { for (Element curOperElem : operationElements) { - String nodeName = curOperElem.getNodeName(); + String nodeName = UtilXml.getNodeNameIgnorePrefix(curOperElem); MethodOperation methodOp = null; MethodOperation.Factory factory = methodOperationFactories.get(nodeName); if (factory != null) { diff --git a/framework/minilang/src/org/ofbiz/minilang/method/otherops/Log.java b/framework/minilang/src/org/ofbiz/minilang/method/otherops/Log.java index 784cea7879..4a8aadbf3f 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/otherops/Log.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/otherops/Log.java @@ -19,6 +19,7 @@ package org.ofbiz.minilang.method.otherops; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.string.FlexibleStringExpander; import org.ofbiz.minilang.MiniLangException; import org.ofbiz.minilang.MiniLangValidate; @@ -50,7 +51,7 @@ public final class Log extends MethodOperation { MiniLangValidate.noChildElements(simpleMethod, element); } this.messageFse = FlexibleStringExpander.getInstance(element.getAttribute("message")); - String levelAttribute = element.getAttribute("level"); + String levelAttribute = UtilXml.getAttributeValueIgnorePrefix(element, "level"); if (levelAttribute.length() == 0) { levelAttribute = "info"; } diff --git a/framework/webapp/dtd/site-conf-ns.xsd b/framework/webapp/dtd/site-conf-ns.xsd new file mode 100644 index 0000000000..5082cc678e --- /dev/null +++ b/framework/webapp/dtd/site-conf-ns.xsd @@ -0,0 +1,811 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + This includes all elements of the controller.xml file references. + + Note that if you define any of the event blocks in this file (the including file) they + will override (replace) the one in the included file, effectively emptying it. The event + blocks are: firstvisit, preprocessor, postprocessor, after-login, and before-logout. + + + + + + + + + + + + + + + + A redirection HTTP status-code + If set it will override, for this whole controller, the default status-code sets in requestHandler.properties + + Most possible redirection status-codes are 301, 303 and 307. + 302 (the Java default) is not recommended for SEO reasons, 301 is preferred. + + + + + + + Defines a Java class which handles a specific named type (either request or view). + This allows different logics for processing input from requests. + + + + + + + + + + + + To keep it short, request is for action when view is for rendering + + + + + + + + + + + + + + + Mechanism used to protect from data leakage (data stolen from a login/password couple compromised). + It works like the grey list anti-spam feature (aka tarpitting). + Any error will be ignored and will not affect the requests processing flow. + + + + + + + + + + + + + Event runs at the 1st visit and only then. + Any error will be ignored and will not affect the requests processing flow. + + + + + + + + + + + + Event runs before each request. + Any error will be ignored and will not affect the requests processing flow. + + + + + + + + + + + + Event runs after each request. + Any error will be ignored and will not affect the requests processing flow. + + + + + + + + + + + + Event runs after login and only then. + Any error will be ignored and will not affect the requests processing flow. + + + + + + + + + + + + Event runs before logout and only then. + Any error will be ignored and will not affect the requests processing flow. + + + + + + + + + + + + If a request cannot be called, or is not defined, the default-request is used + + + + + + + + + + + + + Place where are defined the elements of a request. + + + + + + + + + + + + + + + + + + The name of this request. This will be the name used to access the request. + + + + + + + Reserved for future use (not used yet). + + + + + + + + + + + + + Allow or not to track first visit (related to firstvisit preprocessor). + + + + + + + + + Don't track as first visit (related to firstvisit preprocessor). + + + + + + + + + + Allow or not to track statistics. + + + + + + + + + Don't track in the statistics. + + + + + + + + + + + Define the security of the request-map, using https and auth boolean attributes. + + + + + + + + + + + + + + Redirects to/uses/generates the secured HTTPS protocol if necessary and possible + + + + + + + + + + + If auth=true, when you hit the request if you are not logged in you will be forwarded to the login page. + + + + + + + + + + + + + It true, check for HTTPS client (x.509) security. + If the request is not secured throws an exception + + + + + + + + + + + + + If false, prevent to pass a view through the url ("chaining" it after the request, + like control/request/view in an FTL file). + Default to true. + + + + + + + + + + + + + If false the request can only be accessed in a chained request, default to true. + + + + + + + + + + + + + + Calculate and maintain a moving average response time for a Request or Event. Request Metrics can be used + for monitoring and reporting, Event Metrics only for reporting. Request Metrics can also be used to trigger an alternate + response if the optional threshold attribute is used. + + The metric works by gathering statistics until a configurable maximum is reached (number of + requests or elapsed time), then the average is calculated. A smoothing factor is used to + smooth differences between calculations. + + + + + + + Each metric must have a unique name. + + + + + + + Positive integer number of requests to include in the metrics calculation. Defaults to "100". + + + + + + + Positive integer number of milliseconds to include in the metrics calculation. Defaults to "1000". + + + + + + + Positive decimal smoothing factor - used to smooth the differences between calculations. A value of "1" disables smoothing. Defaults to "0.7". + + + + + + + The metric threshold in milliseconds. If the average response time exceeds this setting, + then a "threshold-exceeded" response code will be generated. That response code can be used + in a response element. The threshold check will ignore the first three requests - to give + the metric a chance to stablize after startup. A value of "0.0" disables the threshold. + Defaults to "0.0". + + + + + + + + + Defines a piece of code (see handlers) which will handles the request need. + Return any string which is then used to route to different responses. + Only one event by request-map. + + + + + + + + + + + + + + There are as much as types (of type request) as available defined and accessible event handlers. + Most used are java, service, service-multi, simple and groovy (or bsf). + A most comprehensive list can be found in the common-controller. + + + + + + + Event name, mostly used with special events + (firstvisit, + preprocessor, + postprocessor, + after-login, + before-logout) + where the name allows to differentiate them. + Most of the time reques-maps, which have only 1 event, don't use it. + + + + + + + The path to the class or XML file containing this event. + Leave empty for services, except if you want to run it as a job, then use "async" + + + + + + + The name of the method or service to be run. + + + + + + + For service-multi, defines if the event should be wrapped in a transaction, default to true + + + + + + + + + + + + + + You can have one response for each possible return code from the event. + An event can return any string, and that string can be used to route to different responses. + At least one reponse by request-map. + + + + + + + + Defines a possible parameter to redirect + + + + + + + + + + + + The name of the response, wich also matches the string returned by the event + + + + + + + One of the possible types between: + none, + view, + view-last, + view-last-noparam, + view-home, + request, + request-redirect, + request-redirect-noparam, + url, + cross-redirect + + + + + + + + This is used in situations where the event will actually + be generating the response. If you have an event that + returns a binary download for example, you would use + a response of type=none, so that the control servlet + doesn't try to render anything and send it down to the + client. + + + + + + + Send to a view for final rendering + + + + + + + Will use the view from the last request unless there + is a saved from some previous request (using the save-last-view + attribute). Use the value attribute to specify a default view + in case no previous view can be retrieved. + + + + + + + Same than view-last but no parameters are redirect + + + + + + + Will use the view from the last saved 'home' position + (using the save-home-view attribute). + + + + + + + Internally chains to another request + + + + + + + Send a redirect down to the browser telling it to go to the new request. + Automatically redirect all current request parameters to the new request or only redirected parameters if specified. + + + + + + + Send a redirect down to the browser telling it to go to the new request. + No current request parameters are sent to the new request, nor redirected parameters if specified. + + + + + + + Any URL, relative or absolute. Redirected parameters are not used, you can put them in the url. + + + + + + + Works like URL but you can also pass redirected parameters. + + + + + + + + + + Depending on the type of response, will either + be the view or request name (ie view-map-name or request-map URI). + + Can be an URL. + + + + + + + Saves the last (previous) request's view for future use, generally + with the view-last type of response. + + + + + + + + + + + + + Saves the current request's view for future use, generally with + the view-last type of response. + + + + + + + + + + + + + Saves the current request's view for future use, generally with + the view-home type of response. + + + + + + + + + + + + + A redirection HTTP status-code + If set it will override, for this request, the default status-code sets in requestHandler.properties + and the possible status-code sets at the controller level (included controllers inclusive) + + Most possible redirection status-codes are 301, 303 and 307. + 302 (the Java default) is not recommended for SEO reasons, 301 is preferred. + + + + + + + + Adds a parameter with the given name to the redirect. Finds value in a + request attribute if exists, or a request parameter if no attribute is found. + + + + + + + + + + + Name of the parameter to redirect + + + + + + + If specified used instead of the value of name for the key to find + a request attribute or parameter. + + + + + + + Set a string value to the parameter. + + + + + + + + + Place where are defined the elements of a view. + + + + + + + + + + + + + + The name of this view. This will be the name used to access the view. + + + + + + + The page mapped to this view. + + + + + + + The name of the view handler that will render the output: screen, screenfop, ftl etc... + A most comprehensive list can be found in the common-controller. + + + + + + + Extended information passed to the view handler. + + + + + + + Content-type in the HTML sense + + + + + + + Charset in the HTML sense. By default "text/html" is used. + If the encoding is "none" then no charset will be used. + + + + + + + Send no-cache headers if set to true. + + + + + + + + + + + + + Provides clickjacking protection by instructing browsers that this page should not be placed within a frame. + Possible values are: + deny - no rendering within a frame, + sameorigin - no rendering if origin mismatch, and + allow-from: - allow rendering if framing page is within the specified URI domain. + Allow from is supported by IE and Firefox, but not Chrome or Safari. + It will also interfere with In Page Google Analytics since it requires your page to be framed by Google. + + + + + + + + + + + + + + HTTP Strict-Transport-Security (HSTS) enforces secure (HTTP over SSL/TLS) connections to the server. + This reduces impact of bugs in web applications leaking session data through cookies and external links and defends against Man-in-the-middle attacks. + HSTS also disables the ability for users to ignore SSL negotiation warnings. + If the security of the connection cannot be ensured (e.g. the server's TLS certificate is not trusted), + it shows an error message and do not allow the user to access the web application. + As recommended by OWASP, by default "max-age=31536000; includeSubDomains" is used except if the server is localhost or 127.0.0.1. + If the strict-transport-security is "none" then it will not be used. + + + + + diff --git a/framework/widget/dtd/compound-widgets.xsd b/framework/widget/dtd/compound-widgets.xsd index 022931c93d..3059b4b3bc 100644 --- a/framework/widget/dtd/compound-widgets.xsd +++ b/framework/widget/dtd/compound-widgets.xsd @@ -1,14 +1,29 @@ - + + + + + + + + + - - - - - - + + + + + + diff --git a/framework/widget/dtd/widget-form-ns.xsd b/framework/widget/dtd/widget-form-ns.xsd new file mode 100644 index 0000000000..52e5284208 --- /dev/null +++ b/framework/widget/dtd/widget-form-ns.xsd @@ -0,0 +1,2144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The form type is always required unless you are extending another form. + + + + + + a single form is a simple single form with values from a single set of values + + + + + DEPRECATED use grid instead - a list form is a list of individual forms in a table (could be called a tabular form), it has a list of sets of values and creates one form for each list element + + + + + a multi form is like a list/tabular form, but it creates a single form to submit all list item forms at once; the field names in the resulting form have an appendage attached to make them unique according to the pattern used for the multi-service + event handler that will call one service for each list element + + + + + + + + + + + + + + + + + + + + + + + + + + + for list type and other multiple data/form types this is the name of the list in the context to iterate over + + + + + if specified each list entry will be put in the context with this name; otherwise the list entry must be a Map and the entries in the Map will be put into the context by name + + + + + + + + + The form-title-area-style specifies the style to use in the header or title area for the form in a multi-form widget with all form fields rendered in one area. + + + + + The form-widget-area-style specifies the style to use in the main or widget area for the form in a multi-form widget with all form fields rendered in one area. + + + + + + + + + + + + The name of the request parameter that is used for specifying the sorted column. This is required when you + have more than one list on a screen - each list must use its own sort field parameter. Defaults to "sortField". + + + + + + CSS style to used for form sort fields. Defaults to "sort-order". + + + + + CSS style to used for form sort fields. Defaults to "sort-order-asc". + + + + + CSS style to used for form sort fields. Defaults to "sort-order-desc". + + + + + Indicate if this form is paginated or not, true by default. + + + + + Target location for the [Previous] and [Next] buttons in a form with pagination. Accepts ${} notation. + + + + + Target anchor for the [Previous] and [Next] buttons in a form with pagination. + + + + + The name of the parameter that specifies the number of rows to display for each page in a list form with multiple pages. The default is VIEW_SIZE. Accepts ${} notation. + + + + + The name of the parameter that specifies what the current page is in a list form with multiple pages. The default is VIEW_INDEX Accepts ${} notation. + + + + + The total number of rows in the original list (used for pagination). + If not specified, the size of the list will be used. Accepts ${} notation. + You may use any value, true makes sense, when using performFindList, but one value must be passed. + + + + + + Text to display for the [First] button in a form with pagination. Defaults to the CommonFirst label defined in CommonUiLabels.xml. Accepts ${} notation. + + + + + Text to display for the [Previous] button in a form with pagination. Defaults to the CommonPrevious label defined in CommonUiLabels.xml. Accepts ${} notation. + + + + + Text to display for the [Next] button in a form with pagination. Defaults to the CommonNext label defined in CommonUiLabels.xml. Accepts ${} notation. + + + + + Text to display for the [Last] button in a form with pagination. Defaults to the CommonLast label defined in CommonUiLabels.xml. Accepts ${} notation. + + + + + CSS style to use for the whole pager in a form with pagination. Defaults to "nav-pager". + + + + + + + + + + + + + + + + + + + + + + + + The number of items to display per page + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The odd-row-style specifies the style to use in the table content odd rows. + + + + + The even-row-style specifies the style to use in the table content even rows. + + + + + The header-row-style specifies the style to use in the header of table. + + + + + The default-table-style specifies the style to use in the table. + + + + + Tells the browser whether or not to try and autocomplete with values previously entered. Default to true. + + + + + + + + + + + + + + + a list of individual forms in a table (could be called a tabular form), it has a list of sets of values and creates one form for each list element + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + for list type and other multiple data/form types this is the name of the list in the context to iterate over + + + + + if specified each list entry will be put in the context with this name; otherwise the list entry must be a Map and the entries in the Map will be put into the context by name + + + + + + + + + The form-title-area-style specifies the style to use in the header or title area for the form in a multi-form widget with all form fields rendered in one area. + + + + + The form-widget-area-style specifies the style to use in the main or widget area for the form in a multi-form widget with all form fields rendered in one area. + + + + + + + + + + + + The name of the request parameter that is used for specifying the sorted column. This is required when you + have more than one list on a screen - each list must use its own sort field parameter. Defaults to "sortField". + + + + + + CSS style to used for form sort fields. Defaults to "sort-order". + + + + + CSS style to used for form sort fields. Defaults to "sort-order-asc". + + + + + CSS style to used for form sort fields. Defaults to "sort-order-desc". + + + + + Indicate if this form is paginated or not, true by default. + + + + + Target location for the [Previous] and [Next] buttons in a form with pagination. Accepts ${} notation. + + + + + Target anchor for the [Previous] and [Next] buttons in a form with pagination. + + + + + The name of the parameter that specifies the number of rows to display for each page in a list form with multiple pages. The default is VIEW_SIZE. Accepts ${} notation. + + + + + The name of the parameter that specifies what the current page is in a list form with multiple pages. The default is VIEW_INDEX Accepts ${} notation. + + + + + The total number of rows in the original list (used for pagination). If not specified, the size of the list will be used. Accepts ${} notation. + + + + + Text to display for the [First] button in a form with pagination. Defaults to the CommonFirst label defined in CommonUiLabels.xml. Accepts ${} notation. + + + + + Text to display for the [Previous] button in a form with pagination. Defaults to the CommonPrevious label defined in CommonUiLabels.xml. Accepts ${} notation. + + + + + Text to display for the [Next] button in a form with pagination. Defaults to the CommonNext label defined in CommonUiLabels.xml. Accepts ${} notation. + + + + + Text to display for the [Last] button in a form with pagination. Defaults to the CommonLast label defined in CommonUiLabels.xml. Accepts ${} notation. + + + + + CSS style to use for the whole pager in a form with pagination. Defaults to "nav-pager". + + + + + + + + + + + + + + + + + + + + + + + + The number of items to display per page + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The odd-row-style specifies the style to use in the table content odd rows. + + + + + The even-row-style specifies the style to use in the table content even rows. + + + + + The header-row-style specifies the style to use in the header of table. + + + + + The default-table-style specifies the style to use in the table. + + + + + Tells the browser whether or not to try and autocomplete with values previously entered. Default to true. + + + + + + + + + + + + + + + + + + + + + Active a style on a line if the use-when condition is validate + + + + + Boolean expression tested for active the style on a line. + + + + + If use-when return true, concat this style to existing style of the line. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A unique name for this fields group. + + + + + Indicate in this fields group is collapsible or not, false by default. + + + + + Indicate in this fields group is initially collapsed or not, false by default. If set to true implies collapsible even if not set + + + + + Set an unique CSS identifier to this fields group. + + + + + Set a CSS style to this fields group. + + + + + + + + + + + + + + + + + + + + + + + + last-field reorder the given field at the end form. This element is propagated to the inherited form + + + + + + + + + Area to be updated when a form event occurs. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A unique name for this field. + + + + + The name (or location) of the map that contains the data for this field in the form context. + + + + + Used along with the field-name to look up the entity field definition for any information that might be helpful when rendering the form field. + + + + + See the description of entity-name. + + + + + Used along with the attribute-name to look up the service attribute definition for any information that might be helpful when rendering the form field. + + + + + See the description of service-name. + + + + + Defaults to the value of the name attribute; is used to specify the name of the entry in the map that contains the value to populate. + + + + + Defaults to the value of the name attribute; is the name of the parameter to use for this field (the request parameter in a web application). + + + + + The name of this field that will be shown to the user; can use the ${} and foo.bar (dot) syntax to insert values from the context for parameterization or internationalization. + + + + + A link for this field in the header of a list form. Useful for sorting a list form by different columns. + + + + + The CSS style for a header-link. + + + + + The text to show on mouse over or help for more information; can use the ${} and foo.bar (dot) syntax to insert values from the context for parameterization or internationalization. + + + + + The name of a style (like a CSS class) to apply to the area around the title of this field. + + + + + The name of a style (like a CSS class) to apply to the area around the widget that the user will interact with for this field. + + + + + The name of a style (like a CSS class) to apply to the title of this field. + + + + + The name of a style (like a CSS class) to apply to the widget that the user will interact with for this field. + + + + + The name of a style (like a CSS class) to apply to the tooltip of this field. + + + + + For row oriented forms (single type) can specify that the field should be put a column other than the first; for column oriented forms (list type) specifies the row the field should be put in. + + + + + The widget/interaction part will be red if the date value is before-now (for thruDate), after-now (for fromDate), or by-name (if the field's name or entry-name or fromDate or thruDate the corresponding action will be done); only applicable when the field is a + timestamp. + + + + + + + + + + + + + + Used to specify a condition that must be true to use this field; the condition should be written using the + Java syntax and can operate on values in the form context; conditional fields are evaluated in reverse + order so the last field defined that evaluates to true is the one that is rendered. + + + + + + + This attribute is defined to enable ignoring a field on a form of type list or multi, + which is not possible using use-when attribute. Like use-when it should be written using java syntax. + The condition should be evaluated in the form context without looking for data coming from list that feeds the form. + + + + + + + This is for textual output only. If true data shown in fields will be encoded so that it does not interfere with markup of the target output. + For example, if output is HTML then data presented will be HTML encoded so that all HTML-specific characters are escaped. + + + + + + + + + + + + Used to specify a javascript event that may be attached to field. + + + + + Used to specify a javascript action that should be run based on an existing specified event. + + + + + + + + + + + + + + + + + + + + + + The name of a style (like a CSS class) to apply to the title of this field if required. + Will default to form's default-required-field-style. + If field is required, but required-field-style is empty, an '*' will be placed to the right of text, + textarea and password fields. + + + + + + + + + + + + + + The name of a style (like a CSS class) to apply to the sort field link. + Will default to form's default-sort-field-style. + + + + + + Help text to be displayed when the mouse hovers over the column heading. + + + + + + The name of a style (like a CSS class) to apply to the sort field link ordered ascending. + Will default to form's default-sort-field-asc-style. + + + + + + The name of a style (like a CSS class) to apply to the sort field link ordered descending. + Will default to form's default-sort-field-desc-style. + + + + + + + The name of the parent form. This is needed for lookups of children forms. + The parent form being the first form with skip-end="true" which precedes the children forms (with skip-start="true"). + Must be set also on the related field if description-field-name is used. + + + + + + + The HTML tabindex specifies the tab order of an element (when the "tab" button is used for navigating). + To exclude an element from the tab order, set the value of tabindex to 0 + In that case the element is skipped when the user tabs around the form. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A special entry for date-time fields; may just have a default size text + entry box and some sort of widget to make date entry/selection easier. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Will use the type value if set to yes, add a masked input + + + + + + + + + + + Specifies a short hint that describes the expected value of an input field. + + + + + + + + + + + + If set to true, an hidden form field is also rendered, with the name of the field and its content. + + + + + + + + + + + Specifies the string to display, can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default. + + + + + Specifies the size of the field (as a number of characters), when the text to display exceed the given size it is truncated and add the complete text as a hint + + + + + + + + + + Display only the date part of a timestamp field + + + + + Display only the date and hours:minutes part of a timestamp field + + + + + Display the image specified in image-location + + + + + Display negatives in parentheses (configurable, see arithmetic.properties) + + + + + + + + Specifies the currency uom ID used to format context value, should generally use the ${} syntax to retrieve value. + + + + + Specifies the image to display. + + + + + Specifies a string to be displayed if the field is empty. + + + + + + + This is just like display but looks up a description using the Entity Engine; note that if also-hidden is true then it uses the key as the value, not the shown description. + + + + + + + + + + + Specifies the size of the field (as a number of characters), when the text to display exceed the given size it is truncated and add the complete text as a hint + + + + + + + + + + + + + If set to true, an hidden form field is also rendered, with the name of the field and its content. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The key to mark as selected when there is no current entry value. + + + + + + + If non-zero, a text field will conditionally show + next to the select control to implement a crude "combo box". + In order for this to work there must be a option in the select as: + <option key="_OTHER_" description="Specify other"/> + - with '_OTHER_' being required and any 'description' allowed. + In order to use this feature, the javascript code contained in the file: + images/webapp/images/combobox.js must be included in the page. + + + + + + Specifies the size of the field (as a number of characters), when the text to display exceed the given size it is truncated and add the complete text as a hint + + + + + + + + + + + + + + + Tells the browser whether or not to try and autocomplete with values previously entered. Default to true. + + + + + + + + + + + + + + + + + + + + + Specifies the string to display, can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default. + + + + + If set to true, an hidden form field is also rendered, with the name of the field and its content. + + + + + + + + + + + + Deprecated - use the image element. + + + + + Deprecated - use the image element. + + + + + Deprecated - use the image element. + + + + + Deprecated - use the url-mode attribute. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The name of a field whose value is also filled when coming back from lookup selection. + + + + + + The name of a field whose value is passed in as a parameter to the lookup target form. + Can be a comma separated list. You need to affect it the value using parameters.parmI + (where I is the position number in the list, I must begin at 0) in the related lookup screen. + See LookupPreferredContactMech as example + + + + + + + Tells the browser whether or not to try and autocomplete with values previously entered. + Default to true. + + + + + + + + + + + + Makes the input field related to this lookup read-only (no edits allowed) + + + + + + + + + + + + Shows the lookup as moveable and resizable layer or popup window. + Default to layer. + + + + + + + + + + + + Only layer height. I.e. 250px, 12% + + + + + Only layer width. I.e. 250px, 12% + + + + + Only for layer positionining. Default to topleft corner. + + + + + + + + + + + + + + + If true the window background will be faded, default to true. + + + + + + + + + + + If true the search screenlet is collapsed intially, default to false. + + + + + + + + + + + If true, a special span with css class "tooltip" will be created at right of the lookup button + and a description will fill in. + If not set then it depends on the "widget.lookup.showDescription" setting. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tells the browser whether or not to try and autocomplete with values previously entered. Default to true. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tells the browser whether or not to try and autocomplete with values previously entered. Default to true. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Deprecated. Use the on-event-update-area element + instead. + + + + + If true then the user is presented with a dialog box, if confirmation-message is empty, use default + + + + + + + + + + + The message displayed in confirmation box + + + + + + + + + + + + + + + + + + + + + + + Tells the browser whether or not to try and autocomplete with values previously entered. Default to true. + + + + + + + + + + + Defines a customized input mask. Use 9 for numeric, a for alpha and * for alphanumeric character. + + + + + Makes this text field read-only (no edits allowed) + + + + + + + + + + + Specifies a short hint that describes the expected value of an input field. + + + + + + + + + + + + + Makes this textarea read-only (no edits allowed) + + + + + + + + + + + This will enable the html editor on this text area from www.unverse.net (more info there), only one textarea can be used on one page + + + + + + + + + + + In here you can specify which buttons you want to see and in which order separated by blanks. Available buttons are:formatblock fontname fontsize newline bold italic underline left center right number bullet indent outdent undo redo color hilite rule link image + table clean html spellcheck |(separator) Default is that all buttons are shown + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tells the browser whether or not to try and autocomplete with values previously entered. Default to true. + + + + + + + + + + + + + + + + + + + + + + + + + Area to be updated when a field event occurs. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + entity-options will look up options for the field in the given entity + + + + + + + + + + The name of the field in the looked up entity that will be used for the key value; if empty defaults to the entry-name of the field this is in. + + + + + Will be presented to the user with field values substituted using the ${} syntax. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Enables in place editon for the display field. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + list-options will create options based on data in a list + + + + + The name of the list to iterate through to get values. + + + + + + If specified the list entry will be placed in the local + context, otherwise each list entry must be a Map that will be expanded + into the local context. + + + + + + + The value of the key-name will be the value passed + to the server; this should be the full name of the location of the + key value in the context, given the list-entry-name or expanded + list-entry Map as the options you would most likely use. + + + + + + Will be presented to the user with field values substituted using the ${} syntax. + + + + + + + + + + What the user will see in the widget; defaults to the value of the key attribute. + + + + + + + + + + + + + + + + Specifies the string to display, can use the ${} syntax to insert context values; if empty the value of the field will be printed for a default. + + + + + + Deprecated - use the url-mode attribute. + + + + + + + + + + + + + Deprecated - use the style attribute. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This can be "true", "false" or the name of a Map in the context to use as the source Map for the service context. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/widget/dtd/widget-menu-ns.xsd b/framework/widget/dtd/widget-menu-ns.xsd new file mode 100644 index 0000000000..f8f3757cae --- /dev/null +++ b/framework/widget/dtd/widget-menu-ns.xsd @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The style of the container that encloses the menu items. This + attribute is ignored when the id attribute is not empty. + + + + + + + + + + + + + + + + + + + + + + + + + + If a pass-style provided and the condition passes, the widget-style of + the parent menu-item is set with the pass-style. If no pass-style is given, + the widget-style is not changed. + + + + + + + If a disabled-style provided and the condition fails, the disabled-style of + the parent menu-item is set with the disabled-style and processing is allowed to continue. + If no disabled-style is given, the widget-style is not changed and the menu-item is not rendered. + + + + + + + + + + + + + + + + an expanded value of the parentPortalPageId in the Portal entity, will insert buttons using the portalId as the menuitem name portalPageName as the buttom title + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/widget/dtd/widget-screen-ns.xsd b/framework/widget/dtd/widget-screen-ns.xsd new file mode 100644 index 0000000000..d843691d72 --- /dev/null +++ b/framework/widget/dtd/widget-screen-ns.xsd @@ -0,0 +1,659 @@ + + + + + + + + + + + + + + + + + + + + Transaction timeout in seconds + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This can be "true", "false" or the name of a Map in the context to use as the source Map for the service context. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The URL to be called for periodic asynchronous area updates. + Some widget rendering environments support asynchronous updates. + + + + + + The auto-update interval, in seconds. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Title text to be placed in the screenlet title bar. + + + + + + + + + + + + + + + When set to true, screenlet will be collapsed initially. Can be an expanded string to get the value from a variable. Defaults to false. + + + + + When set to true, screenlet collapse status is saved as user preference. Defaults to true. + + + + + + + + + + + When set to true, screenlet content will be padded. Defaults to true. + + + + + + + + + + + Name of the screenlet include-menu sub element that will be used for screenlet navigation. + + + + + Name of the screenlet include-form sub element that will be used for screenlet navigation. The form's pagination menu will be included in the screenlet title bar. + + + + + Name of the screenlet include-menu sub element that will be used for the screenlet tab bar. + + + + + + + + + + + + + + + + + + + + + + + + + Used if non-html content to specify width of iframe. + + + + + Used if non-html content to specify height of iframe. + + + + + Used if non-html content to specify border of iframe. + + + + + + + + Renders the named screen and includes the children of this elements at the point where it finds the decorator-section-include tag. + Note that because of the recursive nature of this tag the share-scope attribute is not availalbe. + + + + + + + + + + + + + + + + + + + + + This is just a place holder to tell the renderer to include the parent container's contents at this point. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Show the portal in configuration mode. + + + + + + + + + + + If a derived private PortalPage exists for the actual UserLogin than show the private PortalPage instead of the original. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Indicate if this section is paginated or not, true by default. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + We don't really want to encourage the use of the html-template-decorator, should be done on the screen level. + To include the sections in the decorator template just use the "render(sectionName)" method "sections" object, FTL example: ${sections.render("main")}. + For more + efficient use the sections.render(sectionName, writer) method should be used, in FTL this would be in a transform or something. + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/widget/dtd/widget-tree-ns.xsd b/framework/widget/dtd/widget-tree-ns.xsd new file mode 100644 index 0000000000..2dea054cfd --- /dev/null +++ b/framework/widget/dtd/widget-tree-ns.xsd @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This can be "true", "false" or the name of a Map in the context to use as the source Map for the service context. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/framework/widget/src/org/ofbiz/widget/WidgetFactory.java b/framework/widget/src/org/ofbiz/widget/WidgetFactory.java index a6f1cc2f31..aadaaed510 100644 --- a/framework/widget/src/org/ofbiz/widget/WidgetFactory.java +++ b/framework/widget/src/org/ofbiz/widget/WidgetFactory.java @@ -29,6 +29,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.ofbiz.base.util.Assert; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilGenerics; +import org.ofbiz.base.util.UtilXml; import org.ofbiz.widget.model.IterateSectionWidget; import org.ofbiz.widget.model.ModelScreen; import org.ofbiz.widget.model.ModelScreenWidget; @@ -69,9 +70,10 @@ public class WidgetFactory { */ public static ModelScreenWidget getModelScreenWidget(ModelScreen modelScreen, Element element) { Assert.notNull("modelScreen", modelScreen, "element", element); - Constructor widgetConst = screenWidgets.get(element.getTagName()); + String tagName = UtilXml.getTagNameIgnorePrefix(element); + Constructor widgetConst = screenWidgets.get(tagName); if (widgetConst == null) { - throw new IllegalArgumentException("ModelScreenWidget class not found for element " + element.getTagName()); + throw new IllegalArgumentException("ModelScreenWidget class not found for element " + tagName); } try { return widgetConst.newInstance(modelScreen, element); diff --git a/framework/widget/src/org/ofbiz/widget/model/AbstractModelAction.java b/framework/widget/src/org/ofbiz/widget/model/AbstractModelAction.java index e4cdcf9801..ec1d4dd667 100644 --- a/framework/widget/src/org/ofbiz/widget/model/AbstractModelAction.java +++ b/framework/widget/src/org/ofbiz/widget/model/AbstractModelAction.java @@ -91,25 +91,26 @@ public abstract class AbstractModelAction implements Serializable, ModelAction { * @return A new ModelAction instance */ public static ModelAction newInstance(ModelWidget modelWidget, Element actionElement) { - if ("set".equals(actionElement.getNodeName())) { + String nodeName = UtilXml.getNodeNameIgnorePrefix(actionElement); + if ("set".equals(nodeName)) { return new SetField(modelWidget, actionElement); - } else if ("property-map".equals(actionElement.getNodeName())) { + } else if ("property-map".equals(nodeName)) { return new PropertyMap(modelWidget, actionElement); - } else if ("property-to-field".equals(actionElement.getNodeName())) { + } else if ("property-to-field".equals(nodeName)) { return new PropertyToField(modelWidget, actionElement); - } else if ("script".equals(actionElement.getNodeName())) { + } else if ("script".equals(nodeName)) { return new Script(modelWidget, actionElement); - } else if ("service".equals(actionElement.getNodeName())) { + } else if ("service".equals(nodeName)) { return new Service(modelWidget, actionElement); - } else if ("entity-one".equals(actionElement.getNodeName())) { + } else if ("entity-one".equals(nodeName)) { return new EntityOne(modelWidget, actionElement); - } else if ("entity-and".equals(actionElement.getNodeName())) { + } else if ("entity-and".equals(nodeName)) { return new EntityAnd(modelWidget, actionElement); - } else if ("entity-condition".equals(actionElement.getNodeName())) { + } else if ("entity-condition".equals(nodeName)) { return new EntityCondition(modelWidget, actionElement); - } else if ("get-related-one".equals(actionElement.getNodeName())) { + } else if ("get-related-one".equals(nodeName)) { return new GetRelatedOne(modelWidget, actionElement); - } else if ("get-related".equals(actionElement.getNodeName())) { + } else if ("get-related".equals(nodeName)) { return new GetRelated(modelWidget, actionElement); } else { throw new IllegalArgumentException("Action element not supported with name: " + actionElement.getNodeName()); diff --git a/framework/widget/src/org/ofbiz/widget/model/FieldInfo.java b/framework/widget/src/org/ofbiz/widget/model/FieldInfo.java index fc530c30ae..91cf445d16 100644 --- a/framework/widget/src/org/ofbiz/widget/model/FieldInfo.java +++ b/framework/widget/src/org/ofbiz/widget/model/FieldInfo.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.Map; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilXml; import org.ofbiz.widget.renderer.FormStringRenderer; import org.w3c.dom.Element; @@ -135,7 +136,7 @@ public abstract class FieldInfo { /** XML Constructor */ protected FieldInfo(Element element, ModelFormField modelFormField) { this.fieldSource = FieldInfo.SOURCE_EXPLICIT; - this.fieldType = findFieldTypeFromName(element.getTagName()); + this.fieldType = findFieldTypeFromName(UtilXml.getTagNameIgnorePrefix(element)); this.modelFormField = modelFormField; } diff --git a/framework/widget/src/org/ofbiz/widget/model/ModelFormFieldBuilder.java b/framework/widget/src/org/ofbiz/widget/model/ModelFormFieldBuilder.java index 5ae078948d..ec376ae6b5 100644 --- a/framework/widget/src/org/ofbiz/widget/model/ModelFormFieldBuilder.java +++ b/framework/widget/src/org/ofbiz/widget/model/ModelFormFieldBuilder.java @@ -165,7 +165,7 @@ public class ModelFormFieldBuilder { Element childElement = null; List subElements = UtilXml.childElementList(fieldElement); for (Element subElement : subElements) { - String subElementName = subElement.getTagName(); + String subElementName = UtilXml.getTagNameIgnorePrefix(subElement); if ("on-field-event-update-area".equals(subElementName)) { UpdateArea updateArea = new UpdateArea(subElement); if ("change".equals(updateArea.getEventType())) diff --git a/specialpurpose/example/widget/example/ExampleCompoundWidgets.xml b/specialpurpose/example/widget/example/ExampleCompoundWidgets.xml index 6a2acefa9f..6d501c3a3d 100644 --- a/specialpurpose/example/widget/example/ExampleCompoundWidgets.xml +++ b/specialpurpose/example/widget/example/ExampleCompoundWidgets.xml @@ -19,97 +19,103 @@ under the License. --> - + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Demo For Compound Screen Widget + + + + + + + + - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - -
-
-
-
-
-
- - -
- - - - - - - - - - -
- - - - - -
-
-
-
-
-
-
- - -
- -
- -
- -
-
- - - - - - - + + + + + + + + + + + + + + + + Demo For Compound Screen Widget + + + + + + + + +
+ + + + + + + + + + + + + + + +