FindPaperSummary Class Reference

Collaboration diagram for FindPaperSummary:

Collaboration graph
[legend]

List of all members.


Public Member Functions

String getQueryParam (String param)
String getQueryString ()
void setQueryString (String queryString)
String getExperiment ()
void setExperiment (String experiment)
String getReaction ()
void setReaction (String reaction)
String getObservable ()
void setObservable (String observable)
String getSqrts ()
void setSqrts (String sqrts)
String getPlength ()
void setPlength (String plength)
String getStarting ()
void setStarting (String starting)
String getFirstQueryParameters ()
String getLastQueryParameters ()
String getNextQueryParameters ()
String getPrevQueryParameters ()
String getFirstNumber ()
String getSearchString ()
String getLastNumber ()
String getPageSize ()
Long getCount ()
String getFirstAuthorName ()
String getFirstExperimentName ()
String getFirstInformalName ()
String getFirstPublished ()
String getFirstPreprint ()
String getTitle ()
String setCounter ()
int getCounter ()
Paper getPaper ()
void setPaper (Paper paper)
List< Paper > getPapers ()

Detailed Description

Definition at line 16 of file FindPaperSummary.java.


Member Function Documentation

String getQueryParam ( String  param  ) 

Definition at line 25 of file FindPaperSummary.java.

Referenced by FindPaperSummary.getCount(), FindPaperSummary.getFirstNumber(), FindPaperSummary.getPapers(), and FindPaperSummary.getStarting().

00025                                              {
00026        String temp =  _reqGlobals.getRequest().getParameter(param);
00027        return _reqGlobals.getRequest().getParameter(param);
00028     }

String getQueryString (  ) 

Definition at line 32 of file FindPaperSummary.java.

00032 { return queryString; } 

void setQueryString ( String  queryString  ) 

Definition at line 33 of file FindPaperSummary.java.

00033 {this.queryString = queryString;}

String getExperiment (  ) 

Definition at line 37 of file FindPaperSummary.java.

00037 { return experiment; } 

void setExperiment ( String  experiment  ) 

Definition at line 38 of file FindPaperSummary.java.

00038 {this.experiment = experiment;}

String getReaction (  ) 

Definition at line 42 of file FindPaperSummary.java.

00042 { return reaction; } 

void setReaction ( String  reaction  ) 

Definition at line 43 of file FindPaperSummary.java.

00043 {this.reaction = reaction;}

String getObservable (  ) 

Definition at line 47 of file FindPaperSummary.java.

00047 { return observable; } 

void setObservable ( String  observable  ) 

Definition at line 48 of file FindPaperSummary.java.

00048 {this.observable = observable;}

String getSqrts (  ) 

Definition at line 52 of file FindPaperSummary.java.

00052 { return sqrts; } 

void setSqrts ( String  sqrts  ) 

Definition at line 53 of file FindPaperSummary.java.

00053 {this.sqrts = sqrts;}

String getPlength (  ) 

Definition at line 57 of file FindPaperSummary.java.

00057 { return plength; } 

void setPlength ( String  plength  ) 

Definition at line 58 of file FindPaperSummary.java.

00058 {this.plength = plength;}

String getStarting (  ) 

Definition at line 62 of file FindPaperSummary.java.

References FindPaperSummary.getQueryParam().

00062                                {
00063         if(getQueryParam("start") == null){starting = "1";}
00064         else {starting = getQueryParam("start");}        
00065         return starting; 
00066     } 

void setStarting ( String  starting  ) 

Definition at line 67 of file FindPaperSummary.java.

00067 {this.starting = starting;}

String getFirstQueryParameters (  ) 

Definition at line 70 of file FindPaperSummary.java.

00070                                            {
00071         StringBuffer qs = new StringBuffer();
00072         String mid = "";
00073         int number =  Integer.parseInt(plength);
00074         int newstart = 1;
00075         qs.append(mid + "experiment=" + experiment);  mid = "&";
00076         qs.append(mid + "reaction=" + reaction);  mid = "&";
00077         qs.append(mid + "observable=" + observable);  mid = "&";
00078         qs.append(mid + "sqrtslo=" + sqrts);  mid = "&";
00079         qs.append(mid + "number=" + plength + mid + "start=" + Integer.toString(newstart));
00080         return qs.toString().replaceAll("\\+","%2B");
00081     }

String getLastQueryParameters (  ) 

Definition at line 83 of file FindPaperSummary.java.

References FindPaperSummary.getCount().

00083                                           {
00084         StringBuffer qs = new StringBuffer();
00085         String mid = "";
00086         int number =  Integer.parseInt(plength);
00087         int newstart = Integer.parseInt(starting);
00088         int last = getCount().intValue();
00089         newstart = last - Integer.parseInt(plength) + 1;
00090         qs.append(mid + "experiment=" + experiment);  mid = "&";
00091         qs.append(mid + "reaction=" + reaction);  mid = "&";
00092         qs.append(mid + "observable=" + observable);  mid = "&";
00093         qs.append(mid + "sqrtslo=" + sqrts);  mid = "&";
00094         qs.append(mid + "number=" + plength + mid + "start=" + Integer.toString(newstart));
00095         return qs.toString().replaceAll("\\+","%2B");
00096     }

String getNextQueryParameters (  ) 

Definition at line 98 of file FindPaperSummary.java.

00098                                           {
00099         StringBuffer qs = new StringBuffer();
00100         String mid = "";
00101         int number =  Integer.parseInt(plength);
00102         int newstart = Integer.parseInt(starting);
00103         newstart += number;
00104         qs.append(mid + "experiment=" + experiment);  mid = "&";
00105         qs.append(mid + "reaction=" + reaction);  mid = "&";
00106         qs.append(mid + "observable=" + observable);  mid = "&";
00107         qs.append(mid + "sqrtslo=" + sqrts);  mid = "&";
00108         qs.append(mid + "number=" + plength + mid + "start=" + Integer.toString(newstart));
00109         return qs.toString().replaceAll("\\+","%2B");
00110     }

String getPrevQueryParameters (  ) 

Definition at line 112 of file FindPaperSummary.java.

00112                                           {
00113         StringBuffer qs = new StringBuffer();
00114         String mid = "";
00115         int number =  Integer.parseInt(plength);
00116         int newstart = Integer.parseInt(starting);
00117         newstart -= number;
00118         qs.append(mid + "experiment=" + experiment);  mid = "&";
00119         qs.append(mid + "reaction=" + reaction);  mid = "&";
00120         qs.append(mid + "observable=" + observable);  mid = "&";
00121         qs.append(mid + "sqrtslo=" + sqrts);  mid = "&";
00122         qs.append(mid + "number=" + plength + mid + "start=" + Integer.toString(newstart));
00123         return qs.toString().replaceAll("\\+","%2B");
00124     }

String getFirstNumber (  ) 

Definition at line 126 of file FindPaperSummary.java.

References FindPaperSummary.getQueryParam().

00126                                   {
00127        if(getQueryParam("start") == null){starting = "1";}else {starting = getQueryParam("start");}        
00128        return starting;
00129     }

String getSearchString (  ) 

Definition at line 131 of file FindPaperSummary.java.

00131                                    {
00132         StringBuffer qs = new StringBuffer();
00133         qs.append("(");
00134         qs.append(reaction);
00135         qs.append(")");
00136         qs.append(" " + observable);
00137         qs.append(" " + sqrts);
00138         qs.append(" " + sqrts);
00139         return qs.toString();
00140     }

String getLastNumber (  ) 

Definition at line 142 of file FindPaperSummary.java.

00142                                  {
00143         int first =  Integer.parseInt(starting);
00144         int number = Integer.parseInt(plength);
00145         int last = first + number - 1;
00146         return Integer.toString(last);
00147    }

String getPageSize (  ) 

Definition at line 149 of file FindPaperSummary.java.

00149                                {
00150        return plength;
00151     }

Long getCount (  ) 

Definition at line 153 of file FindPaperSummary.java.

References FindPaperSummary.getQueryParam().

Referenced by FindPaperSummary.getLastQueryParameters().

00153                           {
00154         if(
00155            (getQueryParam("experiment") == null || getQueryParam("experiment").equals("null")) 
00156                          && (experiment == null || experiment.equals("null")) 
00157        && (getQueryParam("queryString") == null || getQueryParam("queryString").equals("null")) 
00158                         && (queryString == null || queryString.equals("null")) 
00159           ){
00160             return (Long) ConstructQueryPaper.Physics(experiment,null,null,reaction,observable,sqrts,"count",_session).uniqueResult();
00161         }
00162         else if(
00163           (getQueryParam("queryString") == null || getQueryParam("queryString").equals("null")) 
00164                         && (queryString == null || queryString.equals("null")) 
00165           ){
00166             return (Long) ConstructQueryPaper.Experiment(experiment,"count",_session).uniqueResult();
00167         }
00168         else{
00169             return (Long) ConstructQueryPaper.QueryString(queryString,"count",_session).uniqueResult();
00170         }
00171 
00172 //        if((getQueryParam("experiment") == null || getQueryParam("experiment").equals("null")) 
00173 //                       && (experiment == null || experiment.equals("null")) ){
00174 //           return (Long) ConstructQuery.Papers(reaction,observable,sqrts,"count",_session).uniqueResult();
00175 //         }
00176 //        else{           
00177 //           return (Long) ConstructQuery.Papers(experiment,"count",_session).uniqueResult();
00178 //        }
00179    }

String getFirstAuthorName (  ) 

Definition at line 181 of file FindPaperSummary.java.

00181                                      {
00182        int n = 0;
00183        String _firstauthor = "";
00184        for (String author : _paper.getAuthors()){
00185          n += 1;
00186          if(n == 1) {_firstauthor = author;}
00187        }
00188        String _refdate = "xx";
00189        for (Reference reference : _paper.getReferences()){
00190           _refdate = reference.getDate();
00191        }
00192         int _lref = _refdate.length();
00193        _firstauthor = _firstauthor + " " + _refdate.substring(_lref-2,_lref);
00194        return _firstauthor;
00195    }

String getFirstExperimentName (  ) 

Definition at line 196 of file FindPaperSummary.java.

00196                                          {
00197        int n = 0;
00198        String _firstexperiment = "";
00199        for (Experiment experiment : _paper.getExperiments()){
00200            n += 1;
00201            if(n == 1) { _firstexperiment = experiment.getName();}
00202        }
00203        return _firstexperiment;
00204    }

String getFirstInformalName (  ) 

Definition at line 205 of file FindPaperSummary.java.

00205                                       {
00206        int n = 0;
00207        String _firstinformal = "";
00208        for (Experiment experiment : _paper.getExperiments()){
00209            n += 1;
00210            if(n == 1) { _firstinformal = experiment.getInformalName();}
00211        }
00212        return _firstinformal;
00213    }

String getFirstPublished (  ) 

Definition at line 214 of file FindPaperSummary.java.

00214                                     {
00215        int n = 0;
00216        String _firstpublished = "Not Published";
00217        for (Reference ref : _paper.getReferences()){
00218            String refdesc = ref.getDescription();
00219            if(refdesc.startsWith("PL")  ||
00220               refdesc.startsWith("PR")  ||
00221               refdesc.startsWith("ZP")  ||
00222               refdesc.startsWith("EPJ") ||
00223               refdesc.startsWith("NC")  ||
00224               refdesc.startsWith("JPG") ||
00225               refdesc.startsWith("JHEP") ){
00226                  n += 1;
00227                  if(n == 1) { _firstpublished = refdesc;}
00228            }
00229        }
00230        return _firstpublished;
00231    }

String getFirstPreprint (  ) 

Definition at line 232 of file FindPaperSummary.java.

00232                                    {
00233        int n = 0;
00234        String _firstpreprint= "Not Known";
00235        for (Reference reference : _paper.getReferences()){
00236            String ref = reference.getDescription();
00237            if(ref.startsWith("PL")  ||
00238               ref.startsWith("PR")  ||
00239               ref.startsWith("ZP")  ||
00240               ref.startsWith("EPJ") ||
00241               ref.startsWith("NC")  ||
00242               ref.startsWith("JPG") ||
00243               ref.startsWith("JHEP") ){
00244             }
00245            else{
00246                  n += 1;
00247                  if(n == 1) { _firstpreprint = ref;}
00248              
00249            }
00250        }
00251        return _firstpreprint;
00252    }

String getTitle (  ) 

Definition at line 254 of file FindPaperSummary.java.

00254                            {
00255        return _paper.getTitle();
00256    }

String setCounter (  ) 

Definition at line 259 of file FindPaperSummary.java.

00259                              {
00260        counter = Integer.parseInt(starting)-1;
00261        return "";
00262    }

int getCounter (  ) 

Definition at line 263 of file FindPaperSummary.java.

00263                           {
00264        counter += 1;
00265        return counter;
00266    }

Paper getPaper (  ) 

Definition at line 269 of file FindPaperSummary.java.

00269 {  return _paper; }

void setPaper ( Paper  paper  ) 

Definition at line 270 of file FindPaperSummary.java.

00270 {  _paper = paper; }

List<Paper> getPapers (  ) 

Definition at line 272 of file FindPaperSummary.java.

References FindPaperSummary.getQueryParam().

00272                                    {
00273         if(getQueryParam("queryString") == null){}else{ queryString = getQueryParam("queryString"); }
00274         if(getQueryParam("experiment") == null){}else{ experiment = getQueryParam("experiment"); }
00275         if(getQueryParam("reaction") == null){}else{ reaction = getQueryParam("reaction"); }
00276         if(getQueryParam("observable") == null){}else {observable = getQueryParam("observable");}
00277         if(getQueryParam("sqrtslo") == null){}else {sqrts = getQueryParam("sqrtslo");}
00278         if(getQueryParam("number") == null){}else {plength = getQueryParam("number");}
00279         if(getQueryParam("start") == null){}else {starting = getQueryParam("start");}        
00280         Query q=null;
00281         if(
00282            (getQueryParam("experiment") == null || getQueryParam("experiment").equals("null")) 
00283                          && (experiment == null || experiment.equals("null")) 
00284        && (getQueryParam("queryString") == null || getQueryParam("queryString").equals("null")) 
00285                         && (queryString == null || queryString.equals("null")) 
00286           ){
00287             q = ConstructQueryPaper.Physics(experiment,null,null,reaction,observable,sqrts,"",_session);
00288         }
00289         else if(
00290           (getQueryParam("queryString") == null || getQueryParam("queryString").equals("null")) 
00291                         && (queryString == null || queryString.equals("null")) 
00292           ){
00293             q = ConstructQueryPaper.Experiment(experiment,"",_session);
00294         }
00295         else{
00296             q = ConstructQueryPaper.QueryString(queryString,"",_session);
00297         }
00298            // how many results do we want out and where to start
00299         int first = Integer.parseInt(starting);
00300         // setFirstResult counts from zero!!
00301         first=first-1;
00302         q.setFirstResult(first).setMaxResults(Integer.parseInt(plength));
00303            // execute the query and return the list of results
00304         return q.list();   
00305  
00306     }


The documentation for this class was generated from the following file:


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