{"action":"created","comment":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments/60758674","id":60758674,"diff_hunk":"@@ -3882,7 +3885,7 @@ PlaneInfo (as Plane)\n       <xsd:complexContent>\n         <xsd:extension base=\"Shape\">\n           <xsd:sequence>\n-            <xsd:element ref=\"BinData\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n+            <xsd:element ref=\"BinData\" minOccurs=\"1\" maxOccurs=\"1\"/>","path":"components/specification/released-schema/2016-DEV0/ome.xsd","position":24,"original_position":24,"commit_id":"a9b02ebc89c8bcbc6585c4c1c5dff85622975f2a","original_commit_id":"a9b02ebc89c8bcbc6585c4c1c5dff85622975f2a","user":{"login":"rleigh-dundee","id":1528953,"avatar_url":"https://avatars.githubusercontent.com/u/1528953?v=3","gravatar_id":"","url":"https://api.github.com/users/rleigh-dundee","html_url":"https://github.com/rleigh-dundee","followers_url":"https://api.github.com/users/rleigh-dundee/followers","following_url":"https://api.github.com/users/rleigh-dundee/following{/other_user}","gists_url":"https://api.github.com/users/rleigh-dundee/gists{/gist_id}","starred_url":"https://api.github.com/users/rleigh-dundee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rleigh-dundee/subscriptions","organizations_url":"https://api.github.com/users/rleigh-dundee/orgs","repos_url":"https://api.github.com/users/rleigh-dundee/repos","events_url":"https://api.github.com/users/rleigh-dundee/events{/privacy}","received_events_url":"https://api.github.com/users/rleigh-dundee/received_events","type":"User","site_admin":false},"body":"Do we want a similar constraint on `Pixels`?","created_at":"2016-04-22T15:36:53Z","updated_at":"2016-04-22T15:36:53Z","html_url":"https://github.com/openmicroscopy/bioformats/pull/2319#discussion_r60758674","pull_request_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2319","_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments/60758674"},"html":{"href":"https://github.com/openmicroscopy/bioformats/pull/2319#discussion_r60758674"},"pull_request":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2319"}}},"pull_request":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2319","id":65117390,"html_url":"https://github.com/openmicroscopy/bioformats/pull/2319","diff_url":"https://github.com/openmicroscopy/bioformats/pull/2319.diff","patch_url":"https://github.com/openmicroscopy/bioformats/pull/2319.patch","issue_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2319","number":2319,"state":"open","locked":false,"title":"Codegen - Adding BinData","user":{"login":"dgault","id":1628865,"avatar_url":"https://avatars.githubusercontent.com/u/1628865?v=3","gravatar_id":"","url":"https://api.github.com/users/dgault","html_url":"https://github.com/dgault","followers_url":"https://api.github.com/users/dgault/followers","following_url":"https://api.github.com/users/dgault/following{/other_user}","gists_url":"https://api.github.com/users/dgault/gists{/gist_id}","starred_url":"https://api.github.com/users/dgault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgault/subscriptions","organizations_url":"https://api.github.com/users/dgault/orgs","repos_url":"https://api.github.com/users/dgault/repos","events_url":"https://api.github.com/users/dgault/events{/privacy}","received_events_url":"https://api.github.com/users/dgault/received_events","type":"User","site_admin":false},"body":"This PR will allow for our codegen to handle raw binary data. For the Mask implementation in particular this requires some unique behaviour to be added. In our schema a Mask extends base64binary, which in Java would be the equivalent of extending a byte[]. The metadata API reflects this by allowing you to set BinData as such - setMaskBinData(byte[] binData, int ROIIndex, int shapeIndex)\r\n\r\nFrom a Java perspective it would make more sense to have the raw binary as an additional attribute on the BinData object, however this would require larger schema changes and break the existing API in favour of adding new functions that perhaps don't accurately reflect the schema. \r\n\r\nAs such I have modified the codegen so that if a model object has a primitive base then it shall instead extend the default type and the primitive base will be added as an attribute with the tag baseAttribute. Properties tagged as being baseAttributes will be exposed in the API at the top level, ie setMaskBinData as opposed to setMaskBinDataBinData. \r\n\r\nThis will see the BinData model object add the following property along with getters and setters. The getters and setters will then be used by the top level API functions, leaving the metadata API unchanged.\r\n// BinData property\r\nprivate byte[] binData;\r\n\r\nReasons for taking this approach:\r\n- Limit schema changes as much as possible\r\n- Metadata API should remain unchanged\r\n- Simplifies templates by removing previous specialisations for shape and lightsource abstract \r\n- Removes last remaining hardcoded bin data functions\r\n\r\nIn Java we are using a raw byte[], the reason for using this as opposed to List<Byte>, ByteBuffer, InputStream etc was firstly for efficiency in storage and in performance when converting back and forth from the XML. In CPP this is currently listed as a string for simplicity but this would certainly welcome suggestions on a suitable alternative.\r\n\r\nNote: The CPP implementation requires the Shape complex type PR - https://github.com/openmicroscopy/bioformats/pull/2160 \r\nAs such the CPP is not going to validate against the 2013 schema\r\n\r\nTesting:\r\nI am in the process of defining a suitable testing strategy.\r\n- Check that all tests remain green\r\n- Verify that the new attribute has been added to BinData model along with getters and setters\r\n- Verify that metadata API remains unchanged","created_at":"2016-04-04T09:34:24Z","updated_at":"2016-04-22T15:36:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1d79f835c23b20d360219aea03eb8e8cacc9775","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2319/commits","review_comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2319/comments","review_comment_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2319/comments","statuses_url":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/a9b02ebc89c8bcbc6585c4c1c5dff85622975f2a","head":{"label":"dgault:codegen-BinData","ref":"codegen-BinData","sha":"a9b02ebc89c8bcbc6585c4c1c5dff85622975f2a","user":{"login":"dgault","id":1628865,"avatar_url":"https://avatars.githubusercontent.com/u/1628865?v=3","gravatar_id":"","url":"https://api.github.com/users/dgault","html_url":"https://github.com/dgault","followers_url":"https://api.github.com/users/dgault/followers","following_url":"https://api.github.com/users/dgault/following{/other_user}","gists_url":"https://api.github.com/users/dgault/gists{/gist_id}","starred_url":"https://api.github.com/users/dgault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgault/subscriptions","organizations_url":"https://api.github.com/users/dgault/orgs","repos_url":"https://api.github.com/users/dgault/repos","events_url":"https://api.github.com/users/dgault/events{/privacy}","received_events_url":"https://api.github.com/users/dgault/received_events","type":"User","site_admin":false},"repo":{"id":42044740,"name":"bioformats","full_name":"dgault/bioformats","owner":{"login":"dgault","id":1628865,"avatar_url":"https://avatars.githubusercontent.com/u/1628865?v=3","gravatar_id":"","url":"https://api.github.com/users/dgault","html_url":"https://github.com/dgault","followers_url":"https://api.github.com/users/dgault/followers","following_url":"https://api.github.com/users/dgault/following{/other_user}","gists_url":"https://api.github.com/users/dgault/gists{/gist_id}","starred_url":"https://api.github.com/users/dgault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgault/subscriptions","organizations_url":"https://api.github.com/users/dgault/orgs","repos_url":"https://api.github.com/users/dgault/repos","events_url":"https://api.github.com/users/dgault/events{/privacy}","received_events_url":"https://api.github.com/users/dgault/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dgault/bioformats","description":"Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the  Open Microscopy Environment (particularly  UW-Madison LOCI and  Glencoe Software). Bio-Formats is released under the  GNU General Public License (GPL); commercial licenses are available from  Glencoe Software. ","fork":true,"url":"https://api.github.com/repos/dgault/bioformats","forks_url":"https://api.github.com/repos/dgault/bioformats/forks","keys_url":"https://api.github.com/repos/dgault/bioformats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dgault/bioformats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dgault/bioformats/teams","hooks_url":"https://api.github.com/repos/dgault/bioformats/hooks","issue_events_url":"https://api.github.com/repos/dgault/bioformats/issues/events{/number}","events_url":"https://api.github.com/repos/dgault/bioformats/events","assignees_url":"https://api.github.com/repos/dgault/bioformats/assignees{/user}","branches_url":"https://api.github.com/repos/dgault/bioformats/branches{/branch}","tags_url":"https://api.github.com/repos/dgault/bioformats/tags","blobs_url":"https://api.github.com/repos/dgault/bioformats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dgault/bioformats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dgault/bioformats/git/refs{/sha}","trees_url":"https://api.github.com/repos/dgault/bioformats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dgault/bioformats/statuses/{sha}","languages_url":"https://api.github.com/repos/dgault/bioformats/languages","stargazers_url":"https://api.github.com/repos/dgault/bioformats/stargazers","contributors_url":"https://api.github.com/repos/dgault/bioformats/contributors","subscribers_url":"https://api.github.com/repos/dgault/bioformats/subscribers","subscription_url":"https://api.github.com/repos/dgault/bioformats/subscription","commits_url":"https://api.github.com/repos/dgault/bioformats/commits{/sha}","git_commits_url":"https://api.github.com/repos/dgault/bioformats/git/commits{/sha}","comments_url":"https://api.github.com/repos/dgault/bioformats/comments{/number}","issue_comment_url":"https://api.github.com/repos/dgault/bioformats/issues/comments{/number}","contents_url":"https://api.github.com/repos/dgault/bioformats/contents/{+path}","compare_url":"https://api.github.com/repos/dgault/bioformats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dgault/bioformats/merges","archive_url":"https://api.github.com/repos/dgault/bioformats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dgault/bioformats/downloads","issues_url":"https://api.github.com/repos/dgault/bioformats/issues{/number}","pulls_url":"https://api.github.com/repos/dgault/bioformats/pulls{/number}","milestones_url":"https://api.github.com/repos/dgault/bioformats/milestones{/number}","notifications_url":"https://api.github.com/repos/dgault/bioformats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dgault/bioformats/labels{/name}","releases_url":"https://api.github.com/repos/dgault/bioformats/releases{/id}","deployments_url":"https://api.github.com/repos/dgault/bioformats/deployments","created_at":"2015-09-07T09:44:20Z","updated_at":"2015-09-07T09:44:33Z","pushed_at":"2016-04-21T13:21:44Z","git_url":"git://github.com/dgault/bioformats.git","ssh_url":"git@github.com:dgault/bioformats.git","clone_url":"https://github.com/dgault/bioformats.git","svn_url":"https://github.com/dgault/bioformats","homepage":"http://www.openmicroscopy.org/site/products/bio-formats","size":261195,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"openmicroscopy:develop","ref":"develop","sha":"eaaa3a74e7d4a81747140398bd50f30abf4c2f00","user":{"login":"openmicroscopy","id":975861,"avatar_url":"https://avatars.githubusercontent.com/u/975861?v=3","gravatar_id":"","url":"https://api.github.com/users/openmicroscopy","html_url":"https://github.com/openmicroscopy","followers_url":"https://api.github.com/users/openmicroscopy/followers","following_url":"https://api.github.com/users/openmicroscopy/following{/other_user}","gists_url":"https://api.github.com/users/openmicroscopy/gists{/gist_id}","starred_url":"https://api.github.com/users/openmicroscopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmicroscopy/subscriptions","organizations_url":"https://api.github.com/users/openmicroscopy/orgs","repos_url":"https://api.github.com/users/openmicroscopy/repos","events_url":"https://api.github.com/users/openmicroscopy/events{/privacy}","received_events_url":"https://api.github.com/users/openmicroscopy/received_events","type":"Organization","site_admin":false},"repo":{"id":2510503,"name":"bioformats","full_name":"openmicroscopy/bioformats","owner":{"login":"openmicroscopy","id":975861,"avatar_url":"https://avatars.githubusercontent.com/u/975861?v=3","gravatar_id":"","url":"https://api.github.com/users/openmicroscopy","html_url":"https://github.com/openmicroscopy","followers_url":"https://api.github.com/users/openmicroscopy/followers","following_url":"https://api.github.com/users/openmicroscopy/following{/other_user}","gists_url":"https://api.github.com/users/openmicroscopy/gists{/gist_id}","starred_url":"https://api.github.com/users/openmicroscopy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmicroscopy/subscriptions","organizations_url":"https://api.github.com/users/openmicroscopy/orgs","repos_url":"https://api.github.com/users/openmicroscopy/repos","events_url":"https://api.github.com/users/openmicroscopy/events{/privacy}","received_events_url":"https://api.github.com/users/openmicroscopy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openmicroscopy/bioformats","description":"Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the  Open Microscopy Environment (particularly  UW-Madison LOCI and  Glencoe Software). Bio-Formats is released under the  GNU General Public License (GPL); commercial licenses are available from  Glencoe Software. ","fork":false,"url":"https://api.github.com/repos/openmicroscopy/bioformats","forks_url":"https://api.github.com/repos/openmicroscopy/bioformats/forks","keys_url":"https://api.github.com/repos/openmicroscopy/bioformats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmicroscopy/bioformats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmicroscopy/bioformats/teams","hooks_url":"https://api.github.com/repos/openmicroscopy/bioformats/hooks","issue_events_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/events{/number}","events_url":"https://api.github.com/repos/openmicroscopy/bioformats/events","assignees_url":"https://api.github.com/repos/openmicroscopy/bioformats/assignees{/user}","branches_url":"https://api.github.com/repos/openmicroscopy/bioformats/branches{/branch}","tags_url":"https://api.github.com/repos/openmicroscopy/bioformats/tags","blobs_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/{sha}","languages_url":"https://api.github.com/repos/openmicroscopy/bioformats/languages","stargazers_url":"https://api.github.com/repos/openmicroscopy/bioformats/stargazers","contributors_url":"https://api.github.com/repos/openmicroscopy/bioformats/contributors","subscribers_url":"https://api.github.com/repos/openmicroscopy/bioformats/subscribers","subscription_url":"https://api.github.com/repos/openmicroscopy/bioformats/subscription","commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmicroscopy/bioformats/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmicroscopy/bioformats/contents/{+path}","compare_url":"https://api.github.com/repos/openmicroscopy/bioformats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmicroscopy/bioformats/merges","archive_url":"https://api.github.com/repos/openmicroscopy/bioformats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmicroscopy/bioformats/downloads","issues_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues{/number}","pulls_url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls{/number}","milestones_url":"https://api.github.com/repos/openmicroscopy/bioformats/milestones{/number}","notifications_url":"https://api.github.com/repos/openmicroscopy/bioformats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmicroscopy/bioformats/labels{/name}","releases_url":"https://api.github.com/repos/openmicroscopy/bioformats/releases{/id}","deployments_url":"https://api.github.com/repos/openmicroscopy/bioformats/deployments","created_at":"2011-10-04T08:06:14Z","updated_at":"2016-03-31T19:31:49Z","pushed_at":"2016-04-21T13:44:57Z","git_url":"git://github.com/openmicroscopy/bioformats.git","ssh_url":"git@github.com:openmicroscopy/bioformats.git","clone_url":"https://github.com/openmicroscopy/bioformats.git","svn_url":"https://github.com/openmicroscopy/bioformats","homepage":"http://www.openmicroscopy.org/site/products/bio-formats","size":283092,"stargazers_count":101,"watchers_count":101,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":124,"mirror_url":null,"open_issues_count":29,"forks":124,"open_issues":29,"watchers":101,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2319"},"html":{"href":"https://github.com/openmicroscopy/bioformats/pull/2319"},"issue":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2319"},"comments":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2319/comments"},"review_comments":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2319/comments"},"review_comment":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2319/commits"},"statuses":{"href":"https://api.github.com/repos/openmicroscopy/bioformats/statuses/a9b02ebc89c8bcbc6585c4c1c5dff85622975f2a"}}}}