org.apache.portals.gems.browser
Class BrowserPortlet

java.lang.Object
  extended by javax.portlet.GenericPortlet
      extended by org.apache.portals.bridges.common.GenericServletPortlet
          extended by org.apache.portals.bridges.velocity.GenericVelocityPortlet
              extended by org.apache.portals.gems.browser.BrowserPortlet
All Implemented Interfaces:
javax.portlet.Portlet, javax.portlet.PortletConfig, Browser
Direct Known Subclasses:
DatabaseBrowserPortlet, GroupBrowser, GroupChooserPortlet, GroupDetails, PortletSelector, RoleBrowser, RoleChooserPortlet, RoleChooserPortlet, RoleDetails, SecurityUtil, SSOBrowser, SSODetails, UserBrowser

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 java.lang.String BROWSER_ACTION_KEY
           
protected static java.lang.String BROWSER_ITERATOR
           
protected static java.lang.String BROWSER_TABLE_SIZE
           
protected static java.lang.String BROWSER_TITLE_ITERATOR
           
protected  javax.portlet.PortletContext context
           
protected static java.lang.String CUSTOMIZE_TEMPLATE
           
protected static java.lang.String FILTER
           
protected static java.lang.String FILTERED
           
protected static java.lang.String FIND
           
protected static java.lang.String FIRST
           
protected static java.lang.String LAST
           
protected static java.lang.String LINKS_READ
           
protected  org.apache.commons.logging.Log log
          Static initialization of the logger for this class
protected static java.lang.String NEXT
           
protected static java.lang.String PEID
           
protected static java.lang.String POOLNAME
           
protected static java.lang.String PREVIOUS
           
protected static java.lang.String ROW_LINK
           
protected static java.lang.String ROW_LINK_IDS
           
protected static java.lang.String ROW_LINK_TARGETS
           
protected static java.lang.String ROW_LINK_TYPES
           
protected static java.lang.String SEARCH_COLUMN
           
protected static java.lang.String SEARCH_STRING
           
protected static java.lang.String SORT_COLUMN_NAME
           
protected static java.lang.String SQL
           
protected static java.lang.String SQL_PARAM_PREFIX
           
protected  java.util.List sqlParameters
           
protected  SSOProvider sso
           
protected static java.lang.String START
           
protected static java.lang.String TABLE_LINK
           
protected static java.lang.String TABLE_LINK_IDS
           
protected static java.lang.String TABLE_LINK_TARGETS
           
protected static java.lang.String TABLE_LINK_TYPES
           
protected static java.lang.String USER_OBJECT_NAMES
           
protected static java.lang.String USER_OBJECT_TYPES
           
protected static java.lang.String USER_OBJECTS
           
protected static java.lang.String VELOCITY_NULL_ENTRY
           
protected static java.lang.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
 
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(java.util.List row, javax.portlet.RenderRequest request)
           
 int find(BrowserIterator iterator, java.lang.String searchString, java.lang.String searchColumn)
           
protected  BrowserIterator getBrowserIterator(javax.portlet.PortletRequest request)
          Centralizes the calls to session - to retrieve the BrowserIterator.
protected  java.lang.String getPreference(javax.portlet.RenderRequest request, java.lang.String attrName, java.lang.String attrDefValue)
           
 java.lang.String getQueryString(javax.portlet.RenderRequest request)
           
protected  java.lang.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, java.lang.String sql, int windowSize)
           
 void getRows(javax.portlet.RenderRequest request, java.lang.String sql, int windowSize, java.lang.String filter)
           
protected  int getStartIndex()
          to be used if sorting behavior to be overwritten
protected  int getStartVariable(javax.portlet.RenderRequest request, java.lang.String attrName, java.lang.String sortColName, BrowserIterator iterator)
           
 void init(javax.portlet.PortletConfig config)
           
 void populate(int rowIndex, int columnIndex, java.util.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, java.lang.String portlet, java.lang.String topic, java.lang.Throwable e, java.lang.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(java.util.List parameters)
           
 
Methods inherited from class org.apache.portals.bridges.velocity.GenericVelocityPortlet
doCustom, doHelp, doPreferencesEdit, getContext, 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 java.lang.String SQL
See Also:
Constant Field Values

POOLNAME

protected static final java.lang.String POOLNAME
See Also:
Constant Field Values

START

protected static final java.lang.String START
See Also:
Constant Field Values

FIND

protected static final java.lang.String FIND
See Also:
Constant Field Values

SEARCH_STRING

protected static final java.lang.String SEARCH_STRING
See Also:
Constant Field Values

SEARCH_COLUMN

protected static final java.lang.String SEARCH_COLUMN
See Also:
Constant Field Values

FILTERED

protected static final java.lang.String FILTERED
See Also:
Constant Field Values

FILTER

protected static final java.lang.String FILTER
See Also:
Constant Field Values

CUSTOMIZE_TEMPLATE

protected static final java.lang.String CUSTOMIZE_TEMPLATE
See Also:
Constant Field Values

WINDOW_SIZE

protected static final java.lang.String WINDOW_SIZE
See Also:
Constant Field Values

USER_OBJECT_NAMES

protected static final java.lang.String USER_OBJECT_NAMES
See Also:
Constant Field Values

USER_OBJECT_TYPES

protected static final java.lang.String USER_OBJECT_TYPES
See Also:
Constant Field Values

USER_OBJECTS

protected static final java.lang.String USER_OBJECTS
See Also:
Constant Field Values

SQL_PARAM_PREFIX

protected static final java.lang.String SQL_PARAM_PREFIX
See Also:
Constant Field Values

LINKS_READ

protected static final java.lang.String LINKS_READ
See Also:
Constant Field Values

ROW_LINK

protected static final java.lang.String ROW_LINK
See Also:
Constant Field Values

TABLE_LINK

protected static final java.lang.String TABLE_LINK
See Also:
Constant Field Values

ROW_LINK_IDS

protected static final java.lang.String ROW_LINK_IDS
See Also:
Constant Field Values

ROW_LINK_TYPES

protected static final java.lang.String ROW_LINK_TYPES
See Also:
Constant Field Values

ROW_LINK_TARGETS

protected static final java.lang.String ROW_LINK_TARGETS
See Also:
Constant Field Values

TABLE_LINK_IDS

protected static final java.lang.String TABLE_LINK_IDS
See Also:
Constant Field Values

TABLE_LINK_TYPES

protected static final java.lang.String TABLE_LINK_TYPES
See Also:
Constant Field Values

TABLE_LINK_TARGETS

protected static final java.lang.String TABLE_LINK_TARGETS
See Also:
Constant Field Values

BROWSER_TABLE_SIZE

protected static final java.lang.String BROWSER_TABLE_SIZE
See Also:
Constant Field Values

BROWSER_ACTION_KEY

protected static final java.lang.String BROWSER_ACTION_KEY
See Also:
Constant Field Values

BROWSER_ITERATOR

protected static final java.lang.String BROWSER_ITERATOR
See Also:
Constant Field Values

BROWSER_TITLE_ITERATOR

protected static final java.lang.String BROWSER_TITLE_ITERATOR
See Also:
Constant Field Values

NEXT

protected static final java.lang.String NEXT
See Also:
Constant Field Values

PREVIOUS

protected static final java.lang.String PREVIOUS
See Also:
Constant Field Values

FIRST

protected static final java.lang.String FIRST
See Also:
Constant Field Values

LAST

protected static final java.lang.String LAST
See Also:
Constant Field Values

VELOCITY_NULL_ENTRY

protected static final java.lang.String VELOCITY_NULL_ENTRY
See Also:
Constant Field Values

PEID

protected static final java.lang.String PEID
See Also:
Constant Field Values

SORT_COLUMN_NAME

protected static final java.lang.String SORT_COLUMN_NAME
See Also:
Constant Field Values

sqlParameters

protected java.util.List sqlParameters

context

protected javax.portlet.PortletContext context

sso

protected 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
Overrides:
init in class org.apache.portals.bridges.velocity.GenericVelocityPortlet
Throws:
javax.portlet.PortletException

getRows

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

getRows

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

doView

public void doView(javax.portlet.RenderRequest request,
                   javax.portlet.RenderResponse response)
            throws javax.portlet.PortletException,
                   java.io.IOException
Overrides:
doView in class org.apache.portals.bridges.velocity.GenericVelocityPortlet
Throws:
javax.portlet.PortletException
java.io.IOException

doEdit

public void doEdit(javax.portlet.RenderRequest request,
                   javax.portlet.RenderResponse response)
            throws javax.portlet.PortletException,
                   java.io.IOException
Overrides:
doEdit in class org.apache.portals.bridges.velocity.GenericVelocityPortlet
Throws:
javax.portlet.PortletException
java.io.IOException

processAction

public void processAction(javax.portlet.ActionRequest request,
                          javax.portlet.ActionResponse response)
                   throws javax.portlet.PortletException,
                          java.io.IOException
Specified by:
processAction in interface javax.portlet.Portlet
Overrides:
processAction in class org.apache.portals.bridges.velocity.GenericVelocityPortlet
Throws:
javax.portlet.PortletException
java.io.IOException

getBrowserIterator

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

Parameters:
data - The turbine rundata context for this request.

setBrowserIterator

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

Parameters:
data - The turbine rundata context for this request.
iterator. -

clearBrowserIterator

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

Parameters:
data - The turbine rundata context for this request.

getStartVariable

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

getStartIndex

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


getQueryString

protected java.lang.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 java.lang.String getQueryString(javax.portlet.RenderRequest request)

getPreference

protected java.lang.String getPreference(javax.portlet.RenderRequest request,
                                         java.lang.String attrName,
                                         java.lang.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(java.util.List parameters)

readLinkParameters

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

populate

public void populate(int rowIndex,
                     int columnIndex,
                     java.util.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(java.util.List row,
                      javax.portlet.RenderRequest request)
Specified by:
filter in interface Browser

publishStatusMessage

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

find

public int find(BrowserIterator iterator,
                java.lang.String searchString,
                java.lang.String searchColumn)


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