These APIs are used to import from an output stream or a file stored on the server records into the database. These APIs also provide the option to import the document files stored on the server folders into the afm_docs and afm_docvers tables. These APIs will also allow you to generate comparison reports, which will store records into the corresponding add, update, delete or error log files in Excel or CSV format.
Similar to Transfer Out APIs, there are also two types of Transfer In APIs that serve different purposes.
public void transferIn(InputStream is,
XlsBuilder.FileFormatType format,
boolean isImportDocuments,
String documentRootPath,
boolean isGenerateLogs,
String logRootPath,
boolean continueIfErrorExists
) throws ExceptionBase;
is: InputStream.
Specify the inputStream to import . If InputStream is not valid, an exception will throw.
fileType: XlsBuilder.FileFormatType: either CSV or XLS.
isImportDocuments: Boolean.
True if also import the document related with AFM document fields of the table. False otherwise.
documentRootPath: String.
Specify the root path for the A/FM Document Fields’s documents content. The documents are stored and imported from this path documentRootPath appended by the table name.
If empty, the default Document Root Path will be used:
{WebCentral_LOCAL_PATH}/projects/users/{user_name}/
isGenerateLogs: Boolean.
If isGenerateLogs is true, the add/update/delete/error logs will be generated on the server.
logRootPath: String.
Specify the root path for the update/add/delete logs. The logs are stored and imported from this path logRootPath appended by the table name.
If empty, the default Log Root Path will be used:
{WebCentral_LOCAL_PATH}/schema/per- site/datatransfer/{USER_NAME}/
continueIfErrorExists: Boolean.
If true, the data transfer will continue once any error occurs. Otherwise, an exception will be thrown once any error occurs.
public void transferIn(String fileNameAndPath,
boolean isImportDocuments,
String documentRootPath,
boolean isGenerateLogs,
String logRootPath,
boolean continueIfErrorExists
) throws ExceptionBase;
fileNameAndPath: String.
Specify the file name and path to import from. If the file does not exist or the file extension is not .csv or .xls, an exception will throw.
isImportDocuments: Boolean.
If isImportDocuments is set to True, the function will also import the documents related with ARCHIBUS document field(s) from server side folders to database afm_docs and afm_docvers tables. If set to false, no documents will be imported from the server to database. The default is false.
documentRootPath: String.
Specify the root path for the A/FM Document Fields’s documents contents. The documents are stored and imported from this path documentRootPath appended by the table name.
If empty, the default Document Root Path will be used:
{WebCentral_LOCAL_PATH}/projects/users/{user_name}/
isGenerateCompareReport: Boolean.
If isGenerateCompareReport is true, the add/update/delete/error logs will be generated on the server.
logRootPath: String.
Specify the root path for the update/add/delete logs. The logs are stored and imported from this path logRootPath appended by the table name.
If empty, the default Log Root Path will be used:
{WebCentral_LOCAL_PATH}/schema/per- site/datatransfer/{USER_NAME}/
continueIfErrorExists: Boolean.
If true, the data transfer will continue once any error occurs. Otherwise, an exception will be thrown once any error occurs.
long nRecordsImported()
@return counter: long. The number of records imported.
long nRecordsInserted()
@return counter: long. The number of records inserted into database.
long nRecordsUpdated()
@return counter: long. The number of records updated in the database.
long nRecordsWithErrors()
@return counter: long. The number of records that have errors.
long resetCounters()
;