wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
class.ControllerDelegate.php
Go to the documentation of this file.
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2014 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of any of the following licenses
7  * at your choice:
8  *
9  * - GNU Lesser General Public License (LGPL)
10  * http://www.gnu.org/licenses/lgpl.html
11  * - Eclipse Public License (EPL)
12  * http://www.eclipse.org/org/documents/epl-v10.php
13  *
14  * See the license.txt file distributed with this work for
15  * additional information.
16  *
17  * $Id: class.ControllerDelegate.php 1462 2014-02-04 23:52:27Z iherwig $
18  */
19 
20 /**
21  * @class ControllerDelegate
22  * @ingroup Presentation
23  * @brief ControllerDelegate is used to define an interface to vary the behaviour of the
24  * Controller base class. The methods are called by the Controller base class on defined variation
25  * points and get the currently executed controller as parameter.
26  *
27  * @note: There is only one instance used for all controllers, which is passed to the controller
28  * instances on construction.
29  *
30  * Users may implement special application requirements by subclassing ControllerDelegate and
31  * configuring its usage in the configuration section 'implementation', key 'ControllerDelegate'.
32  * If no ControllerDelegate is configured, none is used.
33  * e.g.
34  *
35  * @code
36  * [implementation]
37  * ...
38  * ControllerDelegate = MyControllerDelegate
39  * ...
40  * @endcode
41  *
42  * @author ingo herwig <ingo@wemove.com>
43  */
45 {
46  /**
47  * This method is called after the base class initialize method.
48  * @see Controller::initialize()
49  * @param controller The currently executed controller
50  */
51  function postInitialize(&$controller)
52  {
53  WCMFException::throwEx("postInitialize() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
54  }
55  /**
56  * This method is called instead of the base class method.
57  * @see Controller::validate()
58  * @param controller The currently executed controller
59  * @return The validation result.
60  */
61  function validate(&$controller)
62  {
63  WCMFException::throwEx("validate() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
64  }
65  /**
66  * This method is called after validation and before the base class execute method
67  * @see Controller::execute()
68  * @param controller The currently executed controller
69  */
70  function preExecute(&$controller)
71  {
72  WCMFException::throwEx("preExecute() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
73  }
74  /**
75  * This method is called after the base class execute method.
76  * @see Controller::execute()
77  * @param controller A reference to the currently executed controller
78  * @param result The result of Controller::executeKernel
79  * @return The execution result.
80  */
81  function postExecute(&$controller, $result)
82  {
83  WCMFException::throwEx("postExecute() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
84  }
85  /**
86  * Assign additional variables to the view.
87  * This method is called after the base class assignViewDefaults method.
88  * @param controller The currently executed controller
89  */
90  function assignAdditionalViewValues(&$controller)
91  {
92  WCMFException::throwEx("assignAdditionalViewValues() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
93  }
94 }
95 ?>
assignAdditionalViewValues(&$controller)
ControllerDelegate is used to define an interface to vary the behaviour of the Controller base class...
throwEx($message, $file='', $line='')
postExecute(&$controller, $result)