[OGo-XML-RPC] Re: questions regarding
ZOGi,WAS:[OGo-Users]custom fields and synchronizing ogo
Adam Tauno Williams
xmlrpc@opengroupware.org
Fri, 28 Mar 2008 07:05:43 -0400
> > One moment while I check the code....
> > Nope, zOGI doesn't support retrieving the contact_id (as contactId).
> > But it should support writing it, just set "contactId: 10160" for
> > example. Since "contactId" is an attribute known to OGo Logic it should
> > just set it.
> > That should be corrected in zOGI r951 (Google Code version).
> I don't need to retrieve this information, but writing it, works great!!
> So creation of new companies works great. But still, as mentioned, I get the
> python backtrace when I try updating a company. I have to retrieve the old
> object_version from the database, and then add 1. When I then update the
> company, with the new version, then updating works well too.
> Maybe as an enhancement, zOGI could figure out the old object version, and
> creating a new one, when it is updating a record?
That's not a bug, its a feature! :) You can specify the "ignoreVersion"
flag when you do the putObject and it will disable version checking and
just-do-the-$*@(*&$(*-write! Version detection is there for
applications that operate online and then come back and want to commit
their changes; version checking prevents them from updating a
contact/enterprise that was updated on the server while they were gone.
It is entirely intended that you need to getObject in order to putObject
when doing an update.
You shouldn't need to bump the version number, the version number needs
to be equal to the version on the server.
<quote>
/* Object version check is not performed if ignoreVersion flag
was provided by the client. But this is generally a bad idea
and clients should ONLY use this to offer an explicit force-
overwrite option. */
if (!([_flags containsObject:@"ignoreVersion"])) {
if ([_company objectForKey:@"version"] == nil)
return [NSException exceptionWithHTTPStatus:500
reason:@"No version supplied on company update"];
if ([[_company objectForKey:@"version"] intValue] !=
[[eo objectForKey:@"objectVersion"] intValue]) {
if ([self isDebug]) {
[self warnWithFormat:@"Client object version: %@",
[_company objectForKey:@"version"]];
[self warnWithFormat:@"Server object version: %@",
[eo objectForKey:@"objectVersion"]];
}
return [NSException exceptionWithHTTPStatus:500
reason:@"Client object is out of date"];
}
} /* If ignoreVersion-not-specified */
</quote>