Correct rel and _links for ny-arkiv?

Thomas Sødring thomas.sodring at hioa.no
Mon Feb 6 09:46:30 CET 2017


On 02/05/2017 11:47 PM, Petter Reinholdtsen wrote:
> If I understand page 57 in the specification correct, the relation URL
> for ny-arkiv should be
>
>   http://rel.kxml.no/noark5/v4/api/arkivstruktur/ny-arkiv/
>
> but in Nikita, as far as I can tell, it is
>
>   http://rel.kxml.no/noark5/v4/api/administration/ny-arkiv
>
> Is this intentional or a mistake?

Taking a look at this I think I've mixed up the rels for advertising
arkivstrutur:

 http://rel.kxml.no/noark5/v4/api/arkivstruktur/

with the rel used when creating a new fonds object:

 http://rel.kxml.no/noark5/v4/api/administrasjon/ny-arkiv/
 http://rel.kxml.no/noark5/v4/api/arkivstruktur/ny-arkiv/

It's an easy fix, but I'll do it as described below.

>
> Also, according to 6.1.1.3 on page 17 in the specification, creating
> objects should return a _links array with a 'self' relation as well as
> any "sub-links" to the newly created object.  But when I use the above
> mentioned "ny-arkiv" URL to create a new fond, the returned JSON contain
> "_links" : []" - ie no links returned.  Is this intentional or a
> mistake?

It's intentional, proper _links should be in place in 0.2. One of the
things I understand a Noark core should do according to the standard is
that it should return links of what the user is able to do based on
access rights.

So I have to write a handler class that populates these links with
correct values. This class also needs to interact with some role/action
description service. As far as I can tell, that is not specified
anywhere in Noark, nor should it be as it's very application and domain
specific.

> I was planning to rewrite my test to use the links in _links instead of
> hardcoding URLs, but can't as the URLs are missing. :)
>

I will try and publish a working version of the 0.2 branch which has the
shell of a handler that at least can give the self _links.  I have not
used git that much before and am a little worried about how to merge 0.1
with 0.2 so that 0.2 has all the updates from 0.1. I could try a merge
but I’m afraid that I’ll break the codebase in some way. You have
commented that I "kill" codebases before. I think this might be one of
those reasons I do that. It's easier to manually pull everything
together and starting again than merging into a mess.

So any tips on how to merge 0.1 and 0.2 would be appreciated!

 - Tom



More information about the nikita-noark mailing list