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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Apr 15 14:16:03 BST 2014


Author: whalley
Date: Tue Apr 15 14:16:02 2014
New Revision: 1781

Log:
making doi recognitiohn more general

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

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java	Tue Apr 15 13:07:03 2014	(r1780)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java	Tue Apr 15 14:16:02 2014	(r1781)
@@ -128,14 +128,16 @@
                 _params.put("cds", m.group(1));
                 continue;
             }
-            m = Pattern.compile("\\A" + "10.1016" + "\\Z").matcher(ps);
+            m = Pattern.compile("\\A" + "10.1" + "(\\d+)\\Z").matcher(ps);
             if (m.matches()) {
-                 String doi2=context.get(String.class, i+1);
-                 String doi3="10.1016/"+doi2;
-                _params.put("doi",doi3);
+                String doi="";
+                for (int ii=i; ii<context.getCount(); ii++){ 
+                    if(ii>i) { doi +=  "/"; }
+                    doi +=  context.get(String.class, ii);
+                   _params.put("doi",doi);
+                 }
                 continue;
             }
-
             m = Pattern.compile("\\A" + "red" + "(-?\\d+)\\Z").matcher(ps);
             if (m.matches()) {
                 _params.put("red", m.group(1));
@@ -145,6 +147,7 @@
             m = Pattern.compile("\\A" + "d" + "([\\d,]+)\\Z").matcher(ps);
             if (m.matches()) {
                 _params.put("d", m.group(1));
+
                 continue;
             }
             m = Pattern.compile("\\A" + "d" + "([\\d,-]+)\\Z").matcher(ps);


More information about the HepData-svn mailing list