{"action":"created","issue":{"url":"https://api.github.com/repos/camptocamp/ngeo/issues/888","repository_url":"https://api.github.com/repos/camptocamp/ngeo","labels_url":"https://api.github.com/repos/camptocamp/ngeo/issues/888/labels{/name}","comments_url":"https://api.github.com/repos/camptocamp/ngeo/issues/888/comments","events_url":"https://api.github.com/repos/camptocamp/ngeo/issues/888/events","html_url":"https://github.com/camptocamp/ngeo/pull/888","id":140946710,"number":888,"title":"Add a tree manager service to manage source of layertree","user":{"login":"ger-benjamin","id":1792111,"avatar_url":"https://avatars.githubusercontent.com/u/1792111?v=3","gravatar_id":"","url":"https://api.github.com/users/ger-benjamin","html_url":"https://github.com/ger-benjamin","followers_url":"https://api.github.com/users/ger-benjamin/followers","following_url":"https://api.github.com/users/ger-benjamin/following{/other_user}","gists_url":"https://api.github.com/users/ger-benjamin/gists{/gist_id}","starred_url":"https://api.github.com/users/ger-benjamin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ger-benjamin/subscriptions","organizations_url":"https://api.github.com/users/ger-benjamin/orgs","repos_url":"https://api.github.com/users/ger-benjamin/repos","events_url":"https://api.github.com/users/ger-benjamin/events{/privacy}","received_events_url":"https://api.github.com/users/ger-benjamin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-15T11:36:47Z","updated_at":"2016-03-17T07:51:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/camptocamp/ngeo/pulls/888","html_url":"https://github.com/camptocamp/ngeo/pull/888","diff_url":"https://github.com/camptocamp/ngeo/pull/888.diff","patch_url":"https://github.com/camptocamp/ngeo/pull/888.patch"},"body":"To add, replace or remove theme, group or group by layername.\r\n\r\nFix: https://github.com/camptocamp/ngeo/issues/779\r\nNeeded by: https://github.com/camptocamp/c2cgeoportal/issues/1710\r\nNeeded by: https://github.com/camptocamp/c2cgeoportal/issues/1657\r\nSpecs: https://github.com/camptocamp/c2cgeoportal/wiki/Spec-%231710-Theme-selector-(add)\r\n\r\nExample: http://ger-benjamin.github.io/ngeo/add_theme_example/examples/contribs/gmf/layertree.html\r\n\r\nDesktop example (try to search a group, a theme or a layer) (add theme mode: flush): http://ger-benjamin.github.io/ngeo/add_theme_example/examples/contribs/gmf/apps/desktop\r\n\r\nTodo:\r\n * ~~Use treeManager (and \"its tree\") in each example with layertree (insteade of use directly the Theme as source)~~\r\n * ~~The gmf search should use the tree services to add and remove layers, groups, themes~~\r\n * ~~Add unit tests for the new services~~\r\n * ~~Add descriptions on methodes~~\r\n\r\nIssues (can be resolved in others PR) : \r\n * (New, mobile) Select a theme in the theme selector, menu didn't go back to \"data\" panel (to previous panel).\r\n * (Related) https://github.com/camptocamp/ngeo/issues/883"},"comment":{"url":"https://api.github.com/repos/camptocamp/ngeo/issues/comments/197744319","html_url":"https://github.com/camptocamp/ngeo/pull/888#issuecomment-197744319","issue_url":"https://api.github.com/repos/camptocamp/ngeo/issues/888","id":197744319,"user":{"login":"fredj","id":100959,"avatar_url":"https://avatars.githubusercontent.com/u/100959?v=3","gravatar_id":"","url":"https://api.github.com/users/fredj","html_url":"https://github.com/fredj","followers_url":"https://api.github.com/users/fredj/followers","following_url":"https://api.github.com/users/fredj/following{/other_user}","gists_url":"https://api.github.com/users/fredj/gists{/gist_id}","starred_url":"https://api.github.com/users/fredj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredj/subscriptions","organizations_url":"https://api.github.com/users/fredj/orgs","repos_url":"https://api.github.com/users/fredj/repos","events_url":"https://api.github.com/users/fredj/events{/privacy}","received_events_url":"https://api.github.com/users/fredj/received_events","type":"User","site_admin":false},"created_at":"2016-03-17T07:51:15Z","updated_at":"2016-03-17T07:51:15Z","body":"maybe we can add a new `flush` param to `addGroupByName` to force the mode, eg:\r\n```\r\nthis.gmfTreeManager_.addGroupByName(actionData, false);\r\n```\r\nThe function will be:\r\n```\r\n**\r\n  * Retrieve a group (first found) by its name and add in the tree. Do nothing\r\n  * if any corresponding group is found.\r\n  * @param {string} groupName Name of the group to add.\r\n  * @param {boolean=} opt_flush true to force a flush, false to force a add.\r\n  * @export\r\n  */\r\n gmf.TreeManager.prototype.addGroupByName = function(groupName, opt_flush) {\r\n```\r\n\r\n\r\n"}}