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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Apr 14 16:33:44 BST 2014


Author: whalley
Date: Mon Apr 14 16:33:44 2014
New Revision: 1777

Log:
updating DoiData output

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

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/DoiData.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/DoiData.java	Mon Apr 14 16:32:59 2014	(r1776)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/DoiData.java	Mon Apr 14 16:33:44 2014	(r1777)
@@ -60,12 +60,13 @@
         if (fmt != null) {
             if (fmt.equals("scavis.py")) return asJhepwork();
             if (fmt.equals("hepml")) return asHepML();
+            if (fmt.equals("marcxml")) return asMarcXML();
             if (fmt.equals("bdms")) return asBDMS();
             if (fmt.equals("input")) return asINPUT();
             if (fmt.equals("plain.txt")) return asPlain();
             if (fmt.equals("aida")) return asAIDA(stype);
             if (fmt.equals("pyroot.py")) return asPyROOT();
-            if (fmt.equals("yoda")) return asYODA();
+            if (fmt.equals("yoda")) return asYODA(stype);
             if (fmt.equals("root")) return asROOT();
             if (fmt.equals("mpl")) return asMatplotlib();
             //if (fmt.equals("gnuplot")) return asPlain();
@@ -115,6 +116,18 @@
         return new TextStreamResponse("text/plain", asHepML);
     }
 
+    public Object getMarcXMLContext() {
+        return formatContext("marcxml");
+    }
+    public StreamResponse asMarcXML() {
+        Paper p = getPaper();
+        String asMarcXML = MarcXMLFormatter.format(p);
+        if (asMarcXML == null) {
+            asMarcXML = "No valid paper specified";
+        }
+        return new TextStreamResponse("text/xml", asMarcXML);
+    }
+
     public Object getBdmsContext() {
         return formatContext("bdms");
     }
@@ -156,9 +169,9 @@
     public Object getYodaContext() {
         return formatContext("yoda");
     }
-    public StreamResponse asYODA() {
+    public StreamResponse asYODA(String stype) {
         Set<Dataset> ds = getDatasets();
-        String asYODA = YodaFormatter.format(ds);
+        String asYODA = YodaFormatter.format(ds,stype);
         if (asYODA == null) {
             asYODA = "No valid paper and dataset specified";
         }


More information about the HepData-svn mailing list