|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.patterns.listdata.data.ListOptions
public class ListOptions
This class collects various attributes describing list of data objects to load. It allows to specify what attributes of the data objects to load, what should be the order of data elements, etc. It also provides some placeholders for informations used by GUI to display this list that are not necessary used to load the list, but they needs to be propagated when the list is reloaded or to describe the initial status of the list.
| Field Summary | |
|---|---|
protected int[] |
m_arrFilterableColumnCodes
List of columns codes which could be used to filter data by the persistance store. |
protected int[] |
m_arrOrderColumnCodes
Code of the columns to order by, for each column at the same index is in m_bOrderDirections setup the direction of ordering. |
protected java.lang.String[] |
m_arrOrderDirections
Direction of the ordering ASC/DESC. |
protected int[] |
m_arrRetrieveColumnCodes
List of columns codes representing data object attributes, which are retrieved from the database. |
protected int[] |
m_arrShowColumnCodes
List of columns codes representing data object attributes, which are shown in the list in GUI. |
protected int[] |
m_arrSortableColumnCodes
List of columns codes which could be used to sort data by the persistance store. |
protected boolean |
m_bDistinct
Load only distinct items. |
protected boolean |
m_bKeepSelected
Load also previously selected items even if they are not in the current range of items to load. |
protected ListDefinition |
m_definition
Basic definition used for this list. |
protected SimpleRule |
m_extraFilter
Filter specifying extra conditions which data has to satisfy. |
protected int |
m_iActualListSize
Number of all items in the requested list regardless if only portion of the list is requested or sent. |
protected int |
m_iActualPage
1 based actual page number, e.g 1st page of 10 pages. |
protected int |
m_iBeginPosition
Position of the first requested/loaded item in list. |
protected int |
m_iClientOrderCode
Code of the client column to order the list by on the client. |
protected int |
m_iDomainId
Domain ID that will be used for constructing query for getting object list. |
protected int |
m_iEndPosition
Position of the last requested/loaded item in list. |
protected int |
m_iExtraLogicalOperation
Logical operation used to merge extra filter with the ones from list definition. |
protected int |
m_iFirstVisibleItem
Identification of first visible item on the GUI. |
protected int |
m_iPageSize
Number of items per page defines how many items are loaded at once. |
protected int |
m_iParentDataType
Data type of parent object of the list of data. |
protected int |
m_iParentId
ID of parent object of the list of data. |
protected java.lang.Class |
m_listFactoryClass
Class representing data factory that implements list factory interface to use to retrieve data for list of data objects TODO: Improve: Since this class is used at many levels it doesn't make much sense to specify data factory to use. |
protected SimpleRule |
m_securityFilter
Filter defining what data has user rights to access. |
protected java.lang.String |
m_strClientOrderDirection
Type of the client ordering ASC/DESC. |
protected java.lang.String |
m_strDefinitionId
String representation of a list definition which should be used to load the list of data objects. |
protected java.lang.String |
m_strIgnoredItemIDs
Comma separated list of IDs of items which should not be loaded even though they satisfy filter, extra and security conditions. |
protected java.lang.String |
m_strMarkedItemIDs
String of comma separated marked item IDs from the list. |
protected java.lang.String |
m_strSelectedItemIDs
String of comma separated selected item IDs from the list. |
static int |
PAGE_SIZE_ALL
Use this constant when you want to load all items. |
| Constructor Summary | |
|---|---|
ListOptions(java.lang.Class listFactoryClass)
Empty list options initialized to default parameters |
|
ListOptions(java.lang.Class listFactoryClass,
java.lang.String strDefinitionId,
int iPageSize,
int iActualListSize,
int[] arrOrderColumnCodes,
java.lang.String[] arrOrderDirections,
int iClientOrderCode,
java.lang.String strClientOrderDirection,
int iBeginPosition,
int iEndPosition,
int iActualPage,
int iFirstVisibleItem,
int iParentDataType,
int iParentId,
java.lang.String strSelectedItemIds,
java.lang.String strMarkedItemIds,
int[] arrShowColumnCodes,
java.lang.String strIgnoredItemIds,
boolean bDistinct,
boolean bKeepSelected,
int iDomainId)
|
|
| Method Summary | |
|---|---|
int |
getAbsolutePageCount()
Absolute page count is total amount of pages of data independent from the current position in the list. |
int |
getActualListSize()
|
int |
getActualPage()
|
int |
getBeginPosition()
|
int |
getClientOrderCode()
|
java.lang.String |
getClientOrderDirection()
|
ListDefinition |
getDefinition()
|
java.lang.String |
getDefinitionId()
|
int |
getDomainId()
|
int |
getEndPosition()
|
int |
getExtraConditionAttribute()
Get attribute of the single extra condition that is part of the extra filter. |
java.lang.String |
getExtraConditionValue()
Get value of the single extra condition that is part of the extra filter. |
SimpleRule |
getExtraFilter()
|
int |
getExtraLogicalOperation()
|
int[] |
getFilterableColumnCodes()
Get list of columns codes which could be used to filter data by the persistance store. |
int |
getFirstVisibleItem()
|
java.util.List |
getGoToPages()
Generate list of pages to which user can jump directly. |
java.lang.String |
getIgnoredItemIDs()
|
boolean |
getIsFirstPage()
Check if the list is on the first page Used by JSP |
boolean |
getIsKeepSelectedChecked()
|
boolean |
getIsLastPage()
Check if the list is on the last page Used by JSP |
int |
getKeepSelected()
|
java.lang.Class |
getListFactoryClass()
|
java.lang.String |
getMarkedItemIDs()
|
int[] |
getOrderColumnCodes()
|
java.lang.String[] |
getOrderDirections()
|
int |
getPageSize()
|
int |
getParentDataType()
|
int |
getParentId()
|
int |
getRelativePageCount()
Relative page count is total amount of pages of data relative to the current position in the list since beucase our current position doesn't have to be alligned with page boundaries there might be 1 more page before or after the current position which wouldn't be there otherwise. |
int[] |
getRetrieveColumnCodes()
Get list of columns codes which were/should be retrieved from the database. |
SimpleRule |
getSecurityFilter()
|
java.lang.String |
getSelectedItemIDs()
|
int[] |
getShowColumnCodes()
|
int[] |
getSortableColumnCodes()
Get list of columns codes which could be used to sort data by the persistance store. |
boolean |
isDistinct()
|
void |
setActualListSize(int iActualListSize)
|
void |
setActualPage(int iActualPage)
Set the page which should be the actual page shown. |
void |
setBeginPosition(int iBeginPosition)
Set the begin position which is the position of the first element in the full list of elements. |
void |
setClientOrderCode(int iClientOrderCode)
|
void |
setClientOrderDirection(java.lang.String strClientOrderDirection)
|
void |
setDefinition(ListDefinition definition)
|
void |
setDefinitionId(java.lang.String strDefinitionId)
|
void |
setDistinct(boolean bDistinct)
|
void |
setDomainId(int iDomainId)
|
void |
setEndPosition(int iEndPosition)
Set the end position which is the position of the first element in the full list of elements. |
void |
setExtraFilter(SimpleRule extraFilter,
int iExtraLogicalOperation)
|
void |
setFilterableColumnCodes(int[] arrFilterableColumnCodes)
Set llist of columns codes which could be used to filter data by the persistance store. |
void |
setFirstVisibleItem(int iFirstVisibleItem)
|
void |
setIgnoredItemIDs(java.lang.String strIgnoredItems)
Select IDs of tiems which shouldn't be loaded even through they satisfy other conditions. |
void |
setKeepSelected(boolean bKeepSelected)
|
void |
setMarkedItemIDs(java.lang.String strMarkedItemIDs)
Set IDs of the items, which are or should be highlighted or otherwise marked on the GUI. |
void |
setOrdering(int[] arrOrderColumnCodes,
java.lang.String[] arrOrderDirections)
|
void |
setPageSize(int iPageSize)
|
void |
setParentDataType(int iParentDataType)
|
void |
setParentId(int iParentId)
|
void |
setRetrieveColumnCodes(int[] arrRetrieveColumnCodes)
Set list of columns codes which were/should be retrieved from the persistance store. |
void |
setSecurityFilter(SimpleRule securityRule)
|
void |
setSelectedItemIDs(java.lang.String strSelectedItems)
Set IDs of the items, which are or should be selected on the GUI. |
void |
setShowColumnCodes(int[] arrShowColumnCodes)
|
void |
setSortableColumnCodes(int[] arrSortableColumnCodes)
Set list of columns codes which could be used to sort data by the persistance store. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PAGE_SIZE_ALL
protected java.lang.Class m_listFactoryClass
protected java.lang.String m_strDefinitionId
protected int[] m_arrOrderColumnCodes
protected java.lang.String[] m_arrOrderDirections
protected int m_iPageSize
protected int m_iBeginPosition
protected int m_iEndPosition
protected int m_iActualPage
protected int m_iActualListSize
protected java.lang.String m_strSelectedItemIDs
protected java.lang.String m_strMarkedItemIDs
protected int m_iFirstVisibleItem
protected int m_iClientOrderCode
protected java.lang.String m_strClientOrderDirection
protected ListDefinition m_definition
protected int[] m_arrShowColumnCodes
protected int[] m_arrRetrieveColumnCodes
protected int[] m_arrSortableColumnCodes
protected int[] m_arrFilterableColumnCodes
protected int m_iParentDataType
protected int m_iParentId
protected java.lang.String m_strIgnoredItemIDs
protected SimpleRule m_securityFilter
protected SimpleRule m_extraFilter
protected int m_iExtraLogicalOperation
protected boolean m_bDistinct
protected boolean m_bKeepSelected
protected int m_iDomainId
| Constructor Detail |
|---|
public ListOptions(java.lang.Class listFactoryClass)
listFactoryClass - - class representing data factory that implements
list factory interface to use to retrieve data
for list of data objects
public ListOptions(java.lang.Class listFactoryClass,
java.lang.String strDefinitionId,
int iPageSize,
int iActualListSize,
int[] arrOrderColumnCodes,
java.lang.String[] arrOrderDirections,
int iClientOrderCode,
java.lang.String strClientOrderDirection,
int iBeginPosition,
int iEndPosition,
int iActualPage,
int iFirstVisibleItem,
int iParentDataType,
int iParentId,
java.lang.String strSelectedItemIds,
java.lang.String strMarkedItemIds,
int[] arrShowColumnCodes,
java.lang.String strIgnoredItemIds,
boolean bDistinct,
boolean bKeepSelected,
int iDomainId)
listFactoryClass - - class representing data factory that implements
list factory interface to use to retrieve data
for list of data objectsstrDefinitionId - - string id of definition used as a basis for this list
This ID can be pure numeric value (id) or there can be
stored whole Filter object values that have to be parsed.
These filter values are used when Filter GUI values have
to be applied.iPageSize - - page sizeiActualListSize - - number of all items in listarrOrderColumnCodes - - codes for columns to order by, pass null if nonearrOrderDirections - - order directions (ASC/DESC), see constants in ListDefinitioniClientOrderCode - - client order column codestrClientOrderDirection - - client order type (ASC/DESC), see constants
in ListDefinitioniBeginPosition - - relative begin positioniEndPosition - - relative end positioniActualPage - - actual page numberiFirstVisibleItem - - first visibleiParentDataType - - parent data typeiParentId - - parent IDstrSelectedItemIds - - String of selected items IDs divided by commastrMarkedItemIds - - String of marked items IDs divided by commaarrShowColumnCodes - - array of showed columns codes (ordered)strIgnoredItemIds - - String of ignored items IDs divided by commabDistinct - - if true only distinct items will be listed. Use (true)
this very carefully since it will cause sorting and it
will slow down the query.bKeepSelected - - true = if will be loaded also previously selected itemsiDomainId - - domain ID| Method Detail |
|---|
public java.lang.Class getListFactoryClass()
public java.lang.String getSelectedItemIDs()
public java.lang.String getMarkedItemIDs()
public java.lang.String getIgnoredItemIDs()
public int getActualPage()
public int getBeginPosition()
public int getClientOrderCode()
public int getEndPosition()
public java.lang.String getDefinitionId()
public int getFirstVisibleItem()
public int[] getOrderColumnCodes()
public int getPageSize()
public void setSelectedItemIDs(java.lang.String strSelectedItems)
strSelectedItems - - array of selected item IDspublic void setMarkedItemIDs(java.lang.String strMarkedItemIDs)
strMarkedItemIDs - - marked item IDspublic void setIgnoredItemIDs(java.lang.String strIgnoredItems)
strIgnoredItems - - string of ignored item IDs (separated by ',')public void setActualPage(int iActualPage)
iActualPage - - actual page numberpublic void setBeginPosition(int iBeginPosition)
iBeginPosition - - relative begin positionpublic void setClientOrderCode(int iClientOrderCode)
iClientOrderCode - - client order column codepublic void setEndPosition(int iEndPosition)
iEndPosition - - relative end positionpublic void setDefinitionId(java.lang.String strDefinitionId)
strDefinitionId - - list definition idpublic void setFirstVisibleItem(int iFirstVisibleItem)
iFirstVisibleItem - - first visible item relative position
public void setOrdering(int[] arrOrderColumnCodes,
java.lang.String[] arrOrderDirections)
arrOrderColumnCodes - - codes for columns to order by, pass null if nonearrOrderDirections - - direction of ordering for each columnpublic void setPageSize(int iPageSize)
iPageSize - - page sizepublic int getActualListSize()
public void setActualListSize(int iActualListSize)
iActualListSize - - complete list sizepublic ListDefinition getDefinition()
public void setDefinition(ListDefinition definition)
definition - - list definitionpublic int[] getShowColumnCodes()
public void setShowColumnCodes(int[] arrShowColumnCodes)
arrShowColumnCodes - - array of column codespublic java.lang.String getClientOrderDirection()
public java.lang.String[] getOrderDirections()
public void setClientOrderDirection(java.lang.String strClientOrderDirection)
strClientOrderDirection - - client type for ordering, one of the
ListDefinition.ORDER_XXX constantspublic SimpleRule getSecurityFilter()
public void setSecurityFilter(SimpleRule securityRule)
securityRule - - list security datapublic boolean getIsFirstPage()
public boolean getIsLastPage()
public java.util.List getGoToPages()
public int getAbsolutePageCount()
public int getRelativePageCount()
public int[] getRetrieveColumnCodes()
public void setRetrieveColumnCodes(int[] arrRetrieveColumnCodes)
arrRetrieveColumnCodes - - list of columns codes which were/should
be retrieved from the database.public int[] getSortableColumnCodes()
public void setSortableColumnCodes(int[] arrSortableColumnCodes)
arrSortableColumnCodes - - list of columns codes which could be used
to sort data by the database.public int[] getFilterableColumnCodes()
public void setFilterableColumnCodes(int[] arrFilterableColumnCodes)
arrFilterableColumnCodes - - list of columns codes which could be used
to filter data by the database. If null
then we do not know what data can be used.public int getParentDataType()
public int getParentId()
public void setParentDataType(int iParentDataType)
iParentDataType - - list parent data typepublic void setParentId(int iParentId)
iParentId - - list parent IDpublic int getDomainId()
public void setDomainId(int iDomainId)
iDomainId - - list domain IDpublic SimpleRule getExtraFilter()
public boolean getIsKeepSelectedChecked()
public int getKeepSelected()
public void setKeepSelected(boolean bKeepSelected)
bKeepSelected - - if Keep selected checkbox is checked
public void setExtraFilter(SimpleRule extraFilter,
int iExtraLogicalOperation)
extraFilter - - if not null then these are extra conditions which should
be applied together with filter.iExtraLogicalOperation - - can be one of the SimpleRule.LOGICAL_XXX constantspublic int getExtraLogicalOperation()
public boolean isDistinct()
public void setDistinct(boolean bDistinct)
bDistinct - - if true only distinct items will be listed. Use (true)
this very carefully since it will cause sorting and it
will slow down the query.public int getExtraConditionAttribute()
public java.lang.String getExtraConditionValue()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||