开发者

How to check if file exists in lotus formula?

开发者 https://www.devze.com 2022-12-09 16:44 出处:网络
Scenario: I have an outline where I have links for my menu. Each link points to file stored on FTP server in DMZ. By clicking each link I run the agent which downloads the file locally and deliver url

Scenario: I have an outline where I have links for my menu. Each link points to file stored on FTP server in DMZ. By clicking each link I run the agent which downloads the file locally and deliver url to it for end user.

I would like to hide outline element when file does not exists. Obviously I do not开发者_运维知识库 have this information before I try to access file and I cannot run domino agent to check if I can show this element or not and use it in HideWhen formula window. Also it is not possible to run agent and check all files if exists, store this information in ln db, because simple it's too many files.

Any other ideas?


If you don't have the information available at the "Outline scope" to determine what links to hide and show, then you'll have to find a way to fail gracefully when a file does not exist. Use some error checking in your agent and if the file does not exist, make sure the user gets a friendly message explaining what happened.

You say that you can't check if all files exists because there are too many, but just how many are we talking about? You may not be able to check them while the database is opening because you'll cause the user to wait too long, but perhaps you could cache the results somewhere. An agent that runs when the database opens could check for the cached list of existing files and use that to figure out which to hide. If the cached file doesn't exist, the agent could run a background agent to update the cache and store it on the server or within the database.

If you have some access to the server, you could also write a program that returns a list of existing files, and use that to feed your Notes database. Lots of options there, but for example you could have a PHP or an ASP.NET page that returns an XML list of files that exist on the server when you call it (or even something simpler than XML). Then again when you open the Notes database, your agent could call that URL, get the results, and go through the list of existing files to determine what links to hide.

Hope this helps!


inspiration from bookmark.nsf outlines - @IsAppInstalled

0

精彩评论

暂无评论...
验证码 换一张
取 消