ARCHIBUS Web Central

Using the InManager API

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.

2.1. This Transfer In API is designed to be called by PUW.

 

public void transferIn(InputStream is,
        XlsBuilder.FileFormatType format,
        boolean isImportDocuments,
        String documentRootPath,
        boolean isGenerateLogs,
        String logRootPath,
        boolean continueIfErrorExists
        ) throws ExceptionBase;

 

PARAMETERS:

 

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.

 

2.2. This transferIn() API is designed to be called by other application level or core JAVA codes.

 

public void transferIn(String fileNameAndPath,
        boolean isImportDocuments,
        String documentRootPath,
        boolean isGenerateLogs,
        String logRootPath,
        boolean continueIfErrorExists
        ) throws ExceptionBase;

 

PARAMETERS:

 

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.

 

2.3 This function is used to retrieve the number of records that has been imported.

 

long nRecordsImported()

 

PARAMETERS:

 

@return counter: long. The number of records imported.

 

2.4 This function is used to retrieve the number of records that has been inserted into the database (transfer in). It is only used for the job that keep the insert log on the server ('generateLog' parameter is true)

 

long nRecordsInserted()

 

PARAMETERS:

 

@return counter: long. The number of records inserted into database.

 

2.5. This function is used to retrieve the number of records that has been updated in database (transfer in). It is only used for the job that keep the update log on the server ('generateLog' parameter is true).

 

long nRecordsUpdated()

 

PARAMETERS:

 

@return counter: long. The number of records updated in the database.

 

2.6 This function is used to retrieve the number of records that have errors when importing.

 

long nRecordsWithErrors()

 

PARAMETERS:

 

@return counter: long. The number of records that have errors.

 

2.7 This function is used to reset the number of records that has been inserted, update and with errors.

 

long resetCounters();