{"action":"created","issue":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2419","repository_url":"https://api.github.com/repos/openmicroscopy/bioformats","labels_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2419/labels{/name}","comments_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2419/comments","events_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2419/events","html_url":"https://github.com/openmicroscopy/bioformats/pull/2419","id":154876844,"number":2419,"title":"Model enum units metadata","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},"labels":[{"url":"https://api.github.com/repos/openmicroscopy/bioformats/labels/develop","name":"develop","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-14T21:36:41Z","updated_at":"2016-05-17T14:28:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/pulls/2419","html_url":"https://github.com/openmicroscopy/bioformats/pull/2419","diff_url":"https://github.com/openmicroscopy/bioformats/pull/2419.diff","patch_url":"https://github.com/openmicroscopy/bioformats/pull/2419.patch"},"body":"This PR is the first part of the C++ units support needed for the 2015 model.  The primary change is the introduction of extended enum metadata to the schema, for use by the generator (it's all `xsd:appinfo/xsdfu` data so isn't a model change).  This allows the enum name to be different from the language enum name, which removes the need to hardcode the differences in the generator.  It also has alternative names to allow for plurals, language differences and alternative regexes, which also removes hardcoded behaviour from the generator and supplementary configuration files (`enum_handler.cfg`).\r\n\r\n- Unit language enum names are now the full unit name, matching OMERO.  The symbol names were inconsistent, caused clashes with system headers for C++, and had capitalisation and encoding issues with the micron symbol.  The corresponding code changes are the bulk of this PR.\r\n- Binning names are not hardcoded in the generator; I've chosen a proper name rather than a mixture of names and symbols, which is a breaking change but is a better choice; can be reverted if compatibility is more important\r\n- The code generator passes through a full copy of the parsed schemas, since bugs in generateds strip out needed information like per-enum metadata; this makes much more information available than previously.  Currently it's only used for the enum metadata.\r\n- The C++ generator changes aren't tested here since we don't use the new model yet.  Future work extends (and corrects) some of the changes made here.\r\n\r\n--------\r\n\r\nTesting:\r\n\r\n- Check jobs are green\r\n- Review generated code changes for Java and C++ https://ci.openmicroscopy.org/job/BIOFORMATS-DEV-merge-generated-sources/lastSuccessfulBuild/artifact/ome-xml-model-java.diff\r\n- Verify that the enum name changes are correct and acceptable\r\n- Verify that downstream users are not affected by the changes; if they are then they will need updating\r\n\r\n--------\r\n\r\nFollowup work\r\n\r\n- If the Binning and FontFamily changes to ome.xsd are acceptable, I'd like to move all enum definitions to the top-level like this for consistency with the code generator--it would mean only a single method of handling enums in the generator which would remove some unnecessary complexity from it\r\n- Additional C++ PRs for MapAnnotations and 2015 model generation"},"comment":{"url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/comments/219735180","html_url":"https://github.com/openmicroscopy/bioformats/pull/2419#issuecomment-219735180","issue_url":"https://api.github.com/repos/openmicroscopy/bioformats/issues/2419","id":219735180,"user":{"login":"joshmoore","id":88113,"avatar_url":"https://avatars.githubusercontent.com/u/88113?v=3","gravatar_id":"","url":"https://api.github.com/users/joshmoore","html_url":"https://github.com/joshmoore","followers_url":"https://api.github.com/users/joshmoore/followers","following_url":"https://api.github.com/users/joshmoore/following{/other_user}","gists_url":"https://api.github.com/users/joshmoore/gists{/gist_id}","starred_url":"https://api.github.com/users/joshmoore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshmoore/subscriptions","organizations_url":"https://api.github.com/users/joshmoore/orgs","repos_url":"https://api.github.com/users/joshmoore/repos","events_url":"https://api.github.com/users/joshmoore/events{/privacy}","received_events_url":"https://api.github.com/users/joshmoore/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T14:28:35Z","updated_at":"2016-05-17T14:28:35Z","body":":+1: for the deprecation. Minor comments from me:\r\n\r\n * if a squash is trivial it might be worth it\r\n * Use of the `@Deprecated` annotation would probably be useful at the same time. (It updates the javadoc as well, so if only one is going to be used, I'd side with the annotation)"}}