Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Looking for Datasource Schema definition / .ds.xml demo file

    Hello Isomorphic,

    do you have a schema definition for ds.xml files so that I can look up the detailed definition of datasources (or test my file against the schema)?

    Can you provide a huge (commented) demo-ds.xml file covering all aspects of datasources (PK, FK, Valuemap, Validator, NULL, Default value, ...?

    So far I have these information sources:
    DS javadoc: http://www.smartclient.com/smartgwte...e-summary.html

    Explanation in Chapter 5 (PDF-page 30 / book-page of 20) of the SmartGWT_Quick_Start_Guide.pdf http://www.smartclient.com/releases/...tart_Guide.pdf

    Thanks,
    Blama

    #2
    Hi,

    I just noticed again that a detailed explanation on .ds.xml would be really helpful.
    http://www.smartclient.com/smartgwte...datorType.html lists the available validators in uppercase.
    In the XML files the type property has to be written "doesntContain".

    "doesntcontain" (lowercase like most XML) or
    "DOESNTCONTAIN" like in the javadoc-enum or
    "DoesntContain" like in com.smartgwt.client.widgets.form.validator package don't work.

    Thanks,
    Blama

    Comment


      #3
      I would also like to see the XML schema for a DataSource descriptor all in one place so I can validate my ds.xml. It would make a great resource for at-a-glance learning, too. Is this something that we can expect to see sometime soon?

      Comment


        #4
        Because the DataSource format is extensible, this is not as valuable as it might be with a completely static format, so it hasn't received priority. It would be a valid Feature Sponsorship if it's especially important for your organization.

        Comment


          #5
          Hi Isomophic,

          could you please explain what you mean by extensible? Is it extensible in the meaning that you'll include more attributes in newer versions of Smart GWT? Or is it extensible in the meaning that I can define my own attributes and java code to handle these attributes.

          If the latter, please point to the corresponding javadoc/explanation.

          Does the current http://www.smartclient.com/smartgwte...e-summary.html cover all attributes currently interpreted?

          Thank you,
          Blama
          Last edited by Blama; 6 Feb 2012, 03:40.

          Comment


            #6
            I just noticed that "width" seems to be an supported attribute of .ds.xml field definitions, although it is not listed in http://www.smartclient.com/smartgwte...urceField.html.

            Best regards,
            Blama

            Comment


              #7
              Hi all,

              I just read Isomorphic's new 5.0d feature announcement and remembered this thread.

              In the meantime I created a XML Schema for the subset of .ds.xml fragments I use.
              If you want to use it, you'll have to adapt it to your needs (e.g. use your convention for IDs and table-names; add your additionally used attributes). In Eclipse, besides validity-checking, it also gives the advantage of Ctrl-Space Auto-Completion.

              It is a XSD 1.0 schema, as Eclipse does not support the XSD 1.1 (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=312163).

              Once support for XSD 1.1 arrives, one could add even better checks (e.g. at DS-Field level, no joinType without foreignKey).

              Code:
              <?xml version="1.0" encoding="UTF-8"?>
              <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://myschema.com/SmartGWT/DS_XML" targetNamespace="http://myschema.de/SmartGWT/DS_XML"
              	elementFormDefault="qualified" version="1.0" xml:lang="EN">
              <!-- DataSource Attributes -->
              	<!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/DSServerType.java -->
              	<xs:simpleType name="serverTypes">
              		<xs:restriction base="xs:string">
              			<xs:enumeration value="generic" />
              			<xs:enumeration value="hibernate" />
              			<xs:enumeration value="jpa" />
              			<xs:enumeration value="jpa1" />
              			<xs:enumeration value="sql" />
              		</xs:restriction>
              	</xs:simpleType>
              	<xs:simpleType name="textMatchStyle">
              		<xs:restriction base="xs:string">
              			<xs:enumeration value="exact" />
              			<xs:enumeration value="exactCase" />
              			<xs:enumeration value="startsWith" />
              			<xs:enumeration value="substring" />
              		</xs:restriction>
              	</xs:simpleType>
              	<xs:simpleType name="IDOrtableName">
              		<xs:restriction base="xs:string">
              			<xs:pattern value="[A-Z]{1}[0-9A-Z_]*" />
              		</xs:restriction>
              	</xs:simpleType>
              	<xs:simpleType name="qualifiedClassName">
              		<xs:restriction base="xs:string">
              			<xs:pattern value="(([a-z_]{1}[a-z0-9_]*\.)*([a-zA-Z_]{1}[a-zA-Z0-9_]*){1})" />
              		</xs:restriction>
              	</xs:simpleType>
              
              <!-- Field Attributes -->
              	<!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/FieldType.java -->
              	<xs:simpleType name="fieldType">
              		<xs:restriction base="xs:string">
              			<xs:enumeration value="any" />
              			<xs:enumeration value="binary" />
              			<xs:enumeration value="boolean" />
              			<xs:enumeration value="creator" />
              			<xs:enumeration value="creatorTimestamp" />
              			<xs:enumeration value="custom" />
              			<xs:enumeration value="date" />
              			<xs:enumeration value="datetime" />
              			<xs:enumeration value="enum" />
              			<xs:enumeration value="float" />
              			<xs:enumeration value="image" />
              			<xs:enumeration value="imageFile" />
              			<xs:enumeration value="intEnum" />
              			<xs:enumeration value="integer" />
              			<xs:enumeration value="link" />
              			<xs:enumeration value="localeCurrency" />
              			<xs:enumeration value="localeFloat" />
              			<xs:enumeration value="localeInt" />
              			<xs:enumeration value="modifier" />
              			<xs:enumeration value="modifierTimestamp" />
              			<xs:enumeration value="ntext" />
              			<xs:enumeration value="password" />
              			<xs:enumeration value="sequence" />
              			<xs:enumeration value="text" />
              			<xs:enumeration value="time" />
              			<!-- My types -->
              			<xs:enumeration value="emailType" />
              		</xs:restriction>
              	</xs:simpleType>
              
              	<xs:simpleType name="fieldReference">
              		<xs:restriction base="xs:string">
              			<xs:pattern value="[A-Z]{1}[0-9A-Z_]*\.[A-Z]{1}[0-9A-Z_]*" />
              		</xs:restriction>
              	</xs:simpleType>
              
              	<xs:simpleType name="fieldName">
              		<xs:restriction base="xs:string">
              			<xs:pattern value="[A-Z]{1}[0-9A-Z_]+" />
              		</xs:restriction>
              	</xs:simpleType>
              	
              	<!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/JoinType.java -->
              	<xs:simpleType name="joinType">
              		<xs:restriction base="xs:string">
              			<xs:enumeration value="outer" />
              			<xs:enumeration value="inner" />
              		</xs:restriction>
              	</xs:simpleType>
              	
                <!-- http://www.smartclient.com/smartgwtee-latest/javadoc/com/smartgwt/client/docs/serverds/DataSourceField.html#sqlStorageStrategy -->
              	<xs:simpleType name="sqlStorageStrategy">
              		<xs:restriction base="xs:string">
              	    <!-- Fields of type "boolean" -->
              			<xs:enumeration value="number" />
              			<xs:enumeration value="integer" />
              			<xs:enumeration value="singleChar10" />
              			<xs:enumeration value="singleCharYN" />
              			<xs:enumeration value="singleCharTF" />
              			<xs:enumeration value="singleChar" />
                    <!-- Fields of type "date", "time", and "datetime" -->
              			<xs:enumeration value="string" />
              			<xs:enumeration value="nativeDate" />
              			<xs:enumeration value="text" />
                    <!-- Fields of type "text" -->
              			<xs:enumeration value="ntext" />
              		</xs:restriction>
              	</xs:simpleType>
              
              	<xs:simpleType name="sqlFalseValue">
              		<xs:restriction base="xs:string">
              			<xs:enumeration value="L" />
              			<xs:enumeration value="F" />
              		</xs:restriction>
              	</xs:simpleType>
              
              	<xs:simpleType name="sqlTrueValue">
              		<xs:restriction base="xs:string">
              			<xs:enumeration value="W" />
              			<xs:enumeration value="T" />
              		</xs:restriction>
              	</xs:simpleType>
              
              
              	<xs:simpleType name="editorType">
              		<xs:restriction base="xs:string">
                    <!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/FormItemType.java -->
              			<xs:enumeration value="SelectItem" />
              			<xs:enumeration value="HiddenItem" />
              			<xs:enumeration value="HeaderItem" />
              			<xs:enumeration value="DateItem" />
              			<xs:enumeration value="BlurbItem" />
              			<xs:enumeration value="ComboBoxItem" />
              			<xs:enumeration value="SpacerItem" />
              			<xs:enumeration value="RowSpacerItem" />
              			<xs:enumeration value="CheckboxItem" />
              			<xs:enumeration value="StaticTextItem" />
              			<xs:enumeration value="LinkItem" />
              			<xs:enumeration value="CanvasItem" />
              			<xs:enumeration value="PickTreeItem" />
              			<xs:enumeration value="ButtonItem" />
              			<xs:enumeration value="SubmitItem" />
              			<xs:enumeration value="ResetItem" />
              			<xs:enumeration value="RichTextItem" />
              			<xs:enumeration value="FileItem" />
              			<xs:enumeration value="SliderItem" />
              			<xs:enumeration value="ToolbarItem" />
              			<xs:enumeration value="SectionItem" />
              			<xs:enumeration value="TextAreaItem" />
              			<xs:enumeration value="TextItem" />
              			<xs:enumeration value="UploadItem" />
              			<xs:enumeration value="PasswordItem" />
              			<xs:enumeration value="SpinnerItem" />
              			<xs:enumeration value="TimeItem" />
              			<xs:enumeration value="NativeCheckboxItem" />
              			<xs:enumeration value="radioGroup" />
              		</xs:restriction>
              	</xs:simpleType>
              
              	<xs:simpleType name="outputs">
              		<xs:restriction base="xs:string">
              			<xs:pattern value="(([A-Z]{1}[0-9A-Z_]+)(, [A-Z]{1}[0-9A-Z_]+)*)?" />
              		</xs:restriction>
              	</xs:simpleType>
              	
                <!-- serverObject Attributes-->
              	<!-- http://www.smartclient.com/smartgwtee-latest/javadoc/com/smartgwt/client/docs/serverds/ServerObject.html#lookupStyle -->
              	<xs:simpleType name="lookupStyle">
              		<xs:restriction base="xs:string">
              			<xs:enumeration value="new" />
              			<xs:enumeration value="spring" />
              			<xs:enumeration value="factory" />
              			<xs:enumeration value="attribute" />
              		</xs:restriction>
              	</xs:simpleType>
              	
              <!-- operationBinding Attributes-->
              <!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/DSOperationType.java -->
              	<xs:simpleType name="operationType">
              		<xs:restriction base="xs:string">
              			<xs:enumeration value="add" />
              			<xs:enumeration value="clientExport" />
              			<xs:enumeration value="custom" />
              			<xs:enumeration value="downloadFile" />
              			<xs:enumeration value="fetch" />
              			<xs:enumeration value="remove" />
              			<xs:enumeration value="update" />
              			<xs:enumeration value="validate" />
              			<xs:enumeration value="viewFile" />
              		</xs:restriction>
              	</xs:simpleType>
              
                <!-- validator Attributes-->
                <!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/ValidatorType.java -->
              	<xs:simpleType name="validatorType">
              		<xs:restriction base="xs:string">
              			<xs:enumeration value="contains" />
              			<xs:enumeration value="dateRange" />
              			<xs:enumeration value="doesntContain" />
              			<xs:enumeration value="floatLimit" />
              			<xs:enumeration value="floatPrecision" />
              			<xs:enumeration value="floatRange" />
              			<xs:enumeration value="hasRelatedRecord" />
              			<xs:enumeration value="integerRange" />
              			<xs:enumeration value="isBoolean" />
              			<xs:enumeration value="isFloat" />
              			<xs:enumeration value="isFunction" />
              			<xs:enumeration value="isInteger" />
              			<xs:enumeration value="isOneOf" />
              			<xs:enumeration value="isString" />
              			<xs:enumeration value="isUnique" />
              			<xs:enumeration value="lengthRange" />
              			<xs:enumeration value="mask" />
              			<xs:enumeration value="matchesField" />
              			<xs:enumeration value="readOnly" />
              			<xs:enumeration value="regexp" />
              			<xs:enumeration value="required" />
              			<xs:enumeration value="requiredIf" />
              			<xs:enumeration value="serverCustom" />
              			<xs:enumeration value="substringCount" />
              		</xs:restriction>
              	</xs:simpleType>
              
              
              
                <!-- FIELDS -->
                <!-- ROOT-LEVEL element fields -->
              	<xs:element name="DataSource">
              		<xs:complexType>
              			<xs:sequence>
              				<xs:element ref="ds:fields" minOccurs="0" />
              				<xs:element ref="ds:serverObject" minOccurs="0" />
              				<xs:element ref="ds:operationBindings" minOccurs="0" />
              			</xs:sequence>
              			<xs:attribute name="dbName" type="xs:string" use="required" />
              			<xs:attribute name="ID" type="ds:IDOrtableName" use="required" />
              			<xs:attribute name="tableName" type="ds:IDOrtableName" use="required" />
              			<xs:attribute name="inheritsFrom" type="ds:IDOrtableName" />
              			<xs:attribute name="serverConstructor" type="ds:qualifiedClassName" />
              			<xs:attribute name="serverType" type="ds:serverTypes" use="required" />
              			<xs:attribute name="defaultTextMatchStyle" type="ds:textMatchStyle" default="exactCase" />
              		</xs:complexType>
              	</xs:element>
              
                <!-- TOP-LEVEL element fields -->
              	<xs:element name="fields">
              		<xs:complexType>
              			<xs:sequence>
              				<xs:element ref="ds:field" minOccurs="0" maxOccurs="unbounded" />
              			</xs:sequence>
              		</xs:complexType>
              	</xs:element>
              	
                <!-- TOP-LEVEL element serverObject -->
              	<xs:element name="serverObject">
              		<xs:complexType>
              			<xs:attribute name="lookupStyle" type="ds:lookupStyle" use="required" />
              			<xs:attribute name="className" type="ds:qualifiedClassName" use="required" />
              		</xs:complexType>
              	</xs:element>
              
                <!-- TOP-LEVEL element operationBindings -->
              	<xs:element name="operationBindings">
              		<xs:complexType>
              			<xs:sequence>
              				<xs:element ref="ds:operationBinding" minOccurs="0" maxOccurs="unbounded" />
              			</xs:sequence>
              		</xs:complexType>
              	</xs:element>
              	
                <!-- CHILD-LEVEL element operationBinding -->
              	<xs:element name="operationBinding">
              		<xs:complexType>
              			<xs:sequence>
              				<xs:element name="tableClause" minOccurs="0" />
              				<xs:element name="whereClause" minOccurs="0" />
              			</xs:sequence>
              			<xs:attribute name="operationType" type="ds:operationType" use="required" />
              			<xs:attribute name="requiresRole" type="xs:string" />
              			<xs:attribute name="operationId" type="xs:string" />
              			<xs:attribute name="serverMethod" type="xs:string" />
              			<xs:attribute name="outputs" type="ds:outputs" />
              			<xs:attribute name="canSyncCache" type="xs:boolean" />
              		</xs:complexType>
              	</xs:element>
              	
                <!-- CHILD-LEVEL element field -->
              	<xs:element name="field">
              		<xs:complexType>
              			<xs:sequence>
              				<xs:element name="valueMap" minOccurs="0">
              					<xs:complexType>
              						<xs:sequence>
              							<xs:element name="value" minOccurs="0" maxOccurs="unbounded" />
              						</xs:sequence>
              						<xs:attribute name="id" type="xs:string" />
              					</xs:complexType>
              				</xs:element>
              				<xs:element ref="ds:validators" minOccurs="0" />
              			</xs:sequence>
              			<xs:attribute name="canEdit" type="xs:boolean" />
              			<xs:attribute name="canFilter" type="xs:boolean" />
              			<xs:attribute name="canSave" type="xs:boolean" />
              			<xs:attribute name="customSelectExpression" type="xs:string" />
              			<xs:attribute name="displayField" type="ds:fieldName" />
              			<xs:attribute name="editorType" type="ds:editorType" />
              			<xs:attribute name="escapeHTML" type="xs:boolean" />
              			<xs:attribute name="foreignKey" type="ds:fieldReference" />
              			<xs:attribute name="hidden" type="xs:boolean" />
              			<xs:attribute name="includeFrom" type="ds:fieldReference" />
              			<xs:attribute name="includeVia" type="ds:fieldName" />
              			<xs:attribute name="joinType" type="ds:joinType" />
              			<xs:attribute name="length" type="xs:integer" />
              			<xs:attribute name="name" type="xs:string" />
              			<xs:attribute name="nativeName" type="xs:string" />
              			<xs:attribute name="primaryKey" type="xs:boolean" />
              			<xs:attribute name="relatedTableAlias" type="xs:string" />
              			<xs:attribute name="sqlStorageStrategy" type="ds:sqlStorageStrategy" />
              			<xs:attribute name="sqlTrueValue" type="ds:sqlTrueValue" />
              			<xs:attribute name="sqlFalseValue" type="ds:sqlFalseValue" />
              			<xs:attribute name="required" type="xs:boolean" />
              			<xs:attribute name="tableName" type="ds:IDOrtableName" />
              			<xs:attribute name="title" type="xs:string" />
              			<xs:attribute name="type" type="ds:fieldType" />
              			<!-- With XSD 1.1, make either (includeFrom|name,type) required -->
              		</xs:complexType>
              	</xs:element>
              	
              	<!-- CHILD-LEVEL element validators -->
              	<xs:element name="validators">
              		<xs:complexType>
              			<xs:sequence>
              				<xs:element ref="ds:validator" maxOccurs="unbounded" />
              			</xs:sequence>
              		</xs:complexType>
              	</xs:element>
              
              	<!-- CHILD-LEVEL element validator -->
              	<xs:element name="validator">
              		<xs:complexType>
              			<xs:sequence>
              				<xs:element ref="ds:serverObject" minOccurs="0" />
              				<xs:element name="additionalUniqueField" minOccurs="0" />
              				<xs:element name="serverCondition" minOccurs="0" />
              				<xs:element name="errorMessage" minOccurs="0" />
              			</xs:sequence>
              			<xs:attribute name="errorMessage" type="xs:string" />
              			<xs:attribute name="expression" type="xs:string" />
              			<xs:attribute name="type" type="ds:validatorType" />
              			<xs:attribute name="min" type="xs:integer" />
              			<xs:attribute name="max" type="xs:integer" />
              			<xs:attribute name="otherField" type="ds:IDOrtableName" />
              			<xs:attribute name="serverOnly" type="xs:boolean" />
              		</xs:complexType>
              	</xs:element>
              </xs:schema>

              Best regards,
              Blama
              Last edited by Blama; 16 Sep 2014, 00:46.

              Comment


                #8
                Hi Blama. Just wondering if maybe you have a more updated version of the xsd file? Thanks in advance!

                Comment


                  #9
                  Hi carlossierra,

                  yes, I do. I don't know the exact difference, but some more attributes/elements are in:
                  Code:
                  <?xml version="1.0" encoding="UTF-8"?>
                  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="lmscompany/ds" targetNamespace="lmscompany/ds" elementFormDefault="qualified"
                      version="1.0" xml:lang="EN" xmlns:fmt="lmscompany/fmt">
                      <xs:import namespace="lmscompany/fmt" schemaLocation="fmt.xsd" />
                  <!-- DataSource Attributes -->
                      <!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/DSServerType.java -->
                      <xs:simpleType name="serverTypes">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="generic" />
                              <xs:enumeration value="hibernate" />
                              <xs:enumeration value="jpa" />
                              <xs:enumeration value="jpa1" />
                              <xs:enumeration value="sql" />
                          </xs:restriction>
                      </xs:simpleType>
                      <xs:simpleType name="textMatchStyle">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="exact" />
                              <xs:enumeration value="exactCase" />
                              <xs:enumeration value="startsWith" />
                              <xs:enumeration value="substring" />
                          </xs:restriction>
                      </xs:simpleType>
                      <xs:simpleType name="IDOrtableName">
                          <xs:restriction base="xs:string">
                              <xs:pattern value="[A-Z]{1}[0-9A-Z_]*" />
                          </xs:restriction>
                      </xs:simpleType>
                      <xs:simpleType name="qualifiedClassName">
                          <xs:restriction base="xs:string">
                              <xs:pattern value="(([a-z_]{1}[a-z0-9_]*\.)*([a-zA-Z_]{1}[a-zA-Z0-9_]*){1})" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                  <!-- Field Attributes -->
                      <!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/FieldType.java -->
                      <xs:simpleType name="fieldType">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="any" />
                              <xs:enumeration value="binary" />
                              <xs:enumeration value="boolean" />
                              <xs:enumeration value="creator" />
                              <xs:enumeration value="creatorTimestamp" />
                              <xs:enumeration value="custom" />
                              <xs:enumeration value="date" />
                              <xs:enumeration value="datetime" />
                              <xs:enumeration value="enum" />
                              <xs:enumeration value="float" />
                              <xs:enumeration value="image" />
                              <xs:enumeration value="imageFile" />
                              <xs:enumeration value="intEnum" />
                              <xs:enumeration value="integer" />
                              <xs:enumeration value="link" />
                              <xs:enumeration value="localeCurrency" />
                              <xs:enumeration value="localeFloat" />
                              <xs:enumeration value="localeInt" />
                              <xs:enumeration value="modifier" />
                              <xs:enumeration value="modifierTimestamp" />
                              <xs:enumeration value="ntext" />
                              <xs:enumeration value="password" />
                              <xs:enumeration value="sequence" />
                              <xs:enumeration value="text" />
                              <xs:enumeration value="time" />
                              <!-- My types -->
                              <xs:enumeration value="emailType" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                      <xs:simpleType name="fieldReference">
                          <xs:restriction base="xs:string">
                              <xs:pattern value="[A-Z]{1}[0-9A-Z_]*\.[A-Z]{1}[0-9A-Z_]*" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                      <xs:simpleType name="fieldName">
                          <xs:restriction base="xs:string">
                              <xs:pattern value="[A-Z]{1}[0-9A-Z_]+" />
                          </xs:restriction>
                      </xs:simpleType>
                      
                      <!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/JoinType.java -->
                      <xs:simpleType name="joinType">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="outer" />
                              <xs:enumeration value="inner" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                      <xs:simpleType name="importStrategy">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="key" />
                              <xs:enumeration value="display" />
                              <xs:enumeration value="auto" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                      <xs:simpleType name="mimeType">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="text/html" />
                          </xs:restriction>
                      </xs:simpleType>
                      
                    <!-- http://www.smartclient.com/smartgwtee-latest/javadoc/com/smartgwt/client/docs/serverds/DataSourceField.html#sqlStorageStrategy -->
                      <xs:simpleType name="sqlStorageStrategy">
                          <xs:restriction base="xs:string">
                          <!-- Fields of type "boolean" -->
                              <xs:enumeration value="number" />
                              <xs:enumeration value="integer" />
                              <xs:enumeration value="singleChar10" />
                              <xs:enumeration value="singleCharYN" />
                              <xs:enumeration value="singleCharTF" />
                              <xs:enumeration value="singleChar" />
                        <!-- Fields of type "date", "time", and "datetime" -->
                              <xs:enumeration value="string" />
                              <xs:enumeration value="nativeDate" />
                              <xs:enumeration value="text" />
                        <!-- Fields of type "text" -->
                              <xs:enumeration value="ntext" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                      <xs:simpleType name="sqlFalseValue">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="L" />
                              <xs:enumeration value="F" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                      <xs:simpleType name="sqlTrueValue">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="W" />
                              <xs:enumeration value="T" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                  
                      <xs:simpleType name="editorType">
                          <xs:restriction base="xs:string">
                        <!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/FormItemType.java -->
                              <xs:enumeration value="SelectItem" />
                              <xs:enumeration value="HiddenItem" />
                              <xs:enumeration value="HeaderItem" />
                              <xs:enumeration value="DateItem" />
                              <xs:enumeration value="BlurbItem" />
                              <xs:enumeration value="ComboBoxItem" />
                              <xs:enumeration value="SpacerItem" />
                              <xs:enumeration value="RowSpacerItem" />
                              <xs:enumeration value="CheckboxItem" />
                              <xs:enumeration value="StaticTextItem" />
                              <xs:enumeration value="LinkItem" />
                              <xs:enumeration value="CanvasItem" />
                              <xs:enumeration value="PickTreeItem" />
                              <xs:enumeration value="ButtonItem" />
                              <xs:enumeration value="SubmitItem" />
                              <xs:enumeration value="ResetItem" />
                              <xs:enumeration value="RichTextItem" />
                              <xs:enumeration value="FileItem" />
                              <xs:enumeration value="SliderItem" />
                              <xs:enumeration value="ToolbarItem" />
                              <xs:enumeration value="SectionItem" />
                              <xs:enumeration value="TextAreaItem" />
                              <xs:enumeration value="TextItem" />
                              <xs:enumeration value="UploadItem" />
                              <xs:enumeration value="PasswordItem" />
                              <xs:enumeration value="SpinnerItem" />
                              <xs:enumeration value="TimeItem" />
                              <xs:enumeration value="NativeCheckboxItem" />
                              <xs:enumeration value="radioGroup" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                      <xs:simpleType name="outputs">
                          <xs:restriction base="xs:string">
                              <xs:pattern value="(([A-Z]{1}[0-9A-Z_]*)(, [A-Z]{1}[0-9A-Z_]*)*)?" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                      <xs:simpleType name="operationId">
                          <xs:restriction base="xs:string">
                              <xs:pattern value="[a-z]{1}[0-9A-Za-z_]*" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                    <!-- serverObject Attributes-->
                      <!-- http://www.smartclient.com/smartgwtee-latest/javadoc/com/smartgwt/client/docs/serverds/ServerObject.html#lookupStyle -->
                      <xs:simpleType name="lookupStyle">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="new" />
                              <xs:enumeration value="spring" />
                              <xs:enumeration value="factory" />
                              <xs:enumeration value="attribute" />
                          </xs:restriction>
                      </xs:simpleType>
                      
                  <!-- operationBinding Attributes-->
                  <!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/DSOperationType.java -->
                      <xs:simpleType name="operationType">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="add" />
                              <xs:enumeration value="clientExport" />
                              <xs:enumeration value="custom" />
                              <xs:enumeration value="downloadFile" />
                              <xs:enumeration value="fetch" />
                              <xs:enumeration value="remove" />
                              <xs:enumeration value="update" />
                              <xs:enumeration value="validate" />
                              <xs:enumeration value="viewFile" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                      <xs:simpleType name="criteriaPolicy">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="dropOnChange" />
                              <xs:enumeration value="dropOnShortening" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                    <!-- validator Attributes-->
                    <!-- http://code.google.com/p/smartgwt/source/browse/branches/4.0/main/src/com/smartgwt/client/types/ValidatorType.java -->
                      <xs:simpleType name="validatorType">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="contains" />
                              <xs:enumeration value="dateRange" />
                              <xs:enumeration value="doesntContain" />
                              <xs:enumeration value="floatLimit" />
                              <xs:enumeration value="floatPrecision" />
                              <xs:enumeration value="floatRange" />
                              <xs:enumeration value="hasRelatedRecord" />
                              <xs:enumeration value="integerRange" />
                              <xs:enumeration value="isBoolean" />
                              <xs:enumeration value="isFloat" />
                              <xs:enumeration value="isFunction" />
                              <xs:enumeration value="isInteger" />
                              <xs:enumeration value="isOneOf" />
                              <xs:enumeration value="isString" />
                              <xs:enumeration value="isUnique" />
                              <xs:enumeration value="lengthRange" />
                              <xs:enumeration value="mask" />
                              <xs:enumeration value="matchesField" />
                              <xs:enumeration value="readOnly" />
                              <xs:enumeration value="regexp" />
                              <xs:enumeration value="required" />
                              <xs:enumeration value="requiredIf" />
                              <xs:enumeration value="serverCustom" />
                              <xs:enumeration value="substringCount" />
                          </xs:restriction>
                      </xs:simpleType>
                    
                    <!-- possible OperatorIds -->
                    <!-- http://code.google.com/p/smartgwt/source/browse/branches/5.0/main/src/com/smartgwt/client/types/OperatorId.java -->
                      <xs:simpleType name="operatorId">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="and" />
                              <xs:enumeration value="between" />
                              <xs:enumeration value="betweenInclusive" />
                              <xs:enumeration value="contains" />
                              <xs:enumeration value="containsField" />
                              <xs:enumeration value="containsPattern" />
                              <xs:enumeration value="endsWith" />
                              <xs:enumeration value="endsWithField" />
                              <xs:enumeration value="endsWithPattern" />
                              <xs:enumeration value="equals" />
                              <xs:enumeration value="equalsField" />
                              <xs:enumeration value="greaterOrEqual" />
                              <xs:enumeration value="greaterOrEqualField" />
                              <xs:enumeration value="greaterThan" />
                              <xs:enumeration value="greaterThanField" />
                              <xs:enumeration value="iBetweenInclusive" />
                              <xs:enumeration value="iContains" />
                              <xs:enumeration value="iContainsField" />
                              <xs:enumeration value="iContainsPattern" />
                              <xs:enumeration value="iEndsWith" />
                              <xs:enumeration value="iEndsWithField" />
                              <xs:enumeration value="iEndsWithPattern" />
                              <xs:enumeration value="iEquals" />
                              <xs:enumeration value="iEqualsField" />
                              <xs:enumeration value="iMatchesPattern" />
                              <xs:enumeration value="iNotContains" />
                              <xs:enumeration value="iNotContainsField" />
                              <xs:enumeration value="iNotEndsWith" />
                              <xs:enumeration value="iNotEndsWithField" />
                              <xs:enumeration value="iNotEqual" />
                              <xs:enumeration value="iNotEqualField" />
                              <xs:enumeration value="iNotStartsWith" />
                              <xs:enumeration value="iNotStartsWithField" />
                              <xs:enumeration value="iStartsWith" />
                              <xs:enumeration value="iStartsWithField" />
                              <xs:enumeration value="iStartsWithPattern" />
                              <xs:enumeration value="inSet" />
                              <xs:enumeration value="iregexp" />
                              <xs:enumeration value="isNull" />
                              <xs:enumeration value="lessOrEqual" />
                              <xs:enumeration value="lessOrEqualField" />
                              <xs:enumeration value="lessThan" />
                              <xs:enumeration value="lessThanField" />
                              <xs:enumeration value="matchesPattern" />
                              <xs:enumeration value="not" />
                              <xs:enumeration value="notContains" />
                              <xs:enumeration value="notContainsField" />
                              <xs:enumeration value="notEndsWith" />
                              <xs:enumeration value="notEndsWithField" />
                              <xs:enumeration value="notEqual" />
                              <xs:enumeration value="notEqualField" />
                              <xs:enumeration value="notInSet" />
                              <xs:enumeration value="notNull" />
                              <xs:enumeration value="notStartsWith" />
                              <xs:enumeration value="notStartsWithField" />
                              <xs:enumeration value="or" />
                              <xs:enumeration value="regexp" />
                              <xs:enumeration value="startsWith" />
                              <xs:enumeration value="startsWithField" />
                              <xs:enumeration value="startsWithPattern" />
                          </xs:restriction>
                      </xs:simpleType>
                  
                    <!-- FIELDS -->
                    <!-- ROOT-LEVEL element DataSource -->
                      <xs:element name="DataSource">
                          <xs:complexType>
                              <xs:sequence>
                                  <xs:element ref="fmt:bundle" minOccurs="1" />
                                  <xs:element ref="ds:fields" minOccurs="0" />
                                  <xs:element ref="ds:serverObject" minOccurs="0" />
                                  <xs:element ref="ds:operationBindings" minOccurs="0" />
                              </xs:sequence>
                              <xs:attribute name="dbName" type="xs:string" use="required" />
                              <xs:attribute name="ID" type="ds:IDOrtableName" use="required" />
                              <xs:attribute name="tableName" type="ds:IDOrtableName" use="required" />
                              <xs:attribute name="inheritsFrom" type="ds:IDOrtableName" />
                              <xs:attribute name="serverConstructor" type="ds:qualifiedClassName" />
                              <xs:attribute name="serverType" type="ds:serverTypes" use="required" />
                              <xs:attribute name="defaultTextMatchStyle" type="ds:textMatchStyle" default="exactCase" />
                              <xs:attribute name="titleField" type="ds:IDOrtableName" />
                              <xs:attribute name="progressiveLoading" type="xs:boolean" default="true" />
                              <xs:attribute name="requiresRole" type="xs:string" />
                              <xs:attribute name="criteriaPolicy" type="ds:criteriaPolicy" default="dropOnChange" />
                              <xs:attribute name="serverOnly" type="xs:boolean" default="true" />
                              <xs:attribute name="joinOnly" type="xs:boolean" default="true" />
                          </xs:complexType>
                      </xs:element>
                  
                      <xs:element name="bundle">
                          <xs:complexType>
                              <xs:attribute name="basename" type="xs:string" use="required" />
                              <xs:attribute name="encoding" type="xs:string" use="required" />
                          </xs:complexType>
                      </xs:element>
                  
                    <!-- TOP-LEVEL element fields -->
                      <xs:element name="fields">
                          <xs:complexType>
                              <xs:sequence>
                                  <xs:element ref="ds:field" minOccurs="0" maxOccurs="unbounded" />
                              </xs:sequence>
                          </xs:complexType>
                      </xs:element>
                      
                    <!-- TOP-LEVEL element serverObject -->
                      <xs:element name="serverObject">
                          <xs:complexType>
                              <xs:attribute name="lookupStyle" type="ds:lookupStyle" use="required" />
                              <xs:attribute name="className" type="ds:qualifiedClassName" use="required" />
                          </xs:complexType>
                      </xs:element>
                  
                    <!-- TOP-LEVEL element operationBindings -->
                      <xs:element name="operationBindings">
                          <xs:complexType>
                              <xs:sequence>
                                  <xs:element ref="ds:operationBinding" minOccurs="0" maxOccurs="unbounded" />
                              </xs:sequence>
                          </xs:complexType>
                      </xs:element>
                      
                    <!-- CHILD-LEVEL element operationBinding -->
                      <xs:element name="operationBinding">
                          <xs:complexType>
                              <xs:sequence>
                                  <xs:element name="tableClause" minOccurs="0" maxOccurs="1" />
                                  <xs:element name="whereClause" minOccurs="0" maxOccurs="1" />
                                  <xs:element ref="ds:mail" minOccurs="0" maxOccurs="1" />
                                  <xs:element name="customFields" minOccurs="0" maxOccurs="1" />
                                  <xs:element name="summaryFunctions" minOccurs="0" maxOccurs="1" />
                                  <xs:element name="groupBy" minOccurs="0" maxOccurs="unbounded" />
                                  <xs:element ref="ds:criteria" minOccurs="0" maxOccurs="unbounded" />
                              </xs:sequence>
                              <xs:attribute name="operationType" type="ds:operationType" use="required" />
                              <xs:attribute name="requiresRole" type="xs:string" />
                              <xs:attribute name="operationId" type="ds:operationId" />
                              <xs:attribute name="serverMethod" type="xs:string" />
                              <xs:attribute name="methodArguments" type="xs:string" />
                              <xs:attribute name="outputs" type="ds:outputs" />
                              <xs:attribute name="canSyncCache" type="xs:boolean" />
                              <xs:attribute name="cacheSyncOperation" type="xs:string" />
                              <xs:attribute name="progressiveLoading" type="xs:boolean" default="true" />
                              <xs:attribute name="serverOnly" type="xs:boolean" default="true" />
                              <xs:attribute name="skipRowCount" type="xs:boolean" default="true" />
                          </xs:complexType>
                      </xs:element>
                      
                        <!-- CHILD-LEVEL element mail -->
                      <xs:element name="mail">
                          <xs:complexType>
                              <xs:all>
                                  <xs:element name="to" minOccurs="0" maxOccurs="1" />
                                  <xs:element name="cc" minOccurs="0" maxOccurs="1" />
                                  <xs:element name="bcc" minOccurs="0" maxOccurs="1" />
                                  <xs:element name="from" minOccurs="1" maxOccurs="1" />
                                  <xs:element name="subject" minOccurs="1" maxOccurs="1" />
                                  <xs:element ref="ds:mailTemplateType" minOccurs="1" maxOccurs="1" />
                              </xs:all>
                              <xs:attribute name="contentType" type="ds:mimeType"></xs:attribute>
                          </xs:complexType>
                      </xs:element>
                      <xs:element name="mailTemplateType" abstract="true" />
                      <xs:element name="templateFile" substitutionGroup="ds:mailTemplateType" />
                      <xs:element name="messageTemplate" substitutionGroup="ds:mailTemplateType" />
                  
                    <!-- CHILD-LEVEL element field -->
                      <xs:element name="field">
                          <xs:complexType>
                              <xs:sequence>
                                  <xs:element ref="ds:title" minOccurs="0" />
                                  <xs:element name="valueMap" minOccurs="0">
                                      <xs:complexType>
                                          <xs:sequence>
                                              <xs:element name="value" minOccurs="0" maxOccurs="unbounded" />
                                          </xs:sequence>
                                          <xs:attribute name="id" type="xs:string" />
                                      </xs:complexType>
                                  </xs:element>
                                  <xs:element ref="ds:validators" minOccurs="0" />
                              </xs:sequence>
                              <xs:attribute name="canEdit" type="xs:boolean" default="false" />
                              <xs:attribute name="canFilter" type="xs:boolean" default="false" />
                              <xs:attribute name="canSave" type="xs:boolean" default="false" />
                              <xs:attribute name="canView" type="xs:boolean" default="false" />
                              <xs:attribute name="customInsertExpression" type="xs:string" />
                              <xs:attribute name="customSelectExpression" type="xs:string" />
                              <xs:attribute name="customUpdateExpression" type="xs:string" />
                              <xs:attribute name="customSQL" type="xs:boolean" default="true" />
                              <xs:attribute name="displayField" type="ds:fieldName" />
                              <xs:attribute name="editorType" type="ds:editorType" />
                              <xs:attribute name="escapeHTML" type="xs:boolean" default="true" />
                              <xs:attribute name="foreignKey" type="ds:fieldReference" />
                              <xs:attribute name="hidden" type="xs:boolean" default="true" />
                              <xs:attribute name="ignore" type="xs:boolean" default="true" />
                              <xs:attribute name="importStrategy" type="ds:importStrategy" default="display" />
                              <xs:attribute name="includeFrom" type="ds:fieldReference" />
                              <xs:attribute name="includeVia" type="ds:fieldName" />
                              <xs:attribute name="joinType" type="ds:joinType" default="outer" />
                              <xs:attribute name="length" type="xs:integer" />
                              <xs:attribute name="maxFileSize" type="xs:integer" />
                              <xs:attribute name="name" type="xs:string" />
                              <xs:attribute name="nativeName" type="xs:string" />
                              <xs:attribute name="primaryKey" type="xs:boolean" default="true" />
                              <xs:attribute name="relatedTableAlias" type="xs:string" />
                              <xs:attribute name="sortByField" type="ds:fieldName" />
                              <xs:attribute name="sqlStorageStrategy" type="ds:sqlStorageStrategy" />
                              <xs:attribute name="sqlTrueValue" type="ds:sqlTrueValue" />
                              <xs:attribute name="sqlFalseValue" type="ds:sqlFalseValue" />
                              <xs:attribute name="storeMilliseconds" type="xs:boolean" default="true" />
                              <xs:attribute name="required" type="xs:boolean" default="true" />
                              <xs:attribute name="tableName" type="ds:IDOrtableName" />
                              <!-- Now forced to be an own tag 
                              <xs:attribute name="title" type="xs:string" />
                              -->
                              <xs:attribute name="type" type="ds:fieldType" />
                              <xs:attribute name="uploadFieldName" type="xs:string" />
                              
                              <!-- With XSD 1.1, make either (includeFrom|name,type) required -->
                          </xs:complexType>
                      </xs:element>
                  
                      <xs:element name="title">
                          <xs:complexType>
                              <xs:sequence minOccurs="0">
                                  <xs:element ref="fmt:message" minOccurs="1" />
                              </xs:sequence>
                          </xs:complexType>
                      </xs:element>
                      
                      <!-- CHILD-LEVEL element validators -->
                      <xs:element name="validators">
                          <xs:complexType>
                              <xs:sequence>
                                  <xs:element ref="ds:validator" minOccurs="0" maxOccurs="unbounded" />
                              </xs:sequence>
                          </xs:complexType>
                      </xs:element>
                  
                      <!-- CHILD-LEVEL element validator -->
                      <xs:element name="validator">
                          <xs:complexType>
                              <xs:sequence>
                                  <xs:element ref="ds:serverObject" minOccurs="0" />
                                  <xs:element name="additionalUniqueField" minOccurs="0" />
                                  <xs:element name="serverCondition" minOccurs="0" />
                                  <xs:element name="errorMessage" minOccurs="0" />
                              </xs:sequence>
                              <xs:attribute name="caseSensitive" type="xs:boolean" default="true" />
                              <xs:attribute name="criteriaFields" type="xs:string" />
                              <!-- Now forced to be an own tag 
                              <xs:attribute name="errorMessage" type="xs:string" />
                              -->
                              <xs:attribute name="expression" type="xs:string" />
                              <xs:attribute name="type" type="ds:validatorType" />
                              <xs:attribute name="min" type="xs:integer" />
                              <xs:attribute name="max" type="xs:integer" />
                              <xs:attribute name="otherField" type="ds:IDOrtableName" />
                              <xs:attribute name="serverOnly" type="xs:boolean" default="true" />
                          </xs:complexType>
                      </xs:element>
                  
                      <!-- CHILD-LEVEL element criteria -->
                      <xs:element name="criteria">
                          <xs:complexType>
                              <xs:attribute name="fieldName" type="ds:IDOrtableName" />
                              <xs:attribute name="value" type="xs:string" />
                              <xs:attribute name="operator" type="ds:operatorId" />
                          </xs:complexType>
                      </xs:element>
                  </xs:schema>
                  For fmt-tags for DataSource localisation:
                  Code:
                  <?xml version="1.0" encoding="UTF-8"?>
                  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fmt="lmscompany/fmt" targetNamespace="lmscompany/fmt" elementFormDefault="qualified"
                      version="1.0" xml:lang="EN">
                      <xs:simpleType name="encodings">
                          <xs:restriction base="xs:string">
                              <xs:enumeration value="utf-8" />
                              <xs:enumeration value="iso-8859" />
                          </xs:restriction>
                      </xs:simpleType>
                      <xs:element name="bundle">
                          <xs:complexType>
                              <xs:attribute name="basename" type="xs:string" use="required" />
                              <xs:attribute name="encoding" type="fmt:encodings" use="required" />
                          </xs:complexType>
                      </xs:element>
                      <xs:element name="message">
                          <xs:complexType>
                              <xs:attribute name="key" type="xs:string" use="required" />
                          </xs:complexType>
                      </xs:element>
                  </xs:schema>
                  Best regards
                  Blama

                  Comment


                    #10
                    Blama, thank you so much for sharing and for your time!!! I really appreciate it. Thanks a lot...

                    Comment


                      #11
                      By the way, although I guess it's not something commonly used, this is a very simple/minimal XSD Schema for the appID.app.xml file required for declaring server methods to be used in RPC DMI calls (as described here). Maybe it can be useful for someone that comes here looking for SmartGWT related schemas.

                      Code:
                      <?xml version="1.0" encoding="UTF-8"?>
                      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
                          xmlns:app="focuss/app" 
                          targetNamespace="focuss/app" 
                          elementFormDefault="qualified"
                          version="1.0" 
                          xml:lang="EN">
                          
                          <xs:element name="Application">
                              <xs:complexType>
                                  <xs:sequence>
                                      <xs:element ref="app:rpcBindings" minOccurs="1" />
                                  </xs:sequence>
                              </xs:complexType>
                          </xs:element>
                          
                          <xs:element name="rpcBindings">
                              <xs:complexType>
                                  <xs:sequence>
                                      <xs:element ref="app:ServerObject" minOccurs="1" />
                                  </xs:sequence>
                              </xs:complexType>
                          </xs:element>
                          
                          <xs:element name="ServerObject">
                              <xs:complexType>
                                  <xs:sequence>
                                      <xs:element ref="app:visibleMethods" minOccurs="1" />
                                  </xs:sequence>
                                  <xs:attribute name="ID" type="xs:string" use="required" />
                                  <xs:attribute name="className" type="xs:string" use="required" />
                              </xs:complexType>
                          </xs:element>
                          
                          <xs:element name="visibleMethods">
                              <xs:complexType>
                                  <xs:sequence>
                                      <xs:element ref="app:method" minOccurs="1" />
                                  </xs:sequence>
                              </xs:complexType>
                          </xs:element>
                      
                          <xs:element name="method">
                              <xs:complexType>
                                  <xs:attribute name="name" type="xs:string" use="required" />
                              </xs:complexType>
                          </xs:element>
                          
                      </xs:schema>
                      ​

                      Comment

                      Working...
                      X