[HepData-svn] r1790 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Apr 28 17:03:42 BST 2014


Author: whalley
Date: Mon Apr 28 17:03:42 2014
New Revision: 1790

Log:
tweak to AuthorDate search to stop multiple output and a greater and lesser to date

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java	Mon Apr 28 16:38:03 2014	(r1789)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java	Mon Apr 28 17:03:42 2014	(r1790)
@@ -160,7 +160,7 @@
        else if(redid != null) { return RedId(redid,flag,_session);}
        else if(author != null) { 
            if(date != null){
-               return AuthorDate(author,date,flag,_session);
+               return AuthorDate(author,date,datetype,flag,_session);
            }
            else{
                return Author(author,flag,_session);
@@ -730,7 +730,7 @@
        return q;
     }
 ////// query constructor for Author only///
-    public static Query AuthorDate(String author,String date, String flag,  org.hibernate.Session _session){
+    public static Query AuthorDate(String author, String date, String datetype, String flag,  org.hibernate.Session _session){
        String theAuth=author;
        String theDate=date;
        Query q=null;         
@@ -746,7 +746,14 @@
        b.append(" and p.PAPER_ID=pr.PAPER_ID");
        b.append(" and pa.element like '");
        b.append(author);
-       b.append("' and pr.date like '");
+       if(datetype.equals("=")){
+           b.append("' and pr.date like '");
+       }
+       else{
+           b.append("' and pr.date "); 
+           b.append(datetype);
+           b.append("'");
+       }
        b.append(date);
        b.append("' and pr.date not like '");
        b.append("' order by p.InspireId desc");


More information about the HepData-svn mailing list