org.openscience.nmrshiftdb.portlets
Class ResultPortlet

java.lang.Object
  extended by org.apache.jetspeed.portal.portlets.AbstractPortlet
      extended by org.openscience.nmrshiftdb.portlets.ResultPortlet
All Implemented Interfaces:
java.io.Serializable, org.apache.jetspeed.portal.Portlet, org.apache.jetspeed.portal.PortletState, org.apache.jetspeed.services.portletcache.Cacheable, org.apache.turbine.services.cache.Refreshable

public class ResultPortlet
extends org.apache.jetspeed.portal.portlets.AbstractPortlet

This is the portlet handling searches

Author:
Stefan Kuhn
See Also:
Serialized Form

Field Summary
private  int MOLECULES_PER_PAGE
           
private  int PAGES_PER_BROWSE_LINE
           
 
Fields inherited from class org.apache.jetspeed.portal.portlets.AbstractPortlet
content
 
Fields inherited from interface org.apache.jetspeed.portal.Portlet
PORTLET_MAXIMIZED, PORTLET_MINIMIZED, PORTLET_NORMAL
 
Constructor Summary
ResultPortlet()
           
 
Method Summary
private  java.util.ArrayList executeLastSearch(javax.servlet.http.HttpSession session, StringAndInt chiralMessage, org.apache.turbine.util.RunData runData)
          Executes the last search
private  java.util.ArrayList executeSearch(javax.servlet.http.HttpSession session, int[] searches, StringAndInt chiralMessage, org.apache.turbine.util.RunData runData)
          Executes searches from the searchHistory.
private  java.util.ArrayList executeSearch(javax.servlet.http.HttpSession session, int[] searches, StringAndInt chiralMessage, org.apache.turbine.util.RunData runData, boolean not, boolean andor)
          Executes searches from the searchHistory.
 org.apache.ecs.ConcreteElement getContent(org.apache.turbine.util.RunData runData)
          Gets the HTML to be displayed in the portlet
static int[] getSearches(javax.servlet.http.HttpSession session)
          Gets the searches attribute of the session
 
Methods inherited from class org.apache.jetspeed.portal.portlets.AbstractPortlet
allowClose, allowCustomize, allowInfo, allowMaximize, allowMinimize, allowPrintFriendly, allowView, clearContent, getAllowEdit, getAllowMaximize, getAllowView, getAttribute, getContent, getContent, getCreationTime, getDescription, getDescription, getExpirationMillis, getExpire, getHandle, getHandle, getID, getImage, getImage, getInstance, getName, getPortletConfig, getTitle, getTitle, init, isCacheable, isClosed, isMinimized, isShowTitleBar, providesCustomization, refresh, setAttribute, setCacheable, setCachedObject, setClosed, setContent, setContent, setContent, setCreationTime, setDescription, setExpirationMillis, setHandle, setID, setImage, setMinimized, setName, setPortletConfig, setTitle, setTitle, supportsType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOLECULES_PER_PAGE

private final int MOLECULES_PER_PAGE
See Also:
Constant Field Values

PAGES_PER_BROWSE_LINE

private final int PAGES_PER_BROWSE_LINE
See Also:
Constant Field Values
Constructor Detail

ResultPortlet

public ResultPortlet()
Method Detail

getContent

public org.apache.ecs.ConcreteElement getContent(org.apache.turbine.util.RunData runData)
Gets the HTML to be displayed in the portlet

Specified by:
getContent in interface org.apache.jetspeed.portal.Portlet
Overrides:
getContent in class org.apache.jetspeed.portal.portlets.AbstractPortlet
Parameters:
runData - Created by turbine
Returns:
The content value
Since:

getSearches

public static int[] getSearches(javax.servlet.http.HttpSession session)
Gets the searches attribute of the session

Parameters:
session - The current searches
Returns:
The searches value

executeLastSearch

private java.util.ArrayList executeLastSearch(javax.servlet.http.HttpSession session,
                                              StringAndInt chiralMessage,
                                              org.apache.turbine.util.RunData runData)
                                       throws java.lang.Exception
Executes the last search

Parameters:
session - Current session
Returns:
ArrayList of mdls from MOLECULE table.
Throws:
java.lang.Exception - Database problems

executeSearch

private java.util.ArrayList executeSearch(javax.servlet.http.HttpSession session,
                                          int[] searches,
                                          StringAndInt chiralMessage,
                                          org.apache.turbine.util.RunData runData)
                                   throws NmrshiftdbException,
                                          java.lang.Exception
Executes searches from the searchHistory.

Parameters:
session - The current session.
searches - The searches to execute. Each figure in searches means the search in this position in sarchHistory will be executed, all searches are AND linked.
Returns:
ArrayList of mdls from MOLECULE table.
Throws:
java.lang.Exception - Database problems
NmrshiftdbException

executeSearch

private java.util.ArrayList executeSearch(javax.servlet.http.HttpSession session,
                                          int[] searches,
                                          StringAndInt chiralMessage,
                                          org.apache.turbine.util.RunData runData,
                                          boolean not,
                                          boolean andor)
                                   throws NmrshiftdbException,
                                          java.lang.Exception
Executes searches from the searchHistory.

Parameters:
session - The current session.
searches - The searches to execute. Each figure in searches means the search in this position in sarchHistory will be executed, all searches are AND linked.
Returns:
ArrayList of mdls from MOLECULE table.
Throws:
java.lang.Exception - Database problems
NmrshiftdbException