Welcome to the IBM Collaboration Solutions Community IQJam.
UsernamePassword
Reset Password | Register
   
Home | Leader Board | Tags | Help
WQO agents on xpages 
How to run WQO ( or url ) agents on xpages ?
Domino Development / XPages
Tagged
Rishi Sahi - over 2 years ago |  |  | Viewed 493 times

There are 3 answers

2votes
Marked as correct on2/11/10 1:30 AM
You have a couple of options here, depending on how complex your wqo agents are, and what they are trying to do.
 
My general advice would be to port your LotusScript (I'm assuming it's LS) to be Server Side Javascript and call it in the beforePageLoad event of your Custom Control or XPage. It's unlikely that, if you're setting fields etc, that the code can be ported directly across, but the logic should still be sound. 
 
If you'd rather there are a couple of other things you could try: 
  1. Convert your wqo agent to be AJAX enabled (using documentContext and the QUERY_STRING field) and call it in front end javascript using the dojo.xhrGet function. Again, with this you're going to need some extra logic to get a hold of the fields you want to set etc, but it's not difficult once you've understood the "#{id:myfield}" syntax (more here).
  2. You can manually run an existing agent using the syntax of:
var agent:NotesAgent = database.getAgent("myagent"); 
agent.runOnServer(optionalnoteid); 
 
Hope these options help.
 
Matt 


Matt White - over 2 years ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community


0votes
Thanks Matt, My agent builds a dashboard like "Statistics" feature of IdeaJam. When page loads there is a LS agent which runs using ajax ( dojo :xhr method ) and builds HTML contents along with flash parameters ( for flash charts ) and returning html is set to DIV. I want to know at what extent existing LS agents can be converted into server side JavaScript.




Rishi Sahi - over 2 years ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community


0votes
Hi Matt,
 
Following code I've tried on beforePageLoad event of the xpage ,

    var urlVal="../runMe?OpenAgent";

    var td = dojo.xhrGet({
        url: urlVal,
        preventCache: true,
        handleAs: "text",
        sync: true,
        load: function(resp, ioArgs){
            alert(resp)
        }
    });
 
When I view xpage on the browser it says "Command not handled exception". LS agent just returns user name .

I don't find any description about this error in help file. I assume in 8.5 we don't need to include dojo.js ( and other dojo supported files )?

Thanks,
Rishi


Rishi Sahi - over 2 years ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community