ilscipio/scipio-erp

View on GitHub
framework/base/dtd/ofbiz-component.xsd

Summary

Maintainability
Test Coverage
<?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="ofbiz-component">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="depends-on"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="resource-loader"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="classpath"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="classpath-special"/><!-- SCIPIO: new 2018-06 -->
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="entity-resource"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="service-resource"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="test-suite"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="keystore"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="webapp"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="container"/>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.ofbiz-component"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.ofbiz-component">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:string" name="enabled" use="optional" default="true"/>
    </xs:attributeGroup>
    <xs:element name="depends-on">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.depends-on">
                <xs:annotation>
                    <xs:documentation>
                        SCIPIO: This is a STOCK element, but newly-implemented for Scipio (2017-01-16).
                        Designates the component(s) which this component depends on, or in other words that must
                        be loaded before this component; the component loader will perform automatic dependency resolution
                        to determine a build order which satisfies all dependencies.
                        
                        Current implementation uses a limited per-component-directory dependency resolution (non-global);
                        reordering is only done within a given component directory (such as themes or hot-deploy);
                        however, components from other directories may still be named and will be verified, 
                        in order to help validate installations and for future compatibility.
                        
                        If a component directory contains a component-load.xml file (which dictates an explicit
                        build order), automatic resolution will be DISABLED for the component directory and 
                        this element ignored.

                        NOTE: This directive is not used for build order; build and load order are independent;
                            build.xml files must be used to control build order.
                            However, it is recommended that build order be set to the same as load order.
                            For further information on automatic dependency resolution for build files, see the
                              component://macros.xml#read-component-build-deps 
                            Ant macro (called by get-component-build-deps targets) and the "component.build.dependencies" filelist definitions in individual
                            component build.xml files.
                    </xs:documentation>
                </xs:annotation>
            </xs:attributeGroup>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.depends-on">
        <xs:attribute type="xs:string" name="component-name" use="required"/>
    </xs:attributeGroup>
    <xs:element name="resource-loader">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.resource-loader"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.resource-loader">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute name="type" default="component">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="component"/>
                    <xs:enumeration value="file"/>
                    <xs:enumeration value="classpath"/>
                    <xs:enumeration value="url"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute type="xs:string" name="prepend-env"/>
        <xs:attribute type="xs:string" name="prefix"/>
    </xs:attributeGroup>
    <xs:element name="classpath">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.classpath"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.classpath">
        <xs:attribute name="type" use="required">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="jar"/>
                    <xs:enumeration value="dir"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute type="xs:string" name="location" use="required"/>
    </xs:attributeGroup>
    <xs:element name="classpath-special">
        <xs:annotation>
            <xs:documentation>
                SCIPIO: Identifies a library to enable for use with a specific purpose, such as WebSockets.
                NOTE: This does NOT automatically add the specified lib to the Java classpath - it must be
                covered by another regular classpath element entry.
                Added 2018-06-18.
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" name="webapp">
                    <xs:annotation>
                        <xs:documentation>
                            Limits the special classpath definition to the specified webapps in this component.
                            Added 2018-07-02.
                        </xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:attribute type="xs:string" name="name" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.classpath-special"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.classpath-special">
        <xs:attribute name="purpose" use="required">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="annotations">
                        <xs:annotation>
                            <xs:documentation>
                                Enables scanning specified libraries by the webserver for annotations (including websockets)
                                such as @ServerEndpoint and by custom/scipio reflection code such as @Request, @Service.

                                If webapps are specified using the child webapp element, only those webapps
                                from this component are affected; otherwise EVERY webapp in the system 
                                that has these libraries on their classpath will have this jar scanned.
                                NOTE: For most client uses, it is highly recommended to specify a webapp(s).

                                Warning: This can increase server load times, especially if you do not specify any webapps.
                                SCIPIO: 3.0.0: Added, replacing "server-scan".
                            </xs:documentation>
                        </xs:annotation>
                    </xs:enumeration>
                    <xs:enumeration value="webserver-annotations">
                        <xs:annotation>
                            <xs:documentation>
                                Enables scanning specified libraries by the webserver for annotations (including websockets),
                                such as @ServerEndpoint, but NOT by the Scipio platform such as @Request, @Service.

                                If webapps are specified using the child webapp element, only those webapps
                                from this component are affected; otherwise EVERY webapp in the system
                                that has these libraries on their classpath will have this jar scanned.
                                NOTE: For most client uses, it is highly recommended to specify a webapp(s).

                                Warning: This can increase server load times, especially if you do not specify any webapps.
                                SCIPIO: 3.0.0: Added, replacing "websockets".
                            </xs:documentation>
                        </xs:annotation>
                    </xs:enumeration>
                    <xs:enumeration value="platform-annotations">
                        <xs:annotation>
                            <xs:documentation>
                                Enables scanning specified libraries by the Scipio platform for custom annotations, but
                                NOT webserver/tomcat. This is to scan only annotations such as @Request, @Service,
                                but not webserver-specific ones such as @ServerEndpoint.

                                If webapps are specified using the child webapp element, only those webapps
                                from this component are affected; otherwise EVERY webapp in the system
                                that has these libraries on their classpath will have this jar scanned.
                                NOTE: For most client uses, it is highly recommended to specify a webapp(s).

                                Warning: This can increase server load times, especially if you do not specify any webapps.
                                SCIPIO: 3.0.0: Added.
                            </xs:documentation>
                        </xs:annotation>
                    </xs:enumeration>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="type" use="required">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="jar"/>
                    <xs:enumeration value="dir"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute type="xs:string" name="location" use="required">
            <xs:annotation>
                <xs:documentation>
                    Location of the library or libraries. Supports a single trailing wildcard.
                    Relative locations are supported, e.g.:
                        "../../framework/webapp/build/lib/ofbiz-webapp.jar"
                        "../../framework/webapp/build/lib/*"
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:boolean" name="optional" default="false">
            <xs:annotation>
                <xs:documentation>
                    If false (default), the system prints an error if the location
                    does not exist in the system.
                    Added 2018-07-02.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:attributeGroup>
    <xs:element name="entity-resource">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.entity-resource"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.entity-resource">
        <xs:attribute name="type" use="required">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="model"/>
                    <xs:enumeration value="group"/>
                    <xs:enumeration value="eca"/>
                    <xs:enumeration value="data"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute type="xs:string" name="reader-name" use="required"/>
        <xs:attribute type="xs:string" name="loader" use="required"/>
        <xs:attribute type="xs:string" name="location" use="required"/>
    </xs:attributeGroup>
    <xs:element name="service-resource">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.service-resource"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.service-resource">
        <xs:attribute name="type" use="required">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="model"/>
                    <xs:enumeration value="group"/>
                    <xs:enumeration value="eca"/>
                    <xs:enumeration value="mca"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute type="xs:string" name="loader" use="required"/>
        <xs:attribute type="xs:string" name="location" use="required"/>
    </xs:attributeGroup>
    <xs:element name="test-suite">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.test-suite"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.test-suite">
        <xs:attribute type="xs:string" name="loader" use="required"/>
        <xs:attribute type="xs:string" name="location" use="required"/>
    </xs:attributeGroup>
    <xs:element name="keystore">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.keystore"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.keystore">
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="type" use="required">
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="jks"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="password" type="xs:string" use="required"/>
        <xs:attribute name="is-truststore" type="xs:boolean" use="required"/>
        <xs:attribute name="is-certstore" type="xs:boolean" use="required"/>
        <xs:attribute type="xs:string" name="loader" use="required"/>
        <xs:attribute type="xs:string" name="location" use="required"/>
    </xs:attributeGroup>
    <xs:element name="webapp">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="virtual-host"/>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="init-param"/>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.webapp"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.webapp">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:string" name="title">
            <xs:annotation>
                <xs:documentation>
                    This value is shown in the application menu, when no uiLabelMap is available.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:string" name="description"/>
        <xs:attribute name="menu-name" use="optional" default="main">
            <xs:annotation>
                <xs:documentation>
                    This value determines in which application menu the application is shown. 
                    For instance "secondary" is used by plugins and webtools webapps to put their menu-names in the second menu.
                    Note that not all OOTB themes use this "secondary" option, for instance Flat-Grey does not.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:string" name="position"/>
        <xs:attribute type="xs:string" name="server" use="required"/>
        <xs:attribute type="xs:string" name="location" use="required"/>
        <xs:attribute type="xs:string" name="mount-point"/>
        <xs:attribute type="xs:string" name="access-permission">
            <xs:annotation>
                <xs:documentation>
                    A user must have this permission to access the application.
                    When omitted, the application can be used by anyone. This
                    attribute takes precedence over the base-permission attribute -
                    if both attributes are not empty, this attribute will be used.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute type="xs:string" name="base-permission">
            <xs:annotation>
                <xs:documentation>
                    Deprecated - use access-permission.
                    A user must have ALL of the permissions in the list to access the application.
                    When set to "NONE", the application can be used by anyone.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="privileged" type="xs:boolean" default="false"/>
        <xs:attribute name="app-bar-display" type="xs:boolean" default="true"/>
        <xs:attribute name="enabled" type="xs:boolean" default="true">
            <xs:annotation>
                <xs:documentation>
                    SCIPIO: Toggles whether the webapp gets loaded and enabled.
                    Setting to false has same effect as commenting out the tag, but is easier to edit.
                    Added 2018-05-22.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="override-mode" default="override-mount-point">
            <xs:annotation>
                <xs:documentation>
                    SCIPIO: Determines the behavior when this webapp's
                    mount-point is the same as the mount-point of a previously-loaded
                    webapp (from a different component).
                    Possible values:
                    override-mount-point (default): stock ofbiz behavior: the mount-point is 
                        simply overridden through the webapp container, but entries for
                        both webapps are left in place in the system, and the override
                        is largely handled by the webapp container (rather than the ofbiz loader).
                    remove-overridden-webapp: the webapp which is being overridden will be
                        removed from the global registry, as if it had been commented out.
                    Added 2017-01-19. 
                </xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="override-mount-point"/>
                    <xs:enumeration value="remove-overridden-webapp"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
    </xs:attributeGroup>
    <xs:element name="virtual-host">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.virtual-host"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.virtual-host">
        <xs:attribute type="xs:string" name="host-name" use="required"/>
    </xs:attributeGroup>
    <xs:element name="init-param">
        <xs:complexType>
            <xs:attributeGroup ref="attlist.init-param"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.init-param">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:string" name="value" use="required"/>
    </xs:attributeGroup>

    <xs:element name="container">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="property"/>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.container"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.container">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:string" name="class" use="required"/>
        <xs:attribute type="xs:string" name="loaders"/>
    </xs:attributeGroup>
    <xs:element name="property">
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" maxOccurs="unbounded" ref="property"/>
                <xs:element minOccurs="0" ref="property-value"/>
            </xs:sequence>
            <xs:attributeGroup ref="attlist.property"/>
        </xs:complexType>
    </xs:element>
    <xs:attributeGroup name="attlist.property">
        <xs:attribute type="xs:string" name="name" use="required"/>
        <xs:attribute type="xs:string" name="value"/>
    </xs:attributeGroup>
    <xs:element name="property-value" type="any"/>
    <xs:complexType name="any" mixed="true">
        <xs:sequence>
            <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>