Home Manual Reference Source Test
public class | source

DisplayTransformer

Extends:

Transformer → DisplayTransformer

Splits atvise displays into their SVG and JavaScript parts. A config file is used to describe dependencies and parameters.

Static Member Summary

Static Public Members
public static get

This transformer is only applied to NodeType.Display node types.

Constructor Summary

Public Constructor
public

Creates a new display transformer.

Member Summary

Public Members
public

The XMLBuilder to use when writing to the filesystem.

public

The XMLBuilder to use when writing back to the database.

Method Summary

Public Methods
public

createDisplay(stream: Stream, display: {})

Creates an XML display from buffered SVG, JavaScript and configuration code.

public

flushFromFilesystem(stream: Stream, cb: function(err: Error))

Called after all display files were buffered.

public

transformFromDB(stream: NodeStream, node: Node, enc: String, cb: function(err: Error, node: Node))

Parses display XML files and splits them into SVG, JavaScript and a configuration file.

public

transformFromFilesystem(stream: Stream, file: AtviseFile, enc: String, cb: function(err: Error, file: AtviseFile))

Buffers the contents of the files a display was split into.

Inherited Summary

From class Transformer
public static get

The NodeTypes the transform should be applied to.

public static

encapsule(file: AtviseFile, extname: String)

Encapsules a file.

public static

encapsuledFile(file: AtviseFile, extname: String, contentString: String): AtviseFile

Takes a file and returns an encapsuled file apon it.

public abstract

flushFromDB(stream: NodeStream, cb: function(err: Error))

A function that is applied after all transformations passed.

public abstract

A function that is applied after all transformations passed.

public

Returns a string representation of the current Transformer.

public

transform(direction: TransformDirection): Stream

Applies transformation for a given TransformDirection.

public abstract

transformFromDB(stream: NodeStream, node: Node, enc: String, cb: function(err: Error, node: Node))

Transforms a NodeStream.

public abstract

transformFromFilesystem(stream: Stream, file: AtviseFile, enc: String, cb: function(err: Error, file: AtviseFile))

Transforms a stream of AtviseFiles.

Static Public Members

public static get applyToTypes: Map<NodeType, Boolean> source

This transformer is only applied to NodeType.Display node types.

Override:

Transformer#applyToTypes

Public Constructors

public constructor source

Creates a new display transformer. Currently no options are applied.

Override:

Transformer#constructor

Public Members

public inputXMLBuilder: XMLBuilder source

The XMLBuilder to use when writing to the filesystem. Uses OS specific defaults.

public outputXMLBuilder: XMLBuilder source

The XMLBuilder to use when writing back to the database. Uses atvise specific defaults.

Public Methods

public createDisplay(stream: Stream, display: {}) source

Creates an XML display from buffered SVG, JavaScript and configuration code.

Params:

NameTypeAttributeDescription
stream Stream

The stream used.

display {}

The buffered display content.

public flushFromFilesystem(stream: Stream, cb: function(err: Error)) source

Called after all display files were buffered. Creates display XMLs and writes them to the stream.

Override:

Transformer#flushFromFilesystem

Params:

NameTypeAttributeDescription
stream Stream

The stream used.

cb function(err: Error)

Callback to call after flushing.

public transformFromDB(stream: NodeStream, node: Node, enc: String, cb: function(err: Error, node: Node)) source

Parses display XML files and splits them into SVG, JavaScript and a configuration file.

Override:

Transformer#transformFromDB

Params:

NameTypeAttributeDescription
stream NodeStream

The stream to use.

node Node

The node to split.

enc String

The encoding used.

cb function(err: Error, node: Node)

Callback to call after transformation.

public transformFromFilesystem(stream: Stream, file: AtviseFile, enc: String, cb: function(err: Error, file: AtviseFile)) source

Buffers the contents of the files a display was split into.

Override:

Transformer#transformFromFilesystem

Params:

NameTypeAttributeDescription
stream Stream

The stream used.

file AtviseFile

The file to buffer.

enc String

The encoding used.

cb function(err: Error, file: AtviseFile)

Callback to call after transformation.