Reputation: 2030
I am creating some Java agents, in which I retrieve a HTML post and put it into a variable. In short I have this code:
lotus.domino.Document doc = agentContext.getDocumentContext();
String xml = "";
Vector items = doc.getItems();
for (int j=0; j<items.size(); j++)
{
Item item = (Item)items.elementAt(j);
String fldName = item.getName();
String fldValue = item.getValueString();
if ( fldName.matches("(?i).*request_content.*") )
{
sb.append( fldValue );
xml = sb.toString();
xml = xml.replace("&", "&");
}
etc..
Now for multiple java agents this code is the same.. What would be best practise to do? Put this code in to a script library and java class or put it in to a java package?
And next how do I call a class from out a script library or custom made java package?
thanks
Upvotes: 0
Views: 142
Reputation: 363
IMHO: You should put a java class with this code in the java library and import it to agent (see pic.)
Upvotes: 2