{"action":"created","comment":{"url":"https://api.github.com/repos/diging/quadriga/pulls/comments/51323276","id":51323276,"diff_hunk":"@@ -48,661 +49,642 @@\n import edu.asu.spring.quadriga.web.network.INetworkStatus;\r\n \r\n /**\r\n- * Controller for networks related rest api's exposed to other clients\r\n- * Client could add, manipulate or get details of {@link INetwork}\r\n+ * Controller for networks related rest api's exposed to other clients Client\r\n+ * could add, manipulate or get details of {@link INetwork}\r\n+ * \r\n  * @author Lohith Dwaraka\r\n  * \r\n  */\r\n @Controller\r\n public class NetworkRestController {\r\n \r\n-\tprivate static final Logger logger = LoggerFactory\r\n-\t\t\t.getLogger(NetworkRestController.class);\r\n-\r\n-\t@Autowired\r\n-\tprivate INetworkManager networkManager;\r\n-\r\n-\t@Autowired\r\n-\tprivate IRestMessage errorMessageRest;\r\n-\r\n-\t@Autowired\r\n-\tprivate\tIListWSManager wsManager;\r\n-\r\n-\t@Autowired\r\n-\tprivate IEditorManager editorManager;\r\n-\r\n-\t@Autowired\r\n-\tprivate IEditingNetworkAnnotationManager editingNetworkAnnoManager;\r\n-\r\n-\t@Autowired\r\n-\tprivate IRestVelocityFactory restVelocityFactory;\r\n-\r\n-\t@Autowired\r\n-\tprivate IUserManager userManager;\r\n-\r\n-\t@Autowired\r\n-\tprivate IEmailNotificationManager emailManager;\r\n-\r\n-\r\n-\t/**\r\n-\t * Rest interface for uploading XML for networks\r\n-\t * http://<<URL>:<PORT>>/quadriga/rest/uploadnetworks\r\n-\t * http://localhost:8080/quadriga/rest/uploadnetworks\r\n-\t * \r\n-\t * @author Lohith Dwaraka\r\n-\t * @param request\r\n-\t * @param response\r\n-\t * @param xml\r\n-\t * @param accept\r\n-\t * @return XML\r\n-\t * @throws QuadrigaException\r\n-\t * @throws IOException \r\n-\t * @throws SAXException \r\n-\t * @throws ParserConfigurationException \r\n-\t * @throws JAXBException \r\n-\t * @throws TransformerException \r\n-\t * @throws QuadrigaStorageException \r\n-\t */\r\n-\t@ResponseBody\r\n-\t@RequestMapping(value = \"rest/uploadnetworks\", method = RequestMethod.POST)\r\n-\tpublic String getNetworkFromClients(HttpServletRequest request,\r\n-\t\t\tHttpServletResponse response, @RequestBody String xml,\r\n-\t\t\t@RequestHeader(\"Accept\") String accept,Principal principal) throws QuadrigaException, ParserConfigurationException, SAXException, IOException, JAXBException, TransformerException, QuadrigaStorageException {\r\n-\r\n-\r\n-\t\tIUser user = userManager.getUser(principal.getName());\r\n-\t\tString networkName = request.getParameter(\"networkname\");\r\n-\t\tString networkId=\"\";\r\n-\t\tString workspaceid = request.getParameter(\"workspaceid\");\r\n-\r\n-\t\tif(workspaceid == null||workspaceid.isEmpty()){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\treturn \"Please provide correct workspace id.\";\r\n-\t\t}\r\n-\t\tString projectid = networkManager.getProjectIdForWorkspaceId(workspaceid);\r\n-\t\tif(projectid == null || projectid.isEmpty()){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\treturn \"Please provide correct workspace id.\";\r\n-\t\t}\r\n-\r\n-\t\tif(networkName == null ||  networkName.isEmpty()){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\treturn \"Please provide network name as a part of post parameters\";\r\n-\t\t}\r\n-\r\n-\r\n-\t\txml=xml.trim();\r\n-\t\tif (xml.isEmpty()) {\r\n-\t\t\tresponse.setStatus(406);\r\n-\t\t\treturn \"Please provide XML in body of the post request.\";\r\n-\r\n-\t\t} else {\r\n-\t\t\tString res=networkManager.storeXMLQStore(xml);\r\n-\t\t\tif(res.equals(\"\")){\r\n-\t\t\t\tresponse.setStatus(406);\r\n-\t\t\t\treturn \"Please provide correct XML in body of the post request. Qstore system is not accepting ur XML\";\r\n-\t\t\t}\r\n-\r\n-\t\t\tnetworkId=networkManager.storeNetworkDetails(res, user, networkName, workspaceid, INetworkManager.NEWNETWORK,networkId,INetworkManager.VERSION_ZERO);\r\n-\r\n-\t\t\tif(networkId.endsWith(INetworkManager.DSPACEERROR)){\r\n-\t\t\t\tresponse.setStatus(404);\r\n-\t\t\t\treturn \"Text files don't belong to this workspace.\";\r\n-\t\t\t}\r\n-\r\n-\t\t\t//TODO: Send email to all editors of a workspace\r\n-\t\t\t//TODO: Get the workspace editors from the workspaceid\r\n-\r\n-\r\n-\t\t\tresponse.setStatus(200);\r\n-\t\t\tresponse.setContentType(accept);\r\n-\t\t\tresponse.setHeader(\"networkid\",networkId );\r\n-\t\t\treturn res;\r\n-\t\t}\r\n-\r\n-\t}\r\n-\r\n-\t/**\r\n-\t *  Rest interface for getting status of network \r\n-\t * http://<<URL>:<PORT>>/quadriga/rest/networkstatus/{NetworkId}\r\n-\t * http://localhost:8080/quadriga/rest/networkstatus/NET_1huxp4w7p71o0\r\n-\t * @param networkName\r\n-\t * @param response\r\n-\t * @param accept\r\n-\t * @param principal\r\n-\t * @return status\r\n-\t * @throws Exception \r\n-\t */\r\n-\t@ResponseBody\r\n-\t@RequestMapping(value = \"rest/networkstatus/{NetworkId}\", method = RequestMethod.GET, produces = \"application/xml\")\r\n-\tpublic String getNetworkStatus(@PathVariable(\"NetworkId\") String networkId,\r\n-\t\t\tHttpServletResponse response,\r\n-\t\t\tString accept,Principal principal,HttpServletRequest req) throws Exception {\r\n-\t\tINetwork network = networkManager.getNetwork(networkId);\r\n-\t\tif(network==null){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\tString errorMsg = errorMessageRest.getErrorMsg(\"Network ID : \"+networkId+\" doesn't exist\");\r\n-\t\t\treturn errorMsg;\r\n-\t\t}\r\n-\t\tIUser user = userManager.getUser(principal.getName());\r\n-\t\tVelocityEngine engine = restVelocityFactory.getVelocityEngine(req);\r\n-\t\tTemplate template = null;\r\n-\t\tString status = networkManager.getNetworkStatusCode(network.getStatus())+\"\";\r\n-\t\ttry {\r\n-\t\t\tengine.init();\r\n-\r\n-\t\t\ttemplate = engine\r\n-\t\t\t\t\t.getTemplate(\"velocitytemplates/networkstatus.vm\");\r\n-\t\t\tVelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n-\t\t\tif(network.getStatus() == null)\r\n-\t\t\t\tcontext.put(\"status\", INetworkStatus.UNKNOWN_CODE+\"\");\r\n-\t\t\telse\r\n-\t\t\t\tcontext.put(\"status\", status);\r\n-\t\t\tcontext.put(\"networkid\",networkId);\r\n-\t\t\tList<INetworkAnnotation>  networkAnnoList= editingNetworkAnnoManager.getAllAnnotationOfNetwork(user.getUserName(), networkId);\r\n-\t\t\tcontext.put(\"networkAnnoList\",networkAnnoList);\r\n-\t\t\tStringWriter writer = new StringWriter();\r\n-\t\t\ttemplate.merge(context, writer);\r\n-\t\t\tresponse.setStatus(200);\r\n-\t\t\tresponse.setContentType(accept);\r\n-\t\t\tresponse.setContentType(\"application/xml\");\r\n-\t\t\treturn writer.toString();\r\n-\t\t} catch (ResourceNotFoundException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (ParseErrorException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (MethodInvocationException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t}\r\n-\r\n-\t}\r\n-\r\n-\r\n-\t/**\r\n-\t *  REST API for getting annotations of network \r\n-\t * http://<<URL>:<PORT>>/quadriga/rest/network/annotations/{NetworkId}\r\n-\t * http://localhost:8080/quadriga/rest/network/annotations/dcb6b7bf-ba6b-40d7-a067-e1edf3460daa\r\n-\t * @param networkId\t\t\t\t\t\t\t\t\t{@link INetwork} ID of type {@link String}\r\n-\t * @param response\t\t\t\t\t\t\t\t\t{@link HttpServletResponse} object to set the status and response\r\n-\t * @param accept\t\t\t\t\t\t\t\t\tType of MIME accepted\r\n-\t * @param principal\t\t\t\t\t\t\t\t\t{@link Principal} object to obtain the user details\r\n-\t * @param req\t\t\t\t\t\t\t\t\t\t{@link HttpServletRequest} object to access any user params\r\n-\t * @return\t\t\t\t\t\t\t\t\t\t\tXML with list of annotations belonging to a Network\r\n-\t * @throws Exception\t\t\t\t\t\t\t\tThrows the exception for any issue in the Velocity engine \r\n-\t */\r\n-\t@ResponseBody\r\n-\t@RequestMapping(value = \"rest/network/{NetworkId}/annotations\", method = RequestMethod.GET, produces = \"application/xml\")\r\n-\tpublic String getAnnotationOfNetwork(@PathVariable(\"NetworkId\") String networkId,\r\n-\t\t\tHttpServletResponse response,\r\n-\t\t\tString accept,Principal principal,HttpServletRequest req) throws Exception {\r\n-\t\tINetwork network = networkManager.getNetwork(networkId);\r\n-\t\tif(network==null){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\tString errorMsg = errorMessageRest.getErrorMsg(\"Network ID : \"+networkId+\" doesn't exist\");\r\n-\t\t\treturn errorMsg;\r\n-\t\t}\r\n-\t\tIUser user = userManager.getUser(principal.getName());\r\n-\t\tVelocityEngine engine = restVelocityFactory.getVelocityEngine(req);\r\n-\t\tTemplate template = null;\r\n-\t\ttry {\r\n-\t\t\tengine.init();\r\n-\r\n-\t\t\ttemplate = engine\r\n-\t\t\t\t\t.getTemplate(\"velocitytemplates/networkannotations.vm\");\r\n-\t\t\tVelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n-\t\t\tcontext.put(\"networkid\",networkId);\r\n-\t\t\tList<INetworkAnnotation>  networkAnnoList= editingNetworkAnnoManager.getAllAnnotationOfNetwork(user.getUserName(), networkId);\r\n-\t\t\tcontext.put(\"networkAnnoList\",networkAnnoList);\r\n-\t\t\tStringWriter writer = new StringWriter();\r\n-\t\t\ttemplate.merge(context, writer);\r\n-\t\t\tresponse.setStatus(200);\r\n-\t\t\tresponse.setContentType(accept);\r\n-\t\t\tresponse.setContentType(\"application/xml\");\r\n-\t\t\treturn writer.toString();\r\n-\t\t} catch (ResourceNotFoundException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (ParseErrorException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (MethodInvocationException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t}\r\n-\r\n-\t}\r\n-\r\n-\t/**\r\n-\t *  Rest interface for getting all the network list belonging to a workspace \r\n-\t * http://<<URL>:<PORT>>/quadriga/rest/workspace/{workspaceid}/networks\r\n-\t * http://localhost:8080/quadriga/rest/workspace/WS_23092339551502339/networks\r\n-\t * @param networkName\r\n-\t * @param response\r\n-\t * @param accept\r\n-\t * @param principal\r\n-\t * @return status\r\n-\t * @throws Exception \r\n-\t */\r\n-\t@ResponseBody\r\n-\t@RequestMapping(value = \"rest/workspace/{workspaceid}/networks\", method = RequestMethod.GET, produces = \"application/xml\")\r\n-\tpublic String getWorkspaceNetworkList(@PathVariable(\"workspaceid\") String workspaceId,\r\n-\t\t\tHttpServletResponse response,\r\n-\t\t\tString accept,Principal principal,HttpServletRequest req) throws Exception {\r\n-\t\tIWorkSpace workspace = wsManager.getWorkspaceDetails(workspaceId, principal.getName());\r\n-\t\tif(workspace==null){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\tString errorMsg = errorMessageRest.getErrorMsg(\"Workspace ID : \"+workspaceId+\" doesn't exist\");\r\n-\t\t\treturn errorMsg;\r\n-\t\t}\r\n-\r\n-\t\tList<IWorkspaceNetwork> workspaceNetworkList = wsManager.getWorkspaceNetworkList(workspaceId);\r\n-\t\tworkspaceNetworkList = networkManager.editWorkspaceNetworkStatusCode(workspaceNetworkList);\r\n-\t\tVelocityEngine engine = restVelocityFactory.getVelocityEngine(req);\r\n-\t\tTemplate template = null;\r\n-\t\ttry {\r\n-\t\t\tengine.init();\r\n-\t\t\ttemplate = engine\r\n-\t\t\t\t\t.getTemplate(\"velocitytemplates/networks.vm\");\r\n-\t\t\tVelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n-\t\t\tcontext.put(\"workspaceNetworkList\", workspaceNetworkList);\r\n-\t\t\tStringWriter writer = new StringWriter();\r\n-\t\t\ttemplate.merge(context, writer);\r\n-\t\t\tresponse.setStatus(200);\r\n-\t\t\tresponse.setContentType(accept);\r\n-\t\t\tresponse.setContentType(\"application/xml\");\r\n-\t\t\treturn writer.toString();\r\n-\t\t} catch (ResourceNotFoundException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (ParseErrorException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (MethodInvocationException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t}\r\n-\t}\r\n-\r\n-\r\n-\t/**\r\n-\t *  Rest interface for getting rejected network list belonging to a workspace \r\n-\t * http://<<URL>:<PORT>>/quadriga/rest/workspace/{workspaceid}/rejectednetworks\r\n-\t * http://localhost:8080/quadriga/rest/workspace/WS_23092339551502339/rejectednetworks\r\n-\t * @param networkName\r\n-\t * @param response\r\n-\t * @param accept\r\n-\t * @param principal\r\n-\t * @return status\r\n-\t * @throws Exception \r\n-\t */\r\n-\t@ResponseBody\r\n-\t@RequestMapping(value = \"rest/workspace/{workspaceid}/rejectednetworks\", method = RequestMethod.GET, produces = \"application/xml\")\r\n-\tpublic String getWorkspaceRejectedNetworkList(@PathVariable(\"workspaceid\") String workspaceId,\r\n-\t\t\tHttpServletResponse response,\r\n-\t\t\tString accept,Principal principal,HttpServletRequest req) throws Exception {\r\n-\r\n-\t\tIWorkSpace workspace = wsManager.getWorkspaceDetails(workspaceId, principal.getName());\r\n-\t\tif(workspace==null){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\tString errorMsg = errorMessageRest.getErrorMsg(\"Workspace ID : \"+workspaceId+\" doesn't exist\");\r\n-\t\t\treturn errorMsg;\r\n-\t\t}\r\n-\r\n-\t\tList<IWorkspaceNetwork> workspaceNetworkList = wsManager.getWorkspaceRejectedNetworkList(workspaceId);\r\n-\t\tworkspaceNetworkList = networkManager.editWorkspaceNetworkStatusCode(workspaceNetworkList);\r\n-\t\tVelocityEngine engine = restVelocityFactory.getVelocityEngine(req);\r\n-\t\tTemplate template = null;\r\n-\t\ttry {\r\n-\t\t\tengine.init();\r\n-\t\t\ttemplate = engine\r\n-\t\t\t\t\t.getTemplate(\"velocitytemplates/rejectednetworks.vm\");\r\n-\t\t\tVelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n-\t\t\tcontext.put(\"workspaceNetworkList\", workspaceNetworkList);\r\n-\t\t\tStringWriter writer = new StringWriter();\r\n-\t\t\ttemplate.merge(context, writer);\r\n-\t\t\tresponse.setStatus(200);\r\n-\t\t\tresponse.setContentType(accept);\r\n-\t\t\tresponse.setContentType(\"application/xml\");\r\n-\t\t\treturn writer.toString();\r\n-\t\t} catch (ResourceNotFoundException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (ParseErrorException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (MethodInvocationException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t}\r\n-\t}\r\n-\r\n-\t/**\r\n-\t *  Rest interface for getting accepted network list belonging to a workspace \r\n-\t * http://<<URL>:<PORT>>/quadriga/rest/workspace/{workspaceid}/approvednetworks\r\n-\t * http://localhost:8080/quadriga/rest/workspace/WS_23092339551502339/approvednetworks\r\n-\t * @param networkName\r\n-\t * @param response\r\n-\t * @param accept\r\n-\t * @param principal\r\n-\t * @return status\r\n-\t * @throws Exception \r\n-\t */\r\n-\t@ResponseBody\r\n-\t@RequestMapping(value = \"rest/workspace/{workspaceid}/approvednetworks\", method = RequestMethod.GET, produces = \"application/xml\")\r\n-\tpublic String getWorkspaceApprovedNetworkList(@PathVariable(\"workspaceid\") String workspaceId,\r\n-\t\t\tHttpServletResponse response,\r\n-\t\t\tString accept,Principal principal,HttpServletRequest req) throws Exception {\r\n-\r\n-\t\tIWorkSpace workspace = wsManager.getWorkspaceDetails(workspaceId, principal.getName());\r\n-\t\tif(workspace==null){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\tString errorMsg = errorMessageRest.getErrorMsg(\"Workspace ID : \"+workspaceId+\" doesn't exist\");\r\n-\t\t\treturn errorMsg;\r\n-\t\t}\r\n-\r\n-\t\tList<IWorkspaceNetwork> workspaceNetworkList = wsManager.getWorkspaceApprovedNetworkList(workspaceId);\r\n-\t\tworkspaceNetworkList = networkManager.editWorkspaceNetworkStatusCode(workspaceNetworkList);\r\n-\t\tVelocityEngine engine = restVelocityFactory.getVelocityEngine(req);\r\n-\t\tTemplate template = null;\r\n-\t\ttry {\r\n-\t\t\tengine.init();\r\n-\t\t\ttemplate = engine\r\n-\t\t\t\t\t.getTemplate(\"velocitytemplates/approvednetworks.vm\");\r\n-\t\t\tVelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n-\t\t\tcontext.put(\"workspaceNetworkList\", workspaceNetworkList);\r\n-\t\t\tStringWriter writer = new StringWriter();\r\n-\t\t\ttemplate.merge(context, writer);\r\n-\t\t\tresponse.setStatus(200);\r\n-\t\t\tresponse.setContentType(accept);\r\n-\t\t\tresponse.setContentType(\"application/xml\");\r\n-\t\t\treturn writer.toString();\r\n-\t\t} catch (ResourceNotFoundException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (ParseErrorException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (MethodInvocationException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t}\r\n-\t}\r\n-\r\n-\r\n-\t/**\r\n-\t *  Rest interface for getting network XML for a particular Network ID.\r\n-\t * http://<<URL>:<PORT>>/quadriga/rest/network/xml/{networkid}\r\n-\t * http://localhost:8080/quadriga/rest/network/xml/NET_1huxp4w7p71o0\r\n-\t * @param networkName\r\n-\t * @param response\r\n-\t * @param accept\r\n-\t * @param principal\r\n-\t * @return status\r\n-\t * @throws Exception \r\n-\t */\r\n-\t@ResponseBody\r\n-\t@RequestMapping(value = \"rest/network/{networkid}\", method = RequestMethod.GET, produces = \"application/xml\")\r\n-\tpublic String getNetworkXmlFromQstore(@PathVariable(\"networkid\") String networkId,\r\n-\t\t\tHttpServletResponse response,\r\n-\t\t\tString accept,Principal principal,HttpServletRequest req) throws Exception {\r\n-\r\n-\t\tINetwork network = networkManager.getNetwork(networkId);\r\n-\t\tif(network==null){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\tString errorMsg = errorMessageRest.getErrorMsg(\"Network ID : \"+networkId+\" doesn't exist\");\r\n-\t\t\treturn errorMsg;\r\n-\t\t}\r\n-\t\t\r\n-\t\tString networkXML = networkManager.getNetworkXML(networkId);\r\n-\t\tString status = networkManager.getNetworkStatusCode(network.getStatus())+\"\";\r\n-\t\tif(networkXML.isEmpty() || networkXML == null){\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t}\r\n-\t\tVelocityEngine engine = restVelocityFactory.getVelocityEngine(req);\r\n-\t\tTemplate template = null;\r\n-\t\ttry {\r\n-\t\t\tengine.init();\r\n-\t\t\ttemplate = engine\r\n-\t\t\t\t\t.getTemplate(\"velocitytemplates/networkinfo.vm\");\r\n-\t\t\tVelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n-\t\t\tcontext.put(\"status\", status);\r\n-\t\t\tcontext.put(\"networkxml\", networkXML);\r\n-\t\t\tStringWriter writer = new StringWriter();\r\n-\t\t\ttemplate.merge(context, writer);\r\n-\t\t\tresponse.setStatus(200);\r\n-\t\t\tresponse.setContentType(accept);\r\n-\t\t\tresponse.setContentType(\"application/xml\");\r\n-\t\t\treturn writer.toString();\r\n-\t\t} catch (ResourceNotFoundException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (ParseErrorException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (MethodInvocationException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t}\r\n-\t}\r\n-\r\n-\r\n-\t@ResponseBody\r\n-\t@RequestMapping(value = \"rest/mynetworks\", method = RequestMethod.GET, produces = \"application/xml\")\r\n-\tpublic String getMyNetwork(\r\n-\t\t\tHttpServletResponse response,\r\n-\t\t\tString accept,Principal principal,HttpServletRequest req) throws Exception {\r\n-\r\n-\t\tIUser user = userManager.getUser(principal.getName());\r\n-\r\n-\t\tList<INetwork> networkList = networkManager.getNetworksOfOwner(user);\r\n-\t\tnetworkList = networkManager.editNetworkStatusCode(networkList);\r\n-\t\tVelocityEngine engine = restVelocityFactory.getVelocityEngine(req);\r\n-\t\tTemplate template = null;\r\n-\t\ttry {\r\n-\t\t\tengine.init();\r\n-\t\t\ttemplate = engine\r\n-\t\t\t\t\t.getTemplate(\"velocitytemplates/mynetworks.vm\");\r\n-\t\t\tVelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n-\t\t\tcontext.put(\"networkList\", networkList);\r\n-\t\t\tStringWriter writer = new StringWriter();\r\n-\t\t\ttemplate.merge(context, writer);\r\n-\t\t\tresponse.setStatus(200);\r\n-\t\t\tresponse.setContentType(accept);\r\n-\t\t\tresponse.setContentType(\"application/xml\");\r\n-\t\t\treturn writer.toString();\r\n-\t\t} catch (ResourceNotFoundException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (ParseErrorException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (MethodInvocationException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t}\r\n-\t}\r\n-\r\n-\r\n-\r\n-\t/**\r\n-\t *  Rest interface for getting network list belonging to a workspace \r\n-\t * http://<<URL>:<PORT>>/quadriga/rest/networkdetails/{networkid}\r\n-\t * http://localhost:8080/quadriga/rest/networkdetails/NET_1huxp4w7p71o0\r\n-\t * @param networkName\r\n-\t * @param response\r\n-\t * @param accept\r\n-\t * @param principal\r\n-\t * @return status\r\n-\t * @throws Exception \r\n-\t */\r\n-\t@ResponseBody\r\n-\t@RequestMapping(value = \"rest/network/{networkid}/all\", method = RequestMethod.GET, produces = \"application/xml\")\r\n-\tpublic String getNetworkDetails(@PathVariable(\"networkid\") String networkId,\r\n-\t\t\tHttpServletResponse response,\r\n-\t\t\tString accept,Principal principal,HttpServletRequest req) throws Exception {\r\n-\r\n-\t\tINetwork network = networkManager.getNetwork(networkId);\r\n-\t\tif(network==null){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\tString errorMsg = errorMessageRest.getErrorMsg(\"Network ID : \"+networkId+\" doesn't exist\");\r\n-\t\t\treturn errorMsg;\r\n-\t\t}\r\n-\t\t\r\n-\t\tIUser user = userManager.getUser(principal.getName());\r\n-\t\tString networkXML = networkManager.getNetworkXML(networkId);\r\n-\t\tString status = networkManager.getNetworkStatusCode(network.getStatus())+\"\";\r\n-\t\tif(networkXML.isEmpty() || networkXML == null){\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t}\r\n-\t\tVelocityEngine engine = restVelocityFactory.getVelocityEngine(req);\r\n-\t\tTemplate template = null;\r\n-\t\ttry {\r\n-\t\t\tengine.init();\r\n-\t\t\ttemplate = engine\r\n-\t\t\t\t\t.getTemplate(\"velocitytemplates/networkdetails.vm\");\r\n-\t\t\tVelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n-\t\t\tcontext.put(\"status\", status);\r\n-\t\t\tcontext.put(\"networkxml\", networkXML);\r\n-\t\t\tcontext.put(\"networkAnnoList\",editingNetworkAnnoManager.getAllAnnotationOfNetwork(user.getUserName(), networkId));\r\n-\t\t\tStringWriter writer = new StringWriter();\r\n-\t\t\ttemplate.merge(context, writer);\r\n-\t\t\tresponse.setStatus(200);\r\n-\t\t\tresponse.setContentType(accept);\r\n-\t\t\tresponse.setContentType(\"application/xml\");\r\n-\t\t\treturn writer.toString();\r\n-\t\t} catch (ResourceNotFoundException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (ParseErrorException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t} catch (MethodInvocationException e) {\r\n-\r\n-\t\t\tlogger.error(\"Exception:\", e);\r\n-\t\t\tthrow new RestException(404);\r\n-\t\t}\r\n-\r\n-\t}\r\n-\r\n-\t/**\r\n-\t *  Rest interface for re-upload a changed network ( which was rejected earlier )  \r\n-\t * http://<<URL>:<PORT>>/quadriga/rest/reuploadnetwork/{networkid}\r\n-\t * http://localhost:8080/quadriga/rest/reuploadnetwork/NET_1huxp4w7p71o0\r\n-\t * @param networkId\r\n-\t * @param response\r\n-\t * @param accept\r\n-\t * @param principal\r\n-\t * @param req\r\n-\t * @return\r\n-\t * @throws JAXBException\r\n-\t * @throws QuadrigaStorageException\r\n-\t * @throws RestException\r\n-\t * @throws IOException \r\n-\t * @throws SAXException \r\n-\t * @throws ParserConfigurationException \r\n-\t */\r\n-\t@ResponseBody\r\n-\t@RequestMapping(value = \"rest/reuploadnetwork/{networkid}\", method = RequestMethod.POST)\r\n-\tpublic String reuploadNetwork(@PathVariable(\"networkid\") String networkId,\r\n-\t\t\tHttpServletResponse response,HttpServletRequest request,\r\n-\t\t\t@RequestBody String xml,\r\n-\t\t\t@RequestHeader(\"Accept\") String accept,\r\n-\t\t\tPrincipal principal) throws JAXBException, QuadrigaStorageException, RestException, ParserConfigurationException, SAXException, IOException {\r\n-\r\n-\t\tIUser user = userManager.getUser(principal.getName());\r\n-\r\n-\t\tString networkName = request.getParameter(\"networkname\");\r\n-\r\n-\r\n-\t\tif(networkId == null||networkId.isEmpty()){\r\n-\t\t\tresponse.setStatus(404);\r\n-\t\t\treturn \"Please provide network id.\";\r\n-\t\t}\r\n-\r\n-\t\tINetwork network = null;\r\n-\t\ttry{\r\n-\t\t\tnetwork = networkManager.getNetwork(networkId);\r\n-\t\t\tif(network==null){\r\n-\t\t\t\tlogger.info(\"network is null\");\r\n-\t\t\t\tresponse.setStatus(404);\r\n-\t\t\t\treturn \"Please provide correct network id.\";\r\n-\t\t\t}else{\r\n-\t\t\t\tlogger.info(network.getNetworkName());\r\n-\t\t\t}\r\n-\t\t}catch(QuadrigaStorageException e){\r\n-\t\t\tlogger.error(\"DB Error :\",e);\r\n-\t\t}\r\n-\t\t//\t\tlogger.info(\"Old name : \"+network.getName()+\"  new name : \"+networkName);\r\n-\t\tif(!(network.getStatus().equals(INetworkStatus.REJECTED))){\r\n-\t\t\tresponse.setStatus(500);\r\n-\t\t\treturn \"The Network doesn't have status : REJECTED\";\r\n-\t\t}else{\r\n-\r\n-\t\t\txml=xml.trim();\r\n-\t\t\tif (xml.isEmpty()) {\r\n-\t\t\t\tresponse.setStatus(500);\r\n-\t\t\t\treturn \"Please provide XML in body of the post request.\";\r\n-\r\n-\t\t\t} else {\r\n-\r\n-\t\t\t\tString res=networkManager.storeXMLQStore(xml);\r\n-\t\t\t\tif(res.equals(\"\")){\r\n-\t\t\t\t\tresponse.setStatus(500);\r\n-\t\t\t\t\treturn \"Please provide correct XML in body of the post request. Qstore system is not accepting ur XML\";\r\n-\t\t\t\t}\r\n-\t\t\t\tString networkNameUpdateStatus=\"\";\r\n-\t\t\t\tif(!(networkName == null ||networkName.equals(network.getNetworkName()) || networkName.equals(\"\"))){\r\n-\t\t\t\t\tnetworkNameUpdateStatus = networkManager.updateNetworkName(networkId,networkName);\r\n-\t\t\t\t\tif(!(networkNameUpdateStatus.equals(\"success\"))){\r\n-\t\t\t\t\t\tresponse.setStatus(500);\r\n-\t\t\t\t\t\treturn \"DB Issue, please try after sometime\";\r\n-\t\t\t\t\t}\r\n-\t\t\t\t}\r\n-\r\n-\t\t\t\t//networkManager.archiveNetwork(networkId);\r\n-\t\t\t\teditorManager.updateNetworkStatus(networkId, INetworkStatus.PENDING);\r\n-\t\t\t\tint latestVersion = networkManager.getLatestVersionOfNetwork(networkId) +1;\r\n-\t\t\t\tnetworkId=networkManager.storeNetworkDetails(res, user, networkName, network.getNetworkWorkspace().getWorkspace().getWorkspaceId(), INetworkManager.UPDATENETWORK, networkId,latestVersion);\r\n-\r\n-\t\t\t\tif(networkId.endsWith(INetworkManager.DSPACEERROR)){\r\n-\t\t\t\t\tresponse.setStatus(404);\r\n-\t\t\t\t\treturn \"Text files don't belong to this workspace.\";\r\n-\t\t\t\t}\r\n-\r\n-\t\t\t\tresponse.setStatus(200);\r\n-\t\t\t\tresponse.setContentType(accept);\r\n-\t\t\t\tresponse.setHeader(\"networkid\",networkId );\r\n-\t\t\t\treturn res;\r\n-\t\t\t}\r\n-\t\t}\r\n-\t}\r\n-\r\n-\r\n+    @Autowired\r\n+    private INetworkManager networkManager;\r\n+\r\n+    @Autowired\r\n+    private IRestMessage errorMessageRest;\r\n+\r\n+    @Autowired\r\n+    private IListWSManager wsManager;\r\n+\r\n+    @Autowired\r\n+    private IEditorManager editorManager;\r\n+\r\n+    @Autowired\r\n+    private IEditingNetworkAnnotationManager editingNetworkAnnoManager;\r\n+\r\n+    @Autowired\r\n+    private IRestVelocityFactory restVelocityFactory;\r\n+\r\n+    @Autowired\r\n+    private IUserManager userManager;\r\n+\r\n+    /**\r\n+     * Rest interface for uploading XML for networks http://<<URL>:\r\n+     * <PORT>>/quadriga/rest/uploadnetworks\r\n+     * http://localhost:8080/quadriga/rest/uploadnetworks\r\n+     * \r\n+     * @author Lohith Dwaraka\r\n+     * @param request\r\n+     * @param response\r\n+     * @param xml\r\n+     * @param accept\r\n+     * @return XML\r\n+     * @throws QuadrigaException\r\n+     * @throws IOException\r\n+     * @throws SAXException\r\n+     * @throws ParserConfigurationException\r\n+     * @throws JAXBException\r\n+     * @throws TransformerException\r\n+     * @throws QuadrigaStorageException\r\n+     * @throws RestException\r\n+     */\r\n+    @RequestMapping(value = \"rest/uploadnetworks\", method = RequestMethod.POST)\r\n+    public ResponseEntity<String> getNetworkFromClients(HttpServletRequest request, HttpServletResponse response,\r\n+            @RequestBody String xml, @RequestHeader(\"Accept\") String accept, Principal principal)\r\n+                    throws QuadrigaException, ParserConfigurationException, SAXException, IOException, JAXBException,\r\n+                    TransformerException, QuadrigaStorageException, RestException {\r\n+\r\n+        IUser user = userManager.getUser(principal.getName());\r\n+        String networkName = request.getParameter(\"networkname\");\r\n+        String networkId = \"\";\r\n+        String workspaceid = request.getParameter(\"workspaceid\");\r\n+\r\n+        if (workspaceid == null || workspaceid.isEmpty()) {\r\n+            String errorMsg = errorMessageRest\r\n+                    .getErrorMsg(\"Please provide a workspace id as a part of post parameters\");\r\n+            return new ResponseEntity<String>(errorMsg, HttpStatus.BAD_REQUEST);\r\n+        }\r\n+        String projectid = networkManager.getProjectIdForWorkspaceId(workspaceid);\r\n+        if (projectid == null || projectid.isEmpty()) {\r\n+            String errorMsg = errorMessageRest\r\n+                    .getErrorMsg(\"No project could be found for the given workspace id \" + workspaceid);\r\n+            return new ResponseEntity<String>(errorMsg, HttpStatus.NOT_FOUND);\r\n+        }\r\n+\r\n+        if (networkName == null || networkName.isEmpty()) {\r\n+            String errorMsg = errorMessageRest.getErrorMsg(\"Please provide network name as a part of post parameters\");\r\n+            return new ResponseEntity<String>(errorMsg, HttpStatus.BAD_REQUEST);\r\n+        }\r\n+\r\n+        xml = xml.trim();\r\n+        if (xml.isEmpty()) {\r\n+            String errorMsg = errorMessageRest.getErrorMsg(\"Please provide XML in body of the post request.\");\r\n+            return new ResponseEntity<String>(errorMsg, HttpStatus.BAD_REQUEST);\r\n+\r\n+        }\r\n+\r\n+        String res = networkManager.storeXMLQStore(xml);\r\n+        if (res.equals(\"\")) {\r\n+            String errorMsg = \"Please provide correct XML in body of the post request. Qstore system is not accepting your XML\";\r\n+            return new ResponseEntity<String>(errorMsg, HttpStatus.BAD_REQUEST);\r\n+        }\r\n+\r\n+        networkId = networkManager.storeNetworkDetails(res, user, networkName, workspaceid, INetworkManager.NEWNETWORK,\r\n+                networkId, INetworkManager.VERSION_ZERO);\r\n+\r\n+        // TODO: Send email to all editors of a workspace\r\n+        // TODO: Get the workspace editors from the workspaceid\r\n+\r\n+        HttpHeaders httpHeaders = new HttpHeaders();\r\n+        httpHeaders.setContentType(MediaType.valueOf(accept));\r\n+        httpHeaders.set(\"networkid\", networkId);\r\n+        return new ResponseEntity<String>(res, httpHeaders, HttpStatus.OK);\r\n+\r\n+    }\r\n+\r\n+    /**\r\n+     * Rest interface for getting status of network http://<<URL>:\r\n+     * <PORT>>/quadriga/rest/networkstatus/{NetworkId}\r\n+     * http://localhost:8080/quadriga/rest/networkstatus/NET_1huxp4w7p71o0\r\n+     * \r\n+     * @param networkName\r\n+     * @param response\r\n+     * @param accept\r\n+     * @param principal\r\n+     * @return status\r\n+     * @throws RestException\r\n+     */\r\n+    @RequestMapping(value = \"rest/networkstatus/{NetworkId}\", method = RequestMethod.GET, produces = \"application/xml\")\r\n+    public ResponseEntity<String> getNetworkStatus(@PathVariable(\"NetworkId\") String networkId,\r\n+            HttpServletResponse response, String accept, Principal principal, HttpServletRequest req) throws RestException {\r\n+        INetwork network = null;\r\n+        \r\n+        IUser user = null;\r\n+        VelocityEngine engine = null;\r\n+        Template template = null;\r\n+        \r\n+        try {\r\n+            network = networkManager.getNetwork(networkId);\r\n+            if (network == null) {\r\n+                String errorMsg = errorMessageRest.getErrorMsg(\"Network ID : \" + networkId + \" doesn't exist\");\r\n+                return new ResponseEntity<String>(errorMsg, HttpStatus.NOT_FOUND);\r\n+            }\r\n+            String status = networkManager.getNetworkStatusCode(network.getStatus()) + \"\";\r\n+            \r\n+            user = userManager.getUser(principal.getName());\r\n+            engine = restVelocityFactory.getVelocityEngine(req);\r\n+            engine.init();\r\n+\r\n+            template = engine.getTemplate(\"velocitytemplates/networkstatus.vm\");\r\n+            VelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n+            if (network.getStatus() == null)\r\n+                context.put(\"status\", INetworkStatus.UNKNOWN_CODE + \"\");\r\n+            else\r\n+                context.put(\"status\", status);\r\n+            context.put(\"networkid\", networkId);\r\n+            List<INetworkAnnotation> networkAnnoList = editingNetworkAnnoManager\r\n+                    .getAllAnnotationOfNetwork(user.getUserName(), networkId);\r\n+            context.put(\"networkAnnoList\", networkAnnoList);\r\n+            StringWriter writer = new StringWriter();\r\n+            template.merge(context, writer);\r\n+\r\n+            HttpHeaders httpHeaders = new HttpHeaders();\r\n+            httpHeaders.setContentType(MediaType.APPLICATION_XML);\r\n+            return new ResponseEntity<String>(writer.toString(), httpHeaders, HttpStatus.OK);\r\n+        } catch (ResourceNotFoundException e) {\r\n+            throw new RestException(404, e);\r\n+        } catch (ParseErrorException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (MethodInvocationException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (QuadrigaStorageException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (Exception e) {\r\n+            throw new RestException(500, e);\r\n+        } \r\n+\r\n+    }\r\n+\r\n+    /**\r\n+     * REST API for getting annotations of network http://<<URL>:\r\n+     * <PORT>>/quadriga/rest/network/annotations/{NetworkId}\r\n+     * http://localhost:8080/quadriga/rest/network/annotations/dcb6b7bf-ba6b-\r\n+     * 40d7-a067-e1edf3460daa\r\n+     * \r\n+     * @param networkId\r\n+     *            {@link INetwork} ID of type {@link String}\r\n+     * @param response\r\n+     *            {@link HttpServletResponse} object to set the status and\r\n+     *            response\r\n+     * @param accept\r\n+     *            Type of MIME accepted\r\n+     * @param principal\r\n+     *            {@link Principal} object to obtain the user details\r\n+     * @param req\r\n+     *            {@link HttpServletRequest} object to access any user params\r\n+     * @return XML with list of annotations belonging to a Network\r\n+     * @throws Exception\r\n+     *             Throws the exception for any issue in the Velocity engine\r\n+     */\r\n+    @RequestMapping(value = \"rest/network/{NetworkId}/annotations\", method = RequestMethod.GET, produces = \"application/xml\")\r\n+    public ResponseEntity<String> getAnnotationOfNetwork(@PathVariable(\"NetworkId\") String networkId,\r\n+            HttpServletResponse response, String accept, Principal principal, HttpServletRequest req) throws RestException {\r\n+        INetwork network = null;\r\n+        \r\n+        IUser user = null;\r\n+        VelocityEngine engine = null;\r\n+        Template template = null;\r\n+        try {\r\n+            network = networkManager.getNetwork(networkId);\r\n+            if (network == null) {\r\n+                String errorMsg = errorMessageRest.getErrorMsg(\"Network ID : \" + networkId + \" doesn't exist\");\r\n+                return new ResponseEntity<String>(errorMsg, HttpStatus.NOT_FOUND);\r\n+            }\r\n+            user = userManager.getUser(principal.getName());\r\n+            engine = restVelocityFactory.getVelocityEngine(req);\r\n+            engine.init();\r\n+\r\n+            template = engine.getTemplate(\"velocitytemplates/networkannotations.vm\");\r\n+            VelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n+            context.put(\"networkId\", networkId);\r\n+            List<INetworkAnnotation> networkAnnoList = editingNetworkAnnoManager\r\n+                    .getAllAnnotationOfNetwork(user.getUserName(), networkId);\r\n+            context.put(\"networkAnnoList\", networkAnnoList);\r\n+            StringWriter writer = new StringWriter();\r\n+            template.merge(context, writer);\r\n+\r\n+            HttpHeaders httpHeaders = new HttpHeaders();\r\n+            httpHeaders.setContentType(MediaType.APPLICATION_XML);\r\n+            return new ResponseEntity<String>(writer.toString(), httpHeaders, HttpStatus.OK);\r\n+        } catch (ResourceNotFoundException e) {\r\n+            throw new RestException(404, e);\r\n+        } catch (ParseErrorException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (MethodInvocationException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (QuadrigaStorageException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (Exception e) {\r\n+            throw new RestException(500, e);\r\n+        }\r\n+\r\n+    }\r\n+\r\n+    /**\r\n+     * Rest interface for getting all the network list belonging to a workspace\r\n+     * http://<<URL>:<PORT>>/quadriga/rest/workspace/{workspaceid}/networks\r\n+     * http://localhost:8080/quadriga/rest/workspace/WS_23092339551502339/\r\n+     * networks\r\n+     * \r\n+     * @param networkName\r\n+     * @param response\r\n+     * @param accept\r\n+     * @param principal\r\n+     * @return status\r\n+     * @throws Exception\r\n+     */\r\n+    @RequestMapping(value = \"rest/workspace/{workspaceid}/networks\", method = RequestMethod.GET, produces = \"application/xml\")\r\n+    public ResponseEntity<String> getWorkspaceNetworkList(@PathVariable(\"workspaceid\") String workspaceId,\r\n+            HttpServletResponse response, String accept, Principal principal, HttpServletRequest req) throws RestException {\r\n+        IWorkSpace workspace = null;\r\n+        List<IWorkspaceNetwork> workspaceNetworkList = null;\r\n+        VelocityEngine engine = null;\r\n+        Template template = null;\r\n+        try {\r\n+            workspace = wsManager.getWorkspaceDetails(workspaceId, principal.getName());\r\n+            if (workspace == null) {\r\n+                String errorMsg = errorMessageRest.getErrorMsg(\"Workspace ID : \" + workspaceId + \" doesn't exist\");\r\n+                return new ResponseEntity<String>(errorMsg, HttpStatus.NOT_FOUND);\r\n+            }\r\n+\r\n+            workspaceNetworkList = wsManager.getWorkspaceNetworkList(workspaceId);\r\n+            workspaceNetworkList = networkManager.editWorkspaceNetworkStatusCode(workspaceNetworkList);\r\n+            engine = restVelocityFactory.getVelocityEngine(req);\r\n+            engine.init();\r\n+            template = engine.getTemplate(\"velocitytemplates/approvednetworks.vm\");\r\n+            VelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n+            context.put(\"workspaceNetworkList\", workspaceNetworkList);\r\n+            StringWriter writer = new StringWriter();\r\n+            template.merge(context, writer);\r\n+\r\n+            HttpHeaders httpHeaders = new HttpHeaders();\r\n+            httpHeaders.setContentType(MediaType.APPLICATION_XML);\r\n+            return new ResponseEntity<String>(writer.toString(), httpHeaders, HttpStatus.OK);\r\n+        } catch (ResourceNotFoundException e) {\r\n+            throw new RestException(404, e);\r\n+        } catch (ParseErrorException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (MethodInvocationException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (QuadrigaStorageException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (QuadrigaAccessException e) {\r\n+            throw new RestException(403, e);\r\n+        } catch (Exception e) {\r\n+            throw new RestException(500, e);\r\n+        }\r\n+    }\r\n+\r\n+    /**\r\n+     * Rest interface for getting rejected network list belonging to a workspace\r\n+     * http://<<URL>:\r\n+     * <PORT>>/quadriga/rest/workspace/{workspaceid}/rejectednetworks\r\n+     * http://localhost:8080/quadriga/rest/workspace/WS_23092339551502339/\r\n+     * rejectednetworks\r\n+     * \r\n+     * @param networkName\r\n+     * @param response\r\n+     * @param accept\r\n+     * @param principal\r\n+     * @return status\r\n+     * @throws Exception\r\n+     */\r\n+    @RequestMapping(value = \"rest/workspace/{workspaceid}/rejectednetworks\", method = RequestMethod.GET, produces = \"application/xml\")\r\n+    public ResponseEntity<String> getWorkspaceRejectedNetworkList(@PathVariable(\"workspaceid\") String workspaceId,\r\n+            HttpServletResponse response, String accept, Principal principal, HttpServletRequest req) throws RestException {\r\n+\r\n+        IWorkSpace workspace = null;\r\n+\r\n+        List<IWorkspaceNetwork> workspaceNetworkList = null;\r\n+        VelocityEngine engine = null;\r\n+        Template template = null;\r\n+        try {\r\n+            workspace = wsManager.getWorkspaceDetails(workspaceId, principal.getName());\r\n+            if (workspace == null) {\r\n+                String errorMsg = errorMessageRest.getErrorMsg(\"Workspace ID : \" + workspaceId + \" doesn't exist\");\r\n+                return new ResponseEntity<String>(errorMsg, HttpStatus.NOT_FOUND);\r\n+            }\r\n+\r\n+            workspaceNetworkList = wsManager.getWorkspaceRejectedNetworkList(workspaceId);\r\n+            workspaceNetworkList = networkManager.editWorkspaceNetworkStatusCode(workspaceNetworkList);\r\n+            engine = restVelocityFactory.getVelocityEngine(req);\r\n+            engine.init();\r\n+            template = engine.getTemplate(\"velocitytemplates/rejectednetworks.vm\");\r\n+            VelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n+            context.put(\"workspaceNetworkList\", workspaceNetworkList);\r\n+            StringWriter writer = new StringWriter();\r\n+            template.merge(context, writer);\r\n+            HttpHeaders httpHeaders = new HttpHeaders();\r\n+            httpHeaders.setContentType(MediaType.APPLICATION_XML);\r\n+            return new ResponseEntity<String>(writer.toString(), httpHeaders, HttpStatus.OK);\r\n+        } catch (ResourceNotFoundException e) {\r\n+            throw new RestException(404, e);\r\n+        } catch (ParseErrorException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (MethodInvocationException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (QuadrigaStorageException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (QuadrigaAccessException e) {\r\n+            throw new RestException(403, e);\r\n+        } catch (Exception e) {\r\n+            throw new RestException(500, e);\r\n+        }\r\n+    }\r\n+\r\n+    /**\r\n+     * Rest interface for getting accepted network list belonging to a workspace\r\n+     * http://<<URL>:\r\n+     * <PORT>>/quadriga/rest/workspace/{workspaceid}/approvednetworks\r\n+     * http://localhost:8080/quadriga/rest/workspace/WS_23092339551502339/\r\n+     * approvednetworks\r\n+     * \r\n+     * @param networkName\r\n+     * @param response\r\n+     * @param accept\r\n+     * @param principal\r\n+     * @return status\r\n+     * @throws Exception\r\n+     */\r\n+    @RequestMapping(value = \"rest/workspace/{workspaceid}/approvednetworks\", method = RequestMethod.GET, produces = \"application/xml\")\r\n+    public ResponseEntity<String> getWorkspaceApprovedNetworkList(@PathVariable(\"workspaceid\") String workspaceId,\r\n+            HttpServletResponse response, String accept, Principal principal, HttpServletRequest req) throws RestException {\r\n+\r\n+        IWorkSpace workspace = null;\r\n+\r\n+        List<IWorkspaceNetwork> workspaceNetworkList = null;\r\n+        VelocityEngine engine = null;\r\n+        Template template = null;\r\n+        try {\r\n+            workspace = wsManager.getWorkspaceDetails(workspaceId, principal.getName());\r\n+            if (workspace == null) {\r\n+                String errorMsg = errorMessageRest.getErrorMsg(\"Workspace ID : \" + workspaceId + \" doesn't exist\");\r\n+                return new ResponseEntity<String>(errorMsg, HttpStatus.NOT_FOUND);\r\n+            }\r\n+\r\n+            workspaceNetworkList = wsManager.getWorkspaceApprovedNetworkList(workspaceId);\r\n+            workspaceNetworkList = networkManager.editWorkspaceNetworkStatusCode(workspaceNetworkList);\r\n+            engine = restVelocityFactory.getVelocityEngine(req);\r\n+            engine.init();\r\n+            template = engine.getTemplate(\"velocitytemplates/approvednetworks.vm\");\r\n+            VelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n+            context.put(\"workspaceNetworkList\", workspaceNetworkList);\r\n+            StringWriter writer = new StringWriter();\r\n+            template.merge(context, writer);\r\n+            HttpHeaders httpHeaders = new HttpHeaders();\r\n+            httpHeaders.setContentType(MediaType.APPLICATION_XML);\r\n+            return new ResponseEntity<String>(writer.toString(), httpHeaders, HttpStatus.OK);\r\n+        } catch (ResourceNotFoundException e) {\r\n+            throw new RestException(404, e);\r\n+        } catch (ParseErrorException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (MethodInvocationException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (QuadrigaStorageException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (QuadrigaAccessException e) {\r\n+            throw new RestException(403, e);\r\n+        } catch (Exception e) {\r\n+            throw new RestException(500, e);\r\n+        }\r\n+    }\r\n+\r\n+    /**\r\n+     * Rest interface for getting network XML for a particular Network ID.\r\n+     * http://<<URL>:<PORT>>/quadriga/rest/network/xml/{networkid}\r\n+     * http://localhost:8080/quadriga/rest/network/xml/NET_1huxp4w7p71o0\r\n+     * \r\n+     * @param networkName\r\n+     * @param response\r\n+     * @param accept\r\n+     * @param principal\r\n+     * @return status\r\n+     * @throws Exception\r\n+     */\r\n+    @RequestMapping(value = \"rest/network/{networkid}\", method = RequestMethod.GET, produces = \"application/xml\")\r\n+    public ResponseEntity<String> getNetworkXmlFromQstore(@PathVariable(\"networkid\") String networkId,\r\n+            HttpServletResponse response, String accept, Principal principal, HttpServletRequest req) throws RestException {\r\n+\r\n+        INetwork network = null;\r\n+        VelocityEngine engine = null;\r\n+        Template template = null;\r\n+        try {\r\n+            network = networkManager.getNetwork(networkId);\r\n+            if (network == null) {\r\n+                String errorMsg = errorMessageRest.getErrorMsg(\"Network ID : \" + networkId + \" doesn't exist\");\r\n+                return new ResponseEntity<String>(errorMsg, HttpStatus.NOT_FOUND);\r\n+            }\r\n+\r\n+            String networkXML = networkManager.getNetworkXML(networkId);\r\n+            String status = networkManager.getNetworkStatusCode(network.getStatus()) + \"\";\r\n+            if (networkXML.isEmpty() || networkXML == null) {\r\n+                throw new RestException(404);\r\n+            }\r\n+            engine = restVelocityFactory.getVelocityEngine(req);\r\n+            engine.init();\r\n+            template = engine.getTemplate(\"velocitytemplates/networkinfo.vm\");\r\n+            VelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n+            context.put(\"status\", status);\r\n+            context.put(\"networkxml\", networkXML);\r\n+            StringWriter writer = new StringWriter();\r\n+            template.merge(context, writer);\r\n+            HttpHeaders httpHeaders = new HttpHeaders();\r\n+            httpHeaders.setContentType(MediaType.APPLICATION_XML);\r\n+            return new ResponseEntity<String>(writer.toString(), httpHeaders, HttpStatus.OK);\r\n+        } catch (ResourceNotFoundException e) {\r\n+            throw new RestException(404, e);\r\n+        } catch (ParseErrorException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (MethodInvocationException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (QuadrigaStorageException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (Exception e) {\r\n+            throw new RestException(500, e);\r\n+        }\r\n+    }\r\n+\r\n+    @RequestMapping(value = \"rest/mynetworks\", method = RequestMethod.GET, produces = \"application/xml\")\r\n+    public ResponseEntity<String> getMyNetwork(HttpServletResponse response, String accept, Principal principal,\r\n+            HttpServletRequest req) throws RestException {\r\n+\r\n+        IUser user = null;\r\n+\r\n+        List<INetwork> networkList = null;\r\n+        VelocityEngine engine = null;\r\n+        Template template = null;\r\n+        try {\r\n+            user = userManager.getUser(principal.getName());\r\n+\r\n+            networkList = networkManager.getNetworksOfOwner(user);\r\n+            networkList = networkManager.editNetworkStatusCode(networkList);\r\n+            engine = restVelocityFactory.getVelocityEngine(req);\r\n+            engine.init();\r\n+            template = engine.getTemplate(\"velocitytemplates/mynetworks.vm\");\r\n+            VelocityContext context = new VelocityContext(restVelocityFactory.getVelocityContext());\r\n+            context.put(\"networkList\", networkList);\r\n+            StringWriter writer = new StringWriter();\r\n+            template.merge(context, writer);\r\n+            HttpHeaders httpHeaders = new HttpHeaders();\r\n+            httpHeaders.setContentType(MediaType.APPLICATION_XML);\r\n+            return new ResponseEntity<String>(writer.toString(), httpHeaders, HttpStatus.OK);\r\n+        } catch (ResourceNotFoundException e) {\r\n+            throw new RestException(404, e);\r\n+        } catch (ParseErrorException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (MethodInvocationException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (QuadrigaStorageException e) {\r\n+            throw new RestException(500, e);\r\n+        } catch (Exception e) {\r\n+            throw new RestException(500, e);\r\n+        }\r\n+    }\r\n+\r\n+    /**\r\n+     * Rest interface for getting network list belonging to a workspace http://<\r\n+     * <URL>:<PORT>>/quadriga/rest/networkdetails/{networkid}\r\n+     * http://localhost:8080/quadriga/rest/networkdetails/NET_1huxp4w7p71o0\r\n+     * \r\n+     * @param networkName\r\n+     * @param response\r\n+     * @param accept\r\n+     * @param principal\r\n+     * @return status\r\n+     * @throws Exception\r\n+     */\r\n+    @RequestMapping(value = \"rest/network/{networkid}/all\", method = RequestMethod.GET, produces = \"application/xml\")\r\n+    public ResponseEntity<String> getNetworkDetails(@PathVariable(\"networkid\") String networkId,\r\n+            HttpServletResponse response, String accept, Principal principal, HttpServletRequest req) throws RestException {\r\n+\r\n+        INetwork network = null;\r\n+\r\n+        IUser user = null;\r\n+\r\n+        VelocityEngine engine = null;\r\n+        Template template = null;\r","path":"Quadriga/src/main/java/edu/asu/spring/quadriga/rest/NetworkRestController.java","position":1198,"original_position":1198,"commit_id":"96a3e0a5ab1a4104663c239b8511ce1907b8b486","original_commit_id":"96a3e0a5ab1a4104663c239b8511ce1907b8b486","user":{"login":"jdamerow","id":8881141,"avatar_url":"https://avatars.githubusercontent.com/u/8881141?v=3","gravatar_id":"","url":"https://api.github.com/users/jdamerow","html_url":"https://github.com/jdamerow","followers_url":"https://api.github.com/users/jdamerow/followers","following_url":"https://api.github.com/users/jdamerow/following{/other_user}","gists_url":"https://api.github.com/users/jdamerow/gists{/gist_id}","starred_url":"https://api.github.com/users/jdamerow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdamerow/subscriptions","organizations_url":"https://api.github.com/users/jdamerow/orgs","repos_url":"https://api.github.com/users/jdamerow/repos","events_url":"https://api.github.com/users/jdamerow/events{/privacy}","received_events_url":"https://api.github.com/users/jdamerow/received_events","type":"User","site_admin":false},"body":"declare where needed","created_at":"2016-01-29T22:11:05Z","updated_at":"2016-01-29T22:11:05Z","html_url":"https://github.com/diging/quadriga/pull/67#discussion_r51323276","pull_request_url":"https://api.github.com/repos/diging/quadriga/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/diging/quadriga/pulls/comments/51323276"},"html":{"href":"https://github.com/diging/quadriga/pull/67#discussion_r51323276"},"pull_request":{"href":"https://api.github.com/repos/diging/quadriga/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/diging/quadriga/pulls/67","id":57397200,"html_url":"https://github.com/diging/quadriga/pull/67","diff_url":"https://github.com/diging/quadriga/pull/67.diff","patch_url":"https://github.com/diging/quadriga/pull/67.patch","issue_url":"https://api.github.com/repos/diging/quadriga/issues/67","number":67,"state":"open","locked":false,"title":"Story/quad 46","user":{"login":"suprajkolluri","id":14131064,"avatar_url":"https://avatars.githubusercontent.com/u/14131064?v=3","gravatar_id":"","url":"https://api.github.com/users/suprajkolluri","html_url":"https://github.com/suprajkolluri","followers_url":"https://api.github.com/users/suprajkolluri/followers","following_url":"https://api.github.com/users/suprajkolluri/following{/other_user}","gists_url":"https://api.github.com/users/suprajkolluri/gists{/gist_id}","starred_url":"https://api.github.com/users/suprajkolluri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suprajkolluri/subscriptions","organizations_url":"https://api.github.com/users/suprajkolluri/orgs","repos_url":"https://api.github.com/users/suprajkolluri/repos","events_url":"https://api.github.com/users/suprajkolluri/events{/privacy}","received_events_url":"https://api.github.com/users/suprajkolluri/received_events","type":"User","site_admin":false},"body":"Rebased with develop and worked on review comments","created_at":"2016-01-27T17:52:58Z","updated_at":"2016-01-29T22:11:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8bb15895e108d72294c2d68af9f6d064d1e8921","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/diging/quadriga/pulls/67/commits","review_comments_url":"https://api.github.com/repos/diging/quadriga/pulls/67/comments","review_comment_url":"https://api.github.com/repos/diging/quadriga/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diging/quadriga/issues/67/comments","statuses_url":"https://api.github.com/repos/diging/quadriga/statuses/96a3e0a5ab1a4104663c239b8511ce1907b8b486","head":{"label":"diging:story/QUAD-46","ref":"story/QUAD-46","sha":"96a3e0a5ab1a4104663c239b8511ce1907b8b486","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-01-29T21:56:15Z","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":10148,"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":3,"forks":0,"open_issues":3,"watchers":2,"default_branch":"develop"}},"base":{"label":"diging:develop","ref":"develop","sha":"c01dc751095717760f2f6055f38c9c4b6f8b54c0","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-01-29T21:56:15Z","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":10148,"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":3,"forks":0,"open_issues":3,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diging/quadriga/pulls/67"},"html":{"href":"https://github.com/diging/quadriga/pull/67"},"issue":{"href":"https://api.github.com/repos/diging/quadriga/issues/67"},"comments":{"href":"https://api.github.com/repos/diging/quadriga/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/diging/quadriga/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/diging/quadriga/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diging/quadriga/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/diging/quadriga/statuses/96a3e0a5ab1a4104663c239b8511ce1907b8b486"}}}}