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. )
|