Class AlphaController
The master controller class for the Alpha Framework.
Direct known subclasses
CacheManager, Create, Login, Logout, PreviewArticle, Search, TagManager, ViewArticle, ViewArticlePDF, ViewAttachment, ViewExcel, ViewFeed, CreateArticle, ViewImage, ViewLog, ViewMetrics, ViewRecordSelector, ViewTestResults, Detail, Edit, EditArticle, GenSecureQueryStrings, Install, ListAll, ListBusinessObjectsIndirect known subclasses
EditDEnum, EditTags, ListDEnums, ListSequences, ViewArticleFile, ViewArticlePrint, ViewArticleTitlePackage: alpha::controller
Copyright: Copyright (c) 2012, John Collins (founder of Alpha Framework). All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Alpha Framework nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: The BSD License
Author: John Collins <dev@alphaframework.org>
Version: $Id: AlphaController.inc 1548 2012-07-29 17:07:07Z alphadevx $
Since: 1.0
Located at controller/AlphaController.inc
public
|
#
__construct( string $visibility = 'Public' )
Constructor for the AlphaController that starts a new session if required, and handles the population of new/dirty objects from the session when available. Accepts the name of the rights group that has access to this controller, 'Public' by default. |
public
mixed
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
#
setVisibility( string $visibility )
Setter for the name of the rights group that has access to this controller. |
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
|
#
setUnitOfWork( array $jobs )
Sets the name of the controller job sequence to the values in the supplied array (and stores the array in the session). |
public
|
|
public
|
#
setUnitStartTime( integer $year, integer $month, integer $day, integer $hour, integer $minute, integer $second )
Setter for the unit start time (value will be stored in the session as key unitStartTime). |
public
|
|
public
|
#
setUnitEndTime( integer $year, integer $month, integer $day, integer $hour, integer $minute, integer $second )
Setter for the unit end time (value will be stored in the session as key unitEndTime). |
public
|
|
public
|
|
public
integer
|
|
public
|
|
public
array
|
|
public
|
|
public
array
|
|
public
|
|
public
|
|
private
|
#
clearUnitOfWorkAttributes( )
Clears the session and object attributes related to unit of work sessions |
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
#
setKeywords( string $keywords )
Setter for the page keywords, should pass a comma-seperated list as a string. |
public
|
#
accessError( )
Method to display an access error for trespassing users. HTTP response header code will be 403. |
public
boolean
|
#
checkRights( )
Checks the user rights of the currently logged-in person against the page visibility set for this controller. Will return false if the user has not got the correct rights. |
public static
boolean
|
#
checkSecurityFields( )
Method to check the validity of the two hidden form security fields which aim to ensure that a post to the controller is being sent from the same server that is hosting it. |
public static
array
|
|
public static
string
|
#
getCustomControllerName( string $BOName, string $mode )
Returns the name of a custom controller if one is found, otherwise returns null. |
protected
|
#
loadCustomController( string $BOName, string $mode )
Does a HTTP redirect to a custom controller if one is found. |
public
|
|
public
string
|
#
getStatusMessage( )
Gets the current status message for this controller. Note that by getting the current status message, you clear out the value stored in _SESSION so this method can only be used to get the status message once for display purposes. |
public static
boolean
|
#
checkControllerDefExists( string $controllerName )
Checks that the definition for the controller classname provided exists. Will also return true if you pass "/" for the root of the web application. |
public static
|
#
loadControllerDef( string $controllerName )
Loads the definition for the controller classname provided. |
public static
boolean
|
#
checkIfAccessingFromSecureURL( )
Static function for determining if the current request URL is a secure one (has a tk string or not) |
protected
string
|
$name |
|
#
The name of the controller |
protected
string
|
$visibility | 'Public' |
#
Used to set access privileages for the controller to the name of the rights group allowed to access it. 'Public' by default. |
protected
|
$BO | null |
#
Optionally, a BO may be set for the default validation form handling code to load in the displayPageHead() method. The definition of this BO class will need to be included in the child controller. |
protected
string
|
$unitOfWork |
|
#
Used to determine if the controller is part of a unit of work sequence (either empty or the name of the unit). |
protected
|
$unitStartTime |
|
#
Stores the start time of a unit of work transaction. |
protected
Timestamp.
|
$unitEndTime |
|
#
Stores the end time of a unit of work transaction. |
protected
|
$unitMAXDuration |
|
#
Stores the maximum allowed time duration (in seconds) of the unit of work. |
protected
string
|
$firstJob |
|
#
The name of the first controller that is used in this unit of work. |
protected
string
|
$nextJob |
|
#
The name of the next controller that is used in this unit of work. |
protected
string
|
$previousJob |
|
#
The name of the previous controller that is used in this unit of work. |
protected
string
|
$lastJob |
|
#
The name of the last controller that is used in this unit of work. |
protected
array
|
$dirtyObjects | array() |
#
An array for storing dirty objects in a session (i.e. persistent business objects that have not been updated in the database yet). |
protected
array
|
$newObjects | array() |
#
An array for storing new objects in a session (transient business objects that have no OID yet). |
protected
string
|
$title |
|
#
The title to be displayed on the controller page |
protected
string
|
$keywords |
|
#
Meta keywords for the controller page, generally populated from tags |
protected
string
|
$description |
|
#
Meta description for the controller page. |
protected
string
|
$statusMessage |
|
#
Used to set status update messages to display to the user (messages stored between requests in _SESSION). Useful for when you want to display a message to a user after POSTing a request, or when moving from one page to the next. |
private static
|
$logger | null |
#
Trace logger |