Package org.sakaiproject.cheftool
Class PagedResourceActionII
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.sakaiproject.vm.ComponentServlet
-
- org.sakaiproject.vm.VmServlet
-
- org.sakaiproject.cheftool.VmServlet
-
- org.sakaiproject.cheftool.ToolServlet
-
- org.sakaiproject.cheftool.VelocityPortletPaneledAction
-
- org.sakaiproject.cheftool.PagedResourceActionII
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public abstract class PagedResourceActionII extends VelocityPortletPaneledAction
PagedResourceAction is a base class that handles paged display of lists of Resourecs with service support for paging.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_PAGE_SIZEThe default number of messages per page.protected static StringFORM_PAGE_NUMBERprotected static StringFORM_SEARCHForm fields.protected static int[]PAGESIZESprotected static StringPARAM_PAGESIZEportlet configuration parameter names.protected static org.sakaiproject.util.ResourceLoaderrb_praIIprotected static StringSTATE_CURRENT_PAGEprotected static StringSTATE_FIRST_PAGE_EXISTSprotected static StringSTATE_GO_FIRST_PAGEprotected static StringSTATE_GO_LAST_PAGEprotected static StringSTATE_GO_NEXTprotected static StringSTATE_GO_NEXT_PAGEprotected static StringSTATE_GO_PREVprotected static StringSTATE_GO_PREV_PAGEprotected static StringSTATE_GOTO_PAGEprotected static StringSTATE_LAST_PAGE_EXISTSprotected static StringSTATE_MANUAL_REFRESHprotected static StringSTATE_NEXT_EXISTSprotected static StringSTATE_NEXT_PAGE_EXISTSprotected static StringSTATE_NUM_MESSAGESprotected static StringSTATE_PAGESIZEprotected static StringSTATE_PREV_EXISTSprotected static StringSTATE_PREV_PAGE_EXISTSprotected static StringSTATE_SEARCHprotected static StringSTATE_TOP_PAGE_MESSAGEprotected static StringSTATE_TOTAL_PAGENUMBERprotected static StringSTATE_VIEW_IDstate attribute names.-
Fields inherited from class org.sakaiproject.cheftool.VelocityPortletPaneledAction
ATTR_CONFIG, ATTR_CONTEXT, ATTR_FRAME_FOCUS, ATTR_FRAME_REFRESH, ATTR_PORTLET, ATTR_RUNDATA, ATTR_TOP_REFRESH, BUTTON, CONTEXT_SITE_COLLECTION_ID, CONTEXT_SITE_COLLECTION_URL, HELPER_LINK_MODE, HELPER_MODE_DONE, LAYOUT_MAIN, MODE_OPTIONS, MODE_PERMISSIONS, SAKAI_CSRF_TOKEN, STATE_ACTION, STATE_BUNDLE_KEY, STATE_FLOAT, STATE_HELPER, STATE_MESSAGE, STATE_MODE, STATE_NEW_PANEL, STATE_NOTIF, STATE_OBSERVER, STATE_OBSERVER2, STATE_PRESENCE_OBSERVER, STATE_TOOL, STATE_TOOL_KEY
-
Fields inherited from class org.sakaiproject.cheftool.ToolServlet
ALERT_ATTR, ALERT_STATE_INITED, HELPER_ID, MAIN_PANEL, MENU_ATTR, PARAM_ACTION, PARAM_ACTION_COMBO, TITLE_PANEL, TOOL_MODE_ATTR, TOOL_MODE_DEFAULT
-
Fields inherited from class org.sakaiproject.cheftool.VmServlet
m_validator
-
Fields inherited from class org.sakaiproject.vm.ComponentServlet
ATTR_PARAMS
-
-
Constructor Summary
Constructors Constructor Description PagedResourceActionII()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddListPagingMenus(org.sakaiproject.cheftool.api.Menu bar, org.sakaiproject.event.api.SessionState state)Add the menus for a list mode for paging.protected voidaddSearchMenus(org.sakaiproject.cheftool.api.Menu bar, org.sakaiproject.event.api.SessionState state)Add the menus for search.protected voidaddSearchMenus(org.sakaiproject.cheftool.api.Menu bar, org.sakaiproject.event.api.SessionState state, String accessibilityLabel)Add the menus for search, including accessibility titleprotected voidaddViewPagingMenus(org.sakaiproject.cheftool.api.Menu bar, org.sakaiproject.event.api.SessionState state)Add the menus for a view mode for paging.voidcleanStatePaging(org.sakaiproject.event.api.SessionState state)Clean up all state value for paging.voiddoChange_pagesize(RunData data, Context context)Handle a request to change the page size of search list.voiddoList_first(RunData runData, Context context)Handle a first-message page (list) request.voiddoList_last(RunData runData, Context context)Handle a last-message page (list) request.voiddoList_next(RunData runData, Context context)Handle a next-page (list) request.voiddoList_prev(RunData runData, Context context)Handle a prev-page (list) request.voiddoSearch(RunData runData, Context context)Handle a Search request.voiddoSearch_clear(RunData runData, Context context)Handle a Search Clear request.voiddoView_next(RunData runData, Context context)Handle a next-message (view) request.voiddoView_page(RunData runData, Context context)Handle a view indecated page requestvoiddoView_prev(RunData runData, Context context)Handle a prev-message (view) request.protected voidinitState(org.sakaiproject.event.api.SessionState state, VelocityPortlet portlet, JetspeedRunData rundata)Populate the state object, if needed, concerning pagingvoidpagingInfoToContext(org.sakaiproject.event.api.SessionState state, Context context)protected ListprepPage(org.sakaiproject.event.api.SessionState state)Prepare the current page of messages to display.protected abstract ListreadResourcesPage(org.sakaiproject.event.api.SessionState state, int first, int last)Implement this to return a list of all the resources in this record range, with search and sorting applied.protected voidresetPaging(org.sakaiproject.event.api.SessionState state)Reset to the first pageprotected abstract intsizeResources(org.sakaiproject.event.api.SessionState state)Implement this to return the number of records that are currently selected.protected inttotalPageNumber(org.sakaiproject.event.api.SessionState state)Return the total page number-
Methods inherited from class org.sakaiproject.cheftool.VelocityPortletPaneledAction
actionDispatch, addAlert, addAlert, addFlashNotif, addOptionsMenu, allowedToOptions, build_permissions_context, cancelOptions, checkCSRFToken, checkRunData, doGet, doOptions, doReset, getContext, getDateFormatString, getTimeFormatString, helperActionDispatch, initState, mainPanelUpdateId, panelMethodName, processAction, resetTool, saveOptions, scheduleFocusRefresh, schedulePeerFrameRefresh, scheduleTopRefresh, setVmStdRef, switchPanel, titlePanelUpdateId, toolModeDispatch, updateState
-
Methods inherited from class org.sakaiproject.cheftool.ToolServlet
doPost, getAlert, getAlert, getMenu, getPid, getState, getToolMode, prepState, sendToHelper, setToolMode, startHelper, startHelper
-
Methods inherited from class org.sakaiproject.vm.VmServlet
getActionURL, getVmReference, includeVm, setVmReference
-
Methods inherited from class org.sakaiproject.vm.ComponentServlet
sendParentRedirect, service, setNoCacheHeaders
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service
-
-
-
-
Field Detail
-
rb_praII
protected static org.sakaiproject.util.ResourceLoader rb_praII
-
DEFAULT_PAGE_SIZE
protected static final int DEFAULT_PAGE_SIZE
The default number of messages per page.- See Also:
- Constant Field Values
-
PARAM_PAGESIZE
protected static final String PARAM_PAGESIZE
portlet configuration parameter names.- See Also:
- Constant Field Values
-
STATE_VIEW_ID
protected static final String STATE_VIEW_ID
state attribute names.- See Also:
- Constant Field Values
-
STATE_TOP_PAGE_MESSAGE
protected static final String STATE_TOP_PAGE_MESSAGE
- See Also:
- Constant Field Values
-
STATE_PAGESIZE
protected static final String STATE_PAGESIZE
- See Also:
- Constant Field Values
-
STATE_NUM_MESSAGES
protected static final String STATE_NUM_MESSAGES
- See Also:
- Constant Field Values
-
STATE_NEXT_PAGE_EXISTS
protected static final String STATE_NEXT_PAGE_EXISTS
- See Also:
- Constant Field Values
-
STATE_PREV_PAGE_EXISTS
protected static final String STATE_PREV_PAGE_EXISTS
- See Also:
- Constant Field Values
-
STATE_FIRST_PAGE_EXISTS
protected static final String STATE_FIRST_PAGE_EXISTS
- See Also:
- Constant Field Values
-
STATE_LAST_PAGE_EXISTS
protected static final String STATE_LAST_PAGE_EXISTS
- See Also:
- Constant Field Values
-
STATE_GO_NEXT_PAGE
protected static final String STATE_GO_NEXT_PAGE
- See Also:
- Constant Field Values
-
STATE_GO_PREV_PAGE
protected static final String STATE_GO_PREV_PAGE
- See Also:
- Constant Field Values
-
STATE_GO_NEXT
protected static final String STATE_GO_NEXT
- See Also:
- Constant Field Values
-
STATE_GO_PREV
protected static final String STATE_GO_PREV
- See Also:
- Constant Field Values
-
STATE_NEXT_EXISTS
protected static final String STATE_NEXT_EXISTS
- See Also:
- Constant Field Values
-
STATE_PREV_EXISTS
protected static final String STATE_PREV_EXISTS
- See Also:
- Constant Field Values
-
STATE_GO_FIRST_PAGE
protected static final String STATE_GO_FIRST_PAGE
- See Also:
- Constant Field Values
-
STATE_GO_LAST_PAGE
protected static final String STATE_GO_LAST_PAGE
- See Also:
- Constant Field Values
-
STATE_SEARCH
protected static final String STATE_SEARCH
- See Also:
- Constant Field Values
-
STATE_MANUAL_REFRESH
protected static final String STATE_MANUAL_REFRESH
- See Also:
- Constant Field Values
-
FORM_SEARCH
protected static final String FORM_SEARCH
Form fields.- See Also:
- Constant Field Values
-
STATE_TOTAL_PAGENUMBER
protected static final String STATE_TOTAL_PAGENUMBER
- See Also:
- Constant Field Values
-
STATE_CURRENT_PAGE
protected static final String STATE_CURRENT_PAGE
- See Also:
- Constant Field Values
-
FORM_PAGE_NUMBER
protected static final String FORM_PAGE_NUMBER
- See Also:
- Constant Field Values
-
STATE_GOTO_PAGE
protected static final String STATE_GOTO_PAGE
- See Also:
- Constant Field Values
-
PAGESIZES
protected static final int[] PAGESIZES
-
-
Method Detail
-
readResourcesPage
protected abstract List readResourcesPage(org.sakaiproject.event.api.SessionState state, int first, int last)
Implement this to return a list of all the resources in this record range, with search and sorting applied.- Parameters:
first- The first record to include (1 based).last- The last record to include (inclusive, 1 based).
-
sizeResources
protected abstract int sizeResources(org.sakaiproject.event.api.SessionState state)
Implement this to return the number of records that are currently selected.
-
totalPageNumber
protected int totalPageNumber(org.sakaiproject.event.api.SessionState state)
Return the total page number
-
initState
protected void initState(org.sakaiproject.event.api.SessionState state, VelocityPortlet portlet, JetspeedRunData rundata)Populate the state object, if needed, concerning paging- Overrides:
initStatein classVelocityPortletPaneledAction
-
addViewPagingMenus
protected void addViewPagingMenus(org.sakaiproject.cheftool.api.Menu bar, org.sakaiproject.event.api.SessionState state)Add the menus for a view mode for paging.
-
addListPagingMenus
protected void addListPagingMenus(org.sakaiproject.cheftool.api.Menu bar, org.sakaiproject.event.api.SessionState state)Add the menus for a list mode for paging.
-
addSearchMenus
protected void addSearchMenus(org.sakaiproject.cheftool.api.Menu bar, org.sakaiproject.event.api.SessionState state)Add the menus for search.
-
addSearchMenus
protected void addSearchMenus(org.sakaiproject.cheftool.api.Menu bar, org.sakaiproject.event.api.SessionState state, String accessibilityLabel)Add the menus for search, including accessibility title
-
prepPage
protected List prepPage(org.sakaiproject.event.api.SessionState state)
Prepare the current page of messages to display.- Returns:
- List of MailArchiveMessage to display on this page.
-
doChange_pagesize
public void doChange_pagesize(RunData data, Context context)
Handle a request to change the page size of search list.
-
pagingInfoToContext
public void pagingInfoToContext(org.sakaiproject.event.api.SessionState state, Context context)
-
cleanStatePaging
public void cleanStatePaging(org.sakaiproject.event.api.SessionState state)
Clean up all state value for paging.
-
doView_page
public void doView_page(RunData runData, Context context)
Handle a view indecated page request
-
doView_next
public void doView_next(RunData runData, Context context)
Handle a next-message (view) request.
-
doList_first
public void doList_first(RunData runData, Context context)
Handle a first-message page (list) request.
-
doList_last
public void doList_last(RunData runData, Context context)
Handle a last-message page (list) request.
-
doList_next
public void doList_next(RunData runData, Context context)
Handle a next-page (list) request.
-
doView_prev
public void doView_prev(RunData runData, Context context)
Handle a prev-message (view) request.
-
doList_prev
public void doList_prev(RunData runData, Context context)
Handle a prev-page (list) request.
-
doSearch_clear
public void doSearch_clear(RunData runData, Context context)
Handle a Search Clear request.
-
resetPaging
protected void resetPaging(org.sakaiproject.event.api.SessionState state)
Reset to the first page
-
-