Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: OGOJOGI->Person.insertJob(): msg#00021

cms.opengroupware.xmlrpc.devel

Subject: Re: OGOJOGI->Person.insertJob()

Hi murphee,

your approach helped a little bit, but didn't solve my problem completely. Weh I use insert insert(Person person, java.util.Date startDate, java.util.Date endDate, java.lang.String name) of the JobManager class, I only can set the three job-arguments. Here my code:

public boolean updateJob(OgoJobVO job, String user, String password) throws OgoException, ConnectionException{
boolean gespeichert = false;
String [] args = {job.getId()};
try{
// Verbindung zum Server aufbauen
XMLConnector myCon = new XMLConnector(user,password);
XmlRpcConnection con = myCon.connect();
// OpenGroupWare Instanz
OpenGroupWare ogo = con.getOpenGroupWareInstance();
//JobManager
JobManager jobMan = ogo.getJobManager();
// Jobs abfragen
Iterator iter = ogo.getJobManager().getJobs(args);
if(iter != null){
Job tempJob = (Job)iter.next();
// Ausführer des Jobs ermitteln
Account pers_acc = tempJob.getExecutor();
Person pers = pers_acc.getPerson();
Job insJob = jobMan.insert(pers,job.getStartDatum(), job.getEndDatum(), job.getName());
insJob.setPriority(5);
//tempJob.setStartDate(job.getStartDatum());
//tempJob.setName(job.getName());
}
// Verbindung schließen
con.closeConnection();
}
finally{}
return true;
}

The method isn't completed yet, OgoJobVO is a Valueobject I need with Macromedia Flex and contains only the values of a job.
The insert method works, but if I try to set something, i.e. the priority, I receive org.opengroupware.jogi.ogo.OgoException: NoSuchAction: action not implemented. We mailed about this issue. If you use the xmlrpc_caller tool you will see, there is no function jobs.updateJob even though it is in the xml-rpc-de.pdf documentation. You gave me a hint, person.updateJob is available, but I don't have any documentation about this method and I don't know about the needed arguments.
My problem is, I can't insert a complete new Job and I'm not able to update a job. What a pity.

Any more suggestions apart from sending a bug or an enhancement?

Greets
Christoph


murphee (Werner Schuster) wrote:

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;




--
****************************************
Christoph Guse
Zimmer 33510
Hubertusstraße 149
41239 Mönchengladbach
Tel. 0 21 66 / 14 52 59
Mobil 01 72 / 160 74 84
****************************************

--
OpenGroupware.org XML-RPC
xmlrpc@xxxxxxxxxxxxxxxxx
http://mail.opengroupware.org/mailman/listinfo/xmlrpc



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
db.postgresql.b...    video.ffmpeg.us...    gis.qgis.devel/...    web.rdf.redland...    file-systems.oc...    recreation.rail...    systems.archos....    python.c++/2003...    lang.c--/2005-0...    multimedia.gpho...    network.unison....    editors.jedit.u...    hardware.pciids...    cms.tiki.cvs/20...    bug-tracking.ma...    java.hadoop.hba...    ietf.rsvp/2002-...    xfree86.devel/2...    qnx.openqnx.dev...    apache.labs.dev...    tex.pdftex/2008...    os.solaris.open...    user-groups.lin...    kde.koffice/200...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation