public class TCDLTransformProcessor extends Object implements TCDLProcessor
TCDLTransformProcessor
class is the central class
through which all transformations take place when called from the deployer.
Note due to the very TCDL-tied interface "Transformer" that is part of the OLD code base this class has been reworked to allow transformers to have a very generic interface instead (e.g. output = transform(source)). However, to ensure backward compatibility it is tested if a plugin class implements the OLD interface and if so, the old package is used to perform all processing.
When wanting to use TCDL elsewhere, the TCDLTransformProcessor
is the
main entry point for that.
Constructor and Description |
---|
TCDLTransformProcessor(Class clazz)
Creates a TCDLTransformProcessor with the configured name of the transformer to use
If this transformer implements the old interface (com.tridion.transformer.Transformer),
this instance will delegate the transformation the old API.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(com.tridion.configuration.Configuration configuration)
This is only intended to run within the deployer and the configuration is expected to be the
deployer config.
|
void |
setDynamicComponentLanguage(String dcpLanguage)
When the content that will be processed is a DCP, this method gets called by the deployer to indicate
the target language of the DCP.
|
void |
setTargetLanguage(Integer targetLanguage) |
File |
transformItem(String itemURI,
File transformFile,
String charsetName,
TransformerBinaryStorage binaryStorage)
This method processes an item passed to it.
|
public TCDLTransformProcessor(Class clazz) throws ProcessingException
clazz
- the class for the Transformer implementation.ProcessingException
- in case of error.public void configure(com.tridion.configuration.Configuration configuration) throws com.tridion.configuration.ConfigurationException
configure
in interface com.tridion.configuration.Configurable
configure
in interface TCDLProcessor
configuration
- configuration to be usedcom.tridion.configuration.ConfigurationException
public void setDynamicComponentLanguage(String dcpLanguage)
setDynamicComponentLanguage
in interface TCDLProcessor
dcpLanguage
- language usedpublic void setTargetLanguage(Integer targetLanguage)
setTargetLanguage
in interface TCDLProcessor
public File transformItem(String itemURI, File transformFile, String charsetName, TransformerBinaryStorage binaryStorage) throws ProcessingException
transformItem
in interface TCDLProcessor
itemURI
- uri of the item being transformedtransformFile
- The filename of the of the source file.charsetName
- when non-null indicates the encoding of the source and target file.
When null platform encoding is usedbinaryStorage
- Storage implementationProcessingException
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries