在Lotus Notes中通过Java代理获取Web服务器站点?

时间:2013-05-28 07:09:33

标签: java lotus agent

是否可以通过Java代理在Lotus Web服务器上动态创建Internet站点规则(替换)?

2 个答案:

答案 0 :(得分:2)

规则存储在“普通”Notes文档中。这意味着您可以使用Java创建,编辑和删除此类规则(=文档)。

怎么做?

手动创建一些网站规则,如图here所示。

然后在Domino目录数据库中查看已创建的网站规则文档,并使用Files \ Properties查找哪些字段在此类文档中。然后你知道,文件看起来如何用Java创建。

答案 1 :(得分:1)

是的,有可能,但是:由于每个替换规则都需要重新启动http任务,因此文档无法直接使用...

以下是代码的一部分。在代理中执行以下操作:

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 );