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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Fri Oct 12 12:25:46 BST 2012


Author: whalley
Date: Fri Oct 12 12:25:46 2012
New Revision: 1582

Log:
force view to display only first use hepdataId when inspire id is used in the url

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	Thu Oct 11 14:50:45 2012	(r1581)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java	Fri Oct 12 12:25:46 2012	(r1582)
@@ -515,7 +515,10 @@
                 qs.append(" p._spiresId = :pid");
             } else if (getQueryParam("ins") != null) {
                 pid = getQueryParam("ins");
-                qs.append(" p._inspireId = :pid");
+                Query q2 = getSession().createQuery("select p._hepdataId from Paper p where p._inspireId="+pid);
+                Long first = (Long) q2.list().get(0);
+                pid = first.toString();
+                qs.append(" p._hepdataId = :pid" );
             } else if (getQueryParam("red") != null) {
                 pid = getQueryParam("red");
                 qs.append(" p._redId = :pid");


More information about the HepData-svn mailing list