{"action":"created","issue":{"url":"https://api.github.com/repos/NRGI/resourcecontracts.org/issues/694","labels_url":"https://api.github.com/repos/NRGI/resourcecontracts.org/issues/694/labels{/name}","comments_url":"https://api.github.com/repos/NRGI/resourcecontracts.org/issues/694/comments","events_url":"https://api.github.com/repos/NRGI/resourcecontracts.org/issues/694/events","html_url":"https://github.com/NRGI/resourcecontracts.org/issues/694","id":119446958,"number":694,"title":"Annotation module improvement - linking to multiple pages and section_info","user":{"login":"anjesh","id":120488,"avatar_url":"https://avatars.githubusercontent.com/u/120488?v=3","gravatar_id":"","url":"https://api.github.com/users/anjesh","html_url":"https://github.com/anjesh","followers_url":"https://api.github.com/users/anjesh/followers","following_url":"https://api.github.com/users/anjesh/following{/other_user}","gists_url":"https://api.github.com/users/anjesh/gists{/gist_id}","starred_url":"https://api.github.com/users/anjesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anjesh/subscriptions","organizations_url":"https://api.github.com/users/anjesh/orgs","repos_url":"https://api.github.com/users/anjesh/repos","events_url":"https://api.github.com/users/anjesh/events{/privacy}","received_events_url":"https://api.github.com/users/anjesh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NRGI/resourcecontracts.org/labels/Annotation%20module%20-%20backend","name":"Annotation module - backend","color":"f7c6c7"},{"url":"https://api.github.com/repos/NRGI/resourcecontracts.org/labels/Scoping","name":"Scoping","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/NRGI/resourcecontracts.org/milestones/12","html_url":"https://github.com/NRGI/resourcecontracts.org/milestones/Sprint%20%2312:%20API,%20docker%20for%20pilot%20sites%20and%20data%20model%20update","labels_url":"https://api.github.com/repos/NRGI/resourcecontracts.org/milestones/12/labels","id":1344437,"number":12,"title":"Sprint #12: API, docker for pilot sites and data model update","description":"","creator":{"login":"anderspeders","id":1101585,"avatar_url":"https://avatars.githubusercontent.com/u/1101585?v=3","gravatar_id":"","url":"https://api.github.com/users/anderspeders","html_url":"https://github.com/anderspeders","followers_url":"https://api.github.com/users/anderspeders/followers","following_url":"https://api.github.com/users/anderspeders/following{/other_user}","gists_url":"https://api.github.com/users/anderspeders/gists{/gist_id}","starred_url":"https://api.github.com/users/anderspeders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anderspeders/subscriptions","organizations_url":"https://api.github.com/users/anderspeders/orgs","repos_url":"https://api.github.com/users/anderspeders/repos","events_url":"https://api.github.com/users/anderspeders/events{/privacy}","received_events_url":"https://api.github.com/users/anderspeders/received_events","type":"User","site_admin":false},"open_issues":61,"closed_issues":1,"state":"open","created_at":"2015-10-08T11:45:32Z","updated_at":"2015-12-18T17:41:37Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2015-11-30T09:04:50Z","updated_at":"2015-12-18T21:37:17Z","closed_at":null,"body":"We are thinking of the following UI to capture the information during the annotation process which will address the issue with the annotation linking to multiple pages. When the annotator selects the text in OCR content or highlights the content in the pdf, the following popup will appear. \r\n\r\n![image](https://cloud.githubusercontent.com/assets/120488/11466246/9f1d3e1a-9767-11e5-9940-06d9a5f49ed9.png)\r\n\r\n**Section information**\r\nTill now section information is captured as a part of the annotation text, however we have segregated the section info from the text during rendering. It makes more sense to have a separate box for the section information. \r\n\r\n**Annotation parent category**\r\nOnce the annotation selects the category, the box makes an api call to pull all the annotations for that particular category from that particular contracts and lists under \"annotation parent\". The annotator if selects the parent, then that will be linked to that annotation. \r\n\r\nThe following activities need to carried out\r\n\r\n* Develop annotator plugin for \"section information\" text input\r\n* Develop annotator plugin for \"annotation parent category\" select input\r\n* Develop API to pull the \"annotations\" based on the selected \"annotation category\" to list in \"annotation parent\"\r\n* Write script to fix the existing \"section information\" data. Remove the \"section information\" from the annotation content and save it as a separate field in the annotation model for all the existing annotations. \r\n* Fix the API in the admin section for this new model (to include section-info, annotation-parent-category) \r\n* Fix the UI in the admin\r\n* Fix the ES indexing API that indexes the annotation in the elasticsearch\r\n* Fix the API for the subsite\r\n* Fix the UI in the subsite for these two fields (section-info, annotation-parent-category)\r\n\r\nhttps://docs.google.com/drawings/d/1WRLYbxFGf5LiF9POigDdyogyhZrdEgruHbWlDnKF-98/edit\r\n![image](https://cloud.githubusercontent.com/assets/120488/11467445/3eecf5ea-9770-11e5-8cd5-a131e1848dbe.png)\r\n\r\n\r\nThe following json data model will be generated by the above UI.\r\n\r\nText annotation json\r\n```\r\n{\r\n  \"ranges\": [\r\n    {\r\n      \"start\": \"/div[2]/span[1]/span[2]\",\r\n      \"startOffset\": 892,\r\n      \"end\": \"/div[2]/span[1]/span[2]\",\r\n      \"endOffset\": 1003\r\n    }\r\n  ],\r\n  \"quote\": \"GANOUB EL-WADI HOLDING PETROLEUM\",\r\n  \"category_key\": \"legal-enterprise-identifier\",\r\n  \"cluster\": \"General\"\r\n  \"text\": \"testing\",\r\n  \"section_info\": \"Annex-1\",\r\n  \"annotation_parent\": 1\r\n}\r\n```\r\n\r\nPDF based annotation json \r\n```\r\n{\r\n  \"shapes\": [\r\n    {\r\n      \"type\": \"rect\",\r\n      \"geometry\": {\r\n        \"x\": 0.33781512605042,\r\n        \"width\": 0.37142857142857,\r\n        \"y\": 0.21038961038961,\r\n        \"height\": 0.094805194805195\r\n      }\r\n    }\r\n  ],\r\n  \"category_key\": \"legal-enterprise-identifier\",\r\n  \"cluster\": \"General\"\r\n  \"text\": \"testing\",\r\n  \"section_info\": \"Annex-1\",\r\n  \"annotation_parent\": 1\r\n}\r\n```\r\n\r\nThe annotation will be stored in the following structure in the database \r\n\r\n```\r\nannotation-id\r\nannotation-json { \r\n          annotation-position (ranges for text, shapes for pdf, \r\n          category, \r\n          cluster, \r\n          text, \r\n          section_info \r\n    } \r\npage-no\r\nannotation-parent-id\r\n```\r\n\r\nWhen the annotation is indexed in the ES, there won't be annotation-parent-category field, the system will automatically fill the annotation-text from the annotation-parent-category, so that there will be less need of changes in the subsite. We will still need to fix for the section-info part in the subsite. "},"comment":{"url":"https://api.github.com/repos/NRGI/resourcecontracts.org/issues/comments/165902979","html_url":"https://github.com/NRGI/resourcecontracts.org/issues/694#issuecomment-165902979","issue_url":"https://api.github.com/repos/NRGI/resourcecontracts.org/issues/694","id":165902979,"user":{"login":"anderspeders","id":1101585,"avatar_url":"https://avatars.githubusercontent.com/u/1101585?v=3","gravatar_id":"","url":"https://api.github.com/users/anderspeders","html_url":"https://github.com/anderspeders","followers_url":"https://api.github.com/users/anderspeders/followers","following_url":"https://api.github.com/users/anderspeders/following{/other_user}","gists_url":"https://api.github.com/users/anderspeders/gists{/gist_id}","starred_url":"https://api.github.com/users/anderspeders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anderspeders/subscriptions","organizations_url":"https://api.github.com/users/anderspeders/orgs","repos_url":"https://api.github.com/users/anderspeders/repos","events_url":"https://api.github.com/users/anderspeders/events{/privacy}","received_events_url":"https://api.github.com/users/anderspeders/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T21:37:17Z","updated_at":"2015-12-18T21:37:17Z","body":"As requested by @KaitlinCCSI, please provide mock ups of:\r\na) How this would look on the front end and \r\nb) How  on the back end for an annotating user including workflow\r\n\r\n\r\n"}}