Transformation Operations

This section lists the available transformation operations.

This page discusses:

ITransformationHandler

The base interface of the transformation handler provides the two following methods, which control how documents are transformed within the processing pipeline.

Method

Description

discard()

Discards the current processor document, that is to say, prevents it from going to the next processor or next stage.

yield(doc)

Yields the newly created document to the next processor or to the Consolidation Store. Use this call for documents created in a transformation processor with the IJavaCreateTransformationHandler methods.

ICreateTransformationHandler

The interface to add new documents to the Consolidation Store provides three different create methods.

Tip:

When child URI is forged using the method:

IMutableTransformationDocument childDoc (IJavaAllUpdatesTransformationHandler) handler.createChildDocument(document, subURI , sdcType);
childDoc.getUri()

The created URI is "document.URI" + childSeparator + "sub-URI" but as the childSeparator is a private string that is not visible in generated URIs, it is impossible to reforge this URI later without the same method.

Recommendation: To handle partial update use cases, create links from child to parent from the child only.

Instead of:

document.addArcTo("hasTextualElement", child.getUri()); 
Prefer:
child.addArcFrom("hasTextualElement", document.getUri()); 

Method

Description

createDocument(uri,type,parentTypes)

Creates a transformation document with the required given properties and with automatic memory management. In other words, if no edges point on it at the end of the transformation phase, the document is deleted by the Consolidation Server automatically.

createChildDocument(parentDoc,subURI,type,parentTypes)

Creates a transformation document from a parent one with the given properties.

createUnmanagedDocument(uri,type,parentTypes)

Creates a transformation document with the given properties without automatic memory management. This is the opposite behavior of the createDocument method in terms of memory management.

getDocumentChildrenPath(String parentURI, String childURI)

This method is useful to create a child URI when you do not have access to the child himself. Never forge a URI by hand.

IDeleteTransformationHandler

The interface to send delete orders to the Consolidation Store.

Method

Description

deleteDocument()

Sends a recursive delete order for the current document.

deleteDocument(uri)

Sends a recursive delete order for the document with the given URI prefix.

deleteDocument(uri,boolean)

Sends a delete order for the specified document URI, recursively or not.

If the boolean flag is true, then all URIs with a prefix matching the given URI are also deleted.

deleteDocument(doc)

Sends a recursive delete order for the specified document and possibly all documents with a prefix matching the document URI.

deleteDocument(doc,boolean)

Sends a delete order for the specified document, recursively or not.

If the boolean flag is true, then all URIs with a prefix matching the document URI are also deleted.

deleteDocumentChildren(doc,path)

Sends a delete order for all document children matching the given path. The document itself is not deleted.

deleteDocumentChildren(doc)

Sends a delete order for all document children. The document itself is not deleted.

deleteDocumentChildren(parentURI,path)

Sends a deletion order for all document children matching the path of the given parent URI. The document itself is not deleted.

deleteDocumentChildren(parentURI)

Sends a deletion order for all document children with the given parent URI prefix. The document itself is not deleted.

deleteDocumentRootPath(rootURI)

Sends a deletion order for all documents matching the root URI prefix.

IMutableTransformationDocument

The following interface provides the operations specific to a Transformation document.

Method

Description

addArcFrom(arcType, fromDoc)

Registers an arc addition from the specified document to the current one.

addArcFrom(arcType, fromDocURI)

Registers an arc addition from the document specified by the URI to the current one.

addArcTo(arcType, toDoc)

Registers an arc addition from the current document to the specified document.

addArcTo(arcType, toDocURI)

Registers an arc addition from the current document to the document specified by the URI.

removeAllPredecessorArcs()

Registers for deletion all adjacent arcs heading to the current one.

removeAllSuccessorArcs()

Registers for deletion all adjacent arcs starting from the current one.

removeArcFrom(arcType, fromDoc)

Registers for deletion the arc starting from the specified document to the current one, with the given type.

removeArcFrom(arcType, fromDocURI)

Registers for deletion the arc starting from the specified document to the current one, with the given type.

removeArcTo(arcType, toDoc)

Registers for deletion the arc starting from the current document to the specified document, with the given type.

removeArcTo(arcType, toDocURI)

Registers for deletion the arc starting from the document specified by the URI to the current one, with the give type.

setType(documentType, parentTypes)

Defines the document type, as well as its possible parents as defined in getTypeInheritance().

IConsolidationDocument

The following interface gives access to the default data encapsulated within a consolidation document, either for transformation or aggregation.

Method

Description

isOfType(type)

Indicates if the type transmitted is among the list of the current document types.

getAllDirectives()

Returns all the directives defined in this document.

getAllMetas()

Returns all the metas defined in this document.

getAllParts()

Returns all the parts defined in this document.

getDirectiveNames()

Returns all the document directive names.

getDirective(name)

Returns the first directive value for the given name.

getDirectives(name)

Returns all the directives for the given name.

getMetaNames()

Returns all the meta names.

getMeta(name)

Returns the first meta value for the given name.

getMetas(name)

Returns all the meta values for the given name.

getOriginalSources()

Returns the list of original sources for the given document.

getPartNames()

Returns all the document part names.

getPart(name)

Returns the first document part for the given name.

getParts(name)

Returns the list of document parts for the given name.

getSource()

Returns the document original source that produced it.

getType()

Returns the document representative type.

getTypeInheritance()

Returns the type inheritance for the document.

The first one in the list is a descendant of the second one, the second one of the third one, and so on. So types are ordered from the most specific to the most generic.

getUri()

Returns the document unique identifier.

hasDirective(name)

Indicates if the directive name has an associated value within the document.

hasMeta(name)

Indicates if the meta name has an associated value within the document.

hasPart(name)

Indicates if the part name has an associated value within the document.

IMutableConsolidationDocument

This interface enriches the operations available within IConsolidationDocument with a list of operations allowing the modifications of internal data.

Method

Description

deleteDirective(name)

Deletes all the directive values associated to the specified directive name.

deleteDirectives(name, values)

Deletes only the given values for the specified directive name.

deleteMeta(name)

Deletes all the meta values associated to the specified meta name.

deleteMetas(name, values)

Deletes only the given meta values from the specified meta name.

deleteParts(name)

Deletes the document parts related to the specified part name.

deleteParts(name, documentParts)

Deletes all the part directive values for the specified part name.

setDirective(name, value)

Assigns the given value to the specified directive name.

setAllDirectives(directives)

Assigns all the directive name/values associated to the current document.

setMeta(name, value)

Assigns the given meta value to the specified meta name.

setMeta(name, values)

Assigns the given meta values to the specified meta name.

setAllMetas(metas)

Assigns all the meta name/values associated to the current document.

setPart(name, docPart)

Assigns the given document part to the specified part name.

setParts(name, docParts)

Assigns the given document parts to the specified part name.

setAllParts(parts)

Assigns all the parts associated to the current document.

withDirective(name, value)

Adds the value of a specific directive to the possible list of predefined directive values. If none is defined, a new list is created.

withDirectives(name, values)

Adds the values of a specific directive to the possible list of predefined directive values. If none is defined, a new list is created.

withDirectives(directives)

Adds the list of directive key-values to the possible list of predefined directive values.

withMeta(name, value)

Adds the value of a specific meta to the possible list of predefined meta values. If none is defined, a new list is created.

withMeta(name, values)

Adds the values of a specific meta to the possible list of predefined meta values. If none is defined, a new list is created.

withMetas(metas)

Adds the list of meta key-values to the possible list of predefined meta values.

withPart(name, docPart)

Adds the document part to the list of existing predefined parts. If none is defined, a new list is created.

withPart(name, docParts)

Adds the sequence of document parts to the list of existing predefined parts. If none is defined, a new list is created.

withParts(allParts)

Adds the list of parts associated to the current document.