{"action":"created","comment":{"url":"https://api.github.com/repos/codice/ddf/pulls/comments/52203625","id":52203625,"diff_hunk":"@@ -82,17 +87,27 @@ public void writeTo(CswRecordCollection recordCollection, Class<?> type, Type ge\n         final String mimeType = recordCollection.getMimeType();\n         LOGGER.debug(\n                 \"Attempting to transform RecordCollection with mime-type: {} & outputSchema: {}\",\n-                mimeType, recordCollection.getOutputSchema());\n+                mimeType,\n+                recordCollection.getOutputSchema());\n         QueryResponseTransformer transformer;\n         Map<String, Serializable> arguments = new HashMap<String, Serializable>();\n-        if (StringUtils.isBlank(recordCollection.getOutputSchema()) && StringUtils\n-                .isNotBlank(mimeType) && !XML_MIME_TYPES.contains(mimeType)) {\n+        if (StringUtils.isBlank(recordCollection.getOutputSchema()) && StringUtils.isNotBlank(\n+                mimeType) && !XML_MIME_TYPES.contains(mimeType)) {\n             transformer = transformerManager.getTransformerByMimeType(mimeType);\n+        } else if (recordCollection.getOutputSchema()\n+                .equals(OCTET_STREAM_OUTPUT_SCHEMA)) {\n+            Resource resource = recordCollection.getResource();","path":"catalog/spatial/csw/spatial-csw-endpoint/src/main/java/org/codice/ddf/spatial/ogc/csw/catalog/endpoint/writer/CswRecordCollectionMessageBodyWriter.java","position":57,"original_position":57,"commit_id":"4f68b2299067a6d96b8b64b3481fd89538959de5","original_commit_id":"4f68b2299067a6d96b8b64b3481fd89538959de5","user":{"login":"tbatie","id":9013620,"avatar_url":"https://avatars.githubusercontent.com/u/9013620?v=3","gravatar_id":"","url":"https://api.github.com/users/tbatie","html_url":"https://github.com/tbatie","followers_url":"https://api.github.com/users/tbatie/followers","following_url":"https://api.github.com/users/tbatie/following{/other_user}","gists_url":"https://api.github.com/users/tbatie/gists{/gist_id}","starred_url":"https://api.github.com/users/tbatie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbatie/subscriptions","organizations_url":"https://api.github.com/users/tbatie/orgs","repos_url":"https://api.github.com/users/tbatie/repos","events_url":"https://api.github.com/users/tbatie/events{/privacy}","received_events_url":"https://api.github.com/users/tbatie/received_events","type":"User","site_admin":false},"body":"It seems like this logic should be inside of CswQueryResponseTranformer instead since it responsible for the actual transformation.","created_at":"2016-02-08T18:14:46Z","updated_at":"2016-02-08T18:14:46Z","html_url":"https://github.com/codice/ddf/pull/524#discussion_r52203625","pull_request_url":"https://api.github.com/repos/codice/ddf/pulls/524","_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments/52203625"},"html":{"href":"https://github.com/codice/ddf/pull/524#discussion_r52203625"},"pull_request":{"href":"https://api.github.com/repos/codice/ddf/pulls/524"}}},"pull_request":{"url":"https://api.github.com/repos/codice/ddf/pulls/524","id":58500159,"html_url":"https://github.com/codice/ddf/pull/524","diff_url":"https://github.com/codice/ddf/pull/524.diff","patch_url":"https://github.com/codice/ddf/pull/524.patch","issue_url":"https://api.github.com/repos/codice/ddf/issues/524","number":524,"state":"open","locked":false,"title":"DDF-1845 Added Product Retrieval Capability to CSW Endpoint","user":{"login":"roelens8","id":5935039,"avatar_url":"https://avatars.githubusercontent.com/u/5935039?v=3","gravatar_id":"","url":"https://api.github.com/users/roelens8","html_url":"https://github.com/roelens8","followers_url":"https://api.github.com/users/roelens8/followers","following_url":"https://api.github.com/users/roelens8/following{/other_user}","gists_url":"https://api.github.com/users/roelens8/gists{/gist_id}","starred_url":"https://api.github.com/users/roelens8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roelens8/subscriptions","organizations_url":"https://api.github.com/users/roelens8/orgs","repos_url":"https://api.github.com/users/roelens8/repos","events_url":"https://api.github.com/users/roelens8/events{/privacy}","received_events_url":"https://api.github.com/users/roelens8/received_events","type":"User","site_admin":false},"body":"**A lot of the changes in the pull request are formatting.** \r\nThe most important code changes are within getRecordById() of CSWEndpoint.java for POST and GET. Also added unit tests for code coverage.\r\n\r\n**Description of the functionality:**\r\nA user can now retrieve products through the getRecordById operation. The client sets the output schema to \"http://www.iana.org/assignments/media-types/application/octet-stream\" and the output format to \"application/octet-stream\". The endpoint will do the following: check that only one Id is provided otherwise throw an exception as multiple products cannot be retrieved. If both output format and output schema are set as mentioned above, the catalog framework will retrieve the resource object for that Id. From that object, it gets the mime type and the actual data. It then tells the CswRecordCollectionMessageBodyWriter to send out the data and set the HTTP content type to the resource's MIME type.\r\n\r\n**Examples of the request:**\r\n![screen shot 2016-02-05 at 4 48 36 pm](https://cloud.githubusercontent.com/assets/5935039/12862387/632fa942-cc28-11e5-9082-f34b4c3f8adf.png)\r\n\r\n@kcwire @ryeats @coyotesqrl @pklinef @tbatie @rzwiefel\r\n","created_at":"2016-02-05T23:40:50Z","updated_at":"2016-02-08T18:14:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b5e0c58b9420747b86563d0bfa9a344287b518a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/codice/ddf/pulls/524/commits","review_comments_url":"https://api.github.com/repos/codice/ddf/pulls/524/comments","review_comment_url":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codice/ddf/issues/524/comments","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/4f68b2299067a6d96b8b64b3481fd89538959de5","head":{"label":"roelens8:DDF-1845","ref":"DDF-1845","sha":"4f68b2299067a6d96b8b64b3481fd89538959de5","user":{"login":"roelens8","id":5935039,"avatar_url":"https://avatars.githubusercontent.com/u/5935039?v=3","gravatar_id":"","url":"https://api.github.com/users/roelens8","html_url":"https://github.com/roelens8","followers_url":"https://api.github.com/users/roelens8/followers","following_url":"https://api.github.com/users/roelens8/following{/other_user}","gists_url":"https://api.github.com/users/roelens8/gists{/gist_id}","starred_url":"https://api.github.com/users/roelens8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roelens8/subscriptions","organizations_url":"https://api.github.com/users/roelens8/orgs","repos_url":"https://api.github.com/users/roelens8/repos","events_url":"https://api.github.com/users/roelens8/events{/privacy}","received_events_url":"https://api.github.com/users/roelens8/received_events","type":"User","site_admin":false},"repo":{"id":37481426,"name":"ddf","full_name":"roelens8/ddf","owner":{"login":"roelens8","id":5935039,"avatar_url":"https://avatars.githubusercontent.com/u/5935039?v=3","gravatar_id":"","url":"https://api.github.com/users/roelens8","html_url":"https://github.com/roelens8","followers_url":"https://api.github.com/users/roelens8/followers","following_url":"https://api.github.com/users/roelens8/following{/other_user}","gists_url":"https://api.github.com/users/roelens8/gists{/gist_id}","starred_url":"https://api.github.com/users/roelens8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roelens8/subscriptions","organizations_url":"https://api.github.com/users/roelens8/orgs","repos_url":"https://api.github.com/users/roelens8/repos","events_url":"https://api.github.com/users/roelens8/events{/privacy}","received_events_url":"https://api.github.com/users/roelens8/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/roelens8/ddf","description":"The Distributed Data Framework - Distribution, SDK, and Test","fork":true,"url":"https://api.github.com/repos/roelens8/ddf","forks_url":"https://api.github.com/repos/roelens8/ddf/forks","keys_url":"https://api.github.com/repos/roelens8/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roelens8/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roelens8/ddf/teams","hooks_url":"https://api.github.com/repos/roelens8/ddf/hooks","issue_events_url":"https://api.github.com/repos/roelens8/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/roelens8/ddf/events","assignees_url":"https://api.github.com/repos/roelens8/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/roelens8/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/roelens8/ddf/tags","blobs_url":"https://api.github.com/repos/roelens8/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roelens8/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roelens8/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/roelens8/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roelens8/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/roelens8/ddf/languages","stargazers_url":"https://api.github.com/repos/roelens8/ddf/stargazers","contributors_url":"https://api.github.com/repos/roelens8/ddf/contributors","subscribers_url":"https://api.github.com/repos/roelens8/ddf/subscribers","subscription_url":"https://api.github.com/repos/roelens8/ddf/subscription","commits_url":"https://api.github.com/repos/roelens8/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/roelens8/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/roelens8/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/roelens8/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/roelens8/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/roelens8/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roelens8/ddf/merges","archive_url":"https://api.github.com/repos/roelens8/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roelens8/ddf/downloads","issues_url":"https://api.github.com/repos/roelens8/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/roelens8/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/roelens8/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/roelens8/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roelens8/ddf/labels{/name}","releases_url":"https://api.github.com/repos/roelens8/ddf/releases{/id}","deployments_url":"https://api.github.com/repos/roelens8/ddf/deployments","created_at":"2015-06-15T17:55:32Z","updated_at":"2015-06-15T17:55:33Z","pushed_at":"2016-02-08T17:44:46Z","git_url":"git://github.com/roelens8/ddf.git","ssh_url":"git@github.com:roelens8/ddf.git","clone_url":"https://github.com/roelens8/ddf.git","svn_url":"https://github.com/roelens8/ddf","homepage":"","size":127429,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"codice:master","ref":"master","sha":"6035f3d71ebdfd697b0e0287b69835322fb56ffa","user":{"login":"codice","id":2386734,"avatar_url":"https://avatars.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"repo":{"id":15173563,"name":"ddf","full_name":"codice/ddf","owner":{"login":"codice","id":2386734,"avatar_url":"https://avatars.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codice/ddf","description":"The Distributed Data Framework - Federated Open Geospatial Consortium (OGC) filter powered metadata catalog with SAML Web SSO secured container","fork":false,"url":"https://api.github.com/repos/codice/ddf","forks_url":"https://api.github.com/repos/codice/ddf/forks","keys_url":"https://api.github.com/repos/codice/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codice/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codice/ddf/teams","hooks_url":"https://api.github.com/repos/codice/ddf/hooks","issue_events_url":"https://api.github.com/repos/codice/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/codice/ddf/events","assignees_url":"https://api.github.com/repos/codice/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/codice/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/codice/ddf/tags","blobs_url":"https://api.github.com/repos/codice/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codice/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codice/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/codice/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/codice/ddf/languages","stargazers_url":"https://api.github.com/repos/codice/ddf/stargazers","contributors_url":"https://api.github.com/repos/codice/ddf/contributors","subscribers_url":"https://api.github.com/repos/codice/ddf/subscribers","subscription_url":"https://api.github.com/repos/codice/ddf/subscription","commits_url":"https://api.github.com/repos/codice/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/codice/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/codice/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/codice/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/codice/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/codice/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codice/ddf/merges","archive_url":"https://api.github.com/repos/codice/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codice/ddf/downloads","issues_url":"https://api.github.com/repos/codice/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/codice/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/codice/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/codice/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codice/ddf/labels{/name}","releases_url":"https://api.github.com/repos/codice/ddf/releases{/id}","deployments_url":"https://api.github.com/repos/codice/ddf/deployments","created_at":"2013-12-13T20:38:28Z","updated_at":"2016-02-02T16:34:27Z","pushed_at":"2016-02-08T18:11:17Z","git_url":"git://github.com/codice/ddf.git","ssh_url":"git@github.com:codice/ddf.git","clone_url":"https://github.com/codice/ddf.git","svn_url":"https://github.com/codice/ddf","homepage":"","size":136485,"stargazers_count":32,"watchers_count":32,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":68,"mirror_url":null,"open_issues_count":14,"forks":68,"open_issues":14,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/524"},"html":{"href":"https://github.com/codice/ddf/pull/524"},"issue":{"href":"https://api.github.com/repos/codice/ddf/issues/524"},"comments":{"href":"https://api.github.com/repos/codice/ddf/issues/524/comments"},"review_comments":{"href":"https://api.github.com/repos/codice/ddf/pulls/524/comments"},"review_comment":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codice/ddf/pulls/524/commits"},"statuses":{"href":"https://api.github.com/repos/codice/ddf/statuses/4f68b2299067a6d96b8b64b3481fd89538959de5"}}}}