Home Manual Reference Source Test
import SplittingTransformer from 'atscm/src/lib/transform/SplittingTransformer.js'
public class | source

SplittingTransformer

Extends:

src/lib/transform/PartialTransformer.js~PartialTransformer → SplittingTransformer

Direct Subclass:

XMLTransformer

Indirect Subclass:

ConfigTransformer

A transformer that splits a node into multiple source nodes when pulling.

Test:

Static Member Summary

Static Public Members
public static get abstract

The extension to add to container node names when they are pulled.

public static get abstract

The source file extensions to allow.

Static Method Summary

Static Public Methods
public static

splitFile(node: Node, newExtension: string): Node

Splits a Node: The resulting is a clone of the input file, with a different path.

Method Summary

Public Methods
public abstract

combineNodes(node: BrowsedNode, sourceNodes: Map<string, BrowsedNode>, context: any)

Combines the container node and the source nodes to one single node.

public

Returns false for all container nodes, so they don't get read.

public

async transformFromDB(node: BrowsedNode, context: any)

Renames a container node, should be called by all subclasses.

public

async transformFromFilesystem(node: BrowsedNode, context: Object)

Reads a given container nodes source nodes and combines them.

Private Methods
private

_combineNodes(node: BrowsedNode, sourceNodes: {[extension: string]}, context: any)

Combines the container node and the source nodes to one single node by calling SplittingTransformer#combineNodes.

Static Public Members

public static get abstract extension: string source

The extension to add to container node names when they are pulled.

public static get abstract sourceExtensions: string[] source

The source file extensions to allow.

Static Public Methods

public static splitFile(node: Node, newExtension: string): Node source

Splits a Node: The resulting is a clone of the input file, with a different path.

Params:

NameTypeAttributeDescription
node Node

The file to split.

newExtension string
  • nullable: true

The extension the resulting file gets.

Return:

Node

The resulting node.

Public Methods

public abstract combineNodes(node: BrowsedNode, sourceNodes: Map<string, BrowsedNode>, context: any) source

Combines the container node and the source nodes to one single node.

Params:

NameTypeAttributeDescription
node BrowsedNode

The container node.

sourceNodes Map<string, BrowsedNode>

The source nodes.

context any

The current context.

public readNodeFile(node: BrowsedNode): boolean source

Returns false for all container nodes, so they don't get read.

Params:

NameTypeAttributeDescription
node BrowsedNode

The node to check.

Return:

boolean (nullable: true)

If the node should be read.

public async transformFromDB(node: BrowsedNode, context: any) source

Renames a container node, should be called by all subclasses.

Params:

NameTypeAttributeDescription
node BrowsedNode

A container node.

context any

The tranform context.

public async transformFromFilesystem(node: BrowsedNode, context: Object) source

Reads a given container nodes source nodes and combines them.

Params:

NameTypeAttributeDescription
node BrowsedNode

The node to transform.

context Object

The browser context.

Test:

Private Methods

private _combineNodes(node: BrowsedNode, sourceNodes: {[extension: string]}, context: any) source

Combines the container node and the source nodes to one single node by calling SplittingTransformer#combineNodes.

Params:

NameTypeAttributeDescription
node BrowsedNode

The container node.

sourceNodes {[extension: string]}

The source nodes.

context any

The current context.