[HepData-svn] r1750 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Feb 25 12:41:06 GMT 2014


Author: watt
Date: Tue Feb 25 12:41:06 2014
New Revision: 1750

Log:
Display DOI and correct dserror in InputFormatter.java

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java	Tue Feb 25 10:13:50 2014	(r1749)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java	Tue Feb 25 12:41:06 2014	(r1750)
@@ -33,12 +33,16 @@
         if(p.getRedId() != null) { s.append(" redId='" + p.getRedId() + "'"); }
         else { s.append(" RedId=''"); }
         s.append(" preprintDate=''>\n");
-        s.append("      <title>\n");
-        s.append("        " + p.getTitle() + "\n");
-        s.append("      </title>\n");
-        s.append("      <doi>\n");
-        s.append("        " + p.getDOI() + "\n");
-        s.append("      </doi>\n");
+	if(p.getTitle()!=null) {
+	    s.append("      <title>\n");
+	    s.append("        " + p.getTitle() + "\n");
+	    s.append("      </title>\n");
+	}
+	if (p.getDOI() != null) {
+	    s.append("      <doi>\n");
+	    s.append("        " + p.getDOI() + "\n");
+	    s.append("      </doi>\n");
+	}
         
         for (Modification mod : p.getModifications()){
             s.append("      <modification who='" + mod.getModifier() + "' when='" + mod.getComment() + "' />\n");

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java	Tue Feb 25 10:13:50 2014	(r1749)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java	Tue Feb 25 12:41:06 2014	(r1750)
@@ -22,6 +22,10 @@
         for (Reference ref : p.getReferences()){
             s.append("*reference: "+ref.getDescription()+" : "+ref.getDate()+"\n");
         }
+	
+	if (p.getDOI() != null) {
+	    s.append("*doi: "+p.getDOI()+"\n");
+	}
 
         for (Modification mod : p.getModifications()){
             s.append("*status: Encoded "+mod.getComment()+" by "+mod.getModifier()+"\n");
@@ -66,11 +70,17 @@
                 s.append("*plabkey: "+plab+"\n");
             }
         
+            // for (DatasetError de : ds.getErrors()){
+            //     s.append("*Error: " + de.getPlus());
+            //     if(de.getNormType().toSymbol().equals("%")){s.append(" PCT");}
+            //     s.append(";\n");
+            //     s.append("ErrorComment: " + de.getComment() + ";\n");
+            // }
             for (DatasetError de : ds.getErrors()){
-                s.append("*Error: " + de.getPlus());
+                s.append("*dserror: " + de.getPlus());
                 if(de.getNormType().toSymbol().equals("%")){s.append(" PCT");}
-                s.append(";\n");
-                s.append("ErrorComment: " + de.getComment() + ";\n");
+                s.append(" : " + de.getComment());
+		s.append("\n");
             }
        
 


More information about the HepData-svn mailing list