Update Importer to use correct URI when importing acls
Add cli argument for importing/exporting acls
Remove use of deprecated APIs
Remove unnecessary stream usage
Notes
I only tested using acls as they are the majority of what is outlined under the Web Access Control documentation. I'm not sure if there are other types of WebAC which should be tested for 2983.
There is only a long option for the cli argument, if needed a short option can be added as well
I had to enable relaxed handling (-Dfcrepo.properties.management=relaxed) in order for certain metadata to be accepted, e.g. fedora:created. Before doing this I was receiving errors when trying to upload both fcr:acl and fcr:metadata resources. I'm not sure if it's worth it to create a ticket to have the import-export-tool also have a strict option or possibly add a note in the readme about it.
Testing
Start a fresh fedora repository, e.g. with the one-click server java -Dfcrepo.properties.management=relaxed -jar fcrepo-webapp-5.1.1-jetty-console.jar
Add the acl to the binary: curl -X PUT -H "Content-Type: text/turtle" --data-binary @acl.ttl -u fedoraAdmin:secret3 "http://192.168.99.100:8080/rest/binary/fcr:acl"
Create a bag-config.yml for export
bag-info.txt:
Source-Organization: fcrepo-import-export
Organization-Address: localhost
External-Description: BagIt Bag
Run the exporter, specifying that acls should be exported
Refresh the fedora repository
a. Stop the server
b. Clear the data if necessary (e.g. rm the fcrepo4-data created by the one-click or docker-compose down for docker)
c. Restart the server
Resolves: https://jira.lyrasis.org/browse/FCREPO-3333
Potentially resolves https://jira.lyrasis.org/browse/FCREPO-2983 as well (see notes)
Notes
-Dfcrepo.properties.management=relaxed
) in order for certain metadata to be accepted, e.g.fedora:created
. Before doing this I was receiving errors when trying to upload bothfcr:acl
andfcr:metadata
resources. I'm not sure if it's worth it to create a ticket to have the import-export-tool also have a strict option or possibly add a note in the readme about it.Testing
java -Dfcrepo.properties.management=relaxed -jar fcrepo-webapp-5.1.1-jetty-console.jar
Create an acl for the binary
curl -X PUT -H "Content-Type: text/turtle" --data-binary @acl.ttl -u fedoraAdmin:secret3 "http://192.168.99.100:8080/rest/binary/fcr:acl"
fcrepo4-data
created by the one-click ordocker-compose down
for docker) c. Restart the servercurl -u fedoraAdmin:secret3 http://192.168.99.100:8080/rest/binary/fcr:acl