Import File to Notes Database

I need to develop an application to read a file of about 10,000 records to create main documents in a Notes database. The application will allow the user to create response-type documents to these main documents. The file needs to be read about once a week and if there are new records they need to be added, and if any of the records change, they need to be modified in the Notes database. I have searched the forum and Sandbox and I see many options. I can ask the user to provide the file in whatever format might be best. Can anyone advise on what would be the best approach. I do not code that much so any advise on how to start is appreciated.

Subject: Import File to Notes Database

It is probably a relatively simple application, but with a few things you need to watch out for.

  1. What constitutes a changed document? Will your weekly records contain only new and changed documents or will they contain all documents (new, changed and unchanged)? If the latter, you need to determine how you will differentiate between changed and unchanged.

  2. What will be the unique key(s) that determine the document to be changed? What happens if you have multiple records in your file containing the identical key(s)?

  3. Are you importing only text and numeric data, or will there be pointers to attachments, etc. within the records?

  4. What is to happen to any response documents when a changed document is re-imported? Presumably, those should remain and the update should not cause them to be orphaned.

  5. Scheduled import? Or manual?

Subject: RE: Import File to Notes Database

  1. The file will contain all the records each week; new unchanged and changed.

  2. There is a unique id in the file for each record. There will be no duplicates in the file to be imported.

  3. Yes, only importing text and numerics.

  4. Correct, the update should not cause them to be orphaned.

  5. Preferably scheduled, but manual is not out of the question.

Can you recommend a good approach and point my in the right direction for the agent?

Thank you.

Subject: RE: Import File to Notes Database

Will you have control over the format of the data and filetype (.txt, .xls, .xml) with which the data is given to you? I believe from your first posting that you do. If you decide to use a delmited file, will you have to worry about escaping the delimiter character if it appears inside the data?

Also, will you be able to run Excel on the server (if you decide that .xls format is the best) or even MS XML processor, if you decide on that technology?

Basically, you should create a script library that has a function that takes as a parameter the filepath of the file to be imported. This function would parse the file according to the rules you establish (or if Excel, simply read cell by cell).

Then create two agents:

  1. A scheduled agent that passes a known filepath (may include a weekly date in the filename or something along those lines) to the function in the script library.

  2. An agent that uses UI classes to allow the user to select a file for import. The selected file(s) is passed to the script library function for import.

Other than that, you need to determine what to do in case of error. For UI agents, that can simply be prompted back to the user. For scheduled agents, you would want to log that somehow and maybe send a mail notifying of error.

Without knowing more, it’s difficult to suggest specifics on the actual processing.

Subject: Thank you