Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 12.2 KB

DEVELOPMENT-GUIDE.md

File metadata and controls

59 lines (47 loc) · 12.2 KB

Promena Alfresco Development Guide

Connector

A custom connector can be provided by implementing PromenaTransformationExecutor and registering it as a bean.

The typical flow that a connector should implement:

  1. Validate postTransformationExecutor [PostTransformationExecutorValidator, SerializationPostTransformationExecutorValidator implementation, serializationPostTransformationExecutorValidator bean name]
  2. Check if the nodes from nodeDescriptor have been modified in the current transaction [NodeInCurrentTransactionVerifier, DefaultNodeInCurrentTransactionVerifier implementation, defaultNodeInCurrentTransactionVerifier bean name]
  3. Generate a checksum of nodeDescriptor [NodesChecksumGenerator, RenditionContentNodesChecksumGenerator implementation, renditionContentNodesChecksumGenerator bean name]
  4. Convert nodeDescriptor to DataDescriptor [DataDescriptorGetter, ContentPropertyDataDescriptorGetter implementation, contentPropertyDataDescriptorGetter bean name]
  5. Start a new transformation execution [PromenaMutableTransformationManager, MemoryWithAlfrescoPersistencePromenaMutableTransformationManager implementation, memoryWithAlfrescoPersistencePromenaMutableTransformationManager bean name]
  6. Add PROPERTY_EXECUTION_IDS to the nodes from nodeDescriptor
  7. Perform the transaction asynchronously
  8. Return TransformationExecution from step 6

The flow of an asynchronous transaction execution:

  1. Perform the transformation on Promena depending on the connector - your task
  2. Verify if the nodes from nodeDescriptor still exist [NodesExistenceVerifier, DefaultNodesExistenceVerifier implementation, defaultNodesExistenceVerifier bean name]
  3. Check if the checksum of the nodes from nodeDescriptor haven't changed [NodesChecksumGenerator, RenditionContentNodesChecksumGenerator implementation, renditionContentNodesChecksumGenerator bean name]
  4. Save the results of the transformation execution [TransformedDataDescriptorSaver, MinimalRenditionTransformedDataDescriptorSaver implementation, minimalRenditionTransformedDataDescriptorSaver bean name]
  5. Inject dependencies into postTransformationExecutor and run it if set [PostTransformationExecutorInjector, ReflectionPostTransformationExecutorInjector implementation, reflectionPostTransformationExecutorInjector bean name]
  6. Clean data [DataCleaner, DefaultDataCleaner implementation, defaultDataCleaner bean name]
  7. Complete the transformation execution with the result [PromenaMutableTransformationManager, MemoryWithAlfrescoPersistencePromenaMutableTransformationManager implementation, memoryWithAlfrescoPersistencePromenaMutableTransformationManager bean name]
  8. In case of an error, another execution is run until the number of Retry.maxAttempts is reached. If the number is reached, it completes the transformation execution with an exception [PromenaMutableTransformationManager, MemoryWithAlfrescoPersistencePromenaMutableTransformationManager implementation, memoryWithAlfrescoPersistencePromenaMutableTransformationManager bean name]

Example

Metadata saver

A custom metadata saver can be provided by implementing PromenaTransformationMetadataSaver and registering as a bean.

All registered metadata savers are executed after saving the results of a transformation execution.

Example

Definition

Rendition

A custom rendition definition can be provided by implementing PromenaRenditionDefinition and registering it as a bean.

It is the equivalent of ThumbnailDefinition in Promena environment.

Example

Content Transformer

A custom content transformer definition can be provided by implementing PromenaContentTransformerDefinition and registering it as a bean.

It provides the equivalent to Alfresco Content Transformer in Promena environment and it is used by ContentTransformerRegistry to perform a transformation (visit Content Transformers (and Renditions) for more details).

Example