public abstract class BaseListBean<DataType> extends AbstractAdminFacesBean
Modifier and Type | Field and Description |
---|---|
protected int |
first |
protected int |
itemsPerPage |
protected javax.faces.model.DataModel<DataType> |
list |
protected java.util.List<DataType> |
selection |
CONFIGURATION_SAVED, GLOBAL_RES_FILE, OPERATION_FINISHED
Constructor and Description |
---|
BaseListBean() |
Modifier and Type | Method and Description |
---|---|
protected void |
clearSelection() |
void |
columnsRenderedValueChanged(javax.faces.event.AjaxBehaviorEvent ajaxBehaviorEvent) |
int |
compareLiterals(java.lang.Object item1,
java.lang.Object item2)
TODO: move this to some utility bean, to ease it's configuration avoiding
long binding expressions Generic case insensitive mechanism to compare two
literal values.
|
void |
delete(javax.faces.event.ActionEvent event) |
protected abstract void |
delete(java.util.List<DataType> selectedElements) |
boolean[] |
getColumnsRendered() |
java.util.List<DataType> |
getDataList()
Gets the enclosed data list of the data model.
|
protected java.lang.String |
getDeleteConfirmationMessage()
To be overriden by subclasses to show specific delete confirmation messages
|
int |
getDisplayedResult() |
protected java.lang.String |
getFirstOwner(Acl acl) |
int |
getItemsPerPages() |
javax.faces.model.DataModel<DataType> |
getList() |
protected java.lang.String |
getOwnersOverlay(Acl acl) |
boolean |
getRenderedColumnDefaultValue(java.lang.String columnName) |
int |
getSelectedRowsCount() |
java.lang.String |
getSelectionType() |
java.util.List<Pair<java.lang.String,java.lang.String>> |
getToggleableColumns()
Returns a list of toggleable columns.
|
int |
getTotalResult() |
protected abstract java.lang.String |
getUrl()
To indicate the url of the page used to manage the current list
|
protected java.lang.String |
getViewUrl()
Deprecated.
|
void |
hideNotAccessibleObjects(javax.faces.event.ActionEvent event)
Deprecated.
|
void |
hideObjectsNotOwnedByMe(javax.faces.event.ActionEvent event)
Deprecated.
|
protected abstract void |
init()
Implement any initialization logic here, other than retrieving the list of
elements i.e Controllers initialization.
|
abstract boolean |
isAllowMultipleSelection() |
boolean |
isColumnRendered(java.lang.String columnName)
Deprecated.
|
protected boolean |
isDisabledForSelection(DataType selectedRow)
This method is used in onRowSelection and it evaluates if a selected
element is disabled for edition, in such case it is not added in the
selection.
|
boolean |
isEditionDisabled() |
boolean |
isHideNotAccessibleObjects() |
boolean |
isHideObjectsNotOwnedByMe() |
protected abstract java.util.List<DataType> |
listElements()
To obtain the list of elements that will be managed in the current page In
general, subclasses will use some controller object to retrieve it from
database or some other persistent storage
|
void |
onPageChange(org.primefaces.event.data.PageEvent event) |
void |
onRowSelection(org.primefaces.event.SelectEvent event)
Executed action when a row is selected.
|
void |
refresh() |
void |
refresh(javax.faces.event.ActionEvent event) |
void |
refreshFilteredList() |
void |
refreshSelection()
Executed method for cleaning the selection and only remain the current page
selection
|
protected void |
refreshViewOnDelete()
After a delete takes place, the page should be refreshed because of an
inconsistent state in client scripts.
|
void |
selectAll() |
protected boolean |
selectionExists()
Method to prevent if the selected element exists in the application.
|
void |
selectNone() |
void |
setColumnRendered(javax.faces.event.ActionEvent actionEvent)
Deprecated.
|
void |
setColumnRendered(java.lang.String columnName,
boolean rendered)
Deprecated.
|
void |
setHideNotAccessibleObjects(boolean hideNotAccessibleObjects) |
void |
setHideObjectsNotOwnedByMe(boolean hideObjectsNotOwnedByMe) |
void |
setItemsPerPages(int itemsPerPage) |
protected void |
validateDeletion(java.util.List<DataType> selection)
To be implemented in subclasses that need to perform some validation before
deleting rows
|
addDuplicateNameErrorMessage, addErrorMessage, addErrorMessage, addGlobalErrorMessage, addGlobalErrorMessage, addGlobalInfoMessage, addGlobalWarningMessage, addInfoMessage, addInfoMessage, addRequiredErrorMessage, addWarningMessage, addWarningMessage, closeDialog, containsCharacters, createDuplicateNameErrorMessage, displayMessage, findComponent, findObjectByName, formatDouble, formatInteger, getBreadCrumbItems, getComponentsToUpdate, getController, getController, getDeleteConfirmationTitle, getDialogs, getEditingObjectId, getExternalContext, getJMapAdminSessionBean, getJMapServerAdminBean, getJMapServerUserAdminBean, getJsfBean, getLanguageLabel, getLanguages, getLanguagesConverter, getLayerStatusConverter, getMessage, getMessage, getParameter, getReadableFileSize, getRequest, getRequestLocale, getRequestParameter, getSessionAttribute, getSessionBean, getSessionId, getSessionUser, initRequestContext, isDuplicate, isExtensionAvailable, isJMapCloudConfigurationAvailable, openDialog, redirectToPage, reloadCurrentPage, required, showMessageDialog, validateDuplicateName
protected javax.faces.model.DataModel<DataType> list
protected java.util.List<DataType> selection
protected int itemsPerPage
protected int first
protected abstract java.util.List<DataType> listElements()
public java.lang.String getSelectionType()
public abstract boolean isAllowMultipleSelection()
protected abstract void init()
@Deprecated protected java.lang.String getViewUrl()
protected abstract java.lang.String getUrl()
public void onRowSelection(org.primefaces.event.SelectEvent event)
event
- protected boolean isDisabledForSelection(DataType selectedRow)
selectedRow
- protected boolean selectionExists() throws java.lang.Exception
java.lang.Exception
public void refreshFilteredList()
protected void clearSelection()
public void selectAll()
public void selectNone()
public void refreshSelection()
public void onPageChange(org.primefaces.event.data.PageEvent event)
protected abstract void delete(java.util.List<DataType> selectedElements)
public void delete(javax.faces.event.ActionEvent event)
protected java.lang.String getDeleteConfirmationMessage()
protected void validateDeletion(java.util.List<DataType> selection) throws ValidationException
selection
- ValidationException
- instance containing the error message to be shownprotected void refreshViewOnDelete()
public int getSelectedRowsCount()
public boolean isEditionDisabled()
public int getItemsPerPages()
public void setItemsPerPages(int itemsPerPage)
public int getTotalResult()
public int getDisplayedResult()
public void refresh()
public void refresh(javax.faces.event.ActionEvent event)
public java.util.List<DataType> getDataList()
public int compareLiterals(java.lang.Object item1, java.lang.Object item2)
item1
- item2
- @Deprecated public boolean isColumnRendered(java.lang.String columnName)
@Deprecated public void setColumnRendered(java.lang.String columnName, boolean rendered)
@Deprecated public void setColumnRendered(javax.faces.event.ActionEvent actionEvent)
public boolean[] getColumnsRendered()
public void columnsRenderedValueChanged(javax.faces.event.AjaxBehaviorEvent ajaxBehaviorEvent)
public java.util.List<Pair<java.lang.String,java.lang.String>> getToggleableColumns()
public boolean getRenderedColumnDefaultValue(java.lang.String columnName)
protected java.lang.String getFirstOwner(Acl acl)
protected java.lang.String getOwnersOverlay(Acl acl)
public boolean isHideObjectsNotOwnedByMe()
public void setHideObjectsNotOwnedByMe(boolean hideObjectsNotOwnedByMe)
@Deprecated public void hideObjectsNotOwnedByMe(javax.faces.event.ActionEvent event)
public boolean isHideNotAccessibleObjects()
public void setHideNotAccessibleObjects(boolean hideNotAccessibleObjects)
@Deprecated public void hideNotAccessibleObjects(javax.faces.event.ActionEvent event)
public javax.faces.model.DataModel<DataType> getList()