Files
ofbiz-framework/framework/datafile/dtd/datafiles.xsd
T
Nicolas Malin a1f16274c2 Improved: Add enconding type attribute for import data file tools
(OFBIZ-10234)
During the import of file via datafile import you may want to set encoding type.
Actually only the type UTF-8 is supported.
This commit allows to add a new "encoding-type" attribute into data-file to indicate the type of encoding of the imported file.

Thanks to Pierre Gaudin for this improvement.
2019-11-22 15:10:37 +01:00

138 lines
6.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="data-files">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="data-file"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="data-file">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="record"/>
</xs:sequence>
<xs:attributeGroup ref="attlist.data-file"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.data-file">
<xs:attribute name="name" use="required"/>
<xs:attribute name="type-code" use="required"/>
<xs:attribute name="sender"/>
<xs:attribute name="encoding-type"/>
<xs:attribute name="receiver"/>
<xs:attribute name="delimiter"/>
<xs:attribute name="start-line"/>
<xs:attribute name="text-delimiter"/>
<xs:attribute name="record-length"/>
<xs:attribute name="separator-style" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="fixed-length"/>
<xs:enumeration value="fixed-record"/>
<xs:enumeration value="delimited"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="eol-type" default="CR">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="CR"/>
<xs:enumeration value="CRLF"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="description"/>
</xs:attributeGroup>
<xs:element name="record">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="field"/>
</xs:sequence>
<xs:attributeGroup ref="attlist.record"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.record">
<xs:attribute name="name" use="required"/>
<xs:attribute name="type-code"/>
<xs:attribute name="tc-min"/>
<xs:attribute name="tc-max"/>
<xs:attribute name="tc-isnum" type="xs:boolean" default="true"/>
<xs:attribute name="tc-position"/>
<xs:attribute name="tc-length"/>
<xs:attribute name="description"/>
<xs:attribute name="parent-name"/>
<xs:attribute name="limit" default="many">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="one"/>
<xs:enumeration value="many"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:element name="field">
<xs:complexType>
<xs:attributeGroup ref="attlist.field"/>
</xs:complexType>
</xs:element>
<xs:attributeGroup name="attlist.field">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="position"/>
<xs:attribute name="length"/>
<xs:attribute name="type" use="required">
<xs:annotation><xs:documentation>The field type is always required. See more about the type attribure in Record.setString() method</xs:documentation></xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="CustomDate"/>
<xs:enumeration value="CustomTime"/>
<xs:enumeration value="FixedPointDouble"/>
<xs:enumeration value="java.lang.String"/>
<xs:enumeration value="String"/>
<xs:enumeration value="java.sql.Timestamp"/>
<xs:enumeration value="Timestamp"/>
<xs:enumeration value="java.sql.Time"/>
<xs:enumeration value="Time"/>
<xs:enumeration value="java.lang.Integer"/>
<xs:enumeration value="Integer"/>
<xs:enumeration value="java.lang.Long"/>
<xs:enumeration value="Long"/>
<xs:enumeration value="java.lang.Float"/>
<xs:enumeration value="Float"/>
<xs:enumeration value="java.lang.Double"/>
<xs:enumeration value="Double"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="format">
<xs:annotation><xs:documentation>You may use EncryptedString if you want to encrypt the string (password for instance). See more in Record.setString() method.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="valid-exp"/>
<xs:attribute name="description"/>
<xs:attribute name="default-value"/>
<xs:attribute name="prim-key" type="xs:boolean" default="false"/>
<xs:attribute name="ignored" type="xs:boolean" default="false"/>
<xs:attribute name="expression" type="xs:boolean" default="false"/>
<xs:attribute name="ref-field"/>
</xs:attributeGroup>
</xs:schema>