0.1 and 0.2 merged

Thomas Sødring thomas.sodring at hioa.no
Wed Feb 8 11:16:51 CET 2017


On 02/08/2017 12:02 AM, Petter Reinholdtsen wrote:
> [Thomas Sødring]
>> No it was not my intention, but merging back into master was going to
>> happen eventually. The code is stable enough to be master I think. I
>> thought I tagged when I created the branch. But it makes sense that you
>> formally tag!
> Perhaps you forgot to push the tags, ie to use 'git push --tags'?
I hadn't done that. Will do that from now on.
>> I'm getting more errors on your script, but I think I'll let you test it
>> rather than trying to figure it out myself.
> I fixed a problem with it, and now it run a bit further.  I believe it
> exposes bugs in your code, though.  When creating a fond, I get this
> JSON back:
>
> {
>   "systemID" : "9a59f078-ce54-4128-8315-88a06903bd08",
>   "tittel" : "Title of the test fonds",
>   "beskrivelse" : "Description of the test fonds",
>   "arkivstatus" : "Opprettet",
>   "dokumentmedium" : "Elektronisk arkiv",
>   "oppbevaringsted" : [ "location 1", "location3", "location2" ],
>   "_links" : [ {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/9a59f078-ce54-4128-8315-88a06903bd08/",
>     "rel" : "self",
>     "templated" : false
>   }, {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/metadata/dokumentmedium/",
>     "rel" : "http://rel.kxml.no/noark5/v4/api/metadata/dokumentmedium/",
>     "templated" : false
>   }, {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkivskaper/",
>     "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/arkivskaper/",
>     "templated" : false
>   }, {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkivdel/",
>     "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/arkivdel/",
>     "templated" : false
>   }, {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/",
>     "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/arkiv/",
>     "templated" : false
>   }, {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/ny-arkivskaper",
>     "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/ny-arkivskaper/",
>     "templated" : false
>   }, {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/underarkiv/",
>     "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/underarkiv/",
>     "templated" : false
>   }, {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/metadata/arkivstatus/",
>     "rel" : "http://rel.kxml.no/noark5/v4/api/metadata/arkivstatus/",
>     "templated" : false
>   }, {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/ny-arkivdel/",
>     "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/ny-arkivdel/",
>     "templated" : false
>   }, {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/ny-arkiv/",
>     "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/ny-arkiv/",
>     "templated" : false
>   } ]
> }
>
> Notice this part:
>
>  {
>     "href" : "http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/ny-arkivdel/",
>     "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/ny-arkivdel/",
>     "templated" : false
>   }
>
> I expected the href URL to look like this:
>
>   http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/9a59f078-ce54-4128-8315-88a06903bd08/ny-arkivdel

> I try to use the URL provided to create a new series, but fail because
> http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/ny-arkivdel/ do
> not exist.  Did I misunderstand the specification?
>
No, you have not, it was me that misunderstood. I looked a little
blindly at the REST_REL on page 57. There are only two things that can
be created of arkivstruktur/, fonds and classificationsystem. Everything
else has to be attached to some exisiting object.

Just pushed an update on 0.2 that corrects this. I have updated the
links but I am unsure what this should retrieve:

{
    "href" :
"http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/50c0c66c-c1da-42ee-abf7-e4a337d2a07f/arkiv/",
    "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/arkiv/",
    "templated" : false
  }

The following should retrieve all (sub)fonds:

{
    "href" :
"http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/50c0c66c-c1da-42ee-abf7-e4a337d2a07f/underarkiv/",
    "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/underarkiv/",
    "templated" : false
  }


Any thoughts what the first one should return? or maybe it's just
another way of saying SELF?

The example at:

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

does also not have the following links:

 {
    "href" :
"http://localhost:8092/noark5v4/hateoas-api/metadata/dokumentmedium/",
    "rel" : "http://rel.kxml.no/noark5/v4/api/metadata/dokumentmedium/",
    "templated" : false
  }, {
    "href" :
"http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/50c0c66c-c1da-42ee-abf7-e4a337d2a07f/underarkiv/",
    "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/underarkiv/",
    "templated" : false
  }, {
    "href" :
"http://localhost:8092/noark5v4/hateoas-api/metadata/arkivstatus/",
    "rel" : "http://rel.kxml.no/noark5/v4/api/metadata/arkivstatus/",
    "templated" : false
  },{
    "href" :
"http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/50c0c66c-c1da-42ee-abf7-e4a337d2a07f/ny-arkiv/",
    "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/ny-arkiv/",
    "templated" : false
  }

I'm also guessing now, your going to expect that all the links work and
return something! Don't expect them to work at the moment :)


 - Tom



More information about the nikita-noark mailing list