Create File Resources Programatically

Hi All,

I have a Text file added to my database as a File Resource. There is a flash file that references this Text file to generate a line chart dynamically on the web. The data in the Text file needs to be updated daily. I can manually go to the Designer, delete the old text file and create a new one. However, I would like this entire process to be automated using an agent. Is it possible to access a particular File Resource through LotusScript, delete it and then create a new file resource??

Any help on this would be highly appreciated.

Regards

Zaheed

Subject: Create File Resources Programatically…

Wouldn’t be easy with lotusscript, and afaik, it would be not be supported, standard functionality. However, there is information on how to access design documents as it they were notes document… so if you really really really want to do it, it’s possible.

But would it be possible to attach the textfile to a normal Notes document instead, and have your flash file refer to a normal Notes document instead of a design document?

That would be the preferred solution I think.

Subject: RE: Create File Resources Programatically…

Thanks Herbert for your response.

I have a handle to the File Resource but the important thing as Bram (refer the earlier post) mentioned is to update the Text file. It is stored in some weird format and therefore not easily updatable.

Assuming I had the text file as an attachment in a notes document, how can I access it? At the moment, I’m using a relative path (in my flash file) i.e. “IQ/IQ.nsf/StockPrices.txt”.

Your inputs would be highly appreciated.

Regards

Zaheed

Subject: Create File Resources Programatically…

There is no easy way to get to a file resource via the Lotusscript or Java API; not even via DXL (there’s no abstraction layer built-in).

If you know your way around the C API, you should be able to write the required lotusscript to extract/import these.

Basically it boils down to:

– Finding the correct note

– Dealing with the file data (which is Composite Data in the $FILEDATA item, using one CDFILEHEADER and multiple CDFILESEGMENT structs)

– Dealing with the metadata fields (update time, file size).

It probably would be far simpler to just create a regular document to store your attachment.

cheers,

Bram

Subject: Create File Resources Programatically…

If a third party product is an option, our Midas Rich Text LSX will certainly allow you to create the File resources (see this weblog post, for example), but I am not entirely clear why you would need this as a File Resource.