On Fri, Sep 27, 2013 at 2:30 PM, Anja Le Blanc <
an...@bindrich.de> wrote:
> On 27/09/2013 11:48, helix84 wrote:
>>
>> On Fri, Sep 27, 2013 at 12:36 PM, Anja Le Blanc
>> <
anja.l...@googlemail.com> wrote:
>>>
>>> What does a user of the API actually want?
>>
>>
>> Why don't we let the user request a custom set of information like this:
>> bitstream/:id:/view?fields=bitstreamID,name,sequenceID
>>
>> Of course, we would still provide a sensible set of defaults (fields
>> which are currently needed for display in the UIs) instead of the full
>> set. There could also be
>> bitstream/:id:/view?fields=all
>
>
> Good point. I am just not sure whether 'all' really should be all.
I'm not sure if I was clear. The client would have three choices based
on request parameters:
a) no parameters - a default set (not full) of most used attributes
would be returned
b) explicitly specified fields - return only the specified fields
c) a parameter for full set of fields: 1) so that you don't have to
specify the full list with every request and 2) to prepare for forward
compatibility (an older client wouldn't might not know about a new
field added in a newer server version)
That said, are there any concerns about fields that should be
access-controlled? I don't think bitstreams have any such fields.
>>> I would like to integrate stats updates at this point.
>>
>>
>> I think the correct approach would be to make the rest module an event
>> dispatcher. That way the statistics modules which already are event
>> consumers would be notified of the events automatically.
>
>
> Yes, I've done this previously using events (then I was mangling Wijiti).
> The complications on the stats part is that we really want to know the IP
> address of the user rather than the one of the application using the API,
> otherwise we become our only user.
Good catch. The API should return something like X-Forwarded-For. It
doesn't have to be a HTTP header, it can be a request parameter.
Regards,
~~helix84
Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette