Dear all,
I need to import data from some other system not (probably a combination of relational database and file system storage) into Notes database. The data includes a few fields (text, date) and image files, namely gifs. This gif images should be attached as files to the document so I can show them on web with URLs like httpx://mydbpath/docsview/docunid/$file/filename.gif. Other system is not on the same network so I cannot use LEI or DECS or similar. I will probably get files through FTP or email.
Programmers of the other system will provide me with anything I ask them for (so I am told). I was thinking of using XML and NotesDXLImporter class, but I need to provide details for them. Simple data is obviously not a problem, but how should images be included in XML? I used NotesDXLExporter to export documents and attachment data was exported between tags. I guess it was in Base64 encoding but I am no expert. The question is, what do I need to tell other programers so they will be able to construct a nice XML that will be easily imported into Notes database?
Subject: Import file attachments with XML
OK, I have been using XML a bit recently but not for importing file attachments!
One idea to consider would be to use DXLImporter to create the documents as long as the source XML is formatted as DXL or you will have to parse the XML or translate it.
In the XML should be the names of the file attachments. Assuming the actual files can be dumped to a location your script can get to you could then use the new document to get the file names, build a path using a combination of a path stored in a profile/keyword doc + the file name and loop through attaching each file.
So basically it would be a 2 stage process:
-
Use DXLImporter to create new document
-
Build file paths and attach each file
Hope that makes sense. In theory if the image is encoded in the correct format then you could import it as XML but I’m not sure exactly what encoding is needed.
Subject: RE: Import file attachments with XML
Sure it makes sense, Chris. I was thinking of similar solution if I failed with the encoding issues. Then I figured out that mail-in database would be perfect solution for this situation, so I won’t need any XML at all.