ListDatasets.java

Go to the documentation of this file.
00001 package cedar.hepdata.webapp.pages;
00002 
00003 import cedar.hepdata.model.*;
00004 import cedar.hepdata.xml.*;
00005 import cedar.hepdata.db.*;
00006 
00007 import org.apache.tapestry5.annotations.*;
00008 import org.apache.tapestry5.ioc.annotations.*;
00009 import org.apache.tapestry5.services.*;
00010 
00011 import org.hibernate.*;
00012 import java.util.*;
00013 
00014 
00015 public class ListDatasets {
00016 
00017     @Inject
00018     private org.hibernate.Session _session;
00019 
00020     @Inject
00021     private RequestGlobals _reqGlobals;
00022 
00023     // Papers
00024     private Paper _paper;
00025     public Paper getPaper() { return _paper; }
00026     public void setPaper(Paper p) { _paper = p; }
00027 
00028     public List<Paper> getPapers() {
00029 //        Criteria c = _session.createCriteria(Paper.class);
00030 //        c.setMaxResults(2);
00031 //        return c.list();
00032        int _spiresid = Integer.parseInt(this.getQueryParam("irn"));
00033        Query q = _session.createQuery("from Paper p where p._spiresId = :irn");
00034        q.setLong("irn", _spiresid) ;
00035        return q.list();
00036     }
00037 
00038     // Datasets
00039     private Dataset _dataset;
00040     public Dataset getDataset() { return _dataset; }
00041     public void setDataset(Dataset d) { _dataset = d; }
00042 
00043     public SortedSet<Dataset> getDatasets() {
00044         return _paper.getDatasets();
00045     }
00046 
00047    // YAxes
00048     private YAxis _yaxis;
00049     public YAxis getYAxis() { return _yaxis; }
00050     public void setYAxis(YAxis y) { _yaxis = y; }
00051 
00052     public SortedSet<YAxis> getYAxes() {
00053         return _dataset.getYAxes();
00054     }
00055 
00056 
00057     public String getQueryParam(){
00058        return _reqGlobals.getRequest().getParameter("irn");
00059     }
00060 
00061     public String getQueryParam(String param){
00062        return _reqGlobals.getRequest().getParameter(param);
00063     }
00064 }

Generated on Tue Apr 21 15:55:00 2009 for HepData Web servlets by  doxygen 1.5.5