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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Jul 16 18:32:33 BST 2009


Author: buckley
Date: Thu Jul 16 18:32:30 2009
New Revision: 1290

Log:
Improvements to the search pages

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Index.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java
   trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Index.tml
   trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Search.tml

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Index.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Index.java	Tue Jun 16 12:16:39 2009	(r1289)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Index.java	Thu Jul 16 18:32:30 2009	(r1290)
@@ -18,7 +18,7 @@
 
     @OnEvent(value="submit", component="search")
     public Object onFormSubmit() {
-        _search.setQueryString(query);
+        _search.setSearchString(query.replace(" ", "_"));
         return _search;
     }
 

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java	Tue Jun 16 12:16:39 2009	(r1289)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java	Thu Jul 16 18:32:30 2009	(r1290)
@@ -1,8 +1,9 @@
 package cedar.hepdata.webapp.pages;
 
-import cedar.hepdata.model.*;
-import cedar.hepdata.xml.*;
-import cedar.hepdata.db.*;
+import cedar.hepdata.model.Paper;
+import cedar.hepdata.model.Reference;
+import cedar.hepdata.model.Experiment;
+//import cedar.hepdata.db.*;
 import cedar.hepdata.webapp.query.*;
 
 import org.apache.tapestry5.annotations.*;
@@ -10,7 +11,7 @@
 import org.apache.tapestry5.services.*;
 
 import org.hibernate.*;
-import org.hibernate.criterion.*;
+//import org.hibernate.criterion.*;
 import java.util.*;
 import java.lang.Long;
 import java.math.BigInteger;
@@ -19,6 +20,9 @@
 public class Search {
 
 
+    @Property
+    private String query;
+
     @Inject
     private org.hibernate.Session _session;
 
@@ -29,34 +33,36 @@
     @Inject
     private RequestGlobals _reqGlobals;
 
+    @InjectPage
+    private Search _search;
 
     public String getQueryParam(String param) {
         String temp =  _reqGlobals.getRequest().getParameter(param);
         return _reqGlobals.getRequest().getParameter(param);
     }
 
-    private String _searchquery;
-    public void setQueryString(String q) {
-        _searchquery = q;
-    }
-    public String getQueryString() {
-        // String qs = getQueryParam("q");
-        // if (qs == null) return "";
-        // if (qs.equals("REACFORM")) {
-        //     return buildReacformQueryString();
-        // }
-        return _searchquery;
+    public void setSearchString(String q) {
+        query = q;
+    }
+    public String getSearchString() {
+        return query;
     }
 
 
     public String onPassivate() {
-        return getQueryString();
+        return getSearchString();
     }
     public void onActivate(String q) {
-        setQueryString(q);
+        setSearchString(q.replace("_", " "));
     }
 
 
+    @OnEvent(value="submit", component="searchagain")
+    public Object onFormSubmit() {
+        _search.setSearchString(query.replace(" ", "_"));
+        return _search;
+    }
+
 
     ////////////////////////////////////////////////////
 
@@ -69,16 +75,14 @@
         return _counter;
     }
 
-
-    public Integer getPLength() {
+    public Integer getLength() {
         try {
-            return Integer.parseInt(getQueryParam("show"));
+            return Integer.parseInt(getQueryParam("num"));
         } catch (Exception e) {
             return 20;
         }
     }
 
-
     public Integer getStarting() {
         try {
             return Integer.parseInt(getQueryParam("start"));
@@ -87,291 +91,86 @@
         }
     }
 
-
-    public Long getEnding() {
-        Integer start = getStarting();
-        Integer plength = getPLength();
-        Integer pagemaxnum = start + plength - 1;
-        Long absmaxnum = getNumPapers();
+    public Integer getEnding() {
+        Integer pagemaxnum = getStarting() + getLength() - 1;
+        Integer absmaxnum = getNumPapers();
         return Math.min(pagemaxnum, absmaxnum);
     }
 
-
     public boolean getIsMultiPage() {
-        return getNumPapers() > getPLength();
-    }
-
-
-    public String getPaperIdContext() {
-        return "p" + Long.toString(_paper.getId());
-    }
-
-    public String getPaperSpiresContext() {
-        return "irn" + Long.toString(_paper.getSpiresId());
-    }
-
-
-    /////////////////////////////////////////////
-
-
-    public String getFirstQueryParameters() {
-        StringBuffer qs = new StringBuffer();
-        String q = getQueryString();
-        Integer plength = getPLength();
-        Integer newstart = 1;
-        String mid = "&";
-        qs.append(mid + "q=" + q);
-        qs.append(mid + "plength=" + plength + mid + "start=" + newstart);
-        return qs.toString().replaceAll("\\+","%2B");
-    }
-
-
-    public String getLastQueryParameters() {
-        StringBuffer qs = new StringBuffer();
-        String q = getQueryString();
-        Integer plength = getPLength();
-        Long newstart = getNumPapers() - getPLength() - 1;
-        String mid = "&";
-        qs.append(mid + "q=" + q);
-        qs.append(mid + "plength=" + plength + mid + "start=" + newstart);
-        return qs.toString().replaceAll("\\+","%2B");
-    }
-
-
-    public String getNextQueryParameters(){
-        StringBuffer qs = new StringBuffer();
-        String q = getQueryString();
-        Integer plength = getPLength();
-        Integer newstart = getStarting() + getPLength();
-        String mid = "&";
-        qs.append(mid + "q=" + q);
-        qs.append(mid + "plength=" + plength + mid + "start=" + newstart);
-        return qs.toString().replaceAll("\\+","%2B");
-    }
-
-
-    public String getPrevQueryParameters(){
-        StringBuffer qs = new StringBuffer();
-        String q = getQueryString();
-        Integer plength =  getPLength();
-        Integer newstart = getStarting() - getPLength();
-        String mid = "&";
-        qs.append(mid + "q=" + q);
-        qs.append(mid + "plength=" + plength + mid + "start=" + newstart);
-        return qs.toString().replaceAll("\\+","%2B");
-    }
-
-
-    /// @todo Move into a util class
-    public String getFirstAuthorName(){
-        int n = 0;
-        String _firstauthor = "";
-        try {
-            for (String author : _paper.getAuthors()) {
-                n += 1;
-                if (n == 1) {_firstauthor = author;}
-            }
-        } catch(Exception e) {
-            _firstauthor="unknown";
-        }
-        String _refdate = "xxxx";
-        try {
-            for (Reference reference : _paper.getReferences()) {
-                _refdate = reference.getDate();
-            }
-        } catch(Exception e) {
-            //
-        }
-        int _lref = _refdate.length();
-        try {
-            _firstauthor = _firstauthor + " " + _refdate.substring(_lref-2,_lref);
-        } catch(Exception e) {
-            //
-        }
-        return _firstauthor;
+        return getNumPapers() > getLength();
     }
 
-
-    /// @todo Move into a util class (and return all experiments)
-    public String getFirstExperimentName() {
-        int n = 0;
-        String _firstexperiment = "";
-        for (Experiment experiment : _paper.getExperiments()){
-            n += 1;
-            if(n == 1) { _firstexperiment = experiment.getName();}
-        }
-        if (_firstexperiment.startsWith("FNAL-")) {
-            if(_firstexperiment.indexOf("FNAL-0") < 0){
-                _firstexperiment = _firstexperiment.replaceFirst("-","-E-0");
-            }
-        }
-        return _firstexperiment;
-    }
+    // public String getLastQueryParameters() {
+    //     StringBuffer qs = new StringBuffer();
+    //     Integer length = getLength();
+    //     Long newstart = getNumPapers() - getPLength() - 1;
+    //     String mid = "&";
+    //     qs.append(mid + "q=" + q);
+    //     qs.append(mid + "plength=" + plength + mid + "start=" + newstart);
+    //     return qs.toString().replaceAll("\\+","%2B");
+    // }
+
+
+    // public String getNextQueryParameters(){
+    //     StringBuffer qs = new StringBuffer();
+    //     String q = getQueryString();
+    //     Integer plength = getPLength();
+    //     Integer newstart = getStarting() + getPLength();
+    //     String mid = "&";
+    //     qs.append(mid + "q=" + q);
+    //     qs.append(mid + "plength=" + plength + mid + "start=" + newstart);
+    //     return qs.toString().replaceAll("\\+","%2B");
+    // }
+
+
+    // public String getPrevQueryParameters(){
+    //     StringBuffer qs = new StringBuffer();
+    //     String q = getQueryString();
+    //     Integer plength =  getPLength();
+    //     Integer newstart = getStarting() - getPLength();
+    //     String mid = "&";
+    //     qs.append(mid + "q=" + q);
+    //     qs.append(mid + "plength=" + plength + mid + "start=" + newstart);
+    //     return qs.toString().replaceAll("\\+","%2B");
+    // }
 
 
-    /// @todo Move into a util class (and return all experiments)
-    public String getFirstInformalName() {
-        int n = 0;
-        String _firstinformal = "";
-        for (Experiment experiment : _paper.getExperiments()){
-            n += 1;
-            if(n == 1) { _firstinformal = experiment.getInformalName();}
-        }
-        return _firstinformal;
-    }
+    // Papers search stuff
 
 
-    /// @todo Move into a util class
-    public String getFirstPublished() {
-        int n = 0;
-        String _firstpublished = "Not Published";
-        for (Reference ref : _paper.getReferences()){
-            String refdesc = ref.getDescription();
-            if(ref.getType().equals("JOUR")){
-                n += 1;
-                if(n == 1) { _firstpublished = refdesc;}
-            }
-        }
-        return _firstpublished;
-    }
-
-
-    /// @todo Move into a util class
-    public String getFirstPreprint() {
-        int n = 0;
-        String _firstpreprint= "Not Known";
-        for (Reference ref : _paper.getReferences()){
-            String refdesc = ref.getDescription();
-            if(ref.getType().equals("JOUR")){
-            }
-            else{
-                n += 1;
-                if(n == 1) { _firstpreprint = refdesc;}
+    private Paper _paper;
 
-            }
-        }
-        return _firstpreprint;
+    public Paper getPaper() {
+        return _paper;
     }
 
-
-    public String getTitle() {
-        return _paper.getTitle();
+    public void setPaper(Paper paper) {
+        _paper = paper;
+        _counter += 1;
     }
 
 
-    // Papers search
-    private Paper _paper;
-    public Paper getPaper() { return _paper; }
-    public void setPaper(Paper paper) { _paper = paper; _counter += 1; }
-
     public List <Paper> getPapers() {
-        String queryString = getQueryString();
-        queryString = queryString.replaceAll("=", " ");
-        if (queryString.toUpperCase().equals("REACFORM")) {
-            queryString = buildReacformQueryString();
-        }
-        Query q = null;
-        q = ConstructQueryPaper.QueryString(queryString, "", _session);
+        String queryString = getSearchString();
+        Query q = ConstructQueryPaper.mkQueryFromSearchString(queryString, "", _session);
         int first = getStarting() - 1;
-        int plength = getPLength();
-        q.setFirstResult(first).setMaxResults(plength);
+        q.setFirstResult(first).setMaxResults(getLength());
         return q.list();
     }
 
 
-    public Long getNumPapers() {
-        String queryString = getQueryString();
-        queryString = queryString.replaceAll("="," ");
-        if (queryString.toUpperCase().equals("REACFORM")) {
-            queryString = buildReacformQueryString();
-        }
-        /// @todo Tidy up!
-        Object result = ConstructQueryPaper.QueryString(queryString, "count", _session).uniqueResult();
-        if (result instanceof BigInteger) {
-            return new Long(((BigInteger)result).longValue());
-        } else {
-            return (Long) result;
-        }
+    public Integer getNumPapers() {
+        return getPapers().size();
     }
 
 
-    private String buildReacformQueryString(){
-        StringBuffer qs = new StringBuffer();
-        Boolean first = true;
-        if(!getQueryParam("reac").equals("")) {
-            qs.append("re " + getQueryParam("reac"));
-            first = false;
-        }
-        if(!getQueryParam("beam").equals("") &&
-           !getQueryParam("targ").equals("") &&
-           !getQueryParam("fsp").equals("")){
-            qs.append("re " + getQueryParam("beam") + " " + getQueryParam("targ") + " --> " + getQueryParam("fsp"));
-            first = false;
-        }
-        else if(!getQueryParam("beam").equals("") &&
-                !getQueryParam("targ").equals("")) {
-            qs.append("re " + getQueryParam("beam") + " " + getQueryParam("targ"));
-            first = false;
-        }
-        else if(!getQueryParam("beam").equals("") &&
-                !getQueryParam("fsp").equals("")) {
-            qs.append("re " + getQueryParam("beam") + " --> " + getQueryParam("fsp"));
-            first = false;
-        }
-        else if(!getQueryParam("targ").equals("") &&
-                !getQueryParam("fsp").equals("")) {
-            qs.append("re " + getQueryParam("targ") + " --> " + getQueryParam("fsp"));
-            first = false;
-        }
-        else{
-            if(!getQueryParam("beam").equals("")){
-                if(!first){qs.append(" AND ");}
-                first = false;
-                qs.append("re " + getQueryParam("beam"));
-            }
-            if(!getQueryParam("targ").equals("")){
-                if(!first){qs.append(" AND ");}
-                first = false;
-                qs.append("re " + getQueryParam("targ"));
-            }
-            if(!getQueryParam("fsp").equals("")){
-                if(!first){qs.append(" AND ");}
-                first = false;
-                qs.append("fsp " + getQueryParam("fsp"));
-            }
-        }
-        if(!getQueryParam("obs").equals("")){
-            if(!first){qs.append(" AND ");}
-            first = false;
-            qs.append("obs " + getQueryParam("obs"));
-        }
-        if(!getQueryParam("year").equals("")){
-            if(!first){qs.append(" AND ");}
-            first = false;
-            qs.append("date " + getQueryParam("year"));
-        }
-        if(!getQueryParam("exp").equals("")){
-            if(!first){qs.append(" AND ");}
-            first = false;
-            qs.append("exp " + getQueryParam("exp"));
-        }
-        if(!getQueryParam("auth").equals("")){
-            if(!first){qs.append(" AND ");}
-            first = false;
-            qs.append("auth " + getQueryParam("auth"));
-        }
-        if(!getQueryParam("ref").equals("")){
-            if(!first){qs.append(" AND ");}
-            first = false;
-            qs.append("ref " + getQueryParam("ref"));
-        }
-        if(!getQueryParam("plab").equals("")){
-            if(!first){qs.append(" AND ");}
-            first = false;
-            qs.append("sqrts " + getQueryParam("plab"));
-        }
-        System.out.println("query: " + qs.toString());
-        return qs.toString();
+    public String getPaperIdContext() {
+        return "p" + Long.toString(_paper.getId());
+    }
+
+    public String getPaperSpiresContext() {
+        return "irn" + Long.toString(_paper.getSpiresId());
     }
 
 

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	Tue Jun 16 12:16:39 2009	(r1289)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java	Thu Jul 16 18:32:30 2009	(r1290)
@@ -15,45 +15,47 @@
 
 public class ConstructQueryPaper{
 
-    ////// query constructor for queryString only///
-    public static Query QueryString(String queryString, String flag,  org.hibernate.Session _session){
-        //
-        //start by removing the FIND at the beginning of the query if it is present
+
+    /// Construct a Query object from a HepData search string
+    public static Query mkQueryFromSearchString(String queryString, String flag, org.hibernate.Session _session) {
+        if (queryString == null) return null;
+        queryString = queryString.replace("=", " ");
+
+        // Start by removing the FIND at the beginning of the query if it is present
         int ix = -1;
-        if(queryString.toUpperCase().startsWith("F ") ||
-           queryString.toUpperCase().startsWith("FI ") ||
-           queryString.toUpperCase().startsWith("FIN ") ||
-           queryString.toUpperCase().startsWith("FIND ")){
+        if (queryString.toUpperCase().startsWith("F ") ||
+            queryString.toUpperCase().startsWith("FI ") ||
+            queryString.toUpperCase().startsWith("FIN ") ||
+            queryString.toUpperCase().startsWith("FIND ")) {
             ix = queryString.indexOf(" ");
         }
 
-        // deal with > and < with no spacings, taking care of the reaction -->
-        queryString=queryString.replaceAll("<"," < ");
-        queryString=queryString.replaceAll(">"," > ");
-        queryString=queryString.replaceAll("- >","->");
+        // Deal with > and < with no spacings, taking care of the reaction -->
+        queryString = queryString.replaceAll("<"," < ");
+        queryString = queryString.replaceAll(">"," > ");
+        queryString = queryString.replaceAll("- >","->");
 
 
-        // these next lines are for the special queries on on event shapes etc...
-        if( queryString.toUpperCase().equals("EVENTSHAPES") ){
+        // These next lines are for the special queries on on event shapes etc...
+        if (queryString.toUpperCase().equals("EVENTSHAPES") ) {
             return EventShapes(flag,_session);
         }
-        else if( queryString.toUpperCase().equals("EVENTSHAPESEE") ){
+        else if (queryString.toUpperCase().equals("EVENTSHAPESEE") ) {
             return EventShapesEE(flag,_session);
         }
-        else if( queryString.toUpperCase().equals("EVENTSHAPESNOTEE") ){
+        else if (queryString.toUpperCase().equals("EVENTSHAPESNOTEE") ) {
             return EventShapesNotEE(flag,_session);
         }
-        else if( queryString.toUpperCase().equals("JETPRODUCTION") ){
+        else if (queryString.toUpperCase().equals("JETPRODUCTION") ) {
             return JetProduction(flag,_session);
         }
-        else if( queryString.toUpperCase().equals("JETPRODUCTIONEE") ){
+        else if (queryString.toUpperCase().equals("JETPRODUCTIONEE") ) {
             return JetProductionEE(flag,_session);
         }
-        else if( queryString.toUpperCase().equals("JETPRODUCTIONNOTEE") ){
+        else if (queryString.toUpperCase().equals("JETPRODUCTIONNOTEE") ) {
             return JetProductionNotEE(flag,_session);
         }
-        System.out.println("query: " + queryString);
-        //
+        //System.out.println("query: " + queryString);
 
         String words[] = queryString.substring(ix+1).toUpperCase().split("\\s+AND\\s+");
         String reaction = null;
@@ -890,22 +892,20 @@
             q.setString("sqrtslo",theSqrtsLo);
         }
         // nothing left so must want everything !!
-        else{
-            if (flag.equals("count")){
+        else {
+            if (flag.equals("count")) {
                 b.append("select count(distinct pa) from Paper pa");
-            }
-            else{
+            } else {
                 b.append("select distinct pa from Paper pa");
             }
             b.append(" order by pa._spiresId desc");
             q = _session.createQuery(b.toString());
         }
-
         System.out.println(q.toString());
         return q;
-
     }
 
+
     private static String getInitialState(String r){
         String is="";
         int ipos = r.indexOf("-->");

Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Index.tml
==============================================================================
--- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Index.tml	Tue Jun 16 12:16:39 2009	(r1289)
+++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Index.tml	Thu Jul 16 18:32:30 2009	(r1290)
@@ -19,9 +19,9 @@
           <input t:type="textfield" t:value="query" name="q" size="50"/>&nbsp;<input type="submit" value="Search"/>
           <br/>
           <span class="searchexamples">examples:
-            <a href="#" t:type="pagelink" t:page="search" t:context="literal:re gamma gamma">re gamma gamma</a>,&nbsp;
-            <a href="#" t:type="pagelink" t:page="search" t:context="literal:re+p+p+-&gt;+p+p+and+obs+sig">re p p -&gt; p p and obs sig</a>,&nbsp;
-            <a href="#" t:type="pagelink" t:page="search" t:context="literal:exp+cern">re p p -&gt; p p and obs sig</a>
+            <a href="#" t:type="pagelink" t:page="search" t:context="literal:re_gamma_gamma">re gamma gamma</a>,&nbsp;
+            <a href="#" t:type="pagelink" t:page="search" t:context="literal:re_p_p_-&gt;_p_p_and_obs_sig">re p p -&gt; p p and obs sig</a>,&nbsp;
+            <a href="#" t:type="pagelink" t:page="search" t:context="literal:exp_cern">re p p -&gt; p p and obs sig</a>
             <br/>
             <a href="search_help.shtml">Search help</a>&nbsp;&ndash;
             <a href="browse.shtml">Browse keywords</a>&nbsp;&ndash;

Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Search.tml
==============================================================================
--- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Search.tml	Tue Jun 16 12:16:39 2009	(r1289)
+++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Search.tml	Thu Jul 16 18:32:30 2009	(r1290)
@@ -1,31 +1,30 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html t:type="layout" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
 
-  <title>HepData search &ndash; '${queryString}'</title>
+  <title>HepData search &ndash; '${searchstring}'</title>
 
   <p>
-	Search:&nbsp;<b>${queryString}</b><br/>
-	Result:&nbsp;<b>${numPapers}</b> documents found
-    <t:if test="numPapers">
-      (displaying <b>${starting}</b> to <b>${ending}</b>)
+    Search:&nbsp;<b>${searchstring}</b><br/>
+    <t:if test="papers">
+      Result:&nbsp;<b>${papers.size()}</b> documents found
+      <t:if test="numpapers">
+        (displaying <b>${starting}</b> to <b>${ending}</b>)
+      </t:if>
     </t:if>
   </p>
-  <form method="GET" action="search" title="Enter search query in the box">
-	<input type="text" name="q"  value="${queryString}" size="40"></input>
-    <input type="submit" value="Search again"></input>
-  </form>
+  <t:form t:id="searchagain" t:context="query" action="search">
+    Enter query:
+    <input t:type="textfield" t:value="query" name="q" size="50"/>&nbsp;<input type="submit" value="Search again"/>
+  </t:form>
 
-  <!-- TODO: make this a component (used again at bottom of page, and similar on other pages) -->
   <p>
     <t:if test="isMultiPage">
-      <a href="search?${firstQueryParameters}">First</a>&nbsp;|&nbsp;
-	  <a href="search?${prevQueryParameters}">Previous</a>&nbsp;|&nbsp;
-	  <a href="search?${nextQueryParameters}">Next</a>&nbsp;|&nbsp;
-	  <a href="search?${lastQueryParameters}">Last</a>&nbsp;|&nbsp;
+      <a href="#" t:type="pagelink" t:page="search" t:context="${searchstring}?start=10">foo</a>
+      <a href="search/${searchstring}">First</a>&nbsp;|&nbsp;
+      <!-- <a href="search/${searchString}${prevQueryParameters}">Previous</a>&nbsp;|&nbsp; -->
+      <!-- <a href="search/${searchString}${nextQueryParameters}">Next</a>&nbsp;|&nbsp; -->
+      <!-- <a href="search/${searchString}${lastQueryParameters}">Last</a>&nbsp;|&nbsp; -->
     </t:if>
-    <a href="saveplot?list=all&amp;q=${getQueryString()}" 
-	   title="View the list of plots which have been selected for combined plotting">
-      View selected plots</a>
   </p>
 
 
@@ -34,47 +33,37 @@
 
       <div class="searchresult">
         ${counter}.
-        <a href="#" t:type="pagelink" t:page="view" t:context="${paperIdContext}"
-	       title="Display the complete data record"><b>${firstAuthorName}</b></a>
+        <a href="#" t:type="pagelink" t:page="view" t:context="${paperidcontext}"
+           title="Display the complete data record"><b>${paper.shortname}</b></a>
         &ndash;
         Experiment:
-        <a href="http://durpdg.dur.ac.uk/cgi-bin/spiface/experiments/www2?fin+expt+${firstExperimentName}"
-	       title="View ${firstExperimentName} entry in Spires experiments database">
-          <b>${firstExperimentName}</b></a> (${firstInformalName})
+        <a href="http://durpdg.dur.ac.uk/cgi-bin/spiface/experiments/www2?fin+expt+${paper.experimentname}"
+           title="View ${paper.experimentname} entry in Spires experiments database">
+          <b>${paper.experimentname}</b></a> (${paper.informalname})
         <br/>
-        <t:if test="firstPublished">
-          Published: <b>${firstPublished}</b>
+        <t:if test="paper.firstPublished">
+          Published: <b>${paper.firstpublished}</b>
         </t:if>
-        <t:if test="firstPreprint">
-          Preprint: <b>${firstPreprint}</b>
+        <t:if test="paper.firstPreprint">
+          Preprint: <b>${paper.firstpreprint}</b>
         </t:if>
         <t:if test="paper.spiresId">
-          (Spires ID: 
+          (Spires ID:
           <a href="http://durpdg.dur.ac.uk/cgi-bin/spiface/hep/www?irn+${paper.spiresId}">${paper.spiresId}</a>)
         </t:if>
         <p class="searchresulttitle">${paper.title}</p>
 
-        <a href="#" t:type="pagelink" t:page="view" t:context="${paperIdContext}"
+        <a href="#" t:type="pagelink" t:page="view" t:context="${paperidcontext}"
            title="View the complete data record">Full data record</a>&nbsp;|
-        <a href="#" t:type="pagelink" t:page="view" t:context="literal:${paperIdContext}?format=short"
-	       title="Just view the table headers for this record">Short data record</a>
+        <a href="#" t:type="pagelink" t:page="view" t:context="literal:${paperidcontext}/short"
+           title="Just view the table headers for this record">Short data record</a>
         <t:if test="paper.spiresId">
           |&nbsp;<a href="http://durpdg.dur.ac.uk/cgi-bin/spiface/hep/www?irn+${paper.spiresId}"
-	                title="View the Spires database record for paper with IRN code ${paper.spiresId}">Spires record (${paper.spiresId})</a>
+                    title="View the Spires database record for paper with IRN code ${paper.spiresId}">Spires record (${paper.spiresId})</a>
         </t:if>
       </div>
       
     </t:loop>
   </div>
 
-  <!-- TODO: make this a component -->
-  <t:if test="isMultiPage">
-    <p>
-      <a href="search?${firstQueryParameters}">First</a>&nbsp;|&nbsp;
-	  <a href="search?${prevQueryParameters}">Previous</a>&nbsp;|&nbsp;
-	  <a href="search?${nextQueryParameters}">Next</a>&nbsp;|&nbsp;
-	  <a href="search?${lastQueryParameters}">Last</a>&nbsp;|&nbsp;
-    </p>
-  </t:if>
-       
 </html>


More information about the HepData-svn mailing list