Subject: RE: $$ViewTemplateDefault, WebQueryOpen and Open a URL
How are you defining “An administrator type person”? Here’s what I do for such applications
I have a page pgLauncher with the following code:
Loading the Open Projects… Please be patient…
(this one is just there for looks and is the same as below… .can be left out)
is:
x := @Implode(@UserRoles);
y := @Trim(@ReplaceSubstring(x;“$$WebClient”; “”));
"var y = " + “"” + y + “"”
//The example used here only has one possible role. If you have other roles that you need to filter, you can make y an array instead and loop through the array in the onload event.
in the onLoad event, I place the code:
//Check the user role. If it is Admin, open the openview, else open openbyrequestor
if(y==“[Admin]”){
window.location.replace(‘/projectdeploymentjp.nsf/open?openview’)
}else{
window.location.replace(‘/projectdeploymentjp.nsf/openbyrequestor?openview’)
}
Finally, in my db launch properties, I simply launch the page pgLauncher.
Any conditionals can be done in this manner. UserName can be used instead of roles, or a check to see what groups the user is in could be used. It avoids the whole agent thing completely and runs very quickly. The only catch is that javascript has to be enabled in your environment.
I have run this code in both IE 6 and FF 1.5 and above.
For the “regular people”, you could code the wqo agent into the form that contains the embedded view. This way, they load the view and run the agent, which handles the rest, OR, if you are really just looking for display options, for the “regular people” don’t use a view at all, have the launcher page run an agent via url (instead of opening a view) that builds the html links and prints them back to the browser. I would run this as an AJAX style agent and place the returned html inside a div or span on the launcher page.