Package org.imixs.workflow.odf
Class ODFDOMFindReplaceAdapter
java.lang.Object
org.imixs.workflow.odf.ODFDOMFindReplaceAdapter
- All Implemented Interfaces:
org.imixs.workflow.Adapter,org.imixs.workflow.SignalAdapter
This ODFDOMFindReplaceAdapter can be used to find and replace text fragements
in a Open Document Format (ODF) documents (e.g. .odt, .ods).
The adapter can be configured by the event workflow result:
<odf-update name=
"filename">PLA Membership Agreement-<itemvalue>numsequencenumber</itemvalue>.odt</odf-update>
<odf-update name="findreplace">
<find>[company.name]</find>
<replace><itemvalue>company.name</itemvalue></replace>
</odf-update>
<odf-update name="findreplace">
<find>[company.country]</find>
<replace><itemvalue>company.country</itemvalue></replace>
</odf-update>
<odf-update name="findreplace">
<find>[contract.startdate]</find>
<replace><itemvalue format=
"EEE, MMM d, yyyy">contract.start</itemvalue></replace>
</odf-update>
- Version:
- 1.0
- Author:
- rsoika
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.imixs.workflow.ItemCollectionexecute(org.imixs.workflow.ItemCollection document, org.imixs.workflow.ItemCollection event) This method computes the findreplace configuration and updates an attachments form type .docxvoidupdateFileData(org.imixs.workflow.FileData fileData, org.imixs.workflow.ItemCollection document, List<String> replaceDevList, String eval) This helper method updates the content of a given FileData object with a replaceDevList
-
Field Details
-
DOCUMENT_ERROR
- See Also:
-
CONFIG_ERROR
- See Also:
-
-
Constructor Details
-
ODFDOMFindReplaceAdapter
public ODFDOMFindReplaceAdapter()
-
-
Method Details
-
execute
public org.imixs.workflow.ItemCollection execute(org.imixs.workflow.ItemCollection document, org.imixs.workflow.ItemCollection event) throws org.imixs.workflow.exceptions.AdapterException, org.imixs.workflow.exceptions.PluginException This method computes the findreplace configuration and updates an attachments form type .docx- Specified by:
executein interfaceorg.imixs.workflow.Adapter- Throws:
org.imixs.workflow.exceptions.PluginExceptionorg.imixs.workflow.exceptions.AdapterException
-
updateFileData
public void updateFileData(org.imixs.workflow.FileData fileData, org.imixs.workflow.ItemCollection document, List<String> replaceDevList, String eval) throws org.imixs.workflow.exceptions.PluginException This helper method updates the content of a given FileData object with a replaceDevListThe method verifies if the content of the file need to be loaded from the snapshot
- Parameters:
fileData- - the fileData object containing the text or calc filereplaceDevList- - list of text markers or cell positions to be replacedeval- - optional list of cell positions to be evaluated after update (this is for XSSFWorkbooks only)- Throws:
IOExceptionorg.imixs.workflow.exceptions.PluginException
-