I = session.getAgentContext();
// (Rest of code will go here)
} catch(Exception e) {
e.printStackTrace();
}
}
}
Topic
brittany_lazarski 1000004794
42 Posts
Pinned topic Convert Domino Java agent to Java class
2007-09-25T19:41:12Z |
Updated on 2009-08-04T15:01:44Z at 2009-08-04T15:01:44Z by SystemAdmin
Re: Convert Domino Java agent to Java class2007-09-25T19:45:21Z
This is the accepted answer. This is the accepted answer.I'm not a Domino/NCSO expert, but I just opened NCSO.jar in WinZip and I don't see an AgentBase class in the jar. Are you sure that's a class that should be supported by the NCSO API?
..mb1
Re: Convert Domino Java agent to Java class2007-09-26T19:43:59Z
This is the accepted answer. This is the accepted answer.Hi,
I assume you want to use Portlet Factory and its Domino builders to access an existing Domino database. Tell me more about what you want your application to do. Are you trying to resuse an existing Domino java agent that you have written? The more detail the better.
I believe AgentBase is only used (and accessible) when you are writing an agent in Domino Designer and the agent is run and called by the Domino web server. (Your sample below is the skeleton code provided when you create a new Domino agent in Domino Designer) Like mb1 says, it it not part of ncso.jar, so AgentBase is not meant to be used remotely.
Since you are new to Portlet Factory and the Java world, you might want to start by looking at the Getting Started guide. Start menu > IBM WebSphere > Portlet Factory > Gettting Started Guide. Then, we also have a sample of using Portlet Factory to connect to Domino here:
The Domino builders in Portlet Factory support create, retrieve, update, and delete operations, and a few other operations (see the Domino Help). If you are trying to use Portlet Factory and the Domino Java API to do some additional custom coding, we provide many "back doors" into the API. For instance, the Domino builders contain method that will return you the lotus.domino.Session object and the lotus.domino.Database objects. (See the Domino builder help). You could use these in a Method or Linked Java Object builder.
Once you read the Getting Started and Domino samples, do tell me a little more about what you are trying to do, and I can probably tailor my response accordingly.
Stick with it. There is a learning curve with Portlet Factory, but once you get it, you'll realize its power and flexibility!
Sam
> I =
> text = session.getAgentContext();
> // (Rest of code will go here)
>
> } catch(Exception e) {
> e.printStackTrace();
> }
> }
> }
Re: Convert Domino Java agent to Java class2007-09-26T19:59:18Z
This is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
- 2007-09-26T19:43:59Z
I just realized your previous posts, and that you've had success with PF and the Domino builders. So you do have familiarity with PF and the Domino builders.
Based on your previous posts, it sounds like you are needing to write some custom Java using the Domino API to do something we don't already do in the builder. This is a common use case, and the builder provides "backdoors" into the Domino API to let you do this. Check out the getDominoSession() (returns a lotus.domino.Session) and getDominoDatabase() (returns a lotus.domino.Database) methods provided by the builder. Once you get the Session or the Database, you can likely do what you need to do.
If your code is pretty small, consider using a Method builder. If your code is more complex, consider writing your own Java classes, and use a Linked Java Object builder in your model to access the class.
With this approach, you don't need AgentBase.
Hopefully this helps.
Sam
Re: Convert Domino Java agent to Java class2009-08-03T05:35:50Z
This is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
- 2007-09-26T19:59:18Z
This is just for resolving compilation. Not for running. As mentioned in one of the previous posts Agent should run locally in Domino..
import lotus.domino.Session;
public class AgentBase {
public Session getSession(){
return null;
}
}
Re: Convert Domino Java agent to Java class2009-08-04T15:01:44Z
This is the accepted answer. This is the accepted answer.
Not sure if you realized it, but the thread is two years old.
Also, I don't really think making a dummy AgentBase class would help the user and I would not recommend this approach. When using Portlet Factory's Domino builders, you don't need AgentBase at all. If you're trying to run an existing agent from Portlet Factory, the Domino builders have the ability to run named agents. (In some cases the agent might need to be tweaked a bit) and they also expose the lotus.domino.Session and lotus.domino.Database objects, so if you need to write custom Domino Java api code in your app, you can do so.
Sam