{"action":"created","issue":{"url":"https://api.github.com/repos/fcrepo4/fcrepo4/issues/1357","repository_url":"https://api.github.com/repos/fcrepo4/fcrepo4","labels_url":"https://api.github.com/repos/fcrepo4/fcrepo4/issues/1357/labels{/name}","comments_url":"https://api.github.com/repos/fcrepo4/fcrepo4/issues/1357/comments","events_url":"https://api.github.com/repos/fcrepo4/fcrepo4/issues/1357/events","html_url":"https://github.com/fcrepo4/fcrepo4/pull/1357","id":321302140,"number":1357,"title":"External Content  FCREPO- 2748","user":{"login":"bseeger","id":7966375,"avatar_url":"https://avatars2.githubusercontent.com/u/7966375?v=4","gravatar_id":"","url":"https://api.github.com/users/bseeger","html_url":"https://github.com/bseeger","followers_url":"https://api.github.com/users/bseeger/followers","following_url":"https://api.github.com/users/bseeger/following{/other_user}","gists_url":"https://api.github.com/users/bseeger/gists{/gist_id}","starred_url":"https://api.github.com/users/bseeger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bseeger/subscriptions","organizations_url":"https://api.github.com/users/bseeger/orgs","repos_url":"https://api.github.com/users/bseeger/repos","events_url":"https://api.github.com/users/bseeger/events{/privacy}","received_events_url":"https://api.github.com/users/bseeger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-08T18:45:25Z","updated_at":"2018-05-09T03:52:56Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/fcrepo4/fcrepo4/pulls/1357","html_url":"https://github.com/fcrepo4/fcrepo4/pull/1357","diff_url":"https://github.com/fcrepo4/fcrepo4/pull/1357.diff","patch_url":"https://github.com/fcrepo4/fcrepo4/pull/1357.patch"},"body":"**This PR revamps external content to meet the requirements in the Fedora API spec**\r\n* * *\r\n\r\n**JIRA Ticket**: https://jira.duraspace.org/browse/FCREPO-2748\r\n\r\n* Other Relevant Links (Mailing list discussion, related pull requests, etc.)\r\n\r\n# What does this Pull Request do?\r\nAdds the foundation for External Content as described in the fedora spec. This implements external content redirect, proxy and copy. \r\n\r\n# What's new?\r\n* This splits the lower fcrepo-kernel-modeshape binary classes out a little, to accommodate for URL redirects / proxies.  There are new classes like UrlBinary, LocalFileBinary and InternalFedoraBinary to handle dealing with different scenarios. \r\n\r\n* Copy happens in the fcrepo-http-api layer -- the modeshape level never even knows it's a copy.  You can find that code in FedoraLdp.java. \r\n\r\n# How should this be tested?\r\nA description of what steps someone could take to:\r\n*  Pull down the PR to compile - and play with the resulting war file.   Interaction with External Content will now require a new link header as outlined in the spec. \r\n\r\nHere are three simple interactions to test:  \r\n\r\nRedirect: \r\n```\r\n# create the resource\r\ncurl -X PUT -H \"Link: <https://duraspace.org/>; rel=\\\"http://fedora.info/definitions/fcrepo#ExternalContent\\\"; handling=\\\"redirect\\\"; type=\\\"text/html\\\"\" http://localhost:8080/rest/duraspace-homepage\r\n# verify that the response code is a redirect with the link URI in the  Location header\r\ncurl -X GET http://localhost:8080/rest/duraspace-homepage\r\n```\r\nProxy: \r\n```\r\n# create the resource \r\ncurl -v -X PUT -H \"Link: <https://duraspace.org/wp-content/themes/duraspace/assets/images/whitedura.png>; rel=\\\"http://fedora.info/definitions/fcrepo#ExternalContent\\\"; handling=\\\"proxy\\\"; type=\\\"image/png\\\"\" http://localhost:8080/rest/duraspace-logo.png\r\n\r\n#verify that the resource was created and can be retrieved\r\ncurl -v -X GET http://localhost:8080/rest/duraspace-logo.png\r\n```\r\nCopy: \r\n```\r\n# create resource \r\ncurl -X PUT -H \"Link: <http://localhost:8080/rest/duraspace-log.png>; rel=\\\"http://fedora.info/definitions/fcrepo#ExternalContent\\\"; handling=\\\"copy\\\"; type=\\\"image/png\\\"\" http://localhost:8080/rest/duraspace-logo-copy.png\r\n\r\n#verify that the resource was created: \r\ncurl -v -X GET http://localhost:8080/rest/duraspace-logo-copy.png\r\n```\r\n\r\n\r\nExample:\r\n* Does this change require documentation to be updated?   YES \r\n\r\n# Interested parties\r\nTag (@ mention) interested parties or, if unsure, @fcrepo4/committers\r\n@bbpennel @whikloj @dbernstein \r\n"},"comment":{"url":"https://api.github.com/repos/fcrepo4/fcrepo4/issues/comments/387612343","html_url":"https://github.com/fcrepo4/fcrepo4/pull/1357#issuecomment-387612343","issue_url":"https://api.github.com/repos/fcrepo4/fcrepo4/issues/1357","id":387612343,"user":{"login":"dbernstein","id":344939,"avatar_url":"https://avatars2.githubusercontent.com/u/344939?v=4","gravatar_id":"","url":"https://api.github.com/users/dbernstein","html_url":"https://github.com/dbernstein","followers_url":"https://api.github.com/users/dbernstein/followers","following_url":"https://api.github.com/users/dbernstein/following{/other_user}","gists_url":"https://api.github.com/users/dbernstein/gists{/gist_id}","starred_url":"https://api.github.com/users/dbernstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbernstein/subscriptions","organizations_url":"https://api.github.com/users/dbernstein/orgs","repos_url":"https://api.github.com/users/dbernstein/repos","events_url":"https://api.github.com/users/dbernstein/events{/privacy}","received_events_url":"https://api.github.com/users/dbernstein/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T03:52:56Z","updated_at":"2018-05-09T03:52:56Z","author_association":"CONTRIBUTOR","body":"@bseeger :  great great work @bseeger.  I added some sample code for testing above.  I was able to successfully perform a manual smoke test for proxy, redirect, and copy. "}}
{"actor":{"display_login":"dbernstein"}}