From: <asg...@us...> - 2010-06-26 06:39:45
|
Revision: 13626 http://dcm4che.svn.sourceforge.net/dcm4che/?rev=13626&view=rev Author: asgarhussain Date: 2010-06-26 06:39:38 +0000 (Sat, 26 Jun 2010) Log Message: ----------- OV-80 : Support to run multiple instances of Oviyam on a single server with separate configurations - Solved. Modified Paths: -------------- oviyam/oviyam/trunk/src/in/raster/oviyam/config/ServerXmlConfiguration.java oviyam/oviyam/trunk/src/in/raster/oviyam/servlet/ServerConfig.java oviyam/oviyam/trunk/web/WEB-INF/lib/json.jar oviyam/oviyam/trunk/web/css/oviyam7.css Modified: oviyam/oviyam/trunk/src/in/raster/oviyam/config/ServerXmlConfiguration.java =================================================================== --- oviyam/oviyam/trunk/src/in/raster/oviyam/config/ServerXmlConfiguration.java 2010-06-25 23:02:37 UTC (rev 13625) +++ oviyam/oviyam/trunk/src/in/raster/oviyam/config/ServerXmlConfiguration.java 2010-06-26 06:39:38 UTC (rev 13626) @@ -78,6 +78,7 @@ Document dom; File documentNameFile; + static String fname = "oviyam-config.xml"; // Constructor ----------------------------------------------------------- /* @@ -98,20 +99,21 @@ * It reads and checks whether the file exists or not. If the file does not exist then it creates * a new xml document with the specified name. * - * @param documentName + * @param contextPath */ - public void createAndParseXML(String documentName) { + public void createAndParseXML(String contextPath) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { DocumentBuilder db = dbf.newDocumentBuilder(); String xmlFileName = this.getClass().getResource("/conf/oviyam-config.xml").toString(); + fname = contextPath + "-config.xml"; // check the server and set the documentNameFile according to server if(xmlFileName.indexOf("default") > 0) // for JBOSS server - documentNameFile = new File(xmlFileName.substring(5,xmlFileName.indexOf("default"))+"default/oviyam-config.xml"); + documentNameFile = new File(xmlFileName.substring(5,xmlFileName.indexOf("default"))+"default/" + fname); else // other than JBOSS documentNameFile = new File(this.getClass().getClassLoader().getResource("/conf/oviyam-config.xml").toURI()); @@ -268,7 +270,7 @@ if(xmlFileName.indexOf("default") >0) { File srcFile = new File(this.getClass().getResource("/conf/oviyam-config.xml").toURI()); - File destFile = new File(xmlFileName. substring(5,xmlFileName. indexOf("default"))+"default/oviyam-config.xml"); + File destFile = new File(xmlFileName. substring(5,xmlFileName. indexOf("default"))+"default/" + fname); // check the exists of oviyam-config.xml file. If not exists, copy the file to default folder if(!destFile.exists()) { @@ -329,9 +331,9 @@ * @param wadoPort * @param dcmProtocol */ - public void creatXml(String aeTitle, String hostName, String port, String wadoPort, String dcmProtocol){ + public void creatXml(String aeTitle, String hostName, String port, String wadoPort, String dcmProtocol, String contextPath){ - createAndParseXML("oviyam-config.xml"); + createAndParseXML(contextPath); ServerConfiguration s=new ServerConfiguration(); s.setAeTitle(aeTitle); s.setHostName(hostName); Modified: oviyam/oviyam/trunk/src/in/raster/oviyam/servlet/ServerConfig.java =================================================================== --- oviyam/oviyam/trunk/src/in/raster/oviyam/servlet/ServerConfig.java 2010-06-25 23:02:37 UTC (rev 13625) +++ oviyam/oviyam/trunk/src/in/raster/oviyam/servlet/ServerConfig.java 2010-06-26 06:39:38 UTC (rev 13626) @@ -57,7 +57,7 @@ import org.apache.log4j.Logger; /** - * Creates the new ServerCofiguration file(oviyam-config.xml). + * Creates the new ServerConfiguration file(oviyam-config.xml). * @author bharathi * @version 0.7 * @@ -82,6 +82,7 @@ String port = request.getParameter("port"); String wadoPort = request.getParameter("wadoPort"); String dcmProtocol = request.getParameter("dcmProtocol"); + String contextPath = request.getContextPath().replaceAll("/",""); try { // Initialize the ServerXmlConfiguration instance. ServerXmlConfiguration sxc = new ServerXmlConfiguration(); @@ -90,7 +91,7 @@ * wadoPort,dcmProtocol). It will create the new oviyam-config.xml * file with the given element values. */ - sxc.creatXml(aeTitle, hostName, port, wadoPort, dcmProtocol); + sxc.creatXml(aeTitle, hostName, port, wadoPort, dcmProtocol, contextPath); } catch (Exception e) { log.error("Unable to create oviyam-config.xml ",e); } Modified: oviyam/oviyam/trunk/web/WEB-INF/lib/json.jar =================================================================== (Binary files differ) Modified: oviyam/oviyam/trunk/web/css/oviyam7.css =================================================================== --- oviyam/oviyam/trunk/web/css/oviyam7.css 2010-06-25 23:02:37 UTC (rev 13625) +++ oviyam/oviyam/trunk/web/css/oviyam7.css 2010-06-26 06:39:38 UTC (rev 13626) @@ -549,8 +549,8 @@ #full_resolution { position: absolute; - left: 85%; - bottom: 80px; + left: 77%; + bottom: 70px; font-size: 13px; cursor: pointer; /* hand-shaped cursor */ background:#000000; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |