Skip to content

knaw-huc/service-huc-editor

Repository files navigation

CLARIAH CMDI Forms: services

CCF backend services

demo: run the Hello World Form

  1. Start the docker container:
docker run -p 1210:1210 --name=ccf --rm -it ghcr.io/knaw-huc/service-huc-editor:2.0-RC1
  1. Initialize the HelloWorld app:
curl -v -X PUT -H 'Authorization: Bearer foobar' http://localhost:1210/app/HelloWorld
  1. Visit the HelloWorld app:

http://localhost:1210/app/HelloWorld

Setup your own

create or select a CMDI profile

Create or select a CMDI profile in/from the Component Registry

CCF limitations

  • don't use attributes, as they are tied to XML and don't have a decent counterpart in JSON, RDF, ...

Remember the ID of your profile, which can be seen in its XML representation, e.g. clarin.eu:cr1:p_1721373444008:

<ComponentSpec isProfile="true" CMDVersion="1.2" CMDOriginalVersion="1.2">
  <Header>
    <ID>clarin.eu:cr1:p_1721373444008</ID>
    <Name>ShowcaseForm</Name>
    <Description>A showcase profile for the CLARIAH CMDI Forms</Description>
    <Status>development</Status>
  </Header>
  ...
</ComponentSpec>

start the service

With release image:

docker run -v ./conf:/home/huc/huc-editor-service/conf -v ./data:/home/huc/huc-editor-service/data -p 1210:1210 --name=ccf --rm -it ghcr.io/knaw-huc/service-huc-editor:2.0-RC1

With local image:

docker build -t ccf .
docker run -v ./conf:/home/huc/huc-editor-service/conf -v ./data:/home/huc/huc-editor-service/data -p 1210:1210 --name=ccf --rm -it ccf

This mounts both the local

  • conf directory, containing the global configuration
  • data directory, which will contain the app configuration, the profile, its tweak(s) and records

initialize your app

curl -v -X PUT -H 'Authorization: Bearer foobar' http://0.0.0.0:1210/app/myApp?prof=clarin.eu:cr1:p_1721373444008&desrc="my Application"

tweak the profile

To add cues to the profile you can download a template tweak file for your profile:

http://localhost:1210/app/helloWorld/profile/clarin.eu:cr1:p_1721373444008/tweak/template

The next sections list the cues you can add to elements.

CMDI cues

CLARIAH cues

configure the app

configure the services