org.opensubsystems.patterns.listdata.logic.impl
Class ListControllerImpl

java.lang.Object
  extended by org.opensubsystems.core.logic.impl.StatelessControllerImpl
      extended by org.opensubsystems.patterns.listdata.logic.impl.ListControllerImpl
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean, org.opensubsystems.core.logic.StatelessController, ListController

public class ListControllerImpl
extends org.opensubsystems.core.logic.impl.StatelessControllerImpl
implements ListController

This controller handles all functionality connected with listing of data objects by pages, filtered with filters, sorted by columns, secured by access rights, and maybe much more in the future. You can use instances of this controller directly without the need to derive any new classes or code any new functionality. Just get instance of the controller from the controller manager, create list options and invoke the method of this controller you are interested in.

Version:
$Id: ListControllerImpl.java,v 1.20 2007/01/28 06:54:48 bastafidli Exp $
Author:
Julo Legeny
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
1.15 2006/03/13 16:49:16 bastafidli
XDoclet tag:
type="Stateless" name="ListController" jndi-name="org.opensubsystems.patterns.listdata.logic.ListControllerRemote" local-jndi-name="org.opensubsystems.patterns.listdata.logic.ListController"
XDoclet tag:
local-extends="javax.ejb.EJBLocalHome" extends="javax.ejb.EJBHome"
XDoclet tag:
local-extends="javax.ejb.EJBLocalObject, org.opensubsystems.patterns.listdata.logic.ListController" extends="javax.ejb.EJBObject, org.opensubsystems.patterns.listdata.logic.ListController"
XDoclet tag:
ejb-name="ListController" jndi-name="org.opensubsystems.patterns.listdata.logic.ListControllerRemote"

Field Summary
protected static java.lang.String IMPL_LOCK
          Lock used in synchronized sections.
 
Constructor Summary
ListControllerImpl()
           
 
Method Summary
 void constructor()
          
protected  ListDefinition getDefinition(ListFactory factory, ListOptions options)
          Get list definition to use for specified options.
 java.util.List getDefinitionList(int iDataType)
          Get definition list (list of generic data)
 java.lang.Object[] getExactPage(ListOptions options)
          Get list for some specific page.
 java.lang.Object[] getNextPage(ListOptions options)
          Get list for next page.
 java.lang.Object[] getPreviousPage(ListOptions options)
          Get list for previous page.
protected  SimpleRule getSecurityFilter(ListFactory factory, ListOptions options)
          Get security filter for this list definiting what data object is user authorized to access.
 java.lang.Object[] getSetDefinition(ListOptions options)
          Get list after list definition has changed..
 java.lang.Object[] getSetOrder(ListOptions options)
          Get list after order column changed.
 java.lang.Object[] getSetPageSize(ListOptions options)
          Get list after page size changed.
 java.lang.Object[] getShowList(ListOptions options)
          Get default list, which is the list to show when the list is displayed the first time.
protected  java.lang.Object[] postprocess(ListOptions options, java.util.List objectList, ListFactory factory)
          Postprocess list of retrieved data objectcts.
protected  ListFactory preprocess(ListOptions options)
          Preprocess list options before the list controller functionality is invoked
 
Methods inherited from class org.opensubsystems.core.logic.impl.StatelessControllerImpl
ejbActivate, ejbPassivate, ejbRemove, setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMPL_LOCK

protected static final java.lang.String IMPL_LOCK
Lock used in synchronized sections.

See Also:
Constant Field Values
Constructor Detail

ListControllerImpl

public ListControllerImpl()
Method Detail

getShowList

public java.lang.Object[] getShowList(ListOptions options)
                               throws org.opensubsystems.core.error.OSSException
Get default list, which is the list to show when the list is displayed the first time. No parameters have to be initialized for this action

Specified by:
getShowList in interface ListController
Parameters:
options - - list options
Returns:
Object[] - index 0 - updated list options - index 1 - list of DataObjects - index 2 - object tatatype
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getSetDefinition

public java.lang.Object[] getSetDefinition(ListOptions options)
                                    throws org.opensubsystems.core.error.OSSException
Get list after list definition has changed.. These parameters have to be initialized for this action - definitionId

Specified by:
getSetDefinition in interface ListController
Parameters:
options - - list options
Returns:
Object[] - index 0 - updated list options - index 1 - list of DataObjects - index 2 - object tatatype
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getSetOrder

public java.lang.Object[] getSetOrder(ListOptions options)
                               throws org.opensubsystems.core.error.OSSException
Get list after order column changed. These parameters have to be initialized for this action - definitionId - orderDirection - orderCode - pageSize These parameters are considered if they are initialized - selectedItems

Specified by:
getSetOrder in interface ListController
Parameters:
options - - list options
Returns:
Object[] - index 0 - updated list options - index 1 - list of DataObjects - index 2 - object tatatype
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getSetPageSize

public java.lang.Object[] getSetPageSize(ListOptions options)
                                  throws org.opensubsystems.core.error.OSSException
Get list after page size changed. These parameters have to be initialized for this action - definitionId - orderDirection - orderCode - beginPosition - pageSize These parameters are considered if there are initialized - clientorderDirection - clientOrderCode - firstVisibleItem - selectedItems

Specified by:
getSetPageSize in interface ListController
Parameters:
options - - list options
Returns:
Object[] - index 0 - updated list options - index 1 - list of DataObjects - index 2 - object tatatype
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getPreviousPage

public java.lang.Object[] getPreviousPage(ListOptions options)
                                   throws org.opensubsystems.core.error.OSSException
Get list for previous page. These parameters have to be initialized for this action - definitionId - orderDirection - orderCode - beginPosition - pageSize These parameters are considered if there are initialized - clientorderDirection - clientOrderCode - firstVisibleItem - selectedItems

Specified by:
getPreviousPage in interface ListController
Parameters:
options - - list options
Returns:
Object[] - index 0 - updated list options - index 1 - list of DataObjects - index 2 - object tatatype
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getNextPage

public java.lang.Object[] getNextPage(ListOptions options)
                               throws org.opensubsystems.core.error.OSSException
Get list for next page. These parameters have to be initialized for this action - definitionId - orderDirection - orderCode - endPosition - pageSize These parameters are considered if there are initialized - clientorderDirection - clientOrderCode - firstVisibleItem - selectedItems

Specified by:
getNextPage in interface ListController
Parameters:
options - - list options
Returns:
Object[] - index 0 - updated list options - index 1 - list of DataObjects - index 2 - object tatatype
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getExactPage

public java.lang.Object[] getExactPage(ListOptions options)
                                throws org.opensubsystems.core.error.OSSException
Get list for some specific page. These parameters have to be initialized for this action - definitionId - actualPage - orderDirection - orderCode - pageSize These parameters are considered if there are initialized - clientorderDirection - clientOrderCode - firstVisibleItem - selectedItems

Specified by:
getExactPage in interface ListController
Parameters:
options - - list options
Returns:
Object[] - index 0 - updated list options - index 1 - list of DataObjects - index 2 - object tatatype
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

getDefinitionList

public java.util.List getDefinitionList(int iDataType)
                                 throws org.opensubsystems.core.error.OSSException
Get definition list (list of generic data)

Specified by:
getDefinitionList in interface ListController
Parameters:
iDataType - - datatype of the object
Returns:
List - definition list (list of generic data)
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
XDoclet tag:
XDoclet tag:
type="Supports"

constructor

public void constructor()
                 throws org.opensubsystems.core.error.OSSException

Specified by:
constructor in interface org.opensubsystems.core.logic.StatelessController
Overrides:
constructor in class org.opensubsystems.core.logic.impl.StatelessControllerImpl
Throws:
org.opensubsystems.core.error.OSSException
XDoclet tag:
XDoclet tag:
type="Supports"

getSecurityFilter

protected SimpleRule getSecurityFilter(ListFactory factory,
                                       ListOptions options)
                                throws org.opensubsystems.core.error.OSSException
Get security filter for this list definiting what data object is user authorized to access. User can by default see all data, no security implemented at this level

Parameters:
factory - - list factory for given options
options - - list options
Returns:
SimpleRule - rule representing filter to retrieve only data which user is authorized to see
Throws:
org.opensubsystems.core.error.OSSException - - an erro has occured

getDefinition

protected ListDefinition getDefinition(ListFactory factory,
                                       ListOptions options)
                                throws org.opensubsystems.core.error.OSSException
Get list definition to use for specified options.

Parameters:
factory - - list factory for given options
options - - list options to get the definition for
Returns:
ListDefinition - definition object, never null
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

preprocess

protected ListFactory preprocess(ListOptions options)
                          throws org.opensubsystems.core.error.OSSException
Preprocess list options before the list controller functionality is invoked

Parameters:
options - - list options to preprocess
Returns:
ListFactory - list factory to use to load the data
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured during preprocessing

postprocess

protected java.lang.Object[] postprocess(ListOptions options,
                                         java.util.List objectList,
                                         ListFactory factory)
                                  throws org.opensubsystems.core.error.OSSException
Postprocess list of retrieved data objectcts. This method can be overwritten and can modify returned results.

Parameters:
options - - list options to postprocess
objectList - - list of retrieved data objects
factory - - list factory to use to load the data
Returns:
Object[] - index 0 - updated list options - index 1 - list of DataObjects - index 2 - object tatatype
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured during preprocessing


Copyright © 2003 - 2006 OpenSubsystems s.r.o.