lyrasis / aspace-islandora

Plugin to interoperate with Islandora.
3 stars 0 forks source link

Plugin setup and running examples #21

Closed avatar382 closed 5 years ago

avatar382 commented 5 years ago

Hi, working to configure this plugin on an ArchivesSpace 2.5.1 instance.

I've installed the plugin and have configured the AppConfig[:plugins] and AppConfig[:islandora_config] directives in the config.rb file.

I'm trying to run some test queries against Islandora like the examples in the README, which resemble something like: bundle exec ./archivesspace-cli request --type=GET --path=/repositories/2/digital_objects/1.

But, I don't understand the context behind this command. Is this to be run on the ASpace instance the plugin in installed on? I couldn't find any references to a "archivesspace-cli" executable when searching the ASpace, dependency gem, and plugin source code.

How are these requests to be run?

Thanks!

mark-cooper commented 5 years ago

@avatar382 yeah, sorry, that is confusing. It's actually referring to a deprecated cli project, and the documentation was never updated here (I'll aim to review it soon). If you were to just replace that command with an equivalent one using curl then it'd be the same thing. Something like:

apt-get install jq # brew install jq for mac
echo "export TOKEN=$(curl -Fpassword=admin http://localhost:8089/users/admin/login | jq '.session')" > .session
source .session

curl \
  -H "X-ArchivesSpace-Session: $TOKEN" \
  "http://localhost:8089/repositories/2/digital_objects/1"
mark-cooper commented 5 years ago

Example for POST (i.e. incoming from Islandora), payload.json:

{
  "digital_object_id": "lyrasis:3245",
  "title": "TESTING, 123!",
  "file_versions": [
    {
      "file_uri": "https://dev-islandora.lyrasistechnology.org/islandora/object/lyrasis:3245"
    }
  ]
}

Import:

curl \
  -H "Content-Type: application/json" \
  -H "X-ArchivesSpace-Session: $TOKEN" \
  -X POST \
  -d @payload.json \
  "http://localhost:8089/plugins/aspace_islandora/repositories/2/islandora_deposits?pid=lyrasis:3245"
avatar382 commented 5 years ago

@mark-cooper Thanks, that makes sense. I'll try it out with CURL.