Document nameRevision
DOCU121981

Turbostage Schema reference

 

Turbostage Schema referenceBackgroundDefinitionsSchema mergingBasisInclude filesElement mergingMerge attributesSemicolon separated attribute value listInheritanceMerge variablesRuntime variables<schema> element<execute> element<css> element<include> element<job> element<js> element<type> elementAdvanced process securityIntegrating foreign systems

 

Background

Turbostage Schema is inspired by best-practice object-relational mapper systems by Apache and Microsoft.

It is a system which may spread across several databases and servers. Instead of using more schema layers to define the systems TurboStage defines the complete system in one layer.

Complex business logic is contained in code hooked up to the schema using the <execute> element, the code is however referenced in the schema making the schema covering all aspects – in one layer.

 

Definitions

NameDefinition
ListA list in TurboStage terminology is a list of names separated by semicolon.

 

Schema merging

Basis

The schema files define the data architecture and functionality. The only file that in fact is loaded by TurboStage is custom.schema.xml located in the tweak folder.

This root schema file may include other schema files.

All schema files must start with the <schema> tag. The following sample shows custom <schema> element. The schemasyntaxversion attribute may not be altered manually, it is reserved for public use by TurboStage to keep track of schema version and schema upgrade.

You may design your own system from scratch, however some required types has to be defined in order for TurboStage to startup.

These minimum requirements are defined in /ts/schema/minimum.schema.xml which you may include and build your system from.

 

Include files

The normal procedure for using TurboStage as a business system covering portal and PDM functionality is to just include the Highstage schema file which defines types like Action, Document and Part.

For schema backward compatibility with old Highstage generation use:

Schema files are merged together in the order they are included. If a schema file file1 includes file2 then file2 is loaded first and then file1 is merged to produce the resulting schema xml.

 

Element merging

Merging of two schema files will be done by adding all elements to the resulting schema. However if two elements exists with the same element name then the elements will be merged.

Sample

Note that it is important that all elements must be given names . If elements with no names exist, then an exception will occur at system reset.

 

Merge attributes

For all elements, the following XML merge attributes are available:

NameValuesDescription
_beforeInserts node before the node specified by name, instead of appending to the end.
_delete0/1Removes the xml node completely. The node is deleted after the schema has been merged, so the _delete attribute may be altered at any place in schema and the resulting value will determine if the node is deleted or not.
_inheritInherits the specified sibling node(s) specified in name list before merging the content. The inherited node(s) must precede the node.
_overwrite0/1Replaces the xml node and attributes with completely new content

 

Semicolon separated attribute value list

Standard behavior is that when two elements are merged the attributes from the second element in overwrite the attribute values of the first element. However if the second elements attribute starts with "+=" then the attribute value will be concatenated to the first elements attribute value.

Sample:

 

Inheritance

Inheritance is resolved by first merging leaf's and then merging each level until the root is reached. If one type inherits from several other types then merging is done from left to right.

 

Merge variables

Merge variables @@[<variable-name>] may be used in schema xml files that are included by other schema xml files. The <include> element documented later in this document will replace merge variables with attributes in the <include> element. Merge variables that do not have a corresponding <include> element attribute with identical name will result in schema load exception.

 

Runtime variables

Runtime variables @[<variable-name>] may be used various places in schema xml, refer to element documentation later in this document.

NameDescription
@[t]Type (or subtype)
@[userid]User ID
@[v]Value
@[/<LocalPath>]Variable starting with ‘/’ will be resolved as a web page relative to web site root. Page output is returned as result.
The web page may make use of form, grid and dr objects passed as Context.Items .

 

<schema> element

Starting with the <schema> element the following attributes and elements are available:

Attributes:

NameDescription
schemasyntaxversionFor public TurboStage use
productnameFor public TurboStage use
productversionFor public TurboStage use

Elements:

NameDescription
executeThis element defines an page to execute after the schema has been loaded. This allows for performing specific custom code at startup or setting delegates to custom code.
typeDefines an object type
includeIncludes an external schema file
jobSets a job to be executed. This may execute a web page at regular intervals or at a specific time

 

<execute> element

This element specifies a page to execute after the schema has been loaded. This allows for performing specific custom code at startup or setting delegates to custom code.

Attributes:

NameDescription
nameName of element instance
srcRelative path to local web page

Sample loading folder feature:

 

<css> element

Includes html cascading style sheet (CSS).

Attributes:

AttributesDescription
nameName of element instance
srcLocation of file

Sample:

 

<include> element

The include element loads additional schema xml files.

Attributes:

NameDescription
nameName of element instance
srcPath to source file (See sample below)
<parameters>Parameters may be specified (See sample below)
_removeList of xpath expressions selecting notes to be removed. Use semicolon ; char as spath expression delimitter.

 

Samples on src attribute:

Path relative to the folder containing the current schema file:

Absolute path:

Path relative to web application root folder:

 

Samples on <parameters>:

All attributes of the include element may be used as parameters in the include file:

The value of attribute typePrefix will replace all occurrences of @@[typePrefix].

 

Samples on <_remove>:

Include schema imported from HS, but we are mainly interested en column definitions and want to remove all menu, main and form nodes:

 

<job> element

The job runs specific web pages at a specific interval or time.

Attributes:

NameDescription
nameName of element instance
urlUrl to execute
intervalHH:MM interval specified in 24 hour format. Minimum 00:00 and maximum 23:59.
timeHH:MM specified in 24 hour format. Minimum 00:00 and maximum 23:59. Multiple times may be specified as a semicolon separated list of HH.MM times.

The interval and time attributes may be combined but normally just one of them are used.

 

Sample:

The following sample runs the local server page replicate.aspx at 1 hour interval:

 

<js> element

Includes JavaScrips file and/or inline JavaScript.

Attributes:

NameDescription
nameName of element instance
srcLocation of file

Sample:

 

<type> element

The type element defines a specific object type. Refer to Schema_type_element.htm for more information on the <type> element.

 

Advanced process security

Refer to TN10682-1.pdf

 

Integrating foreign systems

Foreign systems are integrated by creating a schema for the system or the parts of the system that are relevant for integration. As an example ERP systems typically contains many tables (up to many thousands) of which only a few tables (~10) are relevant for the daily core business.

 

If the foreign system tables are not contained on the same SQL server as TurboStage then the SQL server must be linked to the TurboStage SQL server and the foreign system tables must be referenced using a fully qualified path where <server> is the name of the linked server:

Sample of a fully qualified path:

 

IMPORTANT The foreign system types should typically have sqlmanage attribute set to ‘0’ to eliminate risk of redefining foreign SQL tables. The user name used for linked server login should typically have read-only access.

 


highstage_footer