|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opencms.workplace.CmsWorkplace
org.opencms.workplace.tools.CmsToolDialog
org.opencms.workplace.CmsDialog
org.opencms.workplace.list.A_CmsListDialog
public abstract class A_CmsListDialog
Provides a dialog with a list widget.
| Field Summary | |
|---|---|
static int |
ACTION_LIST_INDEPENDENT_ACTION
Value for the action: execute a list item independent action of the list. |
static int |
ACTION_LIST_MULTI_ACTION
Value for the action: execute an multi action of the list. |
static int |
ACTION_LIST_SEARCH
Value for the action: search the list. |
static int |
ACTION_LIST_SELECT_PAGE
Value for the action: go to a page. |
static int |
ACTION_LIST_SINGLE_ACTION
Value for the action: execute a single action of the list. |
static int |
ACTION_LIST_SORT
Value for the action: sort the list. |
static String |
ICON_ACTIVE
Standard list button location. |
static String |
ICON_ADD
Standard list button location. |
static String |
ICON_DELETE
Standard list button location. |
static String |
ICON_DETAILS_HIDE
Standard list button location. |
static String |
ICON_DETAILS_SHOW
Standard list button location. |
static String |
ICON_DISABLED
Standard list button location. |
static String |
ICON_INACTIVE
Standard list button location. |
static String |
ICON_MINUS
Standard list button location. |
static String |
ICON_MULTI_ACTIVATE
Standard list button location. |
static String |
ICON_MULTI_ADD
Standard list button location. |
static String |
ICON_MULTI_DEACTIVATE
Standard list button location. |
static String |
ICON_MULTI_DELETE
Standard list button location. |
static String |
ICON_MULTI_MINUS
Standard list button location. |
static String |
LIST_INDEPENDENT_ACTION
Request parameter value for the list action: a list item independent action has been triggered. |
static String |
LIST_MULTI_ACTION
Request parameter value for the list action: a multi action has been triggered. |
static String |
LIST_SEARCH
Request parameter value for the list action: search/filter. |
static String |
LIST_SELECT_PAGE
Request parameter value for the list action: select a page. |
static String |
LIST_SINGLE_ACTION
Request parameter value for the list action: a single action has been triggered. |
static String |
LIST_SORT
Request parameter value for the list action: sort. |
static String |
PARAM_FORMNAME
Request parameter key for the requested page. |
static String |
PARAM_LIST_ACTION
Request parameter key for the list action. |
static String |
PARAM_PAGE
Request parameter key for the requested page. |
static String |
PARAM_SEARCH_FILTER
Request parameter key for search the filter. |
static String |
PARAM_SEL_ITEMS
Request parameter key for the selected item(s). |
static String |
PARAM_SORT_COL
Request parameter key for the column to sort the list. |
| Fields inherited from class org.opencms.workplace.tools.CmsToolDialog |
|---|
PARAM_BASE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW |
| Constructor Summary | |
|---|---|
protected |
A_CmsListDialog(CmsJspActionElement jsp,
String listId,
CmsMessageContainer listName,
String sortedColId,
CmsListOrderEnum sortOrder,
String searchableColId)
Public constructor. |
| Method Summary | |
|---|---|
void |
actionDialog()
Performs the dialog actions depending on the initialized action. |
protected String |
customHtmlEnd()
Can be overwritten to add some code after the list. |
protected String |
customHtmlStart()
Can be overwritten to add some code before the list. |
protected String |
defaultActionHtml()
Generates the dialog starting html code. |
protected String |
defaultActionHtmlContent()
Returns the html code for the default action content. |
protected String |
defaultActionHtmlEnd()
Generates the dialog ending html code. |
protected String |
defaultActionHtmlStart()
Generates the dialog starting html code. |
void |
displayDialog()
Performs the dialog actions depending on the initialized action and displays the dialog form. |
void |
displayDialog(boolean writeLater)
Performs the dialog actions depending on the initialized action and displays the dialog form if needed. |
void |
executeDefaultActions()
This method execute the default actions for searching, sorting and paging. |
void |
executeListIndepActions()
This method should handle the default list independent actions, by comparing with the id
of the action to execute. |
abstract void |
executeListMultiActions()
This method should handle every defined list multi action, by comparing with the id
of the action to execute. |
abstract void |
executeListSingleActions()
This method should handle every defined list single action, by comparing with the id
of the action to execute. |
protected void |
executeSearch()
Filter a list, given the action is set to LIST_SEARCH and
the filter text is set in the PARAM_SEARCH_FILTER parameter. |
protected void |
executeSelectPage()
Select a page, given the action is set to LIST_SELECT_PAGE and
the page to go to is set in the PARAM_PAGE parameter. |
protected void |
executeSort()
Sort the list, given the action is set to LIST_SORT and
the sort column is set in the PARAM_SORT_COL parameter. |
protected abstract void |
fillDetails(String detailId)
Lazy initialization for detail data. |
protected void |
fillList()
Calls the method and catches any exception. |
CmsHtmlList |
getList()
Returns the list. |
String |
getListId()
Returns the Id of the list. |
protected abstract List |
getListItems()
Should generate a list with the list items to be displayed. |
static CmsHtmlList |
getListObject(Class listDialog,
CmsWorkplaceSettings settings)
Returns the list object for the given list dialog, or null
if no list object has been set. |
protected CmsListMetadata |
getMetadata(String listDialogName,
String listId)
Should generate the metadata definition for the list, and return the corresponding object. |
String |
getParamFormName()
Returns the form name. |
String |
getParamListAction()
Returns the List Action. |
String |
getParamPage()
Returns the current Page. |
String |
getParamSearchFilter()
Returns the Search Filter. |
String |
getParamSelItems()
Returns the Selected Items. |
String |
getParamSortCol()
Returns the sorted Column. |
CmsListItem |
getSelectedItem()
Returns the current selected item. |
List |
getSelectedItems()
Returns a list of current selected items. |
protected void |
initWorkplaceRequestValues(CmsWorkplaceSettings settings,
HttpServletRequest request)
Analyzes the request for workplace parameters and adjusts the workplace settings accordingly. |
boolean |
isActive()
Returns the activation flag. |
protected void |
listRecovery(String listId)
Recover the last list instance that is read from the request attributes. |
protected void |
listSave()
Save the state of the list in the session. |
void |
refreshList()
This method re-read the rows of the list, the user should call this method after executing an action that add or remove rows to the list. |
void |
removeList()
Removes the list from the workplace settings. |
protected abstract void |
setColumns(CmsListMetadata metadata)
Should create the columns and add them to the given list metadata object. |
protected abstract void |
setIndependentActions(CmsListMetadata metadata)
Should add the independent actions to the given list metadata object. |
void |
setList(CmsHtmlList list)
Sets the list. |
void |
setListObject(Class listDialog,
CmsHtmlList listObject)
Stores the given object as "list object" for the given list dialog in the current users session. |
protected abstract void |
setMultiActions(CmsListMetadata metadata)
Should add the multi actions to the given list metadata object. |
void |
setParamFormName(String formName)
Sets the form name. |
void |
setParamListAction(String listAction)
Sets the List Action. |
void |
setParamPage(String page)
Sets the current Page. |
void |
setParamSearchFilter(String searchFilter)
Sets the Search Filter. |
void |
setParamSelItems(String paramSelItems)
Sets the Selelected Items. |
void |
setParamSortCol(String sortCol)
Sets the sorted Column. |
protected void |
setSearchAction(CmsListMetadata metadata,
String columnId)
Creates the default search action. |
protected void |
throwListUnsupportedActionException()
A convenient method to throw a list unsupported action runtime exception. |
protected void |
validateParamaters()
Should be overriden for parameter validation. |
void |
writeDialog()
Writes the dialog html code, only if the is set. |
| Methods inherited from class org.opencms.workplace.tools.CmsToolDialog |
|---|
dialogTitle, getAdminTool, getCurrentToolPath, getParamBase, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, setParamPath, setParamRoot, setParamStyle, useNewStyle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ACTION_LIST_INDEPENDENT_ACTION
public static final int ACTION_LIST_MULTI_ACTION
public static final int ACTION_LIST_SEARCH
public static final int ACTION_LIST_SELECT_PAGE
public static final int ACTION_LIST_SINGLE_ACTION
public static final int ACTION_LIST_SORT
public static final String ICON_ACTIVE
public static final String ICON_ADD
public static final String ICON_DELETE
public static final String ICON_DETAILS_HIDE
public static final String ICON_DETAILS_SHOW
public static final String ICON_DISABLED
public static final String ICON_INACTIVE
public static final String ICON_MINUS
public static final String ICON_MULTI_ACTIVATE
public static final String ICON_MULTI_ADD
public static final String ICON_MULTI_DEACTIVATE
public static final String ICON_MULTI_DELETE
public static final String ICON_MULTI_MINUS
public static final String LIST_INDEPENDENT_ACTION
public static final String LIST_MULTI_ACTION
public static final String LIST_SEARCH
public static final String LIST_SELECT_PAGE
public static final String LIST_SINGLE_ACTION
public static final String LIST_SORT
public static final String PARAM_FORMNAME
public static final String PARAM_LIST_ACTION
public static final String PARAM_PAGE
public static final String PARAM_SEARCH_FILTER
public static final String PARAM_SEL_ITEMS
public static final String PARAM_SORT_COL
| Constructor Detail |
|---|
protected A_CmsListDialog(CmsJspActionElement jsp,
String listId,
CmsMessageContainer listName,
String sortedColId,
CmsListOrderEnum sortOrder,
String searchableColId)
jsp - an initialized JSP action elementlistId - the id of the displayed listlistName - the name of the listsortedColId - the a priory sorted columnsortOrder - the order of the sorted columnsearchableColId - the column to search into| Method Detail |
|---|
public static CmsHtmlList getListObject(Class listDialog,
CmsWorkplaceSettings settings)
null
if no list object has been set.
listDialog - the list dialog classsettings - the wp settings for accessing the session
null
public void actionDialog()
throws JspException,
ServletException,
IOException
JspException - if dialog actions fail
IOException - in case of errros forwarding to the required result page
ServletException - in case of errros forwarding to the required result page
public void displayDialog()
throws JspException,
IOException,
ServletException
JspException - if dialog actions fail
IOException - if writing to the JSP out fails, or in case of errros forwarding to the required result page
ServletException - in case of errros forwarding to the required result page
public void displayDialog(boolean writeLater)
throws JspException,
IOException,
ServletException
writeLater - if true no output is written,
you have to call manually the defaultActionHtml() method.
JspException - if dialog actions fail
IOException - if writing to the JSP out fails, or in case of errros forwarding to the required result page
ServletException - in case of errros forwarding to the required result pagepublic void executeDefaultActions()
public void executeListIndepActions()
getParamListAction() with the id
of the action to execute.
if you want to handle additional independent actions, override this method,
handling your actions and FINALLY calling super.executeListIndepActions();.
public abstract void executeListMultiActions()
throws IOException,
ServletException,
CmsRuntimeException
getParamListAction() with the id
of the action to execute.
IOException - in case of errors when including a required sub-element
ServletException - in case of errors when including a required sub-element
CmsRuntimeException - to signal that an action is not supported
public abstract void executeListSingleActions()
throws IOException,
ServletException,
CmsRuntimeException
getParamListAction() with the id
of the action to execute.
IOException - in case of errors when including a required sub-element
ServletException - in case of errors when including a required sub-element
CmsRuntimeException - to signal that an action is not supportedpublic CmsHtmlList getList()
public final String getListId()
public String getParamFormName()
public String getParamListAction()
public String getParamPage()
public String getParamSearchFilter()
public String getParamSelItems()
public String getParamSortCol()
public CmsListItem getSelectedItem()
public List getSelectedItems()
public boolean isActive()
Useful for dialogs with several lists.
Is if the original formname parameter
is equals to ${listId}-form.
public void refreshList()
public void removeList()
Next time the list is displayed the list will be reloaded.
public void setList(CmsHtmlList list)
list - the list to set
public void setListObject(Class listDialog,
CmsHtmlList listObject)
listDialog - the list dialog classlistObject - the list to storepublic void setParamFormName(String formName)
formName - the form name to setpublic void setParamListAction(String listAction)
listAction - the list Action to setpublic void setParamPage(String page)
page - the current Page to setpublic void setParamSearchFilter(String searchFilter)
searchFilter - the Search Filter to setpublic void setParamSelItems(String paramSelItems)
paramSelItems - the Selelected Items to setpublic void setParamSortCol(String sortCol)
sortCol - the sorted Column to set
public void writeDialog()
throws IOException
CmsDialog.ACTION_DEFAULT is set.
IOException - if writing to the JSP out fails, or in case of errros forwarding to the required result pageprotected String customHtmlEnd()
protected String customHtmlStart()
protected String defaultActionHtml()
protected String defaultActionHtmlContent()
protected String defaultActionHtmlEnd()
protected String defaultActionHtmlStart()
protected void executeSearch()
LIST_SEARCH and
the filter text is set in the PARAM_SEARCH_FILTER parameter.
protected void executeSelectPage()
LIST_SELECT_PAGE and
the page to go to is set in the PARAM_PAGE parameter.
protected void executeSort()
LIST_SORT and
the sort column is set in the PARAM_SORT_COL parameter.
protected abstract void fillDetails(String detailId)
Should fill the given detail column for every list item in
Should not throw any kind of exception.CmsHtmlList.getAllContent()
detailId - the id of the detail to initializeprotected void fillList()
getListItems() method and catches any exception.
protected abstract List getListItems()
throws CmsException
CmsListItems
CmsException - if something goes wrong
protected CmsListMetadata getMetadata(String listDialogName,
String listId)
CmsListMetadata object.
listDialogName - the name of the class generating the listlistId - the id of the list
protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings,
HttpServletRequest request)
CmsWorkplace
initWorkplaceRequestValues in class CmsDialogsettings - the workplace settingsrequest - the current requestCmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)protected void listRecovery(String listId)
This is required for keep the whole list in memory while you browse a page.
listId - the id of the expected listprotected void listSave()
protected abstract void setColumns(CmsListMetadata metadata)
This method will be just executed once, the first time the constructor is called.
metadata - the list metadataprotected abstract void setIndependentActions(CmsListMetadata metadata)
This method will be just executed once, the first time the constructor is called.
metadata - the list metadataprotected abstract void setMultiActions(CmsListMetadata metadata)
This method will be just executed once, the first time the constructor is called.
metadata - the list metadata
protected void setSearchAction(CmsListMetadata metadata,
String columnId)
Can be overriden for more sofisticated search.
metadata - the metadata of the list to do searchablecolumnId - the if of the column to search into
protected void throwListUnsupportedActionException()
throws CmsRuntimeException
Should be triggered if your list implementation does not
support the
action.getParamListAction()
CmsRuntimeException - always to signal that this operation is not supported
protected void validateParamaters()
throws Exception
Exception - if the parameters are not valid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||