|
[HepData-svn] r1862 - in trunk: . hepdata-common hepdata-db hepdata-migration hepdata-model hepdata-webapp hepdata-webapp/src/main/java/cedar/hepdata/webapp/componentsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Jun 3 18:34:31 BST 2015
Author: watt Date: Wed Jun 3 18:34:31 2015 New Revision: 1862 Log: Further fixes to pom.xml files. Print out reackey and obskey values in HTML display. Look for insert.html in resource directory named after Inspire ID. Modified: trunk/hepdata-common/pom.xml trunk/hepdata-db/pom.xml trunk/hepdata-migration/pom.xml trunk/hepdata-model/pom.xml trunk/hepdata-webapp/pom.xml trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DisplayHtmlInsert.java trunk/pom.xml Modified: trunk/hepdata-common/pom.xml ============================================================================== --- trunk/hepdata-common/pom.xml Mon May 18 16:18:36 2015 (r1861) +++ trunk/hepdata-common/pom.xml Wed Jun 3 18:34:31 2015 (r1862) @@ -75,12 +75,14 @@ <id>Java.net</id> <url>http://download.java.net/maven/2</url> </repository> + <!-- <repository> <id>Maven Snapshots</id> <url>http://snapshots.maven.codehaus.org/maven2/</url> <snapshots><enabled>true</enabled></snapshots> <releases><enabled>false</enabled></releases> </repository> + --> <repository> <id>FreeHEP</id> <url>http://java.freehep.org/maven2</url> Modified: trunk/hepdata-db/pom.xml ============================================================================== --- trunk/hepdata-db/pom.xml Mon May 18 16:18:36 2015 (r1861) +++ trunk/hepdata-db/pom.xml Wed Jun 3 18:34:31 2015 (r1862) @@ -121,12 +121,14 @@ <id>Central</id> <url>http://repo1.maven.org/maven2</url> </repository> + <!-- <repository> <id>Maven Snapshots</id> <url>http://snapshots.maven.codehaus.org/maven2/</url> <snapshots><enabled>true</enabled></snapshots> <releases><enabled>false</enabled></releases> </repository> + --> <repository> <id>jboss</id> <url>http://repository.jboss.com/maven2</url> Modified: trunk/hepdata-migration/pom.xml ============================================================================== --- trunk/hepdata-migration/pom.xml Mon May 18 16:18:36 2015 (r1861) +++ trunk/hepdata-migration/pom.xml Wed Jun 3 18:34:31 2015 (r1862) @@ -115,6 +115,7 @@ <id>Default</id> <url>http://repo1.maven.org/maven2</url> </repository> + <!-- <repository> <id>Maven Snapshots</id> <url>http://snapshots.maven.codehaus.org/maven2/</url> @@ -126,6 +127,7 @@ <name>Maven Codehaus Snapshots</name> <url>http://maven.codehaus.org/maven2/</url> </repository> + --> <repository> <id>FreeHEP</id> <url>http://java.freehep.org/maven2</url> Modified: trunk/hepdata-model/pom.xml ============================================================================== --- trunk/hepdata-model/pom.xml Mon May 18 16:18:36 2015 (r1861) +++ trunk/hepdata-model/pom.xml Wed Jun 3 18:34:31 2015 (r1862) @@ -169,12 +169,14 @@ <id>Central</id> <url>http://repo1.maven.org/maven2</url> </repository> +<!-- <repository> <id>CodehausSnapshots</id> <url>http://snapshots.maven.codehaus.org/maven2/</url> <snapshots><enabled>true</enabled></snapshots> <releases><enabled>false</enabled></releases> </repository> +--> <!-- <repository> --> <!-- <id>FreeHEP</id> --> <!-- <url>http://java.freehep.org/maven2</url> --> Modified: trunk/hepdata-webapp/pom.xml ============================================================================== --- trunk/hepdata-webapp/pom.xml Mon May 18 16:18:36 2015 (r1861) +++ trunk/hepdata-webapp/pom.xml Wed Jun 3 18:34:31 2015 (r1862) @@ -42,7 +42,7 @@ <!-- <artifactId>jetty-maven-plugin</artifactId> --> <configuration> <!-- <contextPath>/h8test</contextPath> --> - <contextPath>/h8test</contextPath> + <contextPath>/h2test</contextPath> <!-- <scanIntervalSeconds>10</scanIntervalSeconds> --> <requestLog implementation="org.mortbay.jetty.NCSARequestLog"> <append>true</append> Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java Mon May 18 16:18:36 2015 (r1861) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java Wed Jun 3 18:34:31 2015 (r1862) @@ -69,6 +69,17 @@ } } + // G.W. 03/06/2015 Print out reackey and obskey values. + writer.element("div"); + writer.attributes("class", "permalinks"); + writer.attributes("title", "The reackey and obskey values used for searching the database"); + writer.write("reaction keywords: " + _dataset.getDsReactions()); + writer.element("br"); writer.end(); + writer.write("observable keywords: " + _dataset.getDsObservables()); + writer.element("br"); writer.end(); + writer.element("br"); writer.end(); + writer.end(); + // now try to deal with additional dataset errors... for (DatasetError de : _dataset.getErrors()){ writer.write("Additional systematic error: "); Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DisplayHtmlInsert.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DisplayHtmlInsert.java Mon May 18 16:18:36 2015 (r1861) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DisplayHtmlInsert.java Wed Jun 3 18:34:31 2015 (r1862) @@ -11,68 +11,84 @@ public class DisplayHtmlInsert { @BeginRender - void renderMessage(MarkupWriter writer) { + void renderMessage(MarkupWriter writer) { if(_paper != null){ Long irn = null; - if(_paper.getSpiresId() != null){ - irn = _paper.getSpiresId(); - } - else if(_paper.getRedId() != null){ + String directory = "/home/hepdata/resource/"; + String filename = ""; + Boolean isFile = false; + // G.W. 03/06/2015 Look for insert.html in directory + // named after InspireId, SpiresId, or RedId. + // Only first insert.html found will be displayed. + if (_paper.getInspireId() != null) { + irn = _paper.getInspireId(); + filename = directory + irn + "/insert.html"; + isFile = new File(filename).isFile(); + } + if (_paper.getSpiresId() != null && !isFile) { + irn = _paper.getSpiresId(); + filename = directory + irn + "/insert.html"; + isFile = new File(filename).isFile(); + } + if (_paper.getRedId() != null && !isFile) { irn = _paper.getRedId(); - } - else{ - irn = _paper.getHepdataId(); - } + filename = directory + irn + "/insert.html"; + isFile = new File(filename).isFile(); + } + // if (!isFile) { + // irn = _paper.getHepdataId(); + // filename = directory + irn + "/insert.html"; + // isFile = new File(filename).isFile(); + // } - String filename = "/home/hepdata/resource/" + irn + "/insert.html"; - //String filename = "/mt/home/watt/resource/" + irn + "/insert.html"; // for testing -// writer.write("Systematics from " + filename + " are:"); - try{ - BufferedReader in = new BufferedReader(new FileReader(filename)); - String line; - List <String> inlist = new ArrayList(); - int nlist = -1; - while((line = in.readLine()) != null) { - System.out.println("line: "+line); - String[] part = line.split(">"); - for(int i=0; i<part.length; i++){ - System.out.println("part[i]: "+part[i]); - String[] bits = part[i].split("<"); - for(int n=0; n<bits.length; n++){ - System.out.println("bits[n]: "+bits[n]); - if(bits[n].startsWith("table")) { writer.element(bits[n]); } - else if(bits[n].equals("table0")) { writer.element("table"); writer.attributes("border","0");} - else if(bits[n].equals("/table")){ writer.end(); } - else if(bits[n].equals("tr")){ writer.element("tr"); } - else if(bits[n].equals("/tr")) { writer.end(); } - else if(bits[n].startsWith("td")) { writer.element(bits[n]); } - else if(bits[n].equals("/td")){ writer.end(); } - //else if(bits[n].startsWith("td align")) { writer.element(bits[n]); } - else if(bits[n].startsWith("th")) { writer.element(bits[n]); } - //else if(bits[n].startsWith("th align")) { writer.element(bits[n]); } - else if(bits[n].equals("/th")) { writer.end(); } - else if(bits[n].equals("br")) { writer.element("br"); } - else if(bits[n].equals("/br")) { writer.end(); } - else if(bits[n].equals("br/")) { writer.element("br"); writer.end();} - else if(bits[n].equals("p")) { writer.element("p"); } - else if(bits[n].equals("/p")) { writer.end(); } - else if(bits[n].equals("b")) { writer.element("b"); } - else if(bits[n].equals("/b")) { writer.end(); } - else if(bits[n].equals("p/")) { writer.element("p"); writer.end();} - else if(bits[n].startsWith("a href")) { writer.element(bits[n]); } - else if(bits[n].equals("/a")) { writer.end(); } - else if(bits[n].startsWith("img")) { writer.element(bits[n]); writer.end(); } - else{ writer.write(bits[n]);} - } - } - } // end while - } // end try - catch (IOException e) { - // Handle FileNotFoundException here.... - } // end catch + if (isFile) { + try{ + BufferedReader in = new BufferedReader(new FileReader(filename)); + String line; + List <String> inlist = new ArrayList(); + int nlist = -1; + while((line = in.readLine()) != null) { + System.out.println("line: "+line); + String[] part = line.split(">"); + for(int i=0; i<part.length; i++){ + System.out.println("part[i]: "+part[i]); + String[] bits = part[i].split("<"); + for(int n=0; n<bits.length; n++){ + System.out.println("bits[n]: "+bits[n]); + if(bits[n].startsWith("table")) { writer.element(bits[n]); } + else if(bits[n].equals("table0")) { writer.element("table"); writer.attributes("border","0");} + else if(bits[n].equals("/table")){ writer.end(); } + else if(bits[n].equals("tr")){ writer.element("tr"); } + else if(bits[n].equals("/tr")) { writer.end(); } + else if(bits[n].startsWith("td")) { writer.element(bits[n]); } + else if(bits[n].equals("/td")){ writer.end(); } + //else if(bits[n].startsWith("td align")) { writer.element(bits[n]); } + else if(bits[n].startsWith("th")) { writer.element(bits[n]); } + //else if(bits[n].startsWith("th align")) { writer.element(bits[n]); } + else if(bits[n].equals("/th")) { writer.end(); } + else if(bits[n].equals("br")) { writer.element("br"); } + else if(bits[n].equals("/br")) { writer.end(); } + else if(bits[n].equals("br/")) { writer.element("br"); writer.end();} + else if(bits[n].equals("p")) { writer.element("p"); } + else if(bits[n].equals("/p")) { writer.end(); } + else if(bits[n].equals("b")) { writer.element("b"); } + else if(bits[n].equals("/b")) { writer.end(); } + else if(bits[n].equals("p/")) { writer.element("p"); writer.end();} + else if(bits[n].startsWith("a href")) { writer.element(bits[n]); } + else if(bits[n].equals("/a")) { writer.end(); } + else if(bits[n].startsWith("img")) { writer.element(bits[n]); writer.end(); } + else{ writer.write(bits[n]);} + } + } + } // end while + } // end try + catch (IOException e) { + // Handle FileNotFoundException here.... + } // end catch + } // if(isFile.... } // if(_paper.... } //end rendermassage... @Parameter(name="p") - private Paper _paper; + private Paper _paper; } // end public class Modified: trunk/pom.xml ============================================================================== --- trunk/pom.xml Mon May 18 16:18:36 2015 (r1861) +++ trunk/pom.xml Wed Jun 3 18:34:31 2015 (r1862) @@ -27,12 +27,14 @@ <id>Hibernate</id> <url>http://repository.jboss.org/maven2</url> </repository> + <!-- <repository> <id>Maven Snapshots</id> <url>http://snapshots.maven.codehaus.org/maven2/</url> <snapshots><enabled>true</enabled></snapshots> <releases><enabled>false</enabled></releases> </repository> + --> <repository> <id>FreeHEP</id> <url>http://java.freehep.org/maven2</url>
More information about the HepData-svn mailing list |