wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
PagingController Class Reference
+ Inheritance diagram for PagingController:

Public Member Functions

 initialize (&$request, &$response)
 
 hasView ()
 
 executeKernel ()
 
 getOIDs ()
 
 getDisplayText (&$node)
 
 modifyModel (&$nodes)
 
 getLength ()
 
 updateNavigation ($startIndex, $length, $total)
 
 reset ()
 
- Public Member Functions inherited from Controller
 Controller (&$delegate)
 
 initialize (&$request, &$response)
 
 validate ()
 
 hasView ()
 
 execute ()
 
 executeKernel ()
 
 getErrorMsg ()
 
 setErrorMsg ($msg)
 
 appendErrorMsg ($msg)
 
getRequest ()
 
getResponse ()
 
getView ()
 
getDelegate ()
 
 getViewTemplate ($controller, $context, $action)
 
 getCacheId ()
 
 assignViewDefaults (&$view)
 
 isLocalizedRequest ()
 

Public Attributes

 $OIDS_SESSION_VARNAME = 'PagingController.oids'
 
 $INDEX_SESSION_VARNAME = 'PagingController.index'
 
 $_allOIDs = array()
 
 $_curOIDs = array()
 
 $_total = 0
 
 $_hasPrev = true
 
 $_hasNext = true
 
 $_startIndex = 0
 
 $_size = 0
 
- Public Attributes inherited from Controller
 $_request = null
 
 $_response = null
 
 $_errorMsg = ''
 
 $_view = null
 
 $_delegate = null
 

Detailed Description

PagingController is a controller that allows to navigate lists.

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.PagingController.php 1462 2014-02-04 23:52:27Z iherwig

This is accomplished by loading all object ids of the items to display at the first call and always assign a part of them to the view. The object ids are provided by the getOIDs() method that must be implemented by subclasses. The getLength() method provides the number of items to show per call (The default implementation returns 20).

Actions 'jump', 'prev' and 'next' are used to navigate the list. If an oid is given in the data passed to the controller the controller tries to position the list according to that oid.

A possible configuration could be:

[actionmapping]
??showList = MyPagingController
MyPagingController?? = MyPagingController
[views]
MyPagingController?? = list.tpl

Input actions:

  • prev Navigate backwards
  • next Navigate forward

Output actions:

  • ok In any case
Parameters
[in]oidThe object id of the first object to display
[out]nodesArray of Nodes (The current package)
[out]hasPrevTrue/False whether prev navigation is possible
[out]hasNextTrue/False whether next navigation is possible
[out]totalTotal number of Nodes
[out]indexThe start position of the current package
[out]sizeThe size of the current package
[out]packageStartOidsArray of package start oids
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 67 of file class.PagingController.php.

Member Function Documentation

PagingController::initialize ( $request,
$response 
)
See Also
Controller::initialize()

Definition at line 89 of file class.PagingController.php.

References $_curOIDs, SessionData\getInstance(), getLength(), getOIDs(), WCMFException\throwEx(), and updateNavigation().

Referenced by reset().

+ Here is the call graph for this function:

PagingController::hasView ( )
See Also
Controller::hasView()

Definition at line 159 of file class.PagingController.php.

PagingController::executeKernel ( )

Do processing and assign Node data to View.

Returns
False in every case.
See Also
Controller::executeKernel()

Definition at line 168 of file class.PagingController.php.

References ACTION_READ, BUILDDEPTH_SINGLE, DATATYPE_IGNORE, getDisplayText(), PersistenceFacade\getInstance(), RightsManager\getInstance(), getLength(), and modifyModel().

+ Here is the call graph for this function:

PagingController::getOIDs ( )

Get oids of all items to display.

Returns
Array of oids of all items
Note
subclasses must implement this method.

Definition at line 214 of file class.PagingController.php.

References WCMFException\throwEx().

Referenced by initialize().

+ Here is the call graph for this function:

PagingController::getDisplayText ( $node)

Get the text to display for a given node in the list. This text will be assigned to the value 'displaytext' (DATATYPE_IGNORE) in the node.

Returns
Display text
Note
subclasses must implement this method.

Definition at line 224 of file class.PagingController.php.

References WCMFException\throwEx().

Referenced by executeKernel().

+ Here is the call graph for this function:

PagingController::modifyModel ( $nodes)

Modify the model passed to the view.

Note
subclasses will override this to implement special application requirements.
Parameters
nodesA reference to the array of node references passed to the view

Definition at line 233 of file class.PagingController.php.

Referenced by executeKernel().

PagingController::getLength ( )

Get the number of items to show per call.

Returns
Number of items
Note
The default implementation returns 10. Subclasses may override this to e.g. achive a user defined behaviour

Definition at line 240 of file class.PagingController.php.

Referenced by executeKernel(), and initialize().

PagingController::updateNavigation (   $startIndex,
  $length,
  $total 
)

Set the navigation variables (hasPrev, hasNext) according to the current position

Parameters
startIndexThe position of the first item
lengthThe number of items to show
totalThe number of all items

Definition at line 250 of file class.PagingController.php.

Referenced by initialize().

PagingController::reset ( )

Resets the list (retrieves the oids, ...)

Definition at line 267 of file class.PagingController.php.

References SessionData\getInstance(), and initialize().

Referenced by NodeListController\initialize().

+ Here is the call graph for this function:

Member Data Documentation

PagingController::$OIDS_SESSION_VARNAME = 'PagingController.oids'

Definition at line 70 of file class.PagingController.php.

PagingController::$INDEX_SESSION_VARNAME = 'PagingController.index'

Definition at line 71 of file class.PagingController.php.

PagingController::$_allOIDs = array()

Definition at line 74 of file class.PagingController.php.

PagingController::$_curOIDs = array()

Definition at line 76 of file class.PagingController.php.

Referenced by initialize().

PagingController::$_total = 0

Definition at line 79 of file class.PagingController.php.

PagingController::$_hasPrev = true

Definition at line 81 of file class.PagingController.php.

PagingController::$_hasNext = true

Definition at line 82 of file class.PagingController.php.

PagingController::$_startIndex = 0

Definition at line 83 of file class.PagingController.php.

PagingController::$_size = 0

Definition at line 84 of file class.PagingController.php.


The documentation for this class was generated from the following file: