<!-- 
This DataSource is the special "DataSource DataSource".  It defines the schema by which other 
XML DataSources are loaded, and it is itself a DataSource.  Because it would be the schema *for
itself*, it has to be written assuming schemaless transform.

In W3C XML Schema this bootstrap problem is solved by using the older DTD schema language to define
the schema for the XML Schema language.  

Also part of this bootstrap are the subobjects of DataSources:
DataSourceField.ds.xml
Validator.ds.xml
-->
<Object ID="DataSource"	Constructor="DataSource" __autoConstruct="DataSource"
        addGlobalId="false">
    <fields>
        <!-- basics -->
	    <ID type="string" xmlAttribute="true"/>
        <autoIdField type="string" xmlAttribute="true"/>

	    <inheritsFrom type="string" title="Superclass"/>
        <useParentFieldOrder type="boolean"/>
        <useLocalFieldsOnly type="boolean"/>
        <restrictToParentFields type="boolean"/>

        <dataFormat type="string" title="DataFormat" xmlAttribute="true">
            <valueMap iscServer="ISC Java Server" 
                      xml="XML / WSDL Web Service" 
                      json="JSON Web Service"
                      custom="Custom Binding"/>
        </dataFormat>
        <useStrictJSON type="boolean" xmlAttribute="true"/>

        <!-- special attribute used by VisualBuilder to suppress autoFetch -->
        <noAutoFetch type="boolean" xmlAttribute="true"/>
        <serverType type="string" title="Server Type" xmlAttribute="true">
            <valueMap sql="ISC Server SQL Connectors" 
                      hibernate="ISC Server Hibernate Connectors" 
                      jpa="Use SmartClient's built-in JPA 2.0 connector" 
                      jpa1="Use SmartClient's built-in JPA 1.0 connector" 
                      generic="Requests will be delivered to the server and you are expected to write Java code to create a valid response"
                      />
        </serverType>
        <schemaBean type="string" xmlAttribute="true" />
        <callbackParam type="string" title="Callback Parameter" xmlAttribute="true"/>
        <requestProperties type="Object"/>

	    <fields type="DataSourceField" multiple="true" propertiesOnly="true" 
                childTagName="field"/>

		<addGlobalId type="boolean" title="Add Global ID"/>
        <showPrompt type="boolean"/>

	    <dataSourceVersion type="number" title="DataSource Version" xmlAttribute="true"
                           visibility="internal"/>

        <!-- SQL specific -->
	    <dbName type="string" title="Database Name" xmlAttribute="true"/>
	    <schema type="string" title="Schema" xmlAttribute="true"/>
	    <tableName type="string" title="Table Name" xmlAttribute="true"/>
	    <quoteTableName type="boolean" title="Quote Table Name?" xmlAttribute="true"/>
        <tableCode type="string" xmlAttribute="true"/>
        <strictSQLFiltering type="boolean" xmlAttribute="true" />

        <!-- serverObject definition that applies as a default to all operationBindings -->
        <serverObject type="ServerObject"/>

        <serverConstructor type="string"/>

        <!-- operationBindings for each operation type -->
        <operationBindings multiple="true" type="OperationBinding"/>

        <!-- allow "field" and "operationBinding" without wrapper tags since users frequently
         forget. Hidden because we don't want this showing in tools for editing DataSources -->
        <field type="DataSourceField" propertiesOnly="true" moveTo="fields" hidden="true"/>
        <operationBinding type="OperationBinding" moveTo="operationBindings" hidden="true"/>

        <!-- XML binding specific -->
        <!-- Service Inputs -->
        <serviceNamespace type="string" xmlAttribute="true"/>

        <dataURL type="string" xmlAttribute="true"/>
        <dataProtocol type="string" xmlAttribute="true"/>
        <dataTransport type="string" xmlAttribute="true"/>

        <defaultParams type="Object"/>
        <soapAction type="string"/>
        <jsonPrefix type="string"/>
        <jsonSuffix type="string"/>

        <messageTemplate type="string"/>
        <defaultCriteria type="Object" propertiesOnly="true" visibility="internal"/>
        <tagName type="string" visibility="xmlBinding"/>

        <!-- Service Outputs -->
        <recordXPath type="XPath"/>
        <recordName type="string"/>
        <xmlNamespaces type="Object"/>
        <dropExtraFields type="boolean"/>

        <!-- XML Schema -->
        <schemaNamespace type="string" visibility="internal" xmlAttribute="true"/>
        <mustQualify type="boolean" visibility="internal"/>
        <xsdSimpleContent type="boolean" visibility="internal"/>
        <xsdAnyElement type="boolean" visibility="internal"/>
        <xsdAbstract type="boolean" visibility="internal"/>

        <!-- record titling -->
	    <title type="string" title="Title"/>
	    <titleField type="string" title="Title Field"/>
	    <pluralTitle type="string" title="Plural Title"/>
        
        <!-- clientOnly / caching DataSources -->
	    <clientOnly type="boolean" title="Client Only" xmlAttribute="true"/>
	    <testFileName type="URL" title="Test File Name" xmlAttribute="true"/>
        <dbImportFileName type="URL" xmlAttribute="true" />
	    <testData type="Object" multiple="true" skipSerialization="true"/>
	    <cacheData type="Object" multiple="true"/>
	    <cacheAllData type="boolean" xmlAttribute="true"/>
	    <cacheAcrossOperationIds type="boolean" xmlAttribute="true"/>

        <!-- for declaring inline types -->
	    <types type="DataSourceField" multiple="true" propertiesOnly="true" 
               uniqueProperty="ID" visibility="internal"/>

        <!-- for ordering groups in editing and JSDoc -->
        <groups type="string" multiple="true" visibility="internal"/>

        <!-- action declarations for automatic method routing -->
        <methods type="MethodDeclaration" multiple="true" visibility="internal"/>
        <showSuperClassActions type="boolean"/>
        <createStandalone type="boolean"/>
        
        <useFlatFields type="boolean"/>
        <showLocalFieldsOnly type="boolean" xmlAttribute="true"/>
        <showSuperClassEvents type="boolean" xmlAttribute="true"/>

        <globalNamespaces type="Object"/>
        
        <autoDeriveSchema type="boolean" xmlAttribute="true"/>
        <autoDeriveFKs type="boolean" xmlAttribute="true"/>
        
        <useLocalValidators type="boolean"/>
        <autoDeriveTitles type="boolean"/>
        <qualifyColumnNames type="boolean" xmlAttribute="true"/>
        <validateRelatedRecords type="boolean"/>

        <!-- Security -->
        <requiresAuthentication type="boolean"/>
        <requiresRole type="string"/>
        <requires type="string" />

        <ownerIdField type="string" />
        <guestUserId type="string" />
        
        <beanClassName type="string" xmlAttribute="true"/>
        
        <autoJoinTransactions type="boolean" xmlAttribute="true"/>
        <useAnsiJoins type="boolean" />
        
        <useSpringTransaction type="boolean" xmlAttribute="true"/>
        
        <sparseUpdates type="boolean" />
        <noNullUpdates type="boolean" />

        <canExport type="boolean" />

        <progressiveLoading type="boolean" />

	<autoConvertRelativeDates type="boolean" />

        <allowAdvancedCriteria type="boolean" xmlAttribute="true" />
        
        <scriptImport type="string"/>
        <script type="Object" idAllowed="true"/>

        <allowClientRequestedSummaries type="boolean" />

        <patternMultiWildcard type="string" multiple="true" />
        <patternSingleWildcard type="string" multiple="true" />
        <criteriaPolicy type="string">
            <valueMap dropOnChange="Drop on criteria change" 
                dropOnShortening="Drop if criteria became more restrictive" />
        </criteriaPolicy>
        <substituteClasses type="string" />
        <idClassName type="string" />
        <supportTransactions type="boolean" />
        <creatorOverrides type="boolean" />
        <loadParents type="boolean" xmlAttribute="true" />
        <loadID type="string" />

        <!-- audit -->
        <audit type="boolean" />
        <auditDataSourceID type="string" />
        <auditDSConstructor type="string" />
        <auditRevisionFieldName type="string" />
        <auditTimeStampFieldName type="string" />
        <auditTypeFieldName type="string" />
        <auditUserFieldName type="string" />

        <autoCreateAuditTable type="boolean" />
        <inheritanceMode type="string" >
            <valueMap full="Inherit fields by copying them onto the inheriting DataSource's underlying table." 
                      none="Do not physically inherit fields onto the inheriting DataSource's SQL table" />
        </inheritanceMode>
        <quoteColumnNames type="boolean" />
        <generatedBy type="string" xmlAttribute="true" />
        <useUTCDateTimes type="boolean" />
        <useOfflineStorage type="boolean" />
        <enumOrdinalProperty type="string" />
        <enumTranslateStrategy type="string">
            <valueMap string="Translates to/from a String matching the constant name." 
                      ordinal="Translates to/from an integer matching the ordinal number of the constant within the enumeration"
                      bean="Translates to/from a Javascript object containing one property for each property defined within the enum." />
        </enumTranslateStrategy>
        <xmlFromConfig type="boolean" />
        <translatePatternOperators type="boolean" />

        <!-- fileSource -->
        <fileNameField type="string" />
        <fileTypeField type="string" />
        <fileFormatField type="string" />
        <fileSizeField type="string" />
        <fileLastModifiedField type="string" />
        <fileContentsField type="string" />

        <!-- ProjectFile -->
        <projectFileKey type="string" />
        <projectFileLocations type="string" multiple="true" childTagName="location" /> 
        
        <defaultTextMatchStyle type="string" />
        <ignoreTextMatchStyleCaseSensitive type="boolean" />

        <defaultMultiUpdatePolicy type="string" xmlAttribute="true">
            <valueMap never="PK never required" 
                      clientRequest="PK required for client requests only"
                      rpcManager="PK required for requests associated with RPCManager"
                      always="PK always required no matter what"/>
        </defaultMultiUpdatePolicy>

        <!-- must declare "string" type to enable localization support -->
        <maxFileSizeExceededMessage type="string" />
        
        <requiredMessage type="string" title="Required Message" xmlAttribute="true"/>

    </fields>
</Object>

