com.plumtree.uiinfrastructure.form.pagination
Class PaginationControl

java.lang.Object
  extended by com.plumtree.uiinfrastructure.form.pagination.PaginationControl
All Implemented Interfaces:
IControl, IManagedObject, IMVCObject

public class PaginationControl
extends java.lang.Object
implements IControl

This control sets the current pagination that the user has requested.

Author:
Don Hayler

Field Summary
static java.lang.String HTMLINPUT_MODEL_STORAGE_NAME
          The storage name of the associated Model (hidden input)
static java.lang.String HTMLINPUT_PAGINATE_FROM
          The object count to paginate from (hidden input)
static java.lang.String HTMLINPUT_PAGINATE_FROM_TEXT
          The object count to paginate from (text input)
static java.lang.String HTMLINPUT_PAGINATE_TO
          The object count to paginate to (hidden input)
static java.lang.String HTMLINPUT_PAGINATE_TO_TEXT
          The object count to paginate to (text input)
static java.lang.String HTMLINPUT_PAGINATION_ID
          The id of the objects to paginate (hidden input)
static java.lang.String JAVASCRIPT_PAGINATE
          the name of the javascript method that pages that use the pagination bar need to implement.
static java.lang.String PAGINATION_LINK_SEPARATOR
          the bar that separates different sections in the pagination links.
static java.lang.String STR_MVC_CLASS_NAME
          Object Name for AS
 
Constructor Summary
PaginationControl()
           
 
Method Summary
 Redirect CheckActionSecurityAndExecute(XPHashtable arguments)
          Execute the control business logic and optionally return a Redirect object pointing to another AActivitySpace.
 java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
static PTConstruct CreatePaginationFilterBar(AActivitySpace asOwner, int nPaginationID, int nObjectCount)
          Static method to create a pagination bar.
static java.lang.String CreatePaginationJavascript(AActivitySpace asOwner)
          This method creates the default javascript for the pagination control.
static HTMLElement CreatePaginationLinks(AActivitySpace asOwner, int nPaginationID, int nObjectCount, int nCurrentStart, int nCurrentFinish, int nPaginationSize)
           
static HTMLElement CreatePaginationLinks(AActivitySpace asOwner, int nPaginationID, int nObjectCount, int nCurrentStart, int nCurrentFinish, int nPaginationSize, java.lang.String sModelStorageKey)
          Static method to create the pagination links that go at the bottom of the display.
 java.lang.String GetName()
          Return the name of the MVC object.
 void Init(IModel model, AActivitySpace space)
          Initialize the control with the model it should use and it's parent AActivitySpace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STR_MVC_CLASS_NAME

public static final java.lang.String STR_MVC_CLASS_NAME
Object Name for AS

See Also:
Constant Field Values

HTMLINPUT_PAGINATION_ID

public static final java.lang.String HTMLINPUT_PAGINATION_ID
The id of the objects to paginate (hidden input)

See Also:
Constant Field Values

HTMLINPUT_PAGINATE_FROM

public static final java.lang.String HTMLINPUT_PAGINATE_FROM
The object count to paginate from (hidden input)

See Also:
Constant Field Values

HTMLINPUT_PAGINATE_TO

public static final java.lang.String HTMLINPUT_PAGINATE_TO
The object count to paginate to (hidden input)

See Also:
Constant Field Values

HTMLINPUT_MODEL_STORAGE_NAME

public static final java.lang.String HTMLINPUT_MODEL_STORAGE_NAME
The storage name of the associated Model (hidden input)

See Also:
Constant Field Values

HTMLINPUT_PAGINATE_FROM_TEXT

public static final java.lang.String HTMLINPUT_PAGINATE_FROM_TEXT
The object count to paginate from (text input)

See Also:
Constant Field Values

HTMLINPUT_PAGINATE_TO_TEXT

public static final java.lang.String HTMLINPUT_PAGINATE_TO_TEXT
The object count to paginate to (text input)

See Also:
Constant Field Values

JAVASCRIPT_PAGINATE

public static final java.lang.String JAVASCRIPT_PAGINATE
the name of the javascript method that pages that use the pagination bar need to implement. This javascript method should set the html inputs and post the page to this control (potentially as a pass-thru control).

See Also:
Constant Field Values

PAGINATION_LINK_SEPARATOR

public static final java.lang.String PAGINATION_LINK_SEPARATOR
the bar that separates different sections in the pagination links.

See Also:
Constant Field Values
Constructor Detail

PaginationControl

public PaginationControl()
Method Detail

CreatePaginationFilterBar

public static PTConstruct CreatePaginationFilterBar(AActivitySpace asOwner,
                                                    int nPaginationID,
                                                    int nObjectCount)
Static method to create a pagination bar. DisplayPages that include this pagination bar (through their views) must ensure that the JAVASCRIPT_PAGINATE method is implemented on the page. warning: in 508 mode, this will add the RepostControl.HTMLINPUT_PASSTHRU_CONTROL elements (since they won't be in the form), so if another view tries to use them there will be problems. The pagination bar should also not be added to a page more than once in 508 mode. This bar does pagination filtering (view from X to Y).

Parameters:
AActivitySpace - the owner space for this HTML
int - the pagination ID (usually the class ID)
String - the name of the HTML form
Returns:
PTConstruct a construct for the pagination bar of type PTBannerType.OBJECT_ACTION_BAR

CreatePaginationLinks

public static HTMLElement CreatePaginationLinks(AActivitySpace asOwner,
                                                int nPaginationID,
                                                int nObjectCount,
                                                int nCurrentStart,
                                                int nCurrentFinish,
                                                int nPaginationSize)
See Also:
com.plumtree.uiinfrastructure.form.pagination.PaginationControl#CreatePaginationLinks()

CreatePaginationLinks

public static HTMLElement CreatePaginationLinks(AActivitySpace asOwner,
                                                int nPaginationID,
                                                int nObjectCount,
                                                int nCurrentStart,
                                                int nCurrentFinish,
                                                int nPaginationSize,
                                                java.lang.String sModelStorageKey)
Static method to create the pagination links that go at the bottom of the display. DisplayPages that include this pagination links (through their views) must ensure that the JAVASCRIPT_PAGINATE method is implemented on the page. This bar does pagination links (prev, 1-50, 50-100, etc... next).

Parameters:
AActivitySpace - the owner space for this HTML
int - the pagination ID (usually the class ID)
String - the name of the HTML form
Returns:
HTMLElement the links for the pagination at the bottom of the display

CreatePaginationJavascript

public static java.lang.String CreatePaginationJavascript(AActivitySpace asOwner)
This method creates the default javascript for the pagination control. This assumes that there is an AFormDP that should be reposted via a pass-thru control.

Returns:
String the javascript to display.

CheckActionSecurityAndExecute

public Redirect CheckActionSecurityAndExecute(XPHashtable arguments)
Description copied from interface: IControl
Execute the control business logic and optionally return a Redirect object pointing to another AActivitySpace. Returning null means that the user should return to the parent AActivitySpace's current page. This method is designed to check that the user has access to perform the actions with the given parameters. If the user does not, a redirect object which has had Redirect.SetRedirectToLogin(true) called on it. If the user is the Guest, this will bounce to the login page and back to the Redirect after the user has logged on. If the user is already logged on, they will be redirected to an error page. In general, the error redirect that is returned should contain all of the query string parameters that made up the URL that originally led to the control. Checking whether or not a particular user ever has any access to the space, page, and control should be done in IPTActivitySpace.CheckBasicAccess().

Specified by:
CheckActionSecurityAndExecute in interface IControl
Returns:
Redirect where to redirect to after the control is finished executing. This will go to the login page or an error page if Redirect.SetRedirectToLogin(true) has been called.
See Also:
IControl.CheckActionSecurityAndExecute(XPHashtable)

Create

public java.lang.Object Create()
Description copied from interface: IManagedObject
This method is used by the ASManager to return new instances of managed objects.

Specified by:
Create in interface IManagedObject
Returns:
A new instance of the managed class (i.e. return new Foo();)
See Also:
IManagedObject.Create()

GetName

public java.lang.String GetName()
Description copied from interface: IMVCObject
Return the name of the MVC object.

Specified by:
GetName in interface IMVCObject
Returns:
the name of the object.
See Also:
IMVCObject.GetName()

Init

public void Init(IModel model,
                 AActivitySpace space)
Description copied from interface: IControl
Initialize the control with the model it should use and it's parent AActivitySpace. This method needs to be called before any other methods. This method also clears all internal data so the control can be used again without fear of mixing data.

Specified by:
Init in interface IControl
See Also:
IControl.Init(IModel, AActivitySpace)



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.