Updated version 0.1 of Nikita - interface update

Thomas Sødring thomas.sodring at hioa.no
Tue Jan 31 14:36:12 CET 2017


Hi,

I have added some code that now ensures the core publishes the services
it supports. This is as per the Noark 5v4 standard and what Petter has
been testing.

Please note that I am assuming a trailing slash when a list is expected
to be returned. I am aware there is not really any rule about this, but
the consensus seems to be that if you are expecting a list, use a slash.
I will try and ensure this in the codebase going forward.

You start of at :

curl --header Accept:application/vnd.noark5-v4+json --header
Content-Type:application/vnd.noark5-v4+json -X GET
http://localhost:8092/noark5v4/

This gives you the following list:

{
  "_links" : [ {
    "href" : "http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/",
    "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur"
  }, {
    "href" : "http://localhost:8092/noark5v4/hateoas-api/sakarkiv/",
    "rel" : "http://rel.kxml.no/noark5/v4/api/sakarkiv"
  }, {
    "href" : "http://localhost:8092/noark5v4/gui/",
    "rel" : "http://nikita.arkivlab.no/noark5/v4/gui"
  }, {
    "href" : "http://localhost:8092/noark5v4/import-api/",
    "rel" : "http://nikita.arkivlab.no/noark5/v4/import-api"
  } ]
}

sakarkiv and import return a "501 Not implemented". The gui is returning
html but Petter is reporting that it is requiring a relogin. I won't
look at this now as gui is something that I'll look at later. At this
point you have to login to interact with anything below arkivstruktur.

To login:
curl -i -X POST -d username=admin -d password=password -c cookie.txt
http://localhost:8092/noark5v4/doLogin

Then if you hit:

curl -v --header Accept:application/vnd.noark5-v4+json --header
Content-Type:application/vnd.noark5-v4+json -X GET  -b cookie.txt
"http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/"

You should get the following list that shows everything you can access.

{
  "_links" : [ {
    "href" :
"http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/",
    "rel" : "http://rel.kxml.no/noark5/v4/api/arkivstruktur/arkiv",
    "templated" : true,
    "reltemplatedSpecified" : true
  }, {
    "href" :
"http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/ny-arkiv",
    "rel" : "http://rel.kxml.no/noark5/v4/api/administration/ny-arkiv",
    "templated" : false,
    "reltemplatedSpecified" : true
  }
   ... some items removed for brevity ...
]
}

Mostly these are mapped to findAll methods and will only return
paginated results. I have not implemented next and previous as this will
come in version 0.2.  From here you can hit any of the Noark entities
listed.

curl -v --header Accept:application/vnd.noark5-v4+json --header
Content-Type:application/vnd.noark5-v4+json -X GET  -b cookie.txt
http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/

Hopefully this is the last thing that has to be done for the 0.1 release
and we can now progress with a branch for 0.2. Let me know if you find
any problems.

This update has been committed.

 - Tom


More information about the nikita-noark mailing list