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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Sep 30 15:18:01 BST 2009


Author: whalley
Date: Wed Sep 30 15:18:00 2009
New Revision: 1292

Log:
lots of initial mods to make it work better

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/ReactionPlotWords.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/PlotImage.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java
   trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Index.tml
   trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Plot.tml
   trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Search.tml
   trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Thu Jul 16 18:56:41 2009	(r1291)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Wed Sep 30 15:18:00 2009	(r1292)
@@ -354,11 +354,8 @@
 
             String baseurl = _reqGlobals.getRequest().getContextPath();
             String urlparts = ""
-                + "p=" + _dataset.getPaper().getId()
-                + "&d=" + _dataset.getId();
-            if (getSearchString() != null) {
-                urlparts += "&q=" + getSearchString();
-            }
+                + "/p" + _dataset.getPaper().getId()
+                + "/d" + _dataset.getId();
 
             for (int iy = 1; iy <= ny; iy++) {
                 writer.element("td");
@@ -374,8 +371,7 @@
 
                 // Plot link
                 writer.element("a");
-                writer.attributes("href", baseurl + "/reactionplot?" + urlparts + "&x=1&y=" + iy
-                                  + "&xscale=lin&yscale=lin&sys=yes");
+                writer.attributes("href", baseurl + "/plot" + urlparts + "/x01/y" + iy);
                 writer.attributes("title", "Display this table in graphical form");
                 writer.write("Plot");
                 writer.end();

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/ReactionPlotWords.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/ReactionPlotWords.java	Thu Jul 16 18:56:41 2009	(r1291)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/ReactionPlotWords.java	Wed Sep 30 15:18:00 2009	(r1292)
@@ -162,28 +162,49 @@
 
 // yaxis properties /Name/LowValue/HighValue/Units (ie qualifiers)
         for ( Property property : ya.getProperties() ){
-        if(!property.getName().startsWith("sqrts")){
-        writer.element("b");
-        writer.write("'" + property.getName());
-        writer.write(" IN ");
-        writer.write(property.getUnit().toString());
-        writer.write(" : ");
-        if (property.getLowValue() != null && property.getHighValue() != null &&
-                property.getLowValue().equals(property.getHighValue())) {
-                writer.write(property.getLowValue().toString() + "'");
+            if(!property.getName().startsWith("sqrts")){
+                writer.element("b");
+                writer.write("'" + property.getName());
+                writer.write(" IN ");
+                writer.write(property.getUnit().toString());
+                writer.write(" : ");
+                if (property.getLowValue() != null && property.getHighValue() != null &&
+                    property.getLowValue().equals(property.getHighValue())) {
+                    writer.write(property.getLowValue().toString() + "'");
+                }
+                else {
+                    writer.write(property.getLowValue().toString());
+                    writer.write(" TO ");
+                    writer.write(property.getHighValue().toString() + "'");
+                }
+                writer.element("br");writer.end();
+                writer.end();
+            }
         }
-        else {
-                writer.write(property.getLowValue().toString());
-                writer.write(" TO ");
-                writer.write(property.getHighValue().toString() + "'");
         }
         writer.element("br");writer.end();
-        writer.end();
-        }
-        }
-        }
+
+        String baseurl    = _reqGlobals.getRequest().getContextPath();
+        String urlpaper   = "/p" + _yaxis.getDataset().getPaper().getId();
+        String urldataset = urlpaper + "/d" + _yaxis.getDataset().getId();
+        String urlxlin    = urldataset + "/d" + _yaxis.getDataset().getId() + "/x01";
+        String urlxlog    = urldataset + "/d" + _yaxis.getDataset().getId() + "/xlog01";
+        writer.write("Re-plot as: ");
+        writer.element("a");writer.attributes("href", baseurl + "/plot" + urlxlin + "/ylin" + _yaxis.getId());writer.write("xlin-ylin");writer.end();
+        writer.write(" | ");
+        writer.element("a");writer.attributes("href", baseurl + "/plot" + urlxlin + "/ylog" + _yaxis.getId());writer.write("xlin-ylog");writer.end();
+        writer.write(" | ");
+        writer.element("a");writer.attributes("href", baseurl + "/plot" + urlxlog + "/ylin" + _yaxis.getId());writer.write("xlog-ylin");writer.end();
+        writer.write(" | ");
+        writer.element("a");writer.attributes("href", baseurl + "/plot" + urlxlog + "/ylog" + _yaxis.getId());writer.write("xlog-ylog");writer.end();
         writer.element("br");writer.end();
-    }
+        writer.write("Go back to: ");
+        writer.element("a");writer.attributes("href", baseurl + "/view" + urlpaper);writer.write("paper");writer.end();
+        writer.write(" | ");
+        writer.element("a");writer.attributes("href", baseurl + "/view" + urldataset);writer.write("dataset");writer.end();
+        writer.write(" | ");
+        writer.element("a");writer.attributes("href", baseurl + "/index");writer.write("search box");writer.end();
+}
     @Parameter(name="yaxis")
     private YAxis _yaxis;
 }

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/PlotImage.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/PlotImage.java	Thu Jul 16 18:56:41 2009	(r1291)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/PlotImage.java	Wed Sep 30 15:18:00 2009	(r1292)
@@ -163,7 +163,7 @@
     public StreamResponse makeImage() {
         AxisType xscale = AxisType.LIN;
         if (getQueryParam("xaxis") != null) xscale = AxisType.valueOf(getQueryParam("xaxis").toUpperCase());
-        AxisType yscale = AxisType.LOG;
+        AxisType yscale = AxisType.LIN;
         if (getQueryParam("yaxis") != null) yscale = AxisType.valueOf(getQueryParam("yaxis").toUpperCase());
         JFreeChart chart = Plotter.makeChart(getXAxis(), getYAxes(), xscale, yscale);
         ImageFormat format = ImageFormat.valueOf(getQueryParam("format").toUpperCase());

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	Thu Jul 16 18:56:41 2009	(r1291)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java	Wed Sep 30 15:18:00 2009	(r1292)
@@ -6,6 +6,7 @@
 //import cedar.hepdata.db.*;
 import cedar.hepdata.webapp.query.*;
 
+import org.apache.tapestry5.EventContext;
 import org.apache.tapestry5.annotations.*;
 import org.apache.tapestry5.ioc.annotations.*;
 import org.apache.tapestry5.services.*;
@@ -14,8 +15,10 @@
 //import org.hibernate.criterion.*;
 import java.util.*;
 import java.lang.Long;
+import java.lang.Integer;
 import java.math.BigInteger;
-
+import java.net.URLEncoder;
+import java.net.URLDecoder;
 
 public class Search {
 
@@ -45,10 +48,22 @@
         query = q;
     }
     public String getSearchString() {
-        return query;
+        if(query.indexOf("?") > 0){
+            return query.substring(0,query.indexOf("?"));
+        }
+        else{
+            return query;
+        }
     }
     public String getEscSearchString() {
         return query.replace(" ", "_");
+//       String qy = query;
+//       System.out.println("query: " + query);
+//       try{
+//           qy = URLEncoder.encode(qy,"UTF-8");
+//       }catch(Exception ex){};
+//       System.out.println("returned query: " + qy);
+//       return qy;
     }
 
 
@@ -56,8 +71,14 @@
         return getSearchString();
     }
     public void onActivate(String q) {
+        System.out.println("activating searchString");
         setSearchString(q.replace("_", " "));
     }
+    public void onActivate(EventContext context) {
+        System.out.println("activating context");
+        parseContext(context);
+
+    }
 
 
     @OnEvent(value="submit", component="searchagain")
@@ -69,11 +90,17 @@
 
     ////////////////////////////////////////////////////
 
-
+    @Persist
     private int _counter;
     public void setCounter() {
         _counter = getStarting() - 1;
     }
+
+    public String resetCounter() {
+        _counter = 0;
+        return "";
+    }
+
     public Integer getCounter() {
         return _counter;
     }
@@ -87,11 +114,21 @@
     }
 
     public Integer getStarting() {
+       
         try {
             return Integer.parseInt(getQueryParam("start"));
         } catch (Exception e) {
-            return 1;
-        }
+//            return 1;
+            return _counter+1;
+       }
+
+//        System.out.println("getStarting : " + query);
+//        if(query.indexOf("?") > 0){
+//            return Integer.parseInt(query.substring(query.indexOf("?")));
+//        }
+//        else{
+//            return 1;
+//        }
     }
 
     public Long getEnding() {
@@ -104,6 +141,15 @@
         return getNumPapers() > getLength();
     }
 
+    public boolean getIsMultiPaper(){
+        if(_paper.getSpiresId() == null) { return false; }
+        Long irn = _paper.getSpiresId();
+        String qs = "irn=" + irn;
+        Query q = ConstructQueryPaper.mkQueryFromSearchString(qs,"count", _session);
+        Long result = (Long) q.uniqueResult();
+        if(result == 1) { return false; }
+        else{ return true; }
+    }
     // public String getLastQueryParameters() {
     //     StringBuffer qs = new StringBuffer();
     //     Integer length = getLength();
@@ -157,11 +203,47 @@
     public List <Paper> getPapers() {
         String queryString = getSearchString();
         Query q = ConstructQueryPaper.mkQueryFromSearchString(queryString, "", _session);
-        int first = getStarting() - 1;
+        int first = _counter;
         q.setFirstResult(first).setMaxResults(getLength());
-        return q.list();
+        List <Paper> list = q.list();
+        int size = list.size();
+        for (int i=0; i<size; i++){
+           if(list.get(i).getSpiresId() != null){
+           
+           Long irn = list.get(i).getSpiresId();
+           if(i < size-1) {
+              Long irnnext = list.get(i+1).getSpiresId();
+              if(irn.equals(irnnext)){
+                  list.remove(i+1); size--; 
+             }
+           } 
+           
+           } 
+       }
+        return list;
     }
 
+    private Paper _otherPaper;
+
+    public Paper getOtherPaper() {
+        return _otherPaper;
+    }
+
+    public void setOtherPaper(Paper otherPaper) {
+        _otherPaper = otherPaper;
+        _counter += 1;
+    }
+
+
+    public List <Paper> getOtherPapers() {
+        Long irn = _paper.getSpiresId();
+        String qs = "irn=" + irn;
+        Query q = ConstructQueryPaper.mkQueryFromSearchString(qs, "", _session);
+        List <Paper> otherlist = q.list();
+        otherlist.remove(0);
+        return otherlist;
+    }
+    
 
     public Long getNumPapers() {
         String queryString = getSearchString();
@@ -171,17 +253,75 @@
             return new Long(((BigInteger)result).longValue());
         } else {
             return (Long) result;
-        }
+       }
     }
 
 
-    public String getPaperIdContext() {
-        return "p" + Long.toString(_paper.getId());
+    public List<String> getPaperIdContext() {
+        List<String> ctx = new Vector<String>();
+        ctx.add("p" + Long.toString(_paper.getId()));
+        ctx.add("d1-10");
+        return ctx;
+    }
+
+    public String getOtherPaperIdContext() {
+        return "p" + Long.toString(_otherPaper.getId());
     }
 
     public String getPaperSpiresContext() {
         return "irn" + Long.toString(_paper.getSpiresId());
     }
 
+    public List<String> getShortPaperIdContext() {
+        List<String> ctx = new Vector<String>();
+        ctx.add("p" + Long.toString(_paper.getId()));
+        ctx.add("short");
+        return ctx;
+    }
+    public List<String> getOtherShortPaperIdContext() {
+        List<String> ctx = new Vector<String>();
+        ctx.add("p" + Long.toString(_otherPaper.getId()));
+        ctx.add("short");
+        return ctx;
+    }
+
+    public List<String> getNextContext() {
+        List<String> ctx = new Vector<String>();
+        ctx.add(getSearchString().replace(" ", "_"));
+        ctx.add("next");
+        return ctx;
+    }
+    public List<String> getPrevContext() {
+        List<String> ctx = new Vector<String>();
+        ctx.add(getSearchString().replace(" ", "_"));
+        ctx.add("prev");
+        return ctx;
+    }
+
+    public List<String> getFirstContext() {
+        List<String> ctx = new Vector<String>();
+        ctx.add(getSearchString().replace(" ", "_"));
+        ctx.add("first");
+        return ctx;
+    }
+
+    public List<String> getLastContext() {
+        List<String> ctx = new Vector<String>();
+        ctx.add(getSearchString().replace(" ", "_"));
+        ctx.add("last");
+        return ctx;
+    }
+   
+    public void parseContext(EventContext context){
+        String firstnextlast = "no";
+        for (int i = 0; i < context.getCount(); i++) {
+            String ps = context.get(String.class, i);
+            if(ps.equals("next")) { firstnextlast = "yes"; }
+            if(ps.equals("prev")) { _counter -= 40; firstnextlast = "yes"; }
+            if(ps.equals("first")) { _counter = 0; firstnextlast = "yes"; }
+            if(ps.equals("last")) { _counter = getNumPapers().intValue()-20; firstnextlast = "yes"; }
+         }
+         if(firstnextlast.equals("no")) { _counter = 0; }
+    }
 
 }

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 Jul 16 18:56:41 2009	(r1291)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java	Wed Sep 30 15:18:00 2009	(r1292)
@@ -43,7 +43,25 @@
         _params.put(name, value);
     }
 
-
+    @Persist
+    private int _counter;
+    public void setCounter(){
+        _counter = getStarting();
+    }
+    public String resetCounter(){
+        _counter = 1;
+        return "";
+    }
+    public Integer getCounter(){
+        return _counter;
+    }
+    public Integer getStarting(){    
+        return 1;
+    }
+    public Integer getLength(){    
+        return 10;
+    }
+    
     // Decode URL context into the params map, for use in concrete onActivate methods
     public void parseBaseViewContext(EventContext context) {
 
@@ -51,9 +69,17 @@
         if (_params == null) _params = new TreeMap();
         Matcher m = null;
 
+        String firstnextlast = "no";
+        
         for (int i = 0; i < context.getCount(); i++) {
             String ps = context.get(String.class, i);
-
+            
+            if(ps.equals("next")) { firstnextlast = "yes"; }
+            if(ps.equals("prev")) { _counter -= 20;  firstnextlast = "yes"; } 
+            if(ps.equals("first")) { _counter = 1;  firstnextlast = "yes"; } 
+            if(ps.equals("last")) { _counter = getPaper().getDatasets().size()-9; firstnextlast = "yes"; } 
+            
+            
             m = Pattern.compile("\\A" + "p" + "(\\d+)\\Z").matcher(ps);
             if (m.matches()) {
                 _params.put("p", m.group(1));
@@ -77,19 +103,39 @@
                 _params.put("d", m.group(1));
                 continue;
             }
+            m = Pattern.compile("\\A" + "d" + "([\\d,-]+)\\Z").matcher(ps);
+            if (m.matches()) {
+                System.out.println("Matching dataset string with " + m.group(1) );
+                _params.put("ds", m.group(1));
+                continue;
+            }
 
-            m = Pattern.compile("\\A" + "x" + "([\\d,]+)\\Z").matcher(ps);
+            m = Pattern.compile("\\A" + "x" + "([log|lin]*)([\\d,]+)\\Z").matcher(ps);
             if (m.matches()) {
-                _params.put("x", m.group(1));
+                if(m.group(1).equals("log") || m.group(1).equals("lin")){
+                    _params.put("xaxis", m.group(1)); 
+                    _params.put("x", m.group(2)); 
+                 }
+                else{              
+                     _params.put("x", m.group(2));
+                }     
                 continue;
             }
 
-            m = Pattern.compile("\\A" + "y" + "([\\d,]+)\\Z").matcher(ps);
+            m = Pattern.compile("\\A" + "y" + "([log|lin]*)([\\d,]+)\\Z").matcher(ps);
             if (m.matches()) {
-                _params.put("y", m.group(1));
+                if(m.group(1).equals("log") || m.group(1).equals("lin")){
+                    _params.put("yaxis", m.group(1)); 
+                    _params.put("y", m.group(2)); 
+                }
+                else{ _params.put("y", m.group(2)); 
+                }
                 continue;
             }
+            
         }
+        if(firstnextlast.equals("no")) { _counter = 1; }
+//      System.out.println("leaving parseBaseViewContext..");
     }
 
 
@@ -105,12 +151,16 @@
     public Integer getQueryX() {
         Integer xi = null;
         if (getQueryParam("x") != null) xi = Integer.parseInt(getQueryParam("x"));
+        if (getQueryParam("xlog") != null) xi = Integer.parseInt(getQueryParam("xlog"));
+        if (getQueryParam("xlin") != null) xi = Integer.parseInt(getQueryParam("xlin"));
         return xi;
     }
     /// @todo Parse values as comma-separated lists
     public Integer getQueryY() {
         Integer yi = null;
         if (getQueryParam("y") != null) yi = Integer.parseInt(getQueryParam("y"));
+        if (getQueryParam("ylog") != null) yi = Integer.parseInt(getQueryParam("ylog"));
+        if (getQueryParam("ylin") != null) yi = Integer.parseInt(getQueryParam("ylin"));
         return yi;
     }
 
@@ -118,7 +168,10 @@
     // Dataset cursor
     private Dataset _dataset;
     public Dataset getDataset() { return _dataset; }
-    public void setDataset(Dataset d) { _dataset = d; }
+    public void setDataset(Dataset d) { 
+        _dataset = d;
+        _counter += 1; 
+    }
 
 
     public List<String> getHDPaperContext() {
@@ -161,9 +214,23 @@
     public List<String> getAxesContext() {
         List<String> ctx = getDatasetContext();
         String x = getQueryParam("x");
-        if (x != null) ctx.add("x" + x);
+        if (x != null) {
+             String xaxis = getQueryParam("xaxis");
+             if(xaxis != null) {
+                 ctx.add ("x" + xaxis + x);
+             } else{
+                 ctx.add("x" + x);
+             }
+        }
         String y = getQueryParam("y");
-        if (y != null) ctx.add("y" + y);
+        if (y != null) {
+             String yaxis = getQueryParam("yaxis");
+             if(yaxis != null) {
+                 ctx.add ("y" + yaxis + y);
+             } else{
+                 ctx.add("y" + y);
+             }
+        }    
         return ctx;
     }
     public List<String> getBaseContext() {
@@ -196,12 +263,68 @@
         } else {
             return q;
         }
-
         q = getSession().createQuery(qs.toString());
         q.setString("pid", pid);
         return q;
     }
-
+    
+    
+       public List <Dataset> getDatasetsnew(){
+           String pid = null;
+           StringBuffer qs = new StringBuffer("select distinct d from Paper p join p._datasets d where");
+           if (getQueryParam("p") != null) {
+               pid = getQueryParam("p");
+               qs.append(" p._hepdataId = :pid");
+           } else if (getQueryParam("irn") != null) {
+               pid = getQueryParam("irn");
+               qs.append(" p._spiresId = :pid");
+           } else if (getQueryParam("red") != null) {
+               pid = getQueryParam("red");
+               qs.append(" p._redId = :pid");
+           }    
+//           Integer dsmin = getMinDsId();
+//           Integer dsmax = getMaxDsId();
+           Integer dsmin = getCounter();
+           Integer dsmax = getCounter() + getLength() - 1;
+           System.out.println("outputting datasets " + dsmin + " to " + dsmax);
+           if(dsmin == null && dsmax == null){
+           
+           } else if (dsmax == null){                       
+               qs.append(" and d._localId = :dsmin order by d._localId");
+           } else {
+               qs.append(" and d._localId >= :dsmin  and d._localId <= :dsmax order by d._localId");
+           }
+           Query q = getSession().createQuery(qs.toString());
+           q.setString("pid", pid);
+           if(dsmin != null) q.setParameter("dsmin", dsmin);
+           if(dsmax != null) q.setParameter("dsmax", dsmax);
+           return q.list();
+       }
+       
+       private Integer getMaxDsId(){
+           Integer dId = getQueryD();
+           if (dId == null) {
+               if(getQueryParam("ds") != null){
+                   Matcher m = Pattern.compile("\\A" + "(\\d+)" + "-" + "(\\d+)" + "\\Z").matcher(getQueryParam("ds"));
+                   if (m.matches()){
+                       dId = Integer.parseInt(m.group(2));
+                   }
+               }
+           }
+           return dId;
+       }
+       private Integer getMinDsId(){
+           Integer dId = getQueryD();
+           if (dId == null) {
+               if(getQueryParam("ds") != null){
+                   Matcher m = Pattern.compile("\\A" + "(\\d+)" + "-" + "(\\d+)" + "\\Z").matcher(getQueryParam("ds"));
+                   if (m.matches()){
+                       dId = Integer.parseInt(m.group(1));
+                   }
+               }
+           }
+           return dId;
+       }
 
     // Get datasets requested via URL context
     public Set<Dataset> getDatasets() {
@@ -210,8 +333,27 @@
 
         Integer dId = getQueryD();
         if (dId == null) {
-            return p.getDatasets();
+            //either no dataset or > 1 dataset
+            if(getQueryParam("ds") != null){
+                Matcher m = Pattern.compile("\\A" + "(\\d+)" + "-" + "(\\d+)" + "\\Z").matcher(getQueryParam("ds"));
+                if (m.matches()){
+                    //found match therefore output a range of datasets
+                    Set<Dataset> rtn = new TreeSet<Dataset>();
+                    for (int i=Integer.parseInt(m.group(1)); i<=Integer.parseInt(m.group(2)); i++){
+                        Dataset d = p.getDataset(i);
+                        if (d != null) rtn.add(d);
+                    }
+                    return rtn;
+                } else {
+                    //cannot decode dataset string so output all datasets
+                    return p.getDatasets();
+                }
+            } else {
+               // no requested datasets at all here so output all datasets
+               return p.getDatasets();
+            }
         } else {
+            // single dataset here
             Set<Dataset> rtn = new TreeSet<Dataset>();
             Dataset d = p.getDataset(dId);
             if (d != null) rtn.add(d);
@@ -219,6 +361,4 @@
         }
     }
 
-
-
 }

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	Thu Jul 16 18:56:41 2009	(r1291)
+++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Index.tml	Wed Sep 30 15:18:00 2009	(r1292)
@@ -20,13 +20,13 @@
           <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_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">exp cern</a>
             <br/>
-            <a href="search_help.shtml">Search help</a>&nbsp;&ndash;
+            <a href="#" t:type="pagelink" t:page="searchhelp">Search Help</a>,&nbsp;&ndash;
             <a href="browse.shtml">Browse keywords</a>&nbsp;&ndash;
             <!--   <a href="new_reacform.shtml">Form search</a>&nbsp;&ndash; -->
-            <a href="search_results_help.shtml">Output help</a>
+            <a href="#" t:type="pagelink" t:page="outputhelp">Output Help</a>,&nbsp;&ndash;
           </span>
         </t:form>	
 

Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Plot.tml
==============================================================================
--- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Plot.tml	Thu Jul 16 18:56:41 2009	(r1291)
+++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Plot.tml	Wed Sep 30 15:18:00 2009	(r1292)
@@ -5,13 +5,14 @@
   
   <t:loop source="datasets" value="dataset">    
     <table>
-      <t:loop source="dataset.yaxes" value="yaxis">
+<!--    <t:loop source="dataset.yaxes" value="yaxis"> -->
+      <t:loop source="yaxes" value="yaxis">
         <tr>
           <td width="50%">
             <!-- TODO: What is this? -->
-            <!-- <t:reactionPlotWords yaxis="yaxis" /> -->
+            <t:reactionPlotWords yaxis="yaxis" /> 
             <form method="GET" action="plot">
-              Re-plot:
+              <!-- Re-plot:-->
               <!-- <t:loop source="selects" value="select"> -->
               <!--   <input type="hidden" name="${getSelect()}" value="on" title="Choose scales"/> -->
               <!-- </t:loop> -->

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	Thu Jul 16 18:56:41 2009	(r1291)
+++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Search.tml	Wed Sep 30 15:18:00 2009	(r1292)
@@ -12,13 +12,16 @@
   </p>
   <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"/>
+    <input t:type="textfield" t:value="query" name="q" size="50"/>&nbsp;
+    <input type="submit" value="Search again"/>
   </t:form>
 
   <p>
     <t:if test="isMultiPage">
-      <a href="#" t:type="pagelink" t:page="search" t:context="${escsearchstring}?start=10">foo</a>
-      <a href="search/${searchstring}">First</a>&nbsp;|&nbsp;
+      <a href="#" t:type="pagelink" t:page="search" t:context="firstcontext">First</a>&nbsp;|&nbsp; 
+      <a href="#" t:type="pagelink" t:page="search" t:context="prevcontext">Previous</a>&nbsp;|&nbsp;
+      <a href="#" t:type="pagelink" t:page="search" t:context="nextcontext">Next</a>&nbsp;|&nbsp;
+      <a href="#" t:type="pagelink" t:page="search" t:context="lastcontext">Last</a>
       <!-- <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; -->
@@ -51,13 +54,32 @@
         </t:if>
         <p class="searchresulttitle">${paper.title}</p>
 
-        <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}/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>
+        <t:if test="isMultiPaper">
+            <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="shortpaperidcontext"
+            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>
+            </t:if>
+            <br/>
+            <t:loop source="otherPapers" value="otherPaper">
+               <a href="#" t:type="pagelink" t:page="view" t:context="${otherpaperidcontext}"
+                 title="View the complete data record">Full data record</a>&nbsp;|
+               <a href="#" t:type="pagelink" t:page="view" t:context="othershortpaperidcontext"
+                  title="Just view the table headers for this record">Short data record</a>
+            </t:loop>
+            <t:parameter t:name="else">
+               <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="shortpaperidcontext"
+               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>
+               </t:if>
+           </t:parameter>
         </t:if>
       </div>
       

Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml
==============================================================================
--- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml	Thu Jul 16 18:56:41 2009	(r1291)
+++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml	Wed Sep 30 15:18:00 2009	(r1292)
@@ -1,8 +1,7 @@
 <!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">
 
-  <t:if test="paper">
-
+  <t:if test="paper.hepdataId">
     <title>HepData &ndash; ${paper.shortName}</title>
 
     <div class="paperbox">
@@ -35,8 +34,10 @@
         <a href="#" t:type="pagelink" t:page="view" t:context="baseContext">${paper.id}</a>)
         <br/>
         Spires ID (IRN): <b><a href="http://durpdg.dur.ac.uk/cgi-bin/spiface/hep/www?irn+${paper.spiresId}">${paper.spiresId}</a></b>
-        <!-- <br/> -->
-        <!-- Number of tables: ${datasets.size()} -->
+        <br/>
+         Total number of tables: ${paper.datasets.size()} 
+        <br/>
+         Number of tables displayed: ${datasetsnew.size()} 
       </p>
 
       <div class="papercomments">
@@ -72,7 +73,7 @@
         </div>
       </t:if>
 
-      <t:loop source="datasets" value="dataset">
+      <t:loop source="datasetsnew" value="dataset">
         <div class="datasetbox">
           <h3 class="datasettitle">
             <a href="#" t:type="pagelink" t:page="view" t:context="baseContext">Table ${dataset.id}</a>
@@ -97,5 +98,4 @@
 
     </t:parameter>
   </t:if>
-
 </html>


More information about the HepData-svn mailing list