Reputation: 789
Is it possible to dynamically create internet sites rule(substitutions) on lotus web server via Java agent?
Upvotes: 1
Views: 363
Reputation: 12060
Yes, it is possible, BUT: As every substitution rule needs a restart of the http- task, the documents would not be available directly...
Here is part of the code. In an Agent do the following:
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Database db = agentContext.getCurrentDatabase();
Document doc = db.createDocument();
doc.replaceItemValue("Form", "WebRule" );
//.... WebRule documents can never stand alone, they have to be "attached" to a
//internetsite as Responses. I forgot about this in the first run.
Document docInternet = db.getDocumentByUNID( "PasteUNIDofInternetSiteDocumentHere" );
doc.makeResponse(docInternet);
//.... Fill the fields that you found out like explained by Knut Herrmann
doc.replaceItemValue( .... );
doc.replaceItemValue( .... );
doc.replaceItemValue( .... );
doc.replaceItemValue( .... );
// for lacy programmers who do not want to set all the hidden fields by themselves
doc.computeWithForm(false, false);
doc.save( true, true, true );
Upvotes: 1
Reputation: 30960
The rules are stored in "normal" Notes documents. That means you can create, edit and delete such rules (=documents) using Java.
How to do this?
Create some Web Site Rules manually like shown here.
Look then in Domino Directory Database for created Web Site Rule documents and discover with Files\Properties which fields are in such documents. Then you know, how the documents have to look like you'll create with Java.
Upvotes: 2