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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Feb 25 10:13:50 GMT 2014


Author: watt
Date: Tue Feb 25 10:13:50 2014
New Revision: 1749

Log:
Add cdsId and remove tabs from InputFormatter.java

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java
   trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/SubmittingData.tml

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 18 11:01:27 2014	(r1748)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/InputFormatter.java	Tue Feb 25 10:13:50 2014	(r1749)
@@ -17,29 +17,30 @@
     public static String format(Paper p) {
         if(p == null) return null;
 	    StringBuffer s = new StringBuffer();
-	    s.append("*author:\t" + p.getAuthors().first() + "\n");
+	    s.append("*author: " + p.getAuthors().first() + "\n");
 
         for (Reference ref : p.getReferences()){
-            s.append("*reference:\t"+ref.getDescription()+":"+ref.getDate()+"\n");
+            s.append("*reference: "+ref.getDescription()+" : "+ref.getDate()+"\n");
         }
 
         for (Modification mod : p.getModifications()){
-            s.append("*status:\tEncoded "+mod.getComment()+" by "+mod.getModifier()+"\n");
+            s.append("*status: Encoded "+mod.getComment()+" by "+mod.getModifier()+"\n");
         }
 
         for (Experiment exp : p.getExperiments()){
-            s.append("*experiment:\t"+exp.getName()+"\n");
-            s.append("*detector:\t"+exp.getInformalName()+"\n");
+            s.append("*experiment: "+exp.getName()+"\n");
+            s.append("*detector: "+exp.getInformalName()+"\n");
         }
-        if(p.getSpiresId()!=null) s.append("*spiresId:\t" + p.getSpiresId() + "\n");
-        if(p.getInspireId()!=null) s.append("*inspireId:\t" + p.getInspireId() + "\n");
-        if(p.getRedId()!=null) s.append("*durhamId:\t" + p.getRedId() + "\n");
+        if(p.getSpiresId()!=null) s.append("*spiresId: " + p.getSpiresId() + "\n");
+        if(p.getInspireId()!=null) s.append("*inspireId: " + p.getInspireId() + "\n");
+	if(p.getCdsId()!=null) s.append("*cdsId: " + p.getCdsId() + "\n");
+        if(p.getRedId()!=null) s.append("*durhamId: " + p.getRedId() + "\n");
 
         if(p.getTitle()!=null) {
-           s.append("*title:\t\t"+p.getTitle()+"\n");
+           s.append("*title: "+p.getTitle()+"\n");
         }
         for (String comment : p.getComments()){
-            s.append("*comment:\t"+comment+"\n");
+            s.append("*comment: "+comment+"\n");
         }
 
 
@@ -48,28 +49,28 @@
         
             s.append("\n*dataset:"+"\n");
             if(ds.getTfpString() != null){ 
-                s.append(ds.getTfpString().replace("TFP = L","*l").replace(";","").replace(": ",":\t") + "\n"); 
+                s.append(ds.getTfpString().replace("TFP = L","*l").replace(";","").replace(": ",": ") + "\n"); 
             }
             for (String comment : ds.getComments()){
                 if(!comment.startsWith("Location")){
-                    s.append("*dscomment:\t"+comment+"\n");
+                    s.append("*dscomment: "+comment+"\n");
                 }    
             }
             for (String re : ds.getDsReactions()){
-                s.append("*reackey:\t"+re+"\n");
+                s.append("*reackey: "+re+"\n");
             }
             for (String obs : ds.getDsObservables()){
-                s.append("*obskey:\t"+obs+"\n");
+                s.append("*obskey: "+obs+"\n");
             }
             for (String plab : ds.getDsPlabs()){
-                s.append("*plabkey:\t"+plab+"\n");
+                s.append("*plabkey: "+plab+"\n");
             }
         
             for (DatasetError de : ds.getErrors()){
-                s.append("*Error:\t" + de.getPlus());
+                s.append("*Error: " + de.getPlus());
                 if(de.getNormType().toSymbol().equals("%")){s.append(" PCT");}
                 s.append(";\n");
-                s.append("ErrorComment:\t" + de.getComment() + ";\n");
+                s.append("ErrorComment: " + de.getComment() + ";\n");
             }
        
 
@@ -89,7 +90,7 @@
                 
                
                 for (Property prop : ds.getProperties()){
-                    s.append("*dsqual:\t"+prop.getName()+" :");
+                    s.append("*dsqual: "+prop.getName()+" :");
                     if(prop.getLowValue().equals(prop.getHighValue())){
                         s.append(" "+prop.getLowValue());  
                     } else{
@@ -109,7 +110,7 @@
                     String yheader = "";
                     if(yax.getHeader() != null){ 
                         yheader = yax.getHeader(); 
-                        storelist.add("*yheader:\t" + yheader);
+                        storelist.add("*yheader: " + yheader);
                         nyhead=1;
                     }
                 
@@ -118,7 +119,7 @@
                      	StringBuffer tempbuff = new StringBuffer();
                         String left = comm.split("\\s*:\\s*")[0];
                         String right = comm.split("\\s*:\\s*")[1];
-                        tempbuff.append("*qual:\t\t" + left + " : " + right);
+                        tempbuff.append("*qual: " + left + " : " + right);
                         storelist.add(tempbuff.toString());
                        } else{
                            nycomm =- 1;
@@ -127,7 +128,7 @@
                     for (Property prop : yax.getProperties()){
                         if(!prop.getName().startsWith("sqrts")){
                      	    StringBuffer tempbuff = new StringBuffer();
-                            tempbuff.append("*qual:\t\t" + prop.getName().trim());
+                            tempbuff.append("*qual: " + prop.getName().trim());
                             if(!prop.getUnit().toString().equals("num")) { tempbuff.append(" IN " + prop.getUnit().toString().toUpperCase()); } 
                             if(prop.getLowValue().equals(prop.getHighValue())){
                                 tempbuff.append(" : " + prop.getLowValue());
@@ -167,7 +168,7 @@
                              
                 s.append("*xheader");
                 for(XAxis xax : ds.getXAxes()){
-                    s.append(":\t" + xax.getHeader() + " ");
+                    s.append(": " + xax.getHeader() + " ");
                 }
                 s.append("\n");
                 s.append("*data");

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java	Tue Feb 18 11:01:27 2014	(r1748)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/PlainFormatter.java	Tue Feb 25 10:13:50 2014	(r1749)
@@ -171,7 +171,7 @@
                 s.append("\n");
             }
 
-            s.append("x: " + x.getHeader() + "\n");
+            s.append("x : " + x.getHeader() + "\n");
             for (int ix=1; ix<x.getDataset().getXAxes().size(); ix++){
                 s.append("x" + Integer.toString(ix+1) + ": " + x.getDataset().getXAxis(ix+1).getHeader() + "\n");
             } 

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 Feb 18 11:01:27 2014	(r1748)
+++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/SubmittingData.tml	Tue Feb 25 10:13:50 2014	(r1749)
@@ -31,7 +31,7 @@
 <p/> You can also include other things like
 <b>xfocus</b> (mean of the distribution within the bin); just specify the column definitions when submitting the data.
 <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 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.  It is useful to provide 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.  Numerical values should be given with an appropriate (not excessive) number of significant figures, avoiding, for example, 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 must still be done by <a href='mailto:hepdata at projects.hepforge.org'>email</a>.
+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 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.  It is useful to provide 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://hepda
 ta.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 must still be done by <a href='mailto:hepdata at projects.hepforge.org'>email</a>.
 </td>
 </tr>
 </table>


More information about the HepData-svn mailing list