Emerald Hand Wiki

Sider - Dev - Type

Modified: 2007/03/21 18:39 by Ornus - Categorized as: Development, Sider
Back to development section


Edit

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 nameParent node nameDescriptionValue
typeDocument elementRoot element for the type descriptionNodes describing the type.
@idtypeUnique type ID.String GUID
@nametypeType name. This name is used with XML generated to the view and to initialize type script objects used by the views.String
(@friendlyName)typeType friendly name to show to the user. If ommited, @name is used instead.String
@versiontypeType 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.
@categorytypeType 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)typeType description. Should describe what kind of documents this type defines.String
schematypeSchema 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"/>
defaultViewtypeDefault view used to show documents of this type@id is the view GUID.
referencestypeWraps references to other types.Array of "type" elements, each referencing another type.
typereferencesReference to a single type.@id - Leferenced type's GUID.
scriptFiletypeJavaScript 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"/>
transformationtypeHolds references to type transformations.Holds an array of elements with references to type transformations.
newDocumenttransformationReference 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.


Copyright © 2006-2008 Emerald Hand, Inc. All rights reserved.
Powered by ScrewTurn Wiki version 2.0.34. Some of the icons created by FamFamFam.