{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/carbon-governance/pulls/comments/80210724","id":80210724,"diff_hunk":"@@ -40,192 +41,194 @@\n <script type=\"text/javascript\" src=\"../generic/js/collapsible_menu_util.js\"></script>\n \n <fmt:bundle basename=\"org.wso2.carbon.governance.generic.ui.i18n.Resources\">\n-<carbon:jsi18n\n-        resourceBundle=\"org.wso2.carbon.governance.generic.ui.i18n.JSResources\"\n-        request=\"<%=request%>\" namespace=\"org.wso2.carbon.governance.generic.ui\"/>\n-<%\n-    boolean isBrowseOnly = false;\n-    if(!CarbonUIUtil.isUserAuthorized(request, \"/permission/admin/manage/resources/govern/generic/add\")){\n-        if(CarbonUIUtil.isUserAuthorized(request, \"/permission/admin/manage/resources/browse\")){\n-            isBrowseOnly=true;\n-        }else{\n+    <carbon:jsi18n\n+            resourceBundle=\"org.wso2.carbon.governance.generic.ui.i18n.JSResources\"\n+            request=\"<%=request%>\" namespace=\"org.wso2.carbon.governance.generic.ui\"/>\n+    <%\n+        boolean isBrowseOnly = false;\n+        if (!CarbonUIUtil.isUserAuthorized(request, \"/permission/admin/manage/resources/govern/generic/add\")) {\n+            if (CarbonUIUtil.isUserAuthorized(request, \"/permission/admin/manage/resources/browse\")) {\n+                isBrowseOnly = true;\n+            } else {\n+                return;\n+            }\n+        }\n+        String dataName = request.getParameter(\"dataName\");\n+        if (dataName == null) {\n+            dataName = \"metadata\";\n+        }\n+        String dataNamespace = request.getParameter(\"dataNamespace\");\n+        if (dataNamespace == null) {\n+            dataNamespace = UIGeneratorConstants.DATA_NAMESPACE;\n+        }\n+        String breadcrumb = request.getParameter(\"breadcrumb\");\n+        if (breadcrumb == null) {\n+            breadcrumb = \"Artifact\";\n+        }\n+        String type = request.getParameter(\"type\");\n+        ManageGenericArtifactServiceClient client = new ManageGenericArtifactServiceClient(config, session);\n+\n+        String path = request.getParameter(\"path\");\n+        String relativePath = path;\n+        if (relativePath.startsWith(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH)) {\n+            relativePath = relativePath.substring(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH.length());\n+        }\n+        boolean isVersionedPage = false;\n+        String disabledAttr = \"\";\n+        String saveButtonClass = \"button registryWriteOperation\";\n+        if (relativePath.contains(\";version\")) {\n+            isVersionedPage = true;\n+            disabledAttr = \" disabled=\\\"1\\\"\";\n+            saveButtonClass = \"button registryNonWriteOperation\";\n+        }\n+\n+        String content = client.getArtifactContent(relativePath);\n+        if (content == null) {\n             return;\n         }\n-    }\n-    String dataName = request.getParameter(\"dataName\");\n-    if (dataName == null) {\n-        dataName = \"metadata\";\n-    }\n-    String dataNamespace = request.getParameter(\"dataNamespace\");\n-    if (dataNamespace == null) {\n-        dataNamespace = UIGeneratorConstants.DATA_NAMESPACE;\n-    }\n-    String breadcrumb = request.getParameter(\"breadcrumb\");\n-    if (breadcrumb == null) {\n-        breadcrumb = \"Artifact\";\n-    }\n-    String type = request.getParameter(\"type\");\n-    ManageGenericArtifactServiceClient\n-            client = new ManageGenericArtifactServiceClient(config,session);\n-\n-    String path = request.getParameter(\"path\");\n-    String relativePath = path;\n-    if (relativePath.startsWith(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH)) {\n-        relativePath =\n-                relativePath.substring(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH.length());\n-    }\n-    boolean isVersionedPage = false;\n-    String disabledAttr = \"\";\n-    String saveButtonClass = \"button registryWriteOperation\";\n-    if (relativePath.contains(\";version\")) {\n-        isVersionedPage = true;\n-        disabledAttr = \" disabled=\\\"1\\\"\";\n-        saveButtonClass = \"button registryNonWriteOperation\";\n-    }\n-\n-    String content = client.getArtifactContent(relativePath);\n-    if(content ==null){\n-        return;\n-    }\n-    OMElement data = GenericUtil.loadAddedServiceContent(content);\n-    GenericUIGenerator gen = new GenericUIGenerator(dataName, dataNamespace);\n-    OMElement uiconfig = gen.getUIConfiguration(client.getArtifactUIConfiguration(\n-            request.getParameter(\"key\")),request,config,session);\n-    request.setAttribute(\"content\",data);\n-    Iterator widgets = uiconfig.getChildrenWithName(new QName(null, UIGeneratorConstants.WIDGET_ELEMENT));\n-    StringBuffer table = new StringBuffer();\n-    while(widgets.hasNext()){\n-        OMElement widget = (OMElement)widgets.next();\n-        String widgetText = gen.printWidgetWithValues(widget, data, false, true, true, request, config).replace(\"\\n\", \"<!--LF-->\").replace(\"\\r\", \"<!--CR-->\");\n-        table.append(widgetText.replace(\"<!--LF-->\", \"\\n\").replace(\"<!--CR-->\", \"\\r\"));\n-    }\n-\n-    List<Map> validatationAttributes = gen.getValidationAttributes(uiconfig);\n-    String[] mandatory = gen.getMandatoryIdList(uiconfig);\n-    String[] name = gen.getMandatoryNameList(uiconfig);\n-    String[] unboundedNameList = gen.getUnboundedNameList(uiconfig);\n-    String[] unboundedWidgetList = gen.getUnboundedWidgetList(uiconfig);\n-    String[] unboundedTooltipList = gen.getUnboundedTooltipList(uiconfig);\n-    String[][] unboundedValues = gen.getUnboundedValues(uiconfig, request, config);\n-    String[][] dateIdAndNameList = gen.getDateIdAndNameList(uiconfig, data, true);\n-%>\n-\n-<br/>\n-<script type=\"text/javascript\">\n-\n-    jQuery(document).ready(\n-            function() {\n-                initCollapseMenu(\"#_addEditTable\");\n-            }\n-    );\n-</script>\n-\n-<script type=\"text/javascript\">\n-    function addEditArtifact(){\n-        sessionAwareFunction(function() {\n-            getArtifactName();\n-            var reason = \"\";\n-        <%for(int i=0;i<mandatory.length;i++){%>\n-            reason += validateEmpty(document.getElementById('<%=mandatory[i]%>'),\n+        OMElement data = GenericUtil.loadAddedServiceContent(content);\n+        GenericUIGenerator gen = new GenericUIGenerator(dataName, dataNamespace);\n+        OMElement uiconfig = gen\n+                .getUIConfiguration(client.getArtifactUIConfiguration(request.getParameter(\"key\")), request, config,\n+                        session);\n+        request.setAttribute(\"content\", data);\n+        Iterator widgets = uiconfig.getChildrenWithName(new QName(null, UIGeneratorConstants.WIDGET_ELEMENT));\n+        StringBuffer table = new StringBuffer();\n+        while (widgets.hasNext()) {\n+            OMElement widget = (OMElement) widgets.next();\n+            String widgetText = gen.printWidgetWithValues(widget, data, false, true, true, request, config)\n+                    .replace(\"\\n\", \"<!--LF-->\").replace(\"\\r\", \"<!--CR-->\");\n+            table.append(widgetText.replace(\"<!--LF-->\", \"\\n\").replace(\"<!--CR-->\", \"\\r\"));","path":"components/governance/org.wso2.carbon.governance.generic.ui/src/main/resources/web/generic/edit_ajaxprocessor.jsp","position":190,"original_position":190,"commit_id":"15504b415a682d84b32cd2541bbc7b6f28c10e19","original_commit_id":"15504b415a682d84b32cd2541bbc7b6f28c10e19","user":{"login":"daneshk","id":8402398,"avatar_url":"https://avatars.githubusercontent.com/u/8402398?v=3","gravatar_id":"","url":"https://api.github.com/users/daneshk","html_url":"https://github.com/daneshk","followers_url":"https://api.github.com/users/daneshk/followers","following_url":"https://api.github.com/users/daneshk/following{/other_user}","gists_url":"https://api.github.com/users/daneshk/gists{/gist_id}","starred_url":"https://api.github.com/users/daneshk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daneshk/subscriptions","organizations_url":"https://api.github.com/users/daneshk/orgs","repos_url":"https://api.github.com/users/daneshk/repos","events_url":"https://api.github.com/users/daneshk/events{/privacy}","received_events_url":"https://api.github.com/users/daneshk/received_events","type":"User","site_admin":false},"body":"Shall we define constants for strings","created_at":"2016-09-23T09:30:07Z","updated_at":"2016-09-23T09:30:07Z","html_url":"https://github.com/wso2/carbon-governance/pull/168#discussion_r80210724","pull_request_url":"https://api.github.com/repos/wso2/carbon-governance/pulls/168","_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-governance/pulls/comments/80210724"},"html":{"href":"https://github.com/wso2/carbon-governance/pull/168#discussion_r80210724"},"pull_request":{"href":"https://api.github.com/repos/wso2/carbon-governance/pulls/168"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/carbon-governance/pulls/168","id":65451452,"html_url":"https://github.com/wso2/carbon-governance/pull/168","diff_url":"https://github.com/wso2/carbon-governance/pull/168.diff","patch_url":"https://github.com/wso2/carbon-governance/pull/168.patch","issue_url":"https://api.github.com/repos/wso2/carbon-governance/issues/168","number":168,"state":"closed","locked":false,"title":"Refactoring GenericUI component encodings","user":{"login":"Malintha","id":3253761,"avatar_url":"https://avatars.githubusercontent.com/u/3253761?v=3","gravatar_id":"","url":"https://api.github.com/users/Malintha","html_url":"https://github.com/Malintha","followers_url":"https://api.github.com/users/Malintha/followers","following_url":"https://api.github.com/users/Malintha/following{/other_user}","gists_url":"https://api.github.com/users/Malintha/gists{/gist_id}","starred_url":"https://api.github.com/users/Malintha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Malintha/subscriptions","organizations_url":"https://api.github.com/users/Malintha/orgs","repos_url":"https://api.github.com/users/Malintha/repos","events_url":"https://api.github.com/users/Malintha/events{/privacy}","received_events_url":"https://api.github.com/users/Malintha/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-06T11:39:37Z","updated_at":"2016-09-23T09:30:07Z","closed_at":"2016-04-06T11:41:06Z","merged_at":"2016-04-06T11:41:06Z","merge_commit_sha":"83bb4c8a72a8fd79a8fb2c8fae7e00659306c9a0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wso2/carbon-governance/pulls/168/commits","review_comments_url":"https://api.github.com/repos/wso2/carbon-governance/pulls/168/comments","review_comment_url":"https://api.github.com/repos/wso2/carbon-governance/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/carbon-governance/issues/168/comments","statuses_url":"https://api.github.com/repos/wso2/carbon-governance/statuses/15504b415a682d84b32cd2541bbc7b6f28c10e19","head":{"label":"Malintha:master","ref":"master","sha":"15504b415a682d84b32cd2541bbc7b6f28c10e19","user":{"login":"Malintha","id":3253761,"avatar_url":"https://avatars.githubusercontent.com/u/3253761?v=3","gravatar_id":"","url":"https://api.github.com/users/Malintha","html_url":"https://github.com/Malintha","followers_url":"https://api.github.com/users/Malintha/followers","following_url":"https://api.github.com/users/Malintha/following{/other_user}","gists_url":"https://api.github.com/users/Malintha/gists{/gist_id}","starred_url":"https://api.github.com/users/Malintha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Malintha/subscriptions","organizations_url":"https://api.github.com/users/Malintha/orgs","repos_url":"https://api.github.com/users/Malintha/repos","events_url":"https://api.github.com/users/Malintha/events{/privacy}","received_events_url":"https://api.github.com/users/Malintha/received_events","type":"User","site_admin":false},"repo":{"id":53473557,"name":"carbon-governance","full_name":"Malintha/carbon-governance","owner":{"login":"Malintha","id":3253761,"avatar_url":"https://avatars.githubusercontent.com/u/3253761?v=3","gravatar_id":"","url":"https://api.github.com/users/Malintha","html_url":"https://github.com/Malintha","followers_url":"https://api.github.com/users/Malintha/followers","following_url":"https://api.github.com/users/Malintha/following{/other_user}","gists_url":"https://api.github.com/users/Malintha/gists{/gist_id}","starred_url":"https://api.github.com/users/Malintha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Malintha/subscriptions","organizations_url":"https://api.github.com/users/Malintha/orgs","repos_url":"https://api.github.com/users/Malintha/repos","events_url":"https://api.github.com/users/Malintha/events{/privacy}","received_events_url":"https://api.github.com/users/Malintha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Malintha/carbon-governance","description":"jagery","fork":true,"url":"https://api.github.com/repos/Malintha/carbon-governance","forks_url":"https://api.github.com/repos/Malintha/carbon-governance/forks","keys_url":"https://api.github.com/repos/Malintha/carbon-governance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Malintha/carbon-governance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Malintha/carbon-governance/teams","hooks_url":"https://api.github.com/repos/Malintha/carbon-governance/hooks","issue_events_url":"https://api.github.com/repos/Malintha/carbon-governance/issues/events{/number}","events_url":"https://api.github.com/repos/Malintha/carbon-governance/events","assignees_url":"https://api.github.com/repos/Malintha/carbon-governance/assignees{/user}","branches_url":"https://api.github.com/repos/Malintha/carbon-governance/branches{/branch}","tags_url":"https://api.github.com/repos/Malintha/carbon-governance/tags","blobs_url":"https://api.github.com/repos/Malintha/carbon-governance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Malintha/carbon-governance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Malintha/carbon-governance/git/refs{/sha}","trees_url":"https://api.github.com/repos/Malintha/carbon-governance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Malintha/carbon-governance/statuses/{sha}","languages_url":"https://api.github.com/repos/Malintha/carbon-governance/languages","stargazers_url":"https://api.github.com/repos/Malintha/carbon-governance/stargazers","contributors_url":"https://api.github.com/repos/Malintha/carbon-governance/contributors","subscribers_url":"https://api.github.com/repos/Malintha/carbon-governance/subscribers","subscription_url":"https://api.github.com/repos/Malintha/carbon-governance/subscription","commits_url":"https://api.github.com/repos/Malintha/carbon-governance/commits{/sha}","git_commits_url":"https://api.github.com/repos/Malintha/carbon-governance/git/commits{/sha}","comments_url":"https://api.github.com/repos/Malintha/carbon-governance/comments{/number}","issue_comment_url":"https://api.github.com/repos/Malintha/carbon-governance/issues/comments{/number}","contents_url":"https://api.github.com/repos/Malintha/carbon-governance/contents/{+path}","compare_url":"https://api.github.com/repos/Malintha/carbon-governance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Malintha/carbon-governance/merges","archive_url":"https://api.github.com/repos/Malintha/carbon-governance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Malintha/carbon-governance/downloads","issues_url":"https://api.github.com/repos/Malintha/carbon-governance/issues{/number}","pulls_url":"https://api.github.com/repos/Malintha/carbon-governance/pulls{/number}","milestones_url":"https://api.github.com/repos/Malintha/carbon-governance/milestones{/number}","notifications_url":"https://api.github.com/repos/Malintha/carbon-governance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Malintha/carbon-governance/labels{/name}","releases_url":"https://api.github.com/repos/Malintha/carbon-governance/releases{/id}","deployments_url":"https://api.github.com/repos/Malintha/carbon-governance/deployments","created_at":"2016-03-09T06:20:24Z","updated_at":"2016-03-09T06:20:27Z","pushed_at":"2016-07-13T09:56:10Z","git_url":"git://github.com/Malintha/carbon-governance.git","ssh_url":"git@github.com:Malintha/carbon-governance.git","clone_url":"https://github.com/Malintha/carbon-governance.git","svn_url":"https://github.com/Malintha/carbon-governance","homepage":"","size":4959,"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":"master"}},"base":{"label":"wso2:master","ref":"master","sha":"1d83a4bb0ad001415b2ad52b4e374749e562080c","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":16097563,"name":"carbon-governance","full_name":"wso2/carbon-governance","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/carbon-governance","description":"jagery","fork":false,"url":"https://api.github.com/repos/wso2/carbon-governance","forks_url":"https://api.github.com/repos/wso2/carbon-governance/forks","keys_url":"https://api.github.com/repos/wso2/carbon-governance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/carbon-governance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/carbon-governance/teams","hooks_url":"https://api.github.com/repos/wso2/carbon-governance/hooks","issue_events_url":"https://api.github.com/repos/wso2/carbon-governance/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/carbon-governance/events","assignees_url":"https://api.github.com/repos/wso2/carbon-governance/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/carbon-governance/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/carbon-governance/tags","blobs_url":"https://api.github.com/repos/wso2/carbon-governance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/carbon-governance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/carbon-governance/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/carbon-governance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/carbon-governance/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/carbon-governance/languages","stargazers_url":"https://api.github.com/repos/wso2/carbon-governance/stargazers","contributors_url":"https://api.github.com/repos/wso2/carbon-governance/contributors","subscribers_url":"https://api.github.com/repos/wso2/carbon-governance/subscribers","subscription_url":"https://api.github.com/repos/wso2/carbon-governance/subscription","commits_url":"https://api.github.com/repos/wso2/carbon-governance/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/carbon-governance/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/carbon-governance/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/carbon-governance/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/carbon-governance/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/carbon-governance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/carbon-governance/merges","archive_url":"https://api.github.com/repos/wso2/carbon-governance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/carbon-governance/downloads","issues_url":"https://api.github.com/repos/wso2/carbon-governance/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/carbon-governance/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/carbon-governance/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/carbon-governance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/carbon-governance/labels{/name}","releases_url":"https://api.github.com/repos/wso2/carbon-governance/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/carbon-governance/deployments","created_at":"2014-01-21T09:06:44Z","updated_at":"2016-01-11T08:42:44Z","pushed_at":"2016-09-06T05:21:50Z","git_url":"git://github.com/wso2/carbon-governance.git","ssh_url":"git@github.com:wso2/carbon-governance.git","clone_url":"https://github.com/wso2/carbon-governance.git","svn_url":"https://github.com/wso2/carbon-governance","homepage":"","size":5734,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":12,"forks":62,"open_issues":12,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-governance/pulls/168"},"html":{"href":"https://github.com/wso2/carbon-governance/pull/168"},"issue":{"href":"https://api.github.com/repos/wso2/carbon-governance/issues/168"},"comments":{"href":"https://api.github.com/repos/wso2/carbon-governance/issues/168/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/carbon-governance/pulls/168/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/carbon-governance/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/carbon-governance/pulls/168/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/carbon-governance/statuses/15504b415a682d84b32cd2541bbc7b6f28c10e19"}}}}
{"actor":{"display_login":"daneshk"}}