[BB-API] BB-API Digest, Vol 4, Issue 1
Ian Cresshull
ian at cresshull.co.uk
Thu Feb 14 18:15:03 GMT 2019
I agree with Graham that having to refetch every performance to check whether it has been modified is inefficient and for a large number of records could have a significant performance hit on the Bellboard server.
When I originally raised this issue, I was hoping that a solution along the following lines would be possible. I make these suggestions without a knowledge of the schema of the Bellboard database and so don't know if it is actually possible.
When a performance is initially added to Bellboard the returned XML performance node would be
<performance id="P1234" xmlns="http://bb.ringingworld.co.uk/NS/performances#">
exactly the same as now.
When that performance is modified, it is be given a new id by Bellboard, at present the following node would be returned
<performance id="P5678" xmlns="http://bb.ringingworld.co.uk/NS/performances#">
However I suggest that an extra attribute could be added at this point
<performance id="P5678" originalid="P1234" xmlns="http://bb.ringingworld.co.uk/NS/performances#">
This would indicate that the performance has been modified and links the updated performance to the id given to performance when it was originally created.
In my program I could then check whether I already have a performance with an id or originalid of P1234 and would be able to decide whether this is an updated performance or a new performance record.
This solution has the benefit that the new attribute "originalid" would be an optional attribute and so should not break any existing code.
Ian
-----Original Message-----
From: BB-API <bb-api-bounces at lists.ringingworld.co.uk> On Behalf Of David Simpson via BB-API
Sent: 12 February 2019 14:41
To: bb-api at lists.ringingworld.co.uk
Cc: David Simpson <d.simpson11 at ntlworld.com>
Subject: Re: [BB-API] BB-API Digest, Vol 4, Issue 1
> It is possible. I came across this when I used the bb-api to import
> peals into Campanophile and had to distinguish between new and update
> performances.
> I cannot find the code but I think I used to refetch the peals that I
> already had by their original id and check that the performance still
> had the same id.
> If the performance has been updated you get the new id which I then
> updated my original id with. BB allocates a new ID every time the
> performance is update and keeps a list of them.
> When you fetch a performance BB always gives you the latest ID.
>
> It seems unnecessarily complicated and inefficient (for both databases) to have to refetch all performances to check whether any have been amended.
> Also I can't see the latest id shown on a performance when doing a Get for an old id. Which query did you use? Is there a query that gives you the amendment history of a single performance?
> Graham
Again from memory, I used the bb.ringingworld.co.uk/export.php with fmt=xml from= "StartDate" to = EndDate
I think this gave me all the new and amended performances over the past "n" days .
This is the only call that I used to BB
David
_______________________________________________
BB-API mailing list
BB-API at lists.ringingworld.co.uk
https://lists.ringingworld.co.uk/listinfo/bb-api
More information about the BB-API
mailing list