|
[HepData-svn] r1509 - in trunk/hepdata-webapp/src/main: java/cedar/hepdata/webapp/pages resources/cedar/hepdata/webapp/pagesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgThu Feb 9 14:15:17 GMT 2012
Author: whalley Date: Thu Feb 9 14:15:17 2012 New Revision: 1509 Log: add more functionality for extra resource data Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java Fri Feb 3 10:57:34 2012 (r1508) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java Thu Feb 9 14:15:17 2012 (r1509) @@ -244,11 +244,37 @@ return testfile.exists(); } + public boolean getHaveExtraIRNDesc() { + File testfile = new File("/home/whalley/resource/" + getPaper().getSpiresId() + "/description"); + return testfile.exists(); + } + public boolean getHaveExtraIRNDesc1() { + File testfile = new File("/home/whalley/resource/" + getPaper().getSpiresId() + "/description1"); + return testfile.exists(); + } + public boolean getHaveExtraIRNDesc2() { + File testfile = new File("/home/whalley/resource/" + getPaper().getSpiresId() + "/description2"); + return testfile.exists(); + } + public boolean getHaveExtraRED() { String filename = "/home/whalley/resource/" + getPaper().getRedId() + "/index.shtml"; File testfile = new File(filename); return testfile.exists(); } + public boolean getHaveExtraREDdesc() { + File testfile = new File("/home/whalley/resource/" + getPaper().getRedId() + "/description"); + return testfile.exists(); + } + public boolean getHaveExtraREDdesc1() { + File testfile = new File("/home/whalley/resource/" + getPaper().getRedId() + "/description1"); + return testfile.exists(); + } + public boolean getHaveExtraREDdesc2() { + File testfile = new File("/home/whalley/resource/" + getPaper().getRedId() + "/description2"); + return testfile.exists(); + } + public String getShowExtraIRNDesc() { String filename = "/home/whalley/resource/" + getPaper().getSpiresId() + "/description"; File testfile = new File(filename); @@ -261,6 +287,30 @@ } return line; } + public String getShowExtraIRNDesc1() { + String filename = "/home/whalley/resource/" + getPaper().getSpiresId() + "/description1"; + File testfile = new File(filename); + String line = ""; + if(testfile.exists()){ + try { + BufferedReader in = new BufferedReader(new FileReader(filename)); + line = in.readLine(); + } catch (IOException e){} + } + return line; + } + public String getShowExtraIRNDesc2() { + String filename = "/home/whalley/resource/" + getPaper().getSpiresId() + "/description2"; + File testfile = new File(filename); + String line = ""; + if(testfile.exists()){ + try { + BufferedReader in = new BufferedReader(new FileReader(filename)); + line = in.readLine(); + } catch (IOException e){} + } + return line; + } public String getShowExtraREDDesc() { String filename = "/home/whalley/resource/" + getPaper().getRedId() + "/description"; File testfile = new File(filename); @@ -273,5 +323,29 @@ } return line; } + public String getShowExtraREDDesc1() { + String filename = "/home/whalley/resource/" + getPaper().getRedId() + "/description1"; + File testfile = new File(filename); + String line = ""; + if(testfile.exists()){ + try { + BufferedReader in = new BufferedReader(new FileReader(filename)); + line = in.readLine(); + } catch (IOException e){} + } + return line; + } + public String getShowExtraREDDesc2() { + String filename = "/home/whalley/resource/" + getPaper().getRedId() + "/description2"; + File testfile = new File(filename); + String line = ""; + if(testfile.exists()){ + try { + BufferedReader in = new BufferedReader(new FileReader(filename)); + line = in.readLine(); + } catch (IOException e){} + } + return line; + } } Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml ============================================================================== --- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml Fri Feb 3 10:57:34 2012 (r1508) +++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml Thu Feb 9 14:15:17 2012 (r1509) @@ -102,12 +102,19 @@ </div> <div class="extradata"> - <t:if test="haveExtraIRN"> + <t:if test="haveExtraIRNDesc1"> + <a href="${showExtraIRNDesc1}">${showExtraIRNDesc2}</a> + </t:if> + <t:if test="haveExtraIRNDesc"> + <br/> <a href="/resource/${paper.spiresId}/index.shtml">${showExtraIRNDesc}</a> </t:if> - - <t:if test="haveExtraRED"> - <br/> + + <t:if test="haveExtraREDDesc1"> + <a href="${showExtraREDDesc1}">${showExtraREDDesc2}</a> + </t:if> + <t:if test="haveExtraREDDesc"> + <br/> <a href="/resource/${paper.redId}/index.shtml">${showExtraREDDesc}</a> </t:if> </div>
More information about the HepData-svn mailing list |