{"action":"created","comment":{"url":"https://api.github.com/repos/diging/quadriga/pulls/comments/52524349","id":52524349,"diff_hunk":"@@ -14,50 +16,80 @@\n \n @Service\n public class NetworkTransformationManager implements INetworkTransformationManager {\n-    \n-    private static final Logger logger = LoggerFactory.getLogger(NetworkTransformationManager.class);\n-    \n-    @Autowired\n-    private INetworkManager networkManager;\n-    \n-    @Autowired\n-    private NetworkTransformer transformer;\n \n-    @Override\n-    public ITransformedNetwork getTransformedNetwork(String networkId, String versionID)\n-            throws QuadrigaStorageException {\n+\tprivate static final Logger logger = LoggerFactory.getLogger(NetworkTransformationManager.class);\n \n-        ITransformedNetwork networkJSon = null;\n+\t@Autowired\n+\tprivate INetworkManager networkManager;\n \n-        List<INetworkNodeInfo> oldNetworkTopNodesList = null;\n+\t@Autowired\n+\tprivate NetworkTransformer transformer;\n \n-        try {\n-            oldNetworkTopNodesList = networkManager.getNetworkTopNodesByVersion(networkId, Integer.parseInt(versionID));\n-        } catch (QuadrigaStorageException e) {\n-            logger.error(\"DB Error while getting network top nodes\", e);\n-        }\n+\t@Override\n+\tpublic ITransformedNetwork getTransformedNetwork(String networkId, String versionID)\n+\t\t\tthrows QuadrigaStorageException {\n \n-        networkJSon = transformer.transformNetwork(oldNetworkTopNodesList);\n+\t\tITransformedNetwork networkJSon = null;\n+\t\tList<INetworkNodeInfo> oldNetworkTopNodesList = null;\n \n-        return networkJSon;\n-    }\n-    \n-    @Override\n-    public ITransformedNetwork getTransformedNetwork(String networkId) throws QuadrigaStorageException {\n+\t\ttry {\n+\t\t\toldNetworkTopNodesList = networkManager.getNetworkTopNodesByVersion(networkId, Integer.parseInt(versionID));\n+\t\t} catch (QuadrigaStorageException e) {\n+\t\t\tlogger.error(\"DB Error while getting network top nodes\", e);\n+\t\t}\n \n-        ITransformedNetwork networkJSon = null;\n+\t\tnetworkJSon = transformer.transformNetwork(oldNetworkTopNodesList);\n+\t\treturn networkJSon;\n+\t}\n \n-        List<INetworkNodeInfo> networkTopNodesList = null;\n+\t@Override\n+\tpublic ITransformedNetwork getTransformedNetwork(String networkId) throws QuadrigaStorageException {\n \n-        try {\n-            networkTopNodesList = networkManager.getNetworkTopNodes(networkId);\n-        } catch (QuadrigaStorageException e) {\n-            logger.error(\"DB Error while getting network top nodes\", e);\n-            return null;\n-        }\n+\t\tITransformedNetwork networkJSon = null;\n \n-        networkJSon = transformer.transformNetwork(networkTopNodesList); \n+\t\tList<INetworkNodeInfo> networkTopNodesList = null;\n \n-        return networkJSon;\n-    }\n+\t\ttry {\n+\t\t\tnetworkTopNodesList = networkManager.getNetworkTopNodes(networkId);\n+\t\t} catch (QuadrigaStorageException e) {\n+\t\t\tlogger.error(\"DB Error while getting network top nodes\", e);\n+\t\t\treturn null;\n+\t\t}\n+\n+\t\tnetworkJSon = transformer.transformNetwork(networkTopNodesList);\n+\n+\t\treturn networkJSon;\n+\t}\n+\n+\t@Override\n+\tpublic ITransformedNetwork getTransformedNetworkOfProject(String projectId)\n+\t\t\tthrows QuadrigaStorageException {\n+\n+\t\tList<INetwork> networkList;\n+\t\ttry {\n+\t\t\tnetworkList = networkManager.getNetworksInProject(projectId);\n+\t\t} catch (QuadrigaStorageException e) {\n+\t\t\tthrow new QuadrigaStorageException(\"Database Error while getting networks a project with ID: \" + projectId, e);\n+\t\t}\n+\t\tif (networkList == null) {\n+\t\t\treturn null;\n+\t\t}\n+\n+\t\tList<INetworkNodeInfo> networkNodeInfoList = new ArrayList<INetworkNodeInfo>();\n+\t\tfor (INetwork network : networkList) {\n+\t\t\ttry {\n+\t\t\t\tList<INetworkNodeInfo> localNetworkNodeInfoList =\n+\t\t\t\t\t\tnetworkManager.getNetworkTopNodes(network.getNetworkId());\n+\t\t\t\tif (localNetworkNodeInfoList != null) {\n+\t\t\t\t\tnetworkNodeInfoList.addAll(localNetworkNodeInfoList);\n+\t\t\t\t}\n+\t\t\t} catch (QuadrigaStorageException e) {\n+\t\t\t\tthrow new QuadrigaStorageException(\"Database Error while getting network top nodes for a network with ID: \" +\n+\t\t\t\t\t\tnetwork.getNetworkId(), e);\n+\t\t\t}\n+\t\t}\n+\n+\t\tITransformedNetwork networkJSon = transformer.transformNetwork(networkNodeInfoList);","path":"Quadriga/src/main/java/edu/asu/spring/quadriga/service/network/impl/NetworkTransformationManager.java","position":122,"original_position":122,"commit_id":"b7bf47fa7eddc7cba6fb57d4a7ff57ad13304f9e","original_commit_id":"b7bf47fa7eddc7cba6fb57d4a7ff57ad13304f9e","user":{"login":"vickydoosa","id":3276803,"avatar_url":"https://avatars.githubusercontent.com/u/3276803?v=3","gravatar_id":"","url":"https://api.github.com/users/vickydoosa","html_url":"https://github.com/vickydoosa","followers_url":"https://api.github.com/users/vickydoosa/followers","following_url":"https://api.github.com/users/vickydoosa/following{/other_user}","gists_url":"https://api.github.com/users/vickydoosa/gists{/gist_id}","starred_url":"https://api.github.com/users/vickydoosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vickydoosa/subscriptions","organizations_url":"https://api.github.com/users/vickydoosa/orgs","repos_url":"https://api.github.com/users/vickydoosa/repos","events_url":"https://api.github.com/users/vickydoosa/events{/privacy}","received_events_url":"https://api.github.com/users/vickydoosa/received_events","type":"User","site_admin":false},"body":"I will make this change in the next story","created_at":"2016-02-10T21:02:33Z","updated_at":"2016-02-10T21:02:33Z","html_url":"https://github.com/diging/quadriga/pull/91#discussion_r52524349","pull_request_url":"https://api.github.com/repos/diging/quadriga/pulls/91","_links":{"self":{"href":"https://api.github.com/repos/diging/quadriga/pulls/comments/52524349"},"html":{"href":"https://github.com/diging/quadriga/pull/91#discussion_r52524349"},"pull_request":{"href":"https://api.github.com/repos/diging/quadriga/pulls/91"}}},"pull_request":{"url":"https://api.github.com/repos/diging/quadriga/pulls/91","id":58641674,"html_url":"https://github.com/diging/quadriga/pull/91","diff_url":"https://github.com/diging/quadriga/pull/91.diff","patch_url":"https://github.com/diging/quadriga/pull/91.patch","issue_url":"https://api.github.com/repos/diging/quadriga/issues/91","number":91,"state":"closed","locked":false,"title":"Story/quad 74","user":{"login":"vickydoosa","id":3276803,"avatar_url":"https://avatars.githubusercontent.com/u/3276803?v=3","gravatar_id":"","url":"https://api.github.com/users/vickydoosa","html_url":"https://github.com/vickydoosa","followers_url":"https://api.github.com/users/vickydoosa/followers","following_url":"https://api.github.com/users/vickydoosa/following{/other_user}","gists_url":"https://api.github.com/users/vickydoosa/gists{/gist_id}","starred_url":"https://api.github.com/users/vickydoosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vickydoosa/subscriptions","organizations_url":"https://api.github.com/users/vickydoosa/orgs","repos_url":"https://api.github.com/users/vickydoosa/repos","events_url":"https://api.github.com/users/vickydoosa/events{/privacy}","received_events_url":"https://api.github.com/users/vickydoosa/received_events","type":"User","site_admin":false},"body":"Adds combined network visualizations","created_at":"2016-02-08T17:37:41Z","updated_at":"2016-02-10T21:02:33Z","closed_at":"2016-02-10T19:49:42Z","merged_at":"2016-02-10T19:49:42Z","merge_commit_sha":"05c72d402f009fa6e7995c85e30bd7ef7f941441","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/diging/quadriga/pulls/91/commits","review_comments_url":"https://api.github.com/repos/diging/quadriga/pulls/91/comments","review_comment_url":"https://api.github.com/repos/diging/quadriga/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diging/quadriga/issues/91/comments","statuses_url":"https://api.github.com/repos/diging/quadriga/statuses/b7bf47fa7eddc7cba6fb57d4a7ff57ad13304f9e","head":{"label":"diging:story/QUAD-74","ref":"story/QUAD-74","sha":"b7bf47fa7eddc7cba6fb57d4a7ff57ad13304f9e","user":{"login":"diging","id":5402168,"avatar_url":"https://avatars.githubusercontent.com/u/5402168?v=3","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"repo":{"id":32819066,"name":"quadriga","full_name":"diging/quadriga","owner":{"login":"diging","id":5402168,"avatar_url":"https://avatars.githubusercontent.com/u/5402168?v=3","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diging/quadriga","description":"","fork":false,"url":"https://api.github.com/repos/diging/quadriga","forks_url":"https://api.github.com/repos/diging/quadriga/forks","keys_url":"https://api.github.com/repos/diging/quadriga/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diging/quadriga/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diging/quadriga/teams","hooks_url":"https://api.github.com/repos/diging/quadriga/hooks","issue_events_url":"https://api.github.com/repos/diging/quadriga/issues/events{/number}","events_url":"https://api.github.com/repos/diging/quadriga/events","assignees_url":"https://api.github.com/repos/diging/quadriga/assignees{/user}","branches_url":"https://api.github.com/repos/diging/quadriga/branches{/branch}","tags_url":"https://api.github.com/repos/diging/quadriga/tags","blobs_url":"https://api.github.com/repos/diging/quadriga/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diging/quadriga/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diging/quadriga/git/refs{/sha}","trees_url":"https://api.github.com/repos/diging/quadriga/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diging/quadriga/statuses/{sha}","languages_url":"https://api.github.com/repos/diging/quadriga/languages","stargazers_url":"https://api.github.com/repos/diging/quadriga/stargazers","contributors_url":"https://api.github.com/repos/diging/quadriga/contributors","subscribers_url":"https://api.github.com/repos/diging/quadriga/subscribers","subscription_url":"https://api.github.com/repos/diging/quadriga/subscription","commits_url":"https://api.github.com/repos/diging/quadriga/commits{/sha}","git_commits_url":"https://api.github.com/repos/diging/quadriga/git/commits{/sha}","comments_url":"https://api.github.com/repos/diging/quadriga/comments{/number}","issue_comment_url":"https://api.github.com/repos/diging/quadriga/issues/comments{/number}","contents_url":"https://api.github.com/repos/diging/quadriga/contents/{+path}","compare_url":"https://api.github.com/repos/diging/quadriga/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diging/quadriga/merges","archive_url":"https://api.github.com/repos/diging/quadriga/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diging/quadriga/downloads","issues_url":"https://api.github.com/repos/diging/quadriga/issues{/number}","pulls_url":"https://api.github.com/repos/diging/quadriga/pulls{/number}","milestones_url":"https://api.github.com/repos/diging/quadriga/milestones{/number}","notifications_url":"https://api.github.com/repos/diging/quadriga/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diging/quadriga/labels{/name}","releases_url":"https://api.github.com/repos/diging/quadriga/releases{/id}","deployments_url":"https://api.github.com/repos/diging/quadriga/deployments","created_at":"2015-03-24T19:05:57Z","updated_at":"2016-01-20T21:36:37Z","pushed_at":"2016-02-10T21:02:02Z","git_url":"git://github.com/diging/quadriga.git","ssh_url":"git@github.com:diging/quadriga.git","clone_url":"https://github.com/diging/quadriga.git","svn_url":"https://github.com/diging/quadriga","homepage":"http://diging.github.io/quadriga/","size":10292,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"develop"}},"base":{"label":"diging:develop","ref":"develop","sha":"844c6c3aefbaef82af5079f8e167b79ae286b38d","user":{"login":"diging","id":5402168,"avatar_url":"https://avatars.githubusercontent.com/u/5402168?v=3","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"repo":{"id":32819066,"name":"quadriga","full_name":"diging/quadriga","owner":{"login":"diging","id":5402168,"avatar_url":"https://avatars.githubusercontent.com/u/5402168?v=3","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diging/quadriga","description":"","fork":false,"url":"https://api.github.com/repos/diging/quadriga","forks_url":"https://api.github.com/repos/diging/quadriga/forks","keys_url":"https://api.github.com/repos/diging/quadriga/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diging/quadriga/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diging/quadriga/teams","hooks_url":"https://api.github.com/repos/diging/quadriga/hooks","issue_events_url":"https://api.github.com/repos/diging/quadriga/issues/events{/number}","events_url":"https://api.github.com/repos/diging/quadriga/events","assignees_url":"https://api.github.com/repos/diging/quadriga/assignees{/user}","branches_url":"https://api.github.com/repos/diging/quadriga/branches{/branch}","tags_url":"https://api.github.com/repos/diging/quadriga/tags","blobs_url":"https://api.github.com/repos/diging/quadriga/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diging/quadriga/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diging/quadriga/git/refs{/sha}","trees_url":"https://api.github.com/repos/diging/quadriga/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diging/quadriga/statuses/{sha}","languages_url":"https://api.github.com/repos/diging/quadriga/languages","stargazers_url":"https://api.github.com/repos/diging/quadriga/stargazers","contributors_url":"https://api.github.com/repos/diging/quadriga/contributors","subscribers_url":"https://api.github.com/repos/diging/quadriga/subscribers","subscription_url":"https://api.github.com/repos/diging/quadriga/subscription","commits_url":"https://api.github.com/repos/diging/quadriga/commits{/sha}","git_commits_url":"https://api.github.com/repos/diging/quadriga/git/commits{/sha}","comments_url":"https://api.github.com/repos/diging/quadriga/comments{/number}","issue_comment_url":"https://api.github.com/repos/diging/quadriga/issues/comments{/number}","contents_url":"https://api.github.com/repos/diging/quadriga/contents/{+path}","compare_url":"https://api.github.com/repos/diging/quadriga/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diging/quadriga/merges","archive_url":"https://api.github.com/repos/diging/quadriga/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diging/quadriga/downloads","issues_url":"https://api.github.com/repos/diging/quadriga/issues{/number}","pulls_url":"https://api.github.com/repos/diging/quadriga/pulls{/number}","milestones_url":"https://api.github.com/repos/diging/quadriga/milestones{/number}","notifications_url":"https://api.github.com/repos/diging/quadriga/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diging/quadriga/labels{/name}","releases_url":"https://api.github.com/repos/diging/quadriga/releases{/id}","deployments_url":"https://api.github.com/repos/diging/quadriga/deployments","created_at":"2015-03-24T19:05:57Z","updated_at":"2016-01-20T21:36:37Z","pushed_at":"2016-02-10T21:02:02Z","git_url":"git://github.com/diging/quadriga.git","ssh_url":"git@github.com:diging/quadriga.git","clone_url":"https://github.com/diging/quadriga.git","svn_url":"https://github.com/diging/quadriga","homepage":"http://diging.github.io/quadriga/","size":10292,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diging/quadriga/pulls/91"},"html":{"href":"https://github.com/diging/quadriga/pull/91"},"issue":{"href":"https://api.github.com/repos/diging/quadriga/issues/91"},"comments":{"href":"https://api.github.com/repos/diging/quadriga/issues/91/comments"},"review_comments":{"href":"https://api.github.com/repos/diging/quadriga/pulls/91/comments"},"review_comment":{"href":"https://api.github.com/repos/diging/quadriga/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diging/quadriga/pulls/91/commits"},"statuses":{"href":"https://api.github.com/repos/diging/quadriga/statuses/b7bf47fa7eddc7cba6fb57d4a7ff57ad13304f9e"}}}}