|
[HepData-svn] r1501 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pagesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgThu Dec 15 17:14:02 GMT 2011
Author: whalley Date: Thu Dec 15 17:14:01 2011 New Revision: 1501 Log: add the Inspire id to the rivet search Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java Thu Dec 15 16:26:53 2011 (r1500) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java Thu Dec 15 17:14:01 2011 (r1501) @@ -270,24 +270,36 @@ } public boolean getHaveRivet(){ - if(_paper.getSpiresId() != null){ - String filename = "/home/whalley/rivet/" + _paper.getSpiresId(); - File f = new File(filename); - return f.exists(); - } - else{ - return false; + boolean rtn = false; + if (_paper.getInspireId() != null){ + File fi = new File("/home/whalley/rivet/" + _paper.getInspireId()); + if(fi.exists()) { rtn = true; } } + if (_paper.getSpiresId() != null){ + File fs = new File("/home/whalley/rivet/" + _paper.getSpiresId()); + if(fs.exists()) { rtn = true; } + } + return rtn; } public String getRivetName(){ String str=""; - String filename = "/home/whalley/rivet/" + _paper.getSpiresId(); - try { - BufferedReader in = new BufferedReader(new FileReader(filename)); - String line; - while((line=in.readLine()) != null) {str=line;} - } catch (IOException e) {} + if(_paper.getInspireId() != null){ + String filename = "/home/whalley/rivet/" + _paper.getInspireId(); + try { + BufferedReader in = new BufferedReader(new FileReader(filename)); + String line; + while((line=in.readLine()) != null) {str=line;} + } catch (IOException e) {} + } + if(_paper.getSpiresId() != null){ + String filename = "/home/whalley/rivet/" + _paper.getSpiresId(); + try { + BufferedReader in = new BufferedReader(new FileReader(filename)); + String line; + while((line=in.readLine()) != null) {str=line;} + } catch (IOException e) {} + } return str; }
More information about the HepData-svn mailing list |