Detailed Description

SortController is used to change the order of nodes.

Nodes can either be sorted in a list of nodes of the same type (moveBefore action) or in a list of child nodes of a container node (insertBefore action).

The controller supports the following actions:

Action moveBefore
Insert an object before a reference object in the list of all objects of the same type.

Parameter Description
in insertOid The object id of the object to insert/move
in referenceOid The object id of the object to insert the inserted object before. If the inserted object should be the last in the container order, the referenceOid contains the special value ORDER_BOTTOM
Response Actions
ok In all cases
Action insertBefore
Insert an object before a reference object in the order of a container object.

Parameter Description
in containerOid The oid of the container object
in insertOid The oid of the object to insert/move
in referenceOid The object id of the object to insert the inserted object before. If the inserted object should be the last in the container order, the referenceOid contains the special value ORDER_BOTTOM
in role The role, that the inserted object should have in the container object.
Response Actions
ok In all cases
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 58 of file SortController.php.

+ Inheritance diagram for SortController:

Public Attributes

const ORDER_BOTTOM = 'ORDER_BOTTOM'
 
const UNBOUND = 'UNBOUND'
 

Protected Member Functions

 validate ()
 
 doExecute ()
 
 doMoveBefore ()
 
 doInsertBefore ()
 
 loadObjectsInSortkeyRange ($type, $sortkeyName, $lowerValue, $upperValue)
 
 checkObjects ($objectMap)
 
 isOrderBotton ($request)
 
 getSortkeyValue ($object, $valueName)
 
- Protected Member Functions inherited from Controller
 validate ()
 
 executeSubAction ($action)
 
 getLogger ()
 
 getSession ()
 
 getPersistenceFacade ()
 
 getPermissionManager ()
 
 getActionMapper ()
 
 getLocalization ()
 
 getMessage ()
 
 getConfiguration ()
 
 assignResponseDefaults ()
 
 isLocalizedRequest ()
 
 checkLanguageParameter ()
 

Additional Inherited Members

- Public Member Functions inherited from Controller
 __construct (Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration)
 
 initialize (Request $request, Response $response)
 
 execute ($method=null)
 
 getRequest ()
 
 getResponse ()
 

Member Function Documentation

validate ( )
protected
See also
Controller::validate()

Definition at line 66 of file SortController.php.

doExecute ( )
protected
See also
Controller::doExecute()

Definition at line 133 of file SortController.php.

doMoveBefore ( )
protected

Execute the moveBefore action.

Definition at line 154 of file SortController.php.

doInsertBefore ( )
protected

Execute the insertBefore action.

Definition at line 223 of file SortController.php.

loadObjectsInSortkeyRange (   $type,
  $sortkeyName,
  $lowerValue,
  $upperValue 
)
protected

Load all objects between two sortkey values.

Parameters
$typeThe type of objects
$sortkeyNameThe name of the sortkey attribute
$lowerValueThe lower value of the sortkey or UNBOUND
$upperValueThe upper value of the sortkey or UNBOUND

Definition at line 273 of file SortController.php.

checkObjects (   $objectMap)
protected

Check if all objects in the given array are not null and add an OID_INVALID error to the response, if at least one is.

Parameters
$objectMapAn associative array with the controller parameter names as keys and the objects to check as values
Returns
Boolean

Definition at line 294 of file SortController.php.

isOrderBotton (   $request)
protected

Check if the node should be moved to the bottom of the list.

Parameters
$requestThe request
Returns
Boolean

Definition at line 315 of file SortController.php.

getSortkeyValue (   $object,
  $valueName 
)
protected

Get the sortkey value of an object.

Defaults to the object's id, if the value is null

Parameters
$objectThe object
$valueNameThe name of the sortkey attribute
Returns
String

Definition at line 326 of file SortController.php.

Member Data Documentation

const ORDER_BOTTOM = 'ORDER_BOTTOM'

Definition at line 60 of file SortController.php.

const UNBOUND = 'UNBOUND'

Definition at line 61 of file SortController.php.