org.apache.portals.gems.browser
Class BrowserPortlet

java.lang.Object
  extended byjavax.portlet.GenericPortlet
      extended byorg.apache.portals.bridges.common.GenericServletPortlet
          extended byorg.apache.portals.bridges.velocity.GenericVelocityPortlet
              extended byorg.apache.portals.gems.browser.BrowserPortlet
All Implemented Interfaces:
Browser, javax.portlet.Portlet, javax.portlet.PortletConfig
Direct Known Subclasses:
DatabaseBrowserPortlet

public class BrowserPortlet
extends org.apache.portals.bridges.velocity.GenericVelocityPortlet
implements Browser

AbstractBrowserPortlet

Version:
$Id: AbstractBrowserPortlet.java,v 1.2 2005/01/01 00:01:29 taylor Exp $
Author:
David Sean Taylor

Field Summary
protected static String BROWSER_ACTION_KEY
           
protected static String BROWSER_ITERATOR
           
protected static String BROWSER_TABLE_SIZE
           
protected static String BROWSER_TITLE_ITERATOR
           
protected  javax.portlet.PortletContext context
           
protected static String CUSTOMIZE_TEMPLATE
           
protected static String FILTER
           
protected static String FILTERED
           
protected static String FIND
           
protected static String FIRST
           
protected static String LAST
           
protected static String LINKS_READ
           
protected  org.apache.commons.logging.Log log
          Static initialization of the logger for this class
protected static String NEXT
           
protected static String PEID
           
protected static String POOLNAME
           
protected static String PREVIOUS
           
protected static String ROW_LINK
           
protected static String ROW_LINK_IDS
           
protected static String ROW_LINK_TARGETS
           
protected static String ROW_LINK_TYPES
           
protected static String SEARCH_COLUMN
           
protected static String SEARCH_STRING
           
protected static String SORT_COLUMN_NAME
           
protected static String SQL
           
protected static String SQL_PARAM_PREFIX
           
protected  List sqlParameters
           
protected  org.apache.jetspeed.sso.SSOProvider sso
           
protected static String START
           
protected static String TABLE_LINK
           
protected static String TABLE_LINK_IDS
           
protected static String TABLE_LINK_TARGETS
           
protected static String TABLE_LINK_TYPES
           
protected static String USER_OBJECT_NAMES
           
protected static String USER_OBJECT_TYPES
           
protected static String USER_OBJECTS
           
protected static String VELOCITY_NULL_ENTRY
           
protected static String WINDOW_SIZE
           
 
Fields inherited from class org.apache.portals.bridges.velocity.GenericVelocityPortlet
PORTLET_BRIDGE_CONTEXT
 
Fields inherited from class org.apache.portals.bridges.common.GenericServletPortlet
PARAM_ACTION_PAGE, PARAM_ALLOW_PREFERENCES, PARAM_CUSTOM_PAGE, PARAM_EDIT_PAGE, PARAM_HELP_PAGE, PARAM_MAX_PAGE, PARAM_VIEW_PAGE
 
Fields inherited from class javax.portlet.GenericPortlet
 
Constructor Summary
BrowserPortlet()
           
 
Method Summary
protected  void clearBrowserIterator(javax.portlet.PortletRequest request)
          Centralizes the calls to session - to clear the BrowserIterator from the temp storage.
 void doEdit(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
 void doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
 boolean filter(List row, javax.portlet.RenderRequest request)
           
 int find(BrowserIterator iterator, String searchString, String searchColumn)
           
protected  BrowserIterator getBrowserIterator(javax.portlet.PortletRequest request)
          Centralizes the calls to session - to retrieve the BrowserIterator.
protected  String getPreference(javax.portlet.RenderRequest request, String attrName, String attrDefValue)
           
 String getQueryString(javax.portlet.RenderRequest request)
           
protected  String getQueryString(javax.portlet.RenderRequest request, org.apache.velocity.context.Context context)
          This method returns the sql from the getQuery method which can be overwritten according to the needs of the application.
 void getRows(javax.portlet.RenderRequest request, String sql, int windowSize)
           
 void getRows(javax.portlet.RenderRequest request, String sql, int windowSize, String filter)
           
protected  int getStartIndex()
          to be used if sorting behavior to be overwritten
protected  int getStartVariable(javax.portlet.RenderRequest request, String attrName, String sortColName, BrowserIterator iterator)
           
 void init(javax.portlet.PortletConfig config)
           
 void populate(int rowIndex, int columnIndex, List row)
          This method should be overwritten every time the user object needs to be populated with some user specific constraints.
 void processAction(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
           
 void publishStatusMessage(javax.portlet.PortletRequest request, String portlet, String topic, Throwable e, String message)
           
protected  void readLinkParameters(javax.portlet.RenderRequest request, org.apache.velocity.context.Context context)
           
protected  void readSqlParameters(javax.portlet.RenderRequest request)
           
protected  void readUserParameters(javax.portlet.RenderRequest request, org.apache.velocity.context.Context context)
           
protected  void setBrowserIterator(javax.portlet.RenderRequest request, BrowserIterator iterator)
          Centralizes the calls to session - to set the BrowserIterator.
 void setSQLParameters(List parameters)
           
 
Methods inherited from class org.apache.portals.bridges.velocity.GenericVelocityPortlet
doCustom, doHelp, doPreferencesEdit, getContext, render, setupPreferencesEdit
 
Methods inherited from class org.apache.portals.bridges.common.GenericServletPortlet
getDefaultActionPage, getDefaultCustomPage, getDefaultEditPage, getDefaultHelpPage, getDefaultViewPage, processPreferencesAction, setDefaultActionPage, setDefaultCustomPage, setDefaultEditPage, setDefaultHelpPage, setDefaultViewPage
 
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, getInitParameter, getInitParameterNames, getPortletConfig, getPortletContext, getPortletName, getResourceBundle, getTitle, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SQL

protected static final String SQL
See Also:
Constant Field Values

POOLNAME

protected static final String POOLNAME
See Also:
Constant Field Values

START

protected static final String START
See Also:
Constant Field Values

FIND

protected static final String FIND
See Also:
Constant Field Values

SEARCH_STRING

protected static final String SEARCH_STRING
See Also:
Constant Field Values

SEARCH_COLUMN

protected static final String SEARCH_COLUMN
See Also:
Constant Field Values

FILTERED

protected static final String FILTERED
See Also:
Constant Field Values

FILTER

protected static final String FILTER
See Also:
Constant Field Values

CUSTOMIZE_TEMPLATE

protected static final String CUSTOMIZE_TEMPLATE
See Also:
Constant Field Values

WINDOW_SIZE

protected static final String WINDOW_SIZE
See Also:
Constant Field Values

USER_OBJECT_NAMES

protected static final String USER_OBJECT_NAMES
See Also:
Constant Field Values

USER_OBJECT_TYPES

protected static final String USER_OBJECT_TYPES
See Also:
Constant Field Values

USER_OBJECTS

protected static final String USER_OBJECTS
See Also:
Constant Field Values

SQL_PARAM_PREFIX

protected static final String SQL_PARAM_PREFIX
See Also:
Constant Field Values

LINKS_READ

protected static final String LINKS_READ
See Also:
Constant Field Values

ROW_LINK

protected static final String ROW_LINK
See Also:
Constant Field Values

TABLE_LINK

protected static final String TABLE_LINK
See Also:
Constant Field Values

ROW_LINK_IDS

protected static final String ROW_LINK_IDS
See Also:
Constant Field Values

ROW_LINK_TYPES

protected static final String ROW_LINK_TYPES
See Also:
Constant Field Values

ROW_LINK_TARGETS

protected static final String ROW_LINK_TARGETS
See Also:
Constant Field Values

TABLE_LINK_IDS

protected static final String TABLE_LINK_IDS
See Also:
Constant Field Values

TABLE_LINK_TYPES

protected static final String TABLE_LINK_TYPES
See Also:
Constant Field Values

TABLE_LINK_TARGETS

protected static final String TABLE_LINK_TARGETS
See Also:
Constant Field Values

BROWSER_TABLE_SIZE

protected static final String BROWSER_TABLE_SIZE
See Also:
Constant Field Values

BROWSER_ACTION_KEY

protected static final String BROWSER_ACTION_KEY
See Also:
Constant Field Values

BROWSER_ITERATOR

protected static final String BROWSER_ITERATOR
See Also:
Constant Field Values

BROWSER_TITLE_ITERATOR

protected static final String BROWSER_TITLE_ITERATOR
See Also:
Constant Field Values

NEXT

protected static final String NEXT
See Also:
Constant Field Values

PREVIOUS

protected static final String PREVIOUS
See Also:
Constant Field Values

FIRST

protected static final String FIRST
See Also:
Constant Field Values

LAST

protected static final String LAST
See Also:
Constant Field Values

VELOCITY_NULL_ENTRY

protected static final String VELOCITY_NULL_ENTRY
See Also:
Constant Field Values

PEID

protected static final String PEID
See Also:
Constant Field Values

SORT_COLUMN_NAME

protected static final String SORT_COLUMN_NAME
See Also:
Constant Field Values

sqlParameters

protected List sqlParameters

context

protected javax.portlet.PortletContext context

sso

protected org.apache.jetspeed.sso.SSOProvider sso

log

protected org.apache.commons.logging.Log log
Static initialization of the logger for this class

Constructor Detail

BrowserPortlet

public BrowserPortlet()
Method Detail

init

public void init(javax.portlet.PortletConfig config)
          throws javax.portlet.PortletException
Specified by:
init in interface javax.portlet.Portlet
Throws:
javax.portlet.PortletException

getRows

public void getRows(javax.portlet.RenderRequest request,
                    String sql,
                    int windowSize)
             throws Exception
Specified by:
getRows in interface Browser
Throws:
Exception

getRows

public void getRows(javax.portlet.RenderRequest request,
                    String sql,
                    int windowSize,
                    String filter)
             throws Exception
Throws:
Exception

doView

public void doView(javax.portlet.RenderRequest request,
                   javax.portlet.RenderResponse response)
            throws javax.portlet.PortletException,
                   IOException
Throws:
javax.portlet.PortletException
IOException

doEdit

public void doEdit(javax.portlet.RenderRequest request,
                   javax.portlet.RenderResponse response)
            throws javax.portlet.PortletException,
                   IOException
Throws:
javax.portlet.PortletException
IOException

processAction

public void processAction(javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response)
                   throws javax.portlet.PortletException,
                          IOException
Specified by:
processAction in interface javax.portlet.Portlet
Throws:
javax.portlet.PortletException
IOException

getBrowserIterator

protected BrowserIterator getBrowserIterator(javax.portlet.PortletRequest request)
Centralizes the calls to session - to retrieve the BrowserIterator.


setBrowserIterator

protected void setBrowserIterator(javax.portlet.RenderRequest request,
                                  BrowserIterator iterator)
Centralizes the calls to session - to set the BrowserIterator.


clearBrowserIterator

protected void clearBrowserIterator(javax.portlet.PortletRequest request)
Centralizes the calls to session - to clear the BrowserIterator from the temp storage.


getStartVariable

protected int getStartVariable(javax.portlet.RenderRequest request,
                               String attrName,
                               String sortColName,
                               BrowserIterator iterator)

getStartIndex

protected int getStartIndex()
to be used if sorting behavior to be overwritten


getQueryString

protected String getQueryString(javax.portlet.RenderRequest request,
                                org.apache.velocity.context.Context context)
This method returns the sql from the getQuery method which can be overwritten according to the needs of the application. If the getQuery() returns null, then it gets the value from the psml file. If the psml value is null then it returns the value from the xreg file.


getQueryString

public String getQueryString(javax.portlet.RenderRequest request)

getPreference

protected String getPreference(javax.portlet.RenderRequest request,
                               String attrName,
                               String attrDefValue)

readUserParameters

protected void readUserParameters(javax.portlet.RenderRequest request,
                                  org.apache.velocity.context.Context context)

readSqlParameters

protected void readSqlParameters(javax.portlet.RenderRequest request)

setSQLParameters

public void setSQLParameters(List parameters)

readLinkParameters

protected void readLinkParameters(javax.portlet.RenderRequest request,
                                  org.apache.velocity.context.Context context)

populate

public void populate(int rowIndex,
                     int columnIndex,
                     List row)
This method should be overwritten every time the user object needs to be populated with some user specific constraints. As an example if the user wanted to track the parent of an object based on some calculation per row, it could be done here.

Specified by:
populate in interface Browser

filter

public boolean filter(List row,
                      javax.portlet.RenderRequest request)
Specified by:
filter in interface Browser

publishStatusMessage

public void publishStatusMessage(javax.portlet.PortletRequest request,
                                 String portlet,
                                 String topic,
                                 Throwable e,
                                 String message)

find

public int find(BrowserIterator iterator,
                String searchString,
                String searchColumn)


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.