From 29d757f3382ebad0b37f2062e09103effda9ccbd Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Fri, 29 Jul 2022 11:24:15 -0300 Subject: [PATCH 1/2] Explain Content-Location when replacing files. --- docs/technical-documentation/rest-create.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/technical-documentation/rest-create.md b/docs/technical-documentation/rest-create.md index d65b6d36a..ec4015a8f 100644 --- a/docs/technical-documentation/rest-create.md +++ b/docs/technical-documentation/rest-create.md @@ -198,5 +198,5 @@ The parts of the above request are: 1. `-u admin:islandora` - use these basic authentication credentials 1. `-H"Content-type: image/png"` - send the content-type header 1. `--data-binary "@my-image.png"` - send the contents of the file located at my-image.png as binary -1. `-H"Content-Location: public://images/my-image.png"` - store the file in the public scheme (ie. in Drupal) at the path `images/my-image.png`, to store the file in Fedora use the `fedora//` scheme (ie. fedora://images/my-image.png) +1. `-H"Content-Location: public://images/my-image.png"` - store the file in the public scheme (ie. in Drupal) at the path `images/my-image.png`. To store the file in Fedora use the `fedora//` scheme (ie. fedora://images/my-image.png). Only applies to newly created media. If the media exists, the file content in `--data-binary` will replace the content at the existing file's location. 1. `'http://localhost:8000/node/3/media/image/16'` - the endpoint of the request specifying the node, media type and taxonomy term. From da3740ec7dc559ad05df79405460b96333c40f05 Mon Sep 17 00:00:00 2001 From: Rosie Le Faive Date: Fri, 29 Jul 2022 12:13:36 -0300 Subject: [PATCH 2/2] Make clearer what happens when you PUT over an existing file. --- docs/user-documentation/media.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/user-documentation/media.md b/docs/user-documentation/media.md index 8a4069246..a6526296b 100644 --- a/docs/user-documentation/media.md +++ b/docs/user-documentation/media.md @@ -24,6 +24,8 @@ The metadata associated with a file can be updated by clicking the _Edit_ tab wh The _Create new revision_ checkbox is selected by default which will prompt Fedora to make a new version of the media's metadata before updating its resource record. A message can be added to the revision which is stored in Drupal but is not currently saved in Fedora. +There is currently no interface in Drupal to examine or revert revisions. + ### Using the Media form to replace an existing file does not behave as expected. The media edit form allows a user to remove a file and replace it with a new one. @@ -39,13 +41,15 @@ Third, the metadata synced from the Media into Fedora at [old Fedora URI]/fcr:me To completely delete a file and its metadata from Fedora and Drupal, run the "Delete media and file(s) action" after selecting the Media in the general media list (/admin/content/media). This will cause the paths to the file and its metadata in Fedora to return 404s. !!! note "Replacing Media via REST" - It is possible to use [Islandora's REST interface](../technical-documentation/using-rest-endpoints.md) to replace Media and Files. + It is possible to use [Islandora's REST interface](../technical-documentation/rest-create.md#files-and-media) to replace the file content directly, without changing the name or location of the file. Derivatives, if configured, will be triggered. ## Media Ownership Islandora objects can have any number of media associated with them. Media store a reference to the resource node they belong to using a special field, "Media Of". By changing this field's value, you can change which resource node owns the media, and therefore, where it gets displayed or managed. +Despite us saying that the Media is "owned" by the node, if you delete, change the Drupal author, restrict permissions, etc on the node, it will not take effect on the "owned" media. + !!! note "Compared to Islandora Legacy" The direction of the relationship between objects and datastreams is reversed when compared to Islandora 7. Generally speaking, objects are unaware of their datastreams, and it's a Drupal view that lists datastreams for an object.