{"action":"created","issue":{"url":"https://api.github.com/repos/keeps/roda/issues/481","repository_url":"https://api.github.com/repos/keeps/roda","labels_url":"https://api.github.com/repos/keeps/roda/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/keeps/roda/issues/481/comments","events_url":"https://api.github.com/repos/keeps/roda/issues/481/events","html_url":"https://github.com/keeps/roda/pull/481","id":170898153,"number":481,"title":"326 - Statistics engine","user":{"login":"rui-castro","id":4218366,"avatar_url":"https://avatars.githubusercontent.com/u/4218366?v=3","gravatar_id":"","url":"https://api.github.com/users/rui-castro","html_url":"https://github.com/rui-castro","followers_url":"https://api.github.com/users/rui-castro/followers","following_url":"https://api.github.com/users/rui-castro/following{/other_user}","gists_url":"https://api.github.com/users/rui-castro/gists{/gist_id}","starred_url":"https://api.github.com/users/rui-castro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rui-castro/subscriptions","organizations_url":"https://api.github.com/users/rui-castro/orgs","repos_url":"https://api.github.com/users/rui-castro/repos","events_url":"https://api.github.com/users/rui-castro/events{/privacy}","received_events_url":"https://api.github.com/users/rui-castro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-12T15:32:27Z","updated_at":"2016-08-29T11:23:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/keeps/roda/pulls/481","html_url":"https://github.com/keeps/roda/pull/481","diff_url":"https://github.com/keeps/roda/pull/481.diff","patch_url":"https://github.com/keeps/roda/pull/481.patch"},"body":"Issue #326 \r\nImplemented a jQuery plugin called `statistic` that allows embeding charts and texts with data from the index and custom sources.\r\n\r\n### Embed a chart\r\n\r\n```html\r\n<canvas class=\"statistic\"\r\n        data-source=\"index\"\r\n        data-source-class=\"org.roda.core.data.v2.ip.IndexedAIP\"\r\n        data-source-facets=\"level\"\r\n        data-view=\"chart\"\r\n        data-view-field=\"facetResults\"\r\n        data-view-type=\"pie\"></canvas>\r\n```\r\n\r\n### Embed a number\r\n\r\n```html\r\n<span class=\"statistic\"\r\n  data-source=\"index\"\r\n  data-source-class=\"org.roda.core.data.v2.ip.IndexedAIP\"\r\n  data-source-filters=\"level=fonds\"\r\n  data-view=\"text\"\r\n  data-view-field=\"totalCount\"></span>\r\n```\r\n\r\n### Init the plugin\r\n\r\n```javascript\r\n$(\".statistic\").statistic();\r\n```\r\n\r\nMultiple examples in page [/#administration/statistics](http://127.0.0.1:8888/?locale=en#administration/statistics)\r\n\r\n**IMPORTANT**: this PR dependends on PR #480 "},"comment":{"url":"https://api.github.com/repos/keeps/roda/issues/comments/243098192","html_url":"https://github.com/keeps/roda/pull/481#issuecomment-243098192","issue_url":"https://api.github.com/repos/keeps/roda/issues/481","id":243098192,"user":{"login":"hsilva-keep","id":1315759,"avatar_url":"https://avatars.githubusercontent.com/u/1315759?v=3","gravatar_id":"","url":"https://api.github.com/users/hsilva-keep","html_url":"https://github.com/hsilva-keep","followers_url":"https://api.github.com/users/hsilva-keep/followers","following_url":"https://api.github.com/users/hsilva-keep/following{/other_user}","gists_url":"https://api.github.com/users/hsilva-keep/gists{/gist_id}","starred_url":"https://api.github.com/users/hsilva-keep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsilva-keep/subscriptions","organizations_url":"https://api.github.com/users/hsilva-keep/orgs","repos_url":"https://api.github.com/users/hsilva-keep/repos","events_url":"https://api.github.com/users/hsilva-keep/events{/privacy}","received_events_url":"https://api.github.com/users/hsilva-keep/received_events","type":"User","site_admin":false},"created_at":"2016-08-29T11:23:39Z","updated_at":"2016-08-29T11:23:39Z","body":"@rui-castro please consider:\r\n- Total No. of users: ATM there is a field called isUser & that can be used to distinguish users from groups. So, to obtain the statistic, do (and consult the totalCount): \r\n```\r\n/api/v1/index?returnClass=org.roda.core.data.v2.user.RODAMember&filter=isUser%3Dfalse&start=0&limit=0&onlyActive=true\r\n```\r\n- Total No of Ingest jobs: the actual statistic being presented is 'Total No of Ingest jobs that completed'.\r\n- Min, max and Average ingest time: if this statistics is really needed, we can set a field called duration (as ATM we only have start & end date) for being able to produce this statistic.\r\n- Why IndexResource only consumes/produces JSON? I assume that actually that is the format you're using in the statistics engine, but one should be able to use XML as well (as the other endpoints already put available)."}}
{"actor":{"display_login":"hsilva-keep"}}