org.jasig.portal.portlets.sqlquery
Class SqlQueryPortletController

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.portlet.context.PortletApplicationObjectSupport
          extended by org.springframework.web.portlet.handler.PortletContentGenerator
              extended by org.springframework.web.portlet.mvc.AbstractController
                  extended by org.jasig.portal.portlets.sqlquery.SqlQueryPortletController
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware, Controller

public class SqlQueryPortletController
extends AbstractController

This portlet executes a (configurable) SQL query against a (configurable) DataSource accessed via the Spring application context, translates the ResultSet into a collection of row Map objects, and feeds that object to a JSP page. This portlet is useful for exposing dashboard components with relatively low usage. It does not presently implement caching and so is not suitable for high volume use. This portlet is eminently useful for simple administrative queries. Potentially useful future enhancements of this portlet might include an an ability to bind user attributes to parameters of the query. This portlet is a modern port of the CSqlQuery channel to Spring PortletMVC.

Author:
Andrew Petro, Jen Bourey, jbourey@unicon.net

Field Summary
static String DATASOURCE_BEAN_NAME_PARAM_NAME
          The bean name of the DataSource against which this channel will execute the SQL query is specified as a channel parameter named "dataSource".
static String SQL_QUERY_PARAM_NAME
          The SQL query this channel will execute is specified as a channel parameter named "sql".
static String VIEW_PARAM_NAME
           
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
SqlQueryPortletController()
           
 
Method Summary
 ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response)
           
 
Methods inherited from class org.springframework.web.portlet.mvc.AbstractController
handleActionRequest, handleActionRequestInternal, handleRenderRequestInternal, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession
 
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
 
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired, setPortletContext
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATASOURCE_BEAN_NAME_PARAM_NAME

public static final String DATASOURCE_BEAN_NAME_PARAM_NAME
The bean name of the DataSource against which this channel will execute the SQL query is specified as a channel parameter named "dataSource". This parameter is optional, defaulting to the uPortal DataSource (PortalDb).

See Also:
Constant Field Values

SQL_QUERY_PARAM_NAME

public static final String SQL_QUERY_PARAM_NAME
The SQL query this channel will execute is specified as a channel parameter named "sql". This parameter is required.

See Also:
Constant Field Values

VIEW_PARAM_NAME

public static final String VIEW_PARAM_NAME
See Also:
Constant Field Values
Constructor Detail

SqlQueryPortletController

public SqlQueryPortletController()
Method Detail

handleRenderRequest

public ModelAndView handleRenderRequest(RenderRequest request,
                                        RenderResponse response)
                                 throws Exception
Specified by:
handleRenderRequest in interface Controller
Overrides:
handleRenderRequest in class AbstractController
Throws:
Exception


Copyright © 2010 Jasig. All Rights Reserved.