public class POIFindReplaceAdapter extends Object implements org.imixs.workflow.SignalAdapter
The adapter can be configured by the event workflow result:
<poi-update name=
"filename">PLA Membership Agreement-<itemvalue>numsequencenumber</itemvalue>.docx</poi-update>
<poi-update name="findreplace">
<find>[company.name]</find>
<replace><itemvalue>company.name</itemvalue></replace>
</poi-update>
<poi-update name="findreplace">
<find>[company.country]</find>
<replace><itemvalue>company.country</itemvalue></replace>
</poi-update>
<poi-update name="findreplace">
<find>[contract.startdate]</find>
<replace><itemvalue format=
"EEE, MMM d, yyyy">contract.start</itemvalue></replace>
</poi-update>
For Excel you can replace cell content:
<poi-update name="findreplace">
<find>F4</find>
<replace><itemvalue>numsequencenumber</itemvalue></replace>
<type>text</type>
</poi-update>
Another option for Excel sheets is a typed item value. In this case the tag 'itemname' defindes the item and 'type' defines the type which will be set into the excel sheet
<poi-update name="findreplace">
<find>F4</find>
<itemname>invoice.date</itemname>
</poi-update>
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_ERROR |
static String |
DOCUMENT_ERROR |
| Constructor and Description |
|---|
POIFindReplaceAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
evalXSSFSheet(org.apache.poi.xssf.usermodel.XSSFWorkbook doc,
org.apache.poi.xssf.usermodel.XSSFSheet sheet,
String cell)
Evaluates a given list of cells in a given XSWorkbook
|
org.imixs.workflow.ItemCollection |
execute(org.imixs.workflow.ItemCollection document,
org.imixs.workflow.ItemCollection event)
This method computes the findreplace configuration and updates an attachments
form type .docx
|
static org.apache.poi.xssf.usermodel.XSSFCell |
getCellByRef(org.apache.poi.xssf.usermodel.XSSFWorkbook doc,
org.apache.poi.xssf.usermodel.XSSFSheet sheet,
String cellReference)
Returns a Cell by name or an optional absolute cell postion
Examples for refs are 'A1', 'AB3', 'MyCell' where 'MyCell' is a named cell.
|
void |
updateFileData(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
The method verifies if the content of the file need to be loaded from the
snapshot
|
public static final String DOCUMENT_ERROR
public static final String CONFIG_ERROR
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
execute in interface org.imixs.workflow.Adapterorg.imixs.workflow.exceptions.PluginExceptionorg.imixs.workflow.exceptions.AdapterExceptionpublic void updateFileData(org.imixs.workflow.FileData fileData,
org.imixs.workflow.ItemCollection document,
List<String> replaceDevList,
String eval)
throws IOException,
org.imixs.workflow.exceptions.PluginException
The method verifies if the content of the file need to be loaded from the snapshot
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)IOExceptionorg.imixs.workflow.exceptions.PluginExceptionpublic static org.apache.poi.xssf.usermodel.XSSFCell getCellByRef(org.apache.poi.xssf.usermodel.XSSFWorkbook doc,
org.apache.poi.xssf.usermodel.XSSFSheet sheet,
String cellReference)
Examples for refs are 'A1', 'AB3', 'MyCell' where 'MyCell' is a named cell.
public void evalXSSFSheet(org.apache.poi.xssf.usermodel.XSSFWorkbook doc,
org.apache.poi.xssf.usermodel.XSSFSheet sheet,
String cell)
throws org.imixs.workflow.exceptions.PluginException
doc - sheet - cell - org.imixs.workflow.exceptions.PluginExceptionCopyright © 2022 Imixs Software Solutions GmbH. All rights reserved.