Lotus Domino Web 视图 - 应该只显示当前用户的文档 - 但显示更多?
我正在开发 Lotus Domino Web 应用程序,并且我有一个应该只显示当前用户的文档的视图。 我知道这对服务器来说不是最好的,因为它必须不断计算,但这是一个要求...
这是我正在使用的视图选择公式:
SELECT (Form="Atom Request" | Form=" AtomRequest") & @Name([CN];RequestAuthor) = @Name([CN];@UserName)
RequestAuthor 字段是一个在组合时计算的字段,用于捕获作者姓名。
视图选择对我来说效果很好,但其他用户可以在此视图中查看其他用户的文档。
我可能忽略了一些明显的事情......
有什么建议吗?
德里克
I'm working on a Lotus Domino Web application and I have a view that should only show the current user's documents. I know this is not the best for the server because it has to keep calculating this, but it is a requirement...
This is the view selection formula that I'm using:
SELECT (Form="Atom Request" | Form="AtomRequest") & @Name([CN];RequestAuthor) = @Name([CN];@UserName)
The RequestAuthor field is a computed when composed field that captures the author name.
The view selection works fine for me, but other users are able to see other users documents in this view.
I'm probably overlooking something obvious....
Any suggestions?
Derek
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我将视图转换为分类视图 - 按作者姓名分类。
然后我将视图嵌入到视图模板表单中,将其设置为显示单个类别。
单一类别是用户名。
看来已经成功了..
I converted the view to be a categorized view - categorized by the AuthorName.
Then I embedded the view on the view template form setting it to display a single category.
The single category is the user name.
Seems to have done the trick..
您是否要求用户能够查看自己以外的文档(我的意思是在此视图之外)?
如果没有,则在文档上使用读者字段来限制谁可以查看每个文档。
那么您将不需要选择公式的
@Name([CN];RequestAuthor) = @Name([CN];@UserName)
部分。否则,如果您确实需要用户能够查看除他们自己的文档之外的文档,那么您所采用的嵌入式分类方法可能是最干净的。
do you require the user to be able to see documents other than their own (outside of this view I mean)?
If not, then use a readers field on the documents to limit who can see each document.
Then you won't need the
@Name([CN];RequestAuthor) = @Name([CN];@UserName)
part of the selection formula.Otherwise if you do need users to be able to see documents other than their own the embedded categorized approach you've taken is probably the cleanest.
LRE 的解决方案是一个很好的解决方案。 但从设计角度来看,不要在视图选择公式中使用@UserName、@Now 或@today,这会给数据库和服务器带来严重的性能问题。
每次打开视图时,服务器都会重建索引。 如果您确实需要使用用户特定信息,请创建一个计划代理来设置字段中的值,然后引用该字段作为视图公式的一部分。 只是不要在视图公式中使用任何会更改条件的动态“@”函数。
LRE's solution is a good one. But from a design POV, do not use @UserName or @Now or @today in view selection formula's it causes serious performance problems for your database and the server.
Everytime you open the view the server will be rebuilding the index. If you do need to use user specific info, create a scheduled agent that will set the value in a field and then reference the field as part of the view formula. Just don't use any dynamic "@" functions in the view formula that would change the criteria.