One of our larger Notes Applications was being Webified and gradually the number of views started to grow as each notes view had to be WEBified. I was asked was there a way to use the Notes views directly on the web and more importantly use parms passed in the URL to display a Single category from that view.
I looked at several solutions to this problem and came up with a working agent that does the trick.
The agent uses the document.context document to retrieve the Query_String_Decoded(0) property. This contains the part of the URL that is passed to the agent from the first "?" delimiter.
I used this facility to pass several things to the agent.
- => The view name that will be used
- => The Category to be used
- => The Title to give the display
This would give a URL like this
http://my.domino.com/myfile.nsf/Webagent?openagent&MyView&Yellow Widgets&Yellow Widgets Display
The Query_String_Decoded for this example contains :- ?openagent&MyView&Yellow Widgets&Yellow Widgets Display
Using the evaluate LS function to evaluate the @explode Notes Function this string can be broken down into its constituent bits using the "&" char as a delimited. This returns an array
Url = "Openagent"
Url = "MyView"
Url = "Yellow Widgits"
Url = "Yellow Widgits Display"
Having now got the View Name Url
and the category Url
it is possible to build a View Navigator
based on these values.
I have also in my code allowed for the full view to be displayed by passing *ALL or *all as the Category parm.
Set view = db.GetView(Url(1)) Url(2) = Ucase(Url(2)) If Url(2)="*ALL" Then Set nav = view.CreateViewNav Else Set nav = view.CreateViewNavFromCategory( Url(2) ) End If
The ViewNavigator Nav can then be looped around and its values displayed on the screen in an nest of HTML tables.
I used a CSS file to make this display look pretty and to take advantage of a CSS property called DISPLAY. This property when set to INLINE displays the HTML element in its place holder. When set to NONE the complete Element disappears. This is more useful that the VISIBLE css property that still leaves the place holder of the element visible.
Unfortunately this was implimented on the Intranet so I cant show an example of this in action and as the function requires CSS/JS and an AGENT it is too much for the CODE segment below.
If you would like a sample database with a worked example please let me know an I will Email it to you. I can be reached at mcdonaghs@utvinternet.<remove this>com
Please remember to remove the <remove this> from the address !Rgdz Steve