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

Public Member Functions

 initialize (&$request, &$response)
 
 executeKernel ()
 
 processPart ()
 
 getPreviewCallback ($context)
 
initializeView ($filename)
 
createOutputView ()
 
 assignCommonValues (&$view)
 
 getExportDir ()
 
 useBaseHref ()
 
 writeOutput (&$view, $context)
 
- Public Member Functions inherited from BatchController
 initialize (&$request, &$response)
 
 addWorkPackage ($name, $size, $oids, $callback, $args=null)
 
 getWorkPackage ($number)
 
 getNumberOfSteps ()
 
 getDisplayText ($step)
 
 getSummaryText ()
 
 processPart ()
 
- Public Member Functions inherited from LongTaskController
 initialize (&$request, &$response)
 
 hasView ()
 
 executeKernel ()
 
 getStepNumber ()
 
 getNumberOfSteps ()
 
 getDisplayText ($step)
 
 getSummaryText ()
 
 initializeTask ()
 
 processPart ()
 
- 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

 $FILENAME_VARNAME = 'PageExportController.filename'
 
- Public Attributes inherited from BatchController
 $WORK_PACKAGES_VARNAME = 'BatchController.workPackages'
 
 $NUM_STEPS_VARNAME = 'BatchController.numSteps'
 
 $_workPackages = array()
 
- Public Attributes inherited from LongTaskController
 $STEP_SESSION_VARNAME = 'LongTaskController.curStep'
 
 $ONE_CALL_SESSION_VARNAME = 'LongTaskController.oneCall'
 
 $_curStep = 1
 
- Public Attributes inherited from Controller
 $_request = null
 
 $_response = null
 
 $_errorMsg = ''
 
 $_view = null
 
 $_delegate = null
 

Detailed Description

PageExportController is an abstract controller that is used as base class for Controller classes that export content to pages defined by templates. Export is triggered by any action except 'preview' and 'continue'. On 'preview' action PageExportController creates a preview corresponding to a given oid and context.

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.PageExportController.php 1462 2014-02-04 23:52:27Z iherwig

To do this, subclasses define several work packages (see BatchController::getWorkPackage()). The callback functions may call base class methods to fulfill their tasks.

An example callback could look like this:

function doIndexPage()
{
$filename = 'index.html';
// initialize view
$outputView = &$this->initializeView($filename);
// load and assign model
...
$outputView->assign('message', 'Hello world');
...
// output page
$this->writeOutput($outputView, 'index');
}

The corresponding configuration would look like this:

[actionmapping]
...
PageExportController??continue = PageExportController
PageExportController??done = ViewController
...
[views]
...
PageExportController?? = progressbar.tpl
PageExportController?index? = ../../templates/index_html.tpl
PageExportController?index?preview = ../../templates/index_html.tpl
...

Input actions:

  • preview Show a preview of the given object
  • more actions see BatchController

Output actions:

Parameters
[in]oidThe object id of the object to display in preview mode
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 86 of file class.PageExportController.php.

Member Function Documentation

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

Definition at line 94 of file class.PageExportController.php.

References Controller\initialize().

+ Here is the call graph for this function:

PageExportController::executeKernel ( )
See Also
Controller::executeKernel()

Definition at line 107 of file class.PageExportController.php.

References processPart().

+ Here is the call graph for this function:

PageExportController::processPart ( )

If the given action is 'preview', this method calls - depending on the context - the preview callback method defined by the subclass (

See Also
getPreviewCallback()). For any other action it delegates to the parent class processPart() method
LongTaskController::processPart()

Definition at line 128 of file class.PageExportController.php.

References getPreviewCallback(), and WCMFException\throwEx().

Referenced by executeKernel().

+ Here is the call graph for this function:

PageExportController::getPreviewCallback (   $context)

Get the preview callback method for a given context. This method must have the same signature as one of the callbacks passed to BatchController::addWorkPackage(). The oid array passed as argument to that method will only hold the oid passed as 'oid' parameter to the view.

Note
subclasses must implement this method.

Definition at line 150 of file class.PageExportController.php.

References WCMFException\throwEx().

Referenced by processPart().

+ Here is the call graph for this function:

& PageExportController::initializeView (   $filename)

HELPER FUNCTIONS Create and initialize the view. This is the main entrance to view generation. After creation this method calls the PageExportController::assignCommonValues() method, that subclasses may implement to assign common vallues to their views (such as page title).

Parameters
filenameThe filename of the exported page (relative to exportDir as provided by by getExportDir()), this value is even required for a preview to set the baseHref properly
Returns
A reference to the created and initialized view

Definition at line 167 of file class.PageExportController.php.

References assignCommonValues(), createOutputView(), getExportDir(), URIUtil\makeAbsolute(), and useBaseHref().

+ Here is the call graph for this function:

& PageExportController::createOutputView ( )

Actually create the view for output.

Returns
A reference to the created view

Definition at line 199 of file class.PageExportController.php.

References Controller\assignViewDefaults(), and Controller\getView().

Referenced by initializeView().

+ Here is the call graph for this function:

PageExportController::assignCommonValues ( $view)

Assign common values to the export view. This method is called when the view is initialized.

Parameters
viewA reference to the view to assign the values to

Definition at line 223 of file class.PageExportController.php.

Referenced by initializeView().

PageExportController::getExportDir ( )

Get the directory where the exported files should be placed. The default implementation gets the directory from the key 'exportDir' in the config section 'cms'

Note
subclasses override this method to implement special application requirements.
Returns
The export directory name

Definition at line 230 of file class.PageExportController.php.

References InifileParser\getInstance(), and WCMFException\throwEx().

Referenced by initializeView().

+ Here is the call graph for this function:

PageExportController::useBaseHref ( )

Determine if a baseHref should be used in the html output. The baseHref metatag allows to interpret all resource paths used in the html code to be relative to the baseHref value. If you want to prevent this return false in this method. The default implementation returns true if the action is preview, else false

Note
subclasses override this method to implement special application requirements.
Returns
True/False

Definition at line 245 of file class.PageExportController.php.

Referenced by initializeView().

PageExportController::writeOutput ( $view,
  $context 
)

Write the view content to a file.

Parameters
viewA reference to the view to write
contextThe context of the view template definition in the configuration file

Definition at line 259 of file class.PageExportController.php.

References WCMFInifileParser\getInstance(), and WCMFException\throwEx().

+ Here is the call graph for this function:

Member Data Documentation

PageExportController::$FILENAME_VARNAME = 'PageExportController.filename'

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


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