如何检查莲花公式中是否存在文件?

发布于 2024-08-09 03:11:19 字数 253 浏览 7 评论 0原文

设想: 我有一个大纲,其中有菜单的链接。每个链接都指向 DMZ 中 FTP 服务器上存储的文件。通过单击每个链接,我运行代理,该代理在本地下载文件并将 URL 传递给最终用户。

我想当文件不存在时隐藏大纲元素。显然,在尝试访问文件之前我没有此信息,并且无法运行多米诺骨牌代理来检查是否可以显示此元素并在 HideWhen 公式窗口中使用它。此外,不可能运行代理并检查所有文件(如果存在),将此信息存储在 ln db 中,因为很简单,文件太多。

还有其他想法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

若水般的淡然安静女子 2024-08-16 03:11:19

如果您没有“大纲范围”中的可用信息来确定要隐藏和显示哪些链接,那么您必须找到一种在文件不存在时优雅地失败的方法。在代理中使用一些错误检查,如果文件不存在,请确保用户收到一条友好的消息,解释发生了什么。

你说你无法检查所有文件是否存在,因为文件太多了,但我们到底在谈论多少个?您可能无法在数据库打开时检查它们,因为这会导致用户等待太长时间,但也许您可以将结果缓存在某处。数据库打开时运行的代理可以检查现有文件的缓存列表,并使用它来找出要隐藏的文件。如果缓存文件不存在,代理可以运行后台代理来更新缓存并将其存储在服务器或数据库中。

如果您对服务器有一定的访问权限,您还可以编写一个程序来返回现有文件的列表,并使用它来提供您的 Notes 数据库。那里有很多选项,但例如,您可以有一个 PHP 或 ASP.NET 页面,当您调用它时,它会返回服务器上存在的文件的 XML 列表(甚至比 XML 更简单的东西)。然后,当您打开 Notes 数据库时,您的代理可以调用​​该 URL、获取结果并浏览现有文件列表来确定要隐藏哪些链接。

希望这有帮助!

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!

笑梦风尘 2024-08-16 03:11:19

来自 bookmark.nsf 概述的灵感 - @IsAppInstalled

inspiration from bookmark.nsf outlines - @IsAppInstalled

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文