List Info

Thread: bric_soap sync IDs




bric_soap sync IDs
user name
2007-05-21 09:56:33
The attached script takes XML files output by bric_soap,
and updates all the <story> and <media> IDs from
a given server.
It uses bric_soap to search for the IDs individually,
so it's far from efficient, but on the other hand
it doesn't require a database connection.
Improvements welcome.
No guarantee of useability or suitability for production
use.
  
Re: bric_soap sync IDs
user name
2007-06-05 12:24:26
On Mon, 21 May 2007, Scott Lanning wrote:
> The attached script takes XML files output by
bric_soap,
> and updates all the <story> and <media> IDs
from a given server.
> It uses bric_soap to search for the IDs individually,
> so it's far from efficient, but on the other hand
> it doesn't require a database connection.
> Improvements welcome.
> No guarantee of useability or suitability for
production use.

I made some improvements:
- handles related_story_id and related_media_id
- handles all assets, not just story and media
Attached (zip file for mailing list).

It still will just put a blank 'id' if it doesn't find one,
while really what you want is if the asset doesn't exist
on the 'to-server' then it should....well, I guess
that would be a separate script... where you can simply
transfer a bunch of assets from one server to another
regardless of the IDs.
( Something I realized making this script
is that the Bric SOAP server shouldn't even rely on the
IDs,
it should just use the "attributes" that make the
assets unique
(for example, "site" and "uri" for
category). There'd be a
backwards compatibility problem though, because currently
it's
assumed that if you do update and there's an ID then it's
going
to update that ID no matter what the URI says; for example,
you can change the URI of a media that way. So there'd have
to be like a "bric_soap story sync ..." or
whatever, which would
be like an update but not using the ID. I guess sync would
be more like a create-or-update. )

  
Re: bric_soap sync IDs
user name
2007-06-17 16:08:51
On Jun 5, 2007, at 10:24, Scott Lanning wrote:

> ( Something I realized making this script
> is that the Bric SOAP server shouldn't even rely on the
IDs,
> it should just use the "attributes" that make
the assets unique
> (for example, "site" and "uri" for
category).

Or UUID. That's one of the reasons I added it.

   h
ttp://www.justatheory.com/bricolage/why_uuids.html

> There'd be a
> backwards compatibility problem though, because
currently it's
> assumed that if you do update and there's an ID then
it's going
> to update that ID no matter what the URI says; for
example,
> you can change the URI of a media that way. So there'd
have
> to be like a "bric_soap story sync ..." or
whatever, which would
> be like an update but not using the ID. I guess sync
would
> be more like a create-or-update. )

Yeah, in retrospect, the reliance on IDs was unfortunate,
but it made  
sense at the time…

Best,

David


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )