Back to development sectionEdit Type parts
Edit Introduction
Type describes document structure and its operations. Type is similar to a class in OO programming, where a document is an object. XML schema is used to describe the structure. XSLT and JavaScripts are used to provide operations.
All types are stored in the "
types" folder. Each type is located in a separate folder (usually with the same name as the type name) and in a version subfolder with the same name as the type version. For example: "
types\abstractTree\0.5.0.0".
Sider type consists of several files. "
type.xml" is the main file and describes the type. It holds type ID, version, name and reference to all related files. XSD file is type
Schema and is used to validate the document when it is loaded. XSLT file provides XML generation operations, such as new document constructor. JS file is the
Script that will be loaded with the view and holds operations to work with the document through the view.
Edit type.xml
Example structure
<type id="FA706485-6B3B-438B-9320-DE21872011B8" name="Tree with html" category="concrete" version="0.5.0.0">
<description>More advanced type. Inherits from Tree and HTML.</description>
<schema href="HtmlTree.xsd"/>
<defaultView id="5A9D0FE8-90D3-47F4-9FDE-79E53D194B62"/>
<references>
<type id="F85D6D46-FA83-42C3-A637-DA20ACBFF6CA" prefix="siderTree"/>
<type id="BE20BB35-14E3-42E8-8FDB-3196DA66CC06" prefix="siderHtml"/>
</references>
<scriptFile href="htmlTree.js" />
<transformation>
<newDocument href="constructor.xslt" input="siderTree" prefix="siderHtmlTree" />
</transformation>
</type>
The following table describes "
type.xml" XML nodes. Attributes are preceded with @ symbol. Optional nodes are in parenthesis, i.e. (optionalNode) or (@opitonalAttribute).
>
| Node name | Parent node name | Description | Value |
|---|
| type | Document element | Root element for the type description | Nodes describing the type. |
| @id | type | Unique type ID. | String GUID |
| @name | type | Type name. This name is used with XML generated to the view and to initialize type script objects used by the views. | String |
| (@friendlyName) | type | Type friendly name to show to the user. If ommited, @name is used instead. | String |
| @version | type | Type version in "x.x.x.x" format. For each type ID there should be only one type of the specific version. | Integers separated by a dot (.) Each "x" is an integer. |
| @category | type | Type category. | Category name string. concrete - Complete type. Generally Sider user will see documents of the type from this category. Concrete document can be embedded or standalone. embedded - Type for the documents to be specifically embedded. Embedded document doesn't have common document properties to decrease space consumption. User cannot directly cerate document of embedded type. abstract - Type designed to be derived from. It's impossible to create document for the abstract type. system - Type is system. Developer should not create their own system types.
|
| (description) | type | Type description. Should describe what kind of documents this type defines. | String |
| schema | type | Schema location used to validate documents of this type. | @href with schema file name. Points to the schema file at the same location as "type.xml".<schema href="schema.xsd"/> |
| defaultView | type | Default view used to show documents of this type | @id is the view GUID. |
| references | type | Wraps references to other types. | Array of "type" elements, each referencing another type. |
| type | references | Reference to a single type. | @id - Leferenced type's GUID. |
| scriptFile | type | JavaScript file to load with the view. Provides operations to edit document of this type on the fly. | @href with the JavaScript file name.Points to the script file at the same location as "type.xml".<scriptFile href="typeOperations.js"/> |
| transformation | type | Holds references to type transformations. | Holds an array of elements with references to type transformations. |
| newDocument | transformation | Reference to the transformation to create new document of the current type. | @href - Transformation file name. Points to the XSLT file at the same location as "type.xml". @prefix - Type namespace prefix to which new document will belong. Used to specify prefix for root "document" element in the type's namespace.
|