@DeclareRoles(value={"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"}) @RolesAllowed(value={"org.imixs.ACCESSLEVEL.NOACCESS","org.imixs.ACCESSLEVEL.READERACCESS","org.imixs.ACCESSLEVEL.AUTHORACCESS","org.imixs.ACCESSLEVEL.EDITORACCESS","org.imixs.ACCESSLEVEL.MANAGERACCESS"}) public class DatevImportService extends Object
The import file must contain 2 header rows. The 1st row contains the object type, the 2nd row contains the filed names.
Example 1st line:
"DTVF";700;20;"Kontenbeschriftungen";2;20180917165240335;;"RE";"Farida.Weikard";"";217386;21010;20180101;6;;;"";"";;0;;"";;"";;141987;"04";;;"";""Example 2nd line:
Konto;Kontobeschriftung;SprachId
The service provides methods to search for DATEV objects by key or search phrase. A search result can be optional restricted to a specific DATEV client. NOTE: the item _datev_client_id must be part of the property lucence.indexFieldListNoAnalyze to use this feature.
to import datev data and assign the data to a
workflow model.| Modifier and Type | Field and Description |
|---|---|
static String |
DATEN_FEHLER |
static String |
IMPORT_ERROR |
static int |
MAX_SEARCH_RESULT |
| Constructor and Description |
|---|
DatevImportService() |
| Modifier and Type | Method and Description |
|---|---|
org.imixs.workflow.ItemCollection |
findEntityByName(String key,
String type,
String clientID)
This method finds a datev entity by the attribute 'txtName'
The param clientID is optional and restricts the result to a specific DATEV
client.
|
String |
importData(InputStream imputStream,
String encoding)
This method imports all entities from a csv file.
|
String[] |
normalizeValueList(String[] data)
This method removes the " from a value list
|
List<String> |
parseFieldList(String data)
This method parses a DATEV field description (first line of the csv file)
|
org.imixs.workflow.ItemCollection |
readEntity(String data,
List<String> fieldnames)
This method creates a ItemCollection from a csv file data line
The method also creates a txtworkflowabstract to support fulltext search
|
void |
saveEntry(org.imixs.workflow.ItemCollection aWorkitem,
String type,
String clientID,
String consultenID)
This method process a single workIten in a new transaction.
|
List<org.imixs.workflow.ItemCollection> |
searchEntity(String phrase,
String type,
String clientID)
This method returns a list of ItemCollections matching the search phrase and
type.
|
public static final String DATEN_FEHLER
public static final String IMPORT_ERROR
public static final int MAX_SEARCH_RESULT
public org.imixs.workflow.ItemCollection findEntityByName(String key, String type, String clientID)
The param clientID is optional and restricts the result to a specific DATEV client. NOTE: the item _datev_client_id must be part of the property lucence.indexFieldListNoAnalyze.
key - - name of the object (txtname)type - - DATEV type of the objectclientID - - optional restriction to a specific client id (_datev_client_id)public List<org.imixs.workflow.ItemCollection> searchEntity(String phrase, String type, String clientID)
The param clientID is optional and restricts the result to a specific DATEV client. NOTE: the item _datev_client_id must be part of the property lucence.indexFieldListNoAnalyze.
phrase - - search phrasetype - - DATEV type of the objectclientID - - optional restriction to a specific client id (_datev_client_id)public String importData(InputStream imputStream, String encoding) throws org.imixs.workflow.exceptions.PluginException
The method runs in a new transaction so processing exceptions can be caught.
All existing entries not listed in the current file will be removed.
Each imported document will have the item '_datev_client_id' and '_datev_consultant_id'. These item are mapped to the "Mandant id" and "Berater id" from Datev. These categories allow the import of data from different clients and consults. It is important that the fields '_datev_client_id' and '_datev_consultant_id' are added to the lucene index so that a search for data of a specific client is possible.
lucence.indexFieldListNoAnalyze=....,_datev_client_id,_datev_consultant_id
The method returns a log . If an error occurs a plugin exception is thrown
org.imixs.workflow.exceptions.PluginExceptionpublic String[] normalizeValueList(String[] data)
data - public List<String> parseFieldList(String data)
public void saveEntry(org.imixs.workflow.ItemCollection aWorkitem,
String type,
String clientID,
String consultenID)
throws org.imixs.workflow.exceptions.AccessDeniedException,
org.imixs.workflow.exceptions.ProcessingErrorException,
org.imixs.workflow.exceptions.PluginException,
org.imixs.workflow.exceptions.ModelException
aWorkitem - org.imixs.workflow.exceptions.PluginExceptionorg.imixs.workflow.exceptions.ProcessingErrorExceptionorg.imixs.workflow.exceptions.AccessDeniedExceptionorg.imixs.workflow.exceptions.ModelExceptionCopyright © 2021 Imixs Software Solutions GmbH. All rights reserved.