Re: OGOJOGI->Person.insertJob()
"murphee (Werner Schuster)" <[email protected]>
| Newsgroups | gmane.comp.cms.opengroupware.xmlrpc.devel |
|---|---|
| Message-ID | <[email protected]> |
Christoph Guse wrote:
> Hello List,
>
> I'm trying to use the insertJob(Job job) method of the Person ogojogi
> class. Since I'm not a Java developer, I have difficulties with the
> Job argument because I don't know how to instantiate such a job. Job
> itself is a Interface, so Job job = new Job() doesn't work. If I try
> to use Job job = new XmlRpcJob(Date startDate, Date endDate, String
> name, XmlRpcCaller caller, OpenGroupWare ogo) this doen't work,
> because the constructor is protected and I don't have a caller
> instance and no ogo instance, because it is a brand new Job.
Jobs are managed via the JobManager, which has methods for inserting
Jobs. This is handled this way to ensure
that you only get valid Job objects that actually exist on the OGO server;
You get the JobManager instance object from the OpenGroupWare object
(see the http://ogo-jogi.sourceforge.net/doc/userguide.html)
for an introduction on how to use JOGI and how to get the OpenGroupWare
object);
Basically, you'd do something like:
XmlRpcCaller caller = new ApacheXmlRpcCaller("http://localhost:20001/RPC2", "username", "password");
XmlRpcConnection conn = new XmlRpcConnection(caller);
OpenGroupWare ogo = conn.getOpenGroupWareInstance();
JobManager jobManager = ogo.getJobManager();
job.insert(.....); // put in your arguments for the job;
--
Werner Schuster (murphee)
Student of SoftwareEngineering and KnowledgeManagement
Maintainer of the OGO-JOGI Project @ http://ogo-jogi.sourceforge.net/
Blog @ http://jroller.com/page/murphee
--
OpenGroupware.org XML-RPC
[email protected]
http://mail.opengroupware.org/mailman/listinfo/xmlrpc