| Modifier and Type | Field and Description |
|---|---|
static java.nio.charset.Charset |
CHARSET
The string encoding.
|
static java.lang.String |
DEFAULT_ATTRIBUTE_NAME
Default attribute name for the attribute containing the attachments.
|
static java.lang.String |
DEFAULT_ENCODING
Default encoding.
|
static java.lang.String |
ENCODING_BASE64
BASE64 encoding.
|
static java.lang.String |
KEY_CONTENT
key for the content of the attachment.
|
static java.lang.String |
KEY_NAME
key for the name of the attachment.
|
static java.lang.String |
PROP_ATTRIBUTE_NAME
Name of the input attribute where the encoded attachments are stored.
|
static java.lang.String |
PROP_CODEC_NAME
Name of the codec.
|
static java.lang.String |
PROP_ENCODE
If set to "true", the Pipelet encodes attachments to encoded strings in the attribute.
|
static java.lang.String |
PROP_REMOVE_INPUT
If set to 'true', the Pipelet removes the input of the operation (either attachment or attribute).
|
static java.util.Collection<java.lang.String> |
SUPPORTED_ENCODINGS
Supported encodings.
|
| Constructor and Description |
|---|
CodecPipelet() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(AnyMap configuration)
set configuration of pipelet. called once after instantiation before the pipelet is actually used in a workflow.
|
protected void |
decodeEntry(Blackboard blackboard,
java.lang.String id,
java.lang.String encodingName,
AnyMap entry)
Decode an entry.
|
protected AnyMap |
encodeAttachment(Blackboard blackboard,
java.lang.String id,
java.lang.String encodingName,
java.lang.String attachmentName)
Encodes an attachment to an encoded entry in an attribute.
|
java.lang.String[] |
process(Blackboard blackboard,
java.lang.String[] recordIds)
Decodes encoded strings which are stored in a sequence attribute of the record and stores them as attachments.
|
public static final java.lang.String KEY_NAME
public static final java.lang.String KEY_CONTENT
public static final java.lang.String PROP_ATTRIBUTE_NAME
public static final java.nio.charset.Charset CHARSET
public static final java.lang.String PROP_CODEC_NAME
public static final java.lang.String PROP_ENCODE
public static final java.lang.String PROP_REMOVE_INPUT
public static final java.lang.String DEFAULT_ATTRIBUTE_NAME
public static final java.lang.String ENCODING_BASE64
public static final java.lang.String DEFAULT_ENCODING
public static final java.util.Collection<java.lang.String> SUPPORTED_ENCODINGS
public void configure(AnyMap configuration) throws ProcessingException
configure in interface Pipeletconfiguration - configuration of pipelet.ProcessingException - configuration is not applicable for pipelet (missing properties, wrong datatypes)public java.lang.String[] process(Blackboard blackboard, java.lang.String[] recordIds) throws ProcessingException
{
"_attachments" : [{
"name" : "att1.txt",
"content" : "VGhpcyBpcyB0aGUgZGVjb2RlZCBjb250ZW50Lg=="
}, {
"name" : "att2.pdf",
"content" : "VGhpcyBpcyB0aGUgZGVjb2RlZCBjb250ZW50Lg=="
}
]
}
process in interface Pipeletblackboard - Blackboard holding and managing the records.recordIds - Ids of records to process.ProcessingException - error during processing.protected AnyMap encodeAttachment(Blackboard blackboard, java.lang.String id, java.lang.String encodingName, java.lang.String attachmentName) throws BlackboardAccessException, java.io.IOException
blackboard - the blackboardid - the id of the recordencodingName - the name of the encoding to useattachmentName - the name of the attachmentBlackboardAccessExceptionjava.io.IOExceptionprotected void decodeEntry(Blackboard blackboard, java.lang.String id, java.lang.String encodingName, AnyMap entry) throws BlackboardAccessException
blackboard - The blackboardid - the record's idencodingName - the name of the encoding to useentry - thh entry containing the name and encoded contentBlackboardAccessException