You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2012/04/27 14:54:10 UTC
svn commit: r1331400 - /ofbiz/site/dtds/simple-methods-v2.xsd
Author: adrianc
Date: Fri Apr 27 12:54:10 2012
New Revision: 1331400
URL: http://svn.apache.org/viewvc?rev=1331400&view=rev
Log:
Updated the Mini-language schema.
Modified:
ofbiz/site/dtds/simple-methods-v2.xsd
Modified: ofbiz/site/dtds/simple-methods-v2.xsd
URL: http://svn.apache.org/viewvc/ofbiz/site/dtds/simple-methods-v2.xsd?rev=1331400&r1=1331399&r2=1331400&view=diff
==============================================================================
--- ofbiz/site/dtds/simple-methods-v2.xsd (original)
+++ ofbiz/site/dtds/simple-methods-v2.xsd Fri Apr 27 12:54:10 2012
@@ -57,6 +57,22 @@ under the License.
</xs:choice>
</xs:group>
+ <xs:attribute name="field">
+ <xs:annotation>
+ <xs:documentation>
+ The name of the field to set. The target of the assignment.
+ <br/><br/>
+ Required. Attribute type: expression.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:whiteSpace value="collapse" />
+ <xs:minLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
<xs:attributeGroup name="attlist.propertyInfoOptional">
<xs:attribute type="xs:string" name="resource"/>
<xs:attribute type="xs:string" name="property"/>
@@ -838,31 +854,34 @@ under the License.
<xs:element name="script" substitutionGroup="CallOperations">
<xs:annotation>
<xs:documentation>
- Runs an external script (minilang, bsh, groovy) from the expanded location provided.
+ Runs an external script or a short inline script (scriptlet).
Error messages go on the error list and are handled with the check-errors tag.
</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
- <xs:attributeGroup ref="attlist.script"/>
+ <xs:attribute type="xs:string" name="location">
+ <xs:annotation>
+ <xs:documentation>
+ 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.
+ <br/><br/>
+ Required if the script attribute is empty. Attribute type: constant.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute type="xs:string" name="script">
+ <xs:annotation>
+ <xs:documentation>
+ A short script (scriptlet). Can be used instead of a file.
+ The script must be prefixed with the script language followed by a colon (":").
+ <br/><br/>
+ Required if the location attribute is empty. Attribute type: script.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
</xs:complexType>
</xs:element>
- <xs:attributeGroup name="attlist.script">
- <xs:attribute type="xs:string" name="location">
- <xs:annotation>
- <xs:documentation>
- Script location (component://...)
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute type="xs:string" name="error-list-name" default="error_list">
- <xs:annotation>
- <xs:documentation>
- The name of the list in the method environment to check for error messages.
- Defaults to "error_list".
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:attributeGroup>
<xs:element name="call-bsh" substitutionGroup="CallOperations">
<xs:annotation>
<xs:documentation>
@@ -902,33 +921,63 @@ under the License.
<xs:element name="call-simple-method" substitutionGroup="CallOperations">
<xs:annotation>
<xs:documentation>
- The call-simple-method tag calls another simple-method in the same context as the current one.
- In other words 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.
+ 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.
</xs:documentation>
</xs:annotation>
<xs:complexType>
- <xs:attributeGroup ref="attlist.call-simple-method"/>
+ <xs:sequence>
+ <xs:element ref="result-to-field" minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ Used when scope="function". Copies the called method fields
+ to the calling method fields.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute type="xs:string" name="method-name" use="required">
+ <xs:annotation>
+ <xs:documentation>
+ 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.
+ <br/><br/>
+ Required. Attribute type: constant.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute type="xs:string" name="xml-resource">
+ <xs:annotation>
+ <xs:documentation>
+ 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.
+ <br/><br/>
+ Optional. Attribute type: constant.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="scope">
+ <xs:annotation>
+ <xs:documentation>
+ 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.
+ <br/><br/>
+ Optional. Attribute type: constant.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="inline" />
+ <xs:enumeration value="function" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
</xs:complexType>
</xs:element>
- <xs:attributeGroup name="attlist.call-simple-method">
- <xs:attribute type="xs:string" name="xml-resource">
- <xs:annotation>
- <xs:documentation>
- 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.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute type="xs:string" name="method-name" use="required">
- <xs:annotation>
- <xs:documentation>
- 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.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:attributeGroup>
<!-- Operations to call Java methods and create Java objects -->
<xs:element name="call-object-method" substitutionGroup="CallOperations">
<xs:annotation>
@@ -1249,26 +1298,43 @@ under the License.
<xs:annotation><xs:documentation>The name of the session attribute to use. Defaults to the value of field attribute</xs:documentation></xs:annotation>
</xs:attribute>
</xs:attributeGroup>
- <!-- Service specific operations -->
- <xs:element name="field-to-result" substitutionGroup="ServiceOperations">
+ <xs:element name="field-to-result" substitutionGroup="EnvOperations">
<xs:annotation>
<xs:documentation>
- The field-to-result tag copies a field from a map to the specified service result field.
- The tag is only used when the simple-method is called as a service, it is ignored otherwise.
+ Copies a field to a service OUT attribute.
</xs:documentation>
</xs:annotation>
<xs:complexType>
- <xs:attributeGroup ref="attlist.field-to-result"/>
+ <xs:attribute name="field" use="required">
+ <xs:annotation>
+ <xs:documentation>
+ The name of the field to copy from. The source of the assignment.
+ <br/><br/>
+ Required. Attribute type: expression.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="result-name">
+ <xs:annotation>
+ <xs:documentation>
+ The name of the result field to set. The target of the assignment.
+ <br/><br/>
+ Optional. Attribute type: expression.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:minLength value="1" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
</xs:complexType>
</xs:element>
- <xs:attributeGroup name="attlist.field-to-result">
- <xs:attribute type="xs:string" name="field" use="required">
- <xs:annotation><xs:documentation>The name (key) of the map field to use.</xs:documentation></xs:annotation>
- </xs:attribute>
- <xs:attribute type="xs:string" name="result-name">
- <xs:annotation><xs:documentation>The name of the result Map name/key to use. Defaults to the value of field attribute.</xs:documentation></xs:annotation>
- </xs:attribute>
- </xs:attributeGroup>
<!-- Environment specific operations -->
<xs:element name="map-to-map" substitutionGroup="EnvOperations">
<xs:annotation>
@@ -1341,15 +1407,7 @@ under the License.
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.set">
- <xs:attribute type="xs:string" name="field" use="required">
- <xs:annotation>
- <xs:documentation>
- The name of the field to set. The target of the assignment.
- <br/><br/>
- Required. Attribute type: expression.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
+ <xs:attribute ref="field" use="required" />
<xs:attribute type="xs:string" name="from-field">
<xs:annotation>
<xs:documentation>
@@ -4416,43 +4474,54 @@ under the License.
</xs:annotation>
</xs:attribute>
</xs:attributeGroup>
+ <xs:element name="now" substitutionGroup="OtherOperations">
+ <xs:annotation>
+ <xs:documentation>
+ Sets a field to the current system time.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:attribute ref="field" use="required" />
+ <xs:attribute name="type">
+ <xs:annotation>
+ <xs:documentation>
+ The field data type. Defaults to java.sql.Timestamp.
+ <br/><br/>
+ Optional. Attribute type: constant.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="java.sql.Timestamp"/>
+ <xs:enumeration value="java.sql.Date" />
+ <xs:enumeration value="java.sql.Time" />
+ <xs:enumeration value="java.util.Date" />
+ <xs:enumeration value="java.lang.Long" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
<xs:element name="now-timestamp" substitutionGroup="OtherOperations">
<xs:annotation>
<xs:documentation>
- The now-timestamp tag creates a java.sql.Timestamp object with the current date and time in it and puts it in a field in the method environment.
+ Deprecated - use <now>.
</xs:documentation>
</xs:annotation>
<xs:complexType>
- <xs:attributeGroup ref="attlist.now-timestamp"/>
+ <xs:attribute ref="field" use="required" />
</xs:complexType>
</xs:element>
- <xs:attributeGroup name="attlist.now-timestamp">
- <xs:attribute type="xs:string" name="field" use="required">
- <xs:annotation>
- <xs:documentation>
- The name of the method environment field the timestamp will be put in.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:attributeGroup>
<xs:element name="now-date-to-env" substitutionGroup="OtherOperations">
<xs:annotation>
<xs:documentation>
- The now-date-to-env tag creates a java.sql.Date object with the current date in it and puts it in a field in the method environment.
+ Deprecated - use <now>.
</xs:documentation>
- </xs:annotation><xs:complexType>
- <xs:attributeGroup ref="attlist.now-date-to-env"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:attribute ref="field" use="required" />
</xs:complexType>
</xs:element>
- <xs:attributeGroup name="attlist.now-date-to-env">
- <xs:attribute type="xs:string" name="field" use="required">
- <xs:annotation>
- <xs:documentation>
- The name of the method environment field the date will be put in.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:attributeGroup>
<xs:element name="property-to-field" substitutionGroup="OtherOperations">
<xs:annotation>
<xs:documentation>