[HepData-svn] r1823 - in trunk/hepdata-webapp/src/main: java/cedar/hepdata/webapp/pages resources/cedar/hepdata/webapp/pages

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Oct 21 19:11:24 BST 2014


Author: watt
Date: Tue Oct 21 19:11:24 2014
New Revision: 1823

Log:
Allow files in resource area to be stored in directory named after Inspire number

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java
   trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/SubmittingData.tml
   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	Tue Oct 21 18:51:58 2014	(r1822)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java	Tue Oct 21 19:11:24 2014	(r1823)
@@ -30,7 +30,7 @@
     // private org.hibernate.Session _session;
 
     @InjectPage
-    private SavePlot saveplot;
+	private SavePlot saveplot;
 
     // Decode URL context into the params map
     public StreamResponse onActivate(EventContext context) {
@@ -303,6 +303,33 @@
         File testfile = new File("/home/hepdata/resource/" + getPaper().getSpiresId() + "/description4");
         return testfile.exists();
     }
+
+    public boolean getHaveExtraINS() {
+        String filename = "/home/hepdata/resource/" + getPaper().getInspireId() + "/index.html";
+        File testfile = new File(filename);
+        return testfile.exists();
+    }
+    
+    public boolean getHaveExtraINSDesc() {
+        File testfile = new File("/home/hepdata/resource/" + getPaper().getInspireId() + "/description");
+        return testfile.exists();
+    }
+    public boolean getHaveExtraINSDesc1() {
+        File testfile = new File("/home/hepdata/resource/" + getPaper().getInspireId() + "/description1");
+        return testfile.exists();
+    }
+    public boolean getHaveExtraINSDesc2() {
+        File testfile = new File("/home/hepdata/resource/" + getPaper().getInspireId() + "/description2");
+        return testfile.exists();
+    }
+    public boolean getHaveExtraINSDesc3() {
+        File testfile = new File("/home/hepdata/resource/" + getPaper().getInspireId() + "/description3");
+        return testfile.exists();
+    }
+    public boolean getHaveExtraINSDesc4() {
+        File testfile = new File("/home/hepdata/resource/" + getPaper().getInspireId() + "/description4");
+        return testfile.exists();
+    }
     
     public boolean getHaveExtraRED() {
         String filename = "/home/hepdata/resource/" + getPaper().getRedId() + "/index.shtml";
@@ -336,9 +363,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -348,9 +375,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -360,9 +387,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -372,9 +399,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -384,21 +411,21 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
-     public String getShowExtraIRNDesc3() {
+    public String getShowExtraIRNDesc3() {
         String filename = "/home/hepdata/resource/" + getPaper().getSpiresId() + "/description3";
         File testfile = new File(filename);
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -408,21 +435,21 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
-     public String getShowExtraIRNDesc4() {
+    public String getShowExtraIRNDesc4() {
         String filename = "/home/hepdata/resource/" + getPaper().getSpiresId() + "/description4";
         File testfile = new File(filename);
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -432,21 +459,129 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
+        }
+        return line;
+    }
+    public String getShowExtraINSDesc() {
+        String filename = "/home/hepdata/resource/" + getPaper().getInspireId() + "/description";
+        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 getShowExtraINSDesc1() {
+        String filename = "/home/hepdata/resource/" + getPaper().getInspireId() + "/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 getShowExtraINSLink1() {
+        String filename = "/home/hepdata/resource/" + getPaper().getInspireId() + "/link1";
+        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 getShowExtraINSDesc2() {
+        String filename = "/home/hepdata/resource/" + getPaper().getInspireId() + "/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 getShowExtraINSLink2() {
+        String filename = "/home/hepdata/resource/" + getPaper().getInspireId() + "/link2";
+        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 getShowExtraINSDesc3() {
+        String filename = "/home/hepdata/resource/" + getPaper().getInspireId() + "/description3";
+        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 getShowExtraINSLink3() {
+        String filename = "/home/hepdata/resource/" + getPaper().getInspireId() + "/link3";
+        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 getShowExtraINSDesc4() {
+        String filename = "/home/hepdata/resource/" + getPaper().getInspireId() + "/description4";
+        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 getShowExtraINSLink4() {
+        String filename = "/home/hepdata/resource/" + getPaper().getInspireId() + "/link4";
+        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() {
+    public String getShowExtraREDDesc() {
         String filename = "/home/hepdata/resource/" + getPaper().getRedId() + "/description";
         File testfile = new File(filename);
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -456,9 +591,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -468,9 +603,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -480,9 +615,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -492,9 +627,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -504,9 +639,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -516,9 +651,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -528,9 +663,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		BufferedReader in = new BufferedReader(new FileReader(filename));
+		line = in.readLine();
+	    } catch (IOException e){}
         }
         return line;
     }
@@ -540,9 +675,9 @@
         String line = "";
         if(testfile.exists()){
             try {
-               BufferedReader in = new BufferedReader(new FileReader(filename));
-               line = in.readLine();
-               } catch (IOException e){}
+		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/SubmittingData.tml
==============================================================================
--- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/SubmittingData.tml	Tue Oct 21 18:51:58 2014	(r1822)
+++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/SubmittingData.tml	Tue Oct 21 19:11:24 2014	(r1823)
@@ -17,7 +17,7 @@
 <p/>
 Generally we require only a flat file containing the numerical values.  Postscript and pdf figures are not suitable.  However, supplementary files of any format (.ps, .pdf, .root, .C, .slha, etc.) can be placed in a web directory linked from the main HepData record.
 <p/>
-Any text files you send us will be processed into a standard format, which can be seen from the "input" link on any of the existing records.  Data submissions provided in text formats closer to the "input" format (<i>not</i> the "plain text" format) can therefore be entered more quickly into the database.  You can start by looking at the "input" file for an existing record that is similar to your submitted data.  An annotated <a href="http://hepdata.cedar.ac.uk/resource/sample.input">sample input file</a> is available, as is a <a href="http://hepdata.cedar.ac.uk/resource/6150.pl">Perl script</a> or <a href="http://hepdata.cedar.ac.uk/resource/6150.py">Python script</a> used to produce the "input" file from the <a href="http://hepdata.cedar.ac.uk/resource/zz.txt">original submission</a>.  Some nomenclature that is still used in practice is defined in the historical 1970s <a href="http://hepdata.cedar.ac.uk/resource/EncodingManual.pdf">encoding manual</a> (14 MB).  It is useful to pro
 vide key metadata for each table such as a caption, the process being considered (initial-state and final-state particles), important kinematic cuts, and headers for the x and y columns specifying the quantity with units.  Multiple x and y values can be given in the same row separated by semicolons and non-existent entries can be indicated by dashes "-".  Numerical values should be given with an appropriate and not excessive number of significant figures (in general, a maximum of 4), avoiding giving more decimal places for the errors than the central values.  An <a href="http://hepdata.cedar.ac.uk/resource-cgi/input">online form</a> is available to test data input.  Click on "Browse..." to select your input file, followed by "Upload" and "Process", then click "Display" for the first 10 tables, or "All" for the whole record.  Please note that this <a href="http://hepdata.cedar.ac.uk/resource-cgi/input">online form</a> is only for testing purposes, and the final submittal to HepData m
 ust still be done by email to hepdata(at)projects.hepforge.org.
+Any text files you send us will be processed into a standard format, which can be seen from the "input" link on any of the existing records.  Data submissions provided in text formats closer to the "input" format (<i>not</i> the "plain text" format) can therefore be entered more quickly into the database.  You can start by looking at the "input" file for an existing record that is similar to your submitted data.  An annotated <a href="http://hepdata.cedar.ac.uk/resource/sample.input">sample input file</a> is available, as is a <a href="http://hepdata.cedar.ac.uk/resource/6150.pl">Perl script</a> or <a href="http://hepdata.cedar.ac.uk/resource/6150.py">Python script</a> used to produce the "input" file from the <a href="http://hepdata.cedar.ac.uk/resource/zz.txt">original submission</a>.  Some nomenclature that is still used in practice is defined in the historical 1970s <a href="http://hepdata.cedar.ac.uk/resource/EncodingManual.pdf">encoding manual</a> (14 MB).  It is useful to pro
 vide key metadata for each table such as a caption, the process being considered (initial-state and final-state particles), important kinematic cuts, and headers for the x and y columns specifying the quantity with units.  Multiple x and y values can be given in the same row separated by semicolons and non-existent entries can be indicated by dashes "-".  Numerical values should be given with an appropriate and not excessive number of significant figures (in general, a maximum of 4), avoiding giving more decimal places for the errors than the central values.  An <a href="http://hepdata.cedar.ac.uk/input">online form</a> is available to test data input.  Click on "Browse..." to select your input file, followed by "Upload" and "Process", then click "Display" for the first 10 tables, or "All" for the whole record.  Please note that this <a href="http://hepdata.cedar.ac.uk/input">online form</a> is only for testing purposes, and the final submittal to HepData must still be done by email
  to hepdata(at)projects.hepforge.org.
 <p/>
 A Python <a href="http://hepdata.cedar.ac.uk/resource/hepconverter.py">script</a> has been written by Mike Flowerdew (ATLAS) to convert objects in .root files to the HepData "input" format.  A test .root file can be made with another Python <a href="http://hepdata.cedar.ac.uk/resource/MakeTestFile.py">script</a> and some brief usage <a href="http://hepdata.cedar.ac.uk/resource/hepconverternotes.txt">notes</a> are provided.
 <p/>

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	Tue Oct 21 18:51:58 2014	(r1822)
+++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml	Tue Oct 21 19:11:24 2014	(r1823)
@@ -213,6 +213,18 @@
       <t:if test="haveExtraIRNDesc4">
           <br/><a href="${showExtraIRNLink4}">${showExtraIRNDesc4}</a>
       </t:if>  
+      <t:if test="haveExtraINSDesc1">
+          <a href="${showExtraINSLink1}">${showExtraINSDesc1}</a>
+      </t:if>  
+      <t:if test="haveExtraINSDesc2">
+          <br/><a href="${showExtraINSLink2}">${showExtraINSDesc2}</a>
+      </t:if>  
+      <t:if test="haveExtraINSDesc3">
+         <br/> <a href="${showExtraINSLink3}">${showExtraINSDesc3}</a>
+      </t:if>  
+      <t:if test="haveExtraINSDesc4">
+          <br/><a href="${showExtraINSLink4}">${showExtraINSDesc4}</a>
+      </t:if>  
       <t:if test="haveExtraREDDesc1">
           <br/>
           <a href="${showExtraREDLink1}">${showExtraREDDesc1}</a>
@@ -233,7 +245,10 @@
           <br/>
           <a href="/resource/${paper.spiresId}/index.shtml">${showExtraIRNDesc}</a> 
       </t:if>
-     
+      <t:if test="haveExtraINSDesc">
+          <br/>
+          <a href="/resource/${paper.inspireId}/index.shtml">${showExtraINSDesc}</a> 
+      </t:if>     
       <t:if test="haveExtraREDDesc">
       <br/>
           <a href="/resource/${paper.redId}/index.shtml">${showExtraREDDesc}</a> 
@@ -317,6 +332,11 @@
                   <img src="http://hepdata.cedar.ac.uk/resource/${paper.spiresId}/thumb_fig${dataset.FigureString}.png"/>
                   </a>
                   </t:if>
+                  <t:if test="dataset.haveFigureINS">
+                  <a href="http://hepdata.cedar.ac.uk/resource/${paper.inspireId}/fig${dataset.FigureString}.png">
+                  <img src="http://hepdata.cedar.ac.uk/resource/${paper.inspireId}/thumb_fig${dataset.FigureString}.png"/>
+                  </a>
+                  </t:if>		  
                   <t:if test="dataset.haveFigureRED">
                   <a href="http://hepdata.cedar.ac.uk/resource/${paper.redId}/fig${dataset.FigureString}.png">
                   <img src="http://hepdata.cedar.ac.uk/resource/${paper.redId}/thumb_fig${dataset.FigureString}.png"/>


More information about the HepData-svn mailing list