[Nmrshiftdb-devel] CVS: nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets SearchByFormulaPortl
Brought to you by:
steinbeck
|
From: Stefan K. <sh...@us...> - 2002-05-30 10:59:54
|
Update of /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets
In directory usw-pr-cvs1:/tmp/cvs-serv9952/src/java/org/openscience/nmrshiftdb/portlets
Modified Files:
SearchByFormulaPortlet.java SearchByNamePortlet.java
SearchBySpectrumPortlet.java
Log Message:
User input in the search fields is now kept for longer (til now it was lost as soon as the user browsed the results or viewed details)
Index: SearchByFormulaPortlet.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SearchByFormulaPortlet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** SearchByFormulaPortlet.java 13 May 2002 12:24:52 -0000 1.3
--- SearchByFormulaPortlet.java 30 May 2002 10:59:51 -0000 1.4
***************
*** 36,44 ****
{
HttpServletRequest req = runData.getRequest();
! String spectrum = req.getParameter("formula");
! if (spectrum == null)
! {
! spectrum = "";
! }
try
{
--- 36,45 ----
{
HttpServletRequest req = runData.getRequest();
! String formula = req.getParameter("formula");
! HttpSession session = req.getSession();
! if (formula == null)
! formula = "";
! else
! session.setAttribute("formula",formula);
try
{
***************
*** 55,59 ****
VelocityContext context = new VelocityContext();
! context.put("searchFormula", spectrum);
/*
--- 56,60 ----
VelocityContext context = new VelocityContext();
! context.put("searchFormula", session.getAttribute("formula"));
/*
Index: SearchByNamePortlet.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SearchByNamePortlet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** SearchByNamePortlet.java 13 May 2002 12:24:52 -0000 1.3
--- SearchByNamePortlet.java 30 May 2002 10:59:51 -0000 1.4
***************
*** 36,44 ****
{
HttpServletRequest req = runData.getRequest();
! String spectrum = req.getParameter("searchstring");
! if (spectrum == null)
! {
! spectrum = "";
! }
try
{
--- 36,45 ----
{
HttpServletRequest req = runData.getRequest();
! String name = req.getParameter("searchstring");
! HttpSession session = req.getSession();
! if (name == null)
! name = "";
! else
! session.setAttribute("name",name);
try
{
***************
*** 55,59 ****
VelocityContext context = new VelocityContext();
! context.put("searchName", spectrum);
/*
--- 56,60 ----
VelocityContext context = new VelocityContext();
! context.put("searchName", session.getAttribute("name"));
/*
Index: SearchBySpectrumPortlet.java
===================================================================
RCS file: /cvsroot/nmrshiftdb/nmrshiftdb/src/java/org/openscience/nmrshiftdb/portlets/SearchBySpectrumPortlet.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** SearchBySpectrumPortlet.java 29 May 2002 14:39:20 -0000 1.4
--- SearchBySpectrumPortlet.java 30 May 2002 10:59:51 -0000 1.5
***************
*** 37,47 ****
--- 37,51 ----
HttpServletRequest req = runData.getRequest();
String spectrum = req.getParameter("spectrum");
+ HttpSession session = req.getSession();
String numberOfHits = req.getParameter("numberOfHits");
if (spectrum == null)
{
spectrum = "";
+ }else{
+ session.setAttribute("spectrum",spectrum);
}
if(numberOfHits == null)
numberOfHits="100";
+ session.setAttribute("numberOfHits",numberOfHits);
try
{
***************
*** 58,63 ****
VelocityContext context = new VelocityContext();
! context.put("searchSpectrum", spectrum);
! context.put("numberOfHits",numberOfHits);
/*
--- 62,67 ----
VelocityContext context = new VelocityContext();
! context.put("searchSpectrum", session.getAttribute("spectrum"));
! context.put("numberOfHits",session.getAttribute("numberOfHits"));
/*
|