[HepData-svn] r1455 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Jun 30 15:11:51 BST 2011


Author: whalley
Date: Thu Jun 30 15:11:50 2011
New Revision: 1455

Log:
tweaks to allow extra links with both IRN and RED numbers

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java

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 May 17 15:18:33 2011	(r1454)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/View.java	Thu Jun 30 15:11:50 2011	(r1455)
@@ -16,6 +16,7 @@
 import org.hibernate.*;
 import org.hibernate.criterion.*;
 import java.util.*;
+import java.io.*;
 import java.util.regex.*;
 import java.io.File;
 
@@ -237,11 +238,40 @@
         return getLongFormat();
     }
 
-    public boolean getHaveExtra() {
+    public boolean getHaveExtraIRN() {
         String filename = "/home/whalley/resource/" + getPaper().getSpiresId() + "/index.html";
-        System.out.println("\n" + filename + "\n");
         File testfile = new File(filename);
         return testfile.exists();
     }
+    
+    public boolean getHaveExtraRED() {
+        String filename = "/home/whalley/resource/" + getPaper().getRedId() + "/index.shtml";
+        File testfile = new File(filename);
+        return testfile.exists();
+    }
+    public String getShowExtraIRNDesc() {
+        String filename = "/home/whalley/resource/" + getPaper().getSpiresId() + "/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 getShowExtraREDDesc() {
+        String filename = "/home/whalley/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){}
+        }
+        return line;
+    }
 
 }


More information about the HepData-svn mailing list