Detailed Description

XMLExportController exports the content tree into an XML file.

The controller supports the following actions:

Action default
Initiate the export.

Parameter Description
in docFile The name of the file to write to (path relative to script main location) (default: 'export.xml')
in docType The document type (will be written into XML header) (default: '')
in dtd The dtd (will be written into XML header) (default: '')
in docRootElement The root element of the document (use this to enclose different root types if necessary) (default: 'Root')
in docLinebreak The linebreak character(s) to use (default: '
')
in docIndent The indent character(s) to use (default: ' ')
in nodesPerCall The number of nodes to process in one call (default: 10)

For additional actions and parameters see BatchController actions.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 55 of file XMLExportController.php.

+ Inheritance diagram for XMLExportController:

Public Member Functions

 __construct (Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration, Cache $dynamicCache)
 
 initialize (Request $request, Response $response)
 
- Public Member Functions inherited from BatchController
 initialize (Request $request, Response $response)
 
- 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 ()
 

Public Attributes

const CACHE_KEY_ROOT_OIDS = 'rootOids'
 
const CACHE_KEY_EXPORTED_OIDS = 'exportedOids'
 
const CACHE_KEY_LAST_INDENT = 'lastIndent'
 
const CACHE_KEY_TAGS_TO_CLOSE = 'tagsToClose'
 
const ITERATOR_ID_VAR = 'XMLExportController.iteratorid'
 
- Public Attributes inherited from BatchController
const REQUEST_VAR = 'request'
 
const ONE_CALL_VAR = 'oneCall'
 
const STEP_VAR = 'step'
 
const NUM_STEPS_VAR = 'numSteps'
 
const DOWNLOAD_STEP_VAR = 'downloadStep'
 
const PACKAGES_VAR = 'packages'
 
- Public Attributes inherited from Controller
const CSRF_TOKEN_PARAM = 'csrf_token'
 

Protected Member Functions

 getWorkPackage ($number)
 
 getDownloadFile ()
 
 initExport ($oids)
 
 exportNodes ($oids)
 
 finishExport ($oids)
 
 endTags ($fileHandle, $curIndent)
 
 writeNode ($fileHandle, ObjectId $oid, $depth)
 
 getNumUnvisitedChildren (Node $node)
 
 formatValue ($value)
 
- Protected Member Functions inherited from BatchController
 doExecute ($method=null)
 
 getStepNumber ()
 
 addWorkPackage ($name, $size, $oids, $callback, $args=null)
 
 processPart ($step)
 
 getRequestValue ($name)
 
 getNumberOfSteps ()
 
 getDisplayText ($step)
 
 getDownloadFile ()
 
 getWorkPackage ($number)
 
 cleanup ()
 
- Protected Member Functions inherited from Controller
 validate ()
 
 doExecute ($method=null)
 
 executeSubAction ($action)
 
 redirect ($location, $key=null, $data=null)
 
 getLogger ()
 
 getSession ()
 
 getPersistenceFacade ()
 
 getPermissionManager ()
 
 getActionMapper ()
 
 getLocalization ()
 
 getMessage ()
 
 getConfiguration ()
 
 requireTransaction ()
 
 endTransaction ($commit)
 
 isLocalizedRequest ()
 
 checkLanguageParameter ()
 
 generateCsrfToken ($name)
 
 validateCsrfToken ($name)
 
 getLocalSessionValue ($key, $default=null)
 
 setLocalSessionValue ($key, $value)
 
 clearLocalSessionValues ()
 

Constructor & Destructor Documentation

__construct ( Session  $session,
PersistenceFacade  $persistenceFacade,
PermissionManager  $permissionManager,
ActionMapper  $actionMapper,
Localization  $localization,
Message  $message,
Configuration  $configuration,
Cache  $dynamicCache 
)

Constructor.

Parameters
$session
$persistenceFacade
$permissionManager
$actionMapper
$localization
$message
$configuration
$dynamicCache

Definition at line 87 of file XMLExportController.php.

Member Function Documentation

initialize ( Request  $request,
Response  $response 
)
See also
Controller::initialize()

Definition at line 104 of file XMLExportController.php.

getWorkPackage (   $number)
protected
See also
BatchController::getWorkPackage()

Definition at line 156 of file XMLExportController.php.

getDownloadFile ( )
protected
See also
BatchController::getDownloadFile()

Definition at line 169 of file XMLExportController.php.

initExport (   $oids)
protected

Initialize the XML export (object ids parameter will be ignored)

Parameters
$oidsThe object ids to process
Note
This is a callback method called on a matching work package, see BatchController::addWorkPackage()

Definition at line 178 of file XMLExportController.php.

exportNodes (   $oids)
protected

Serialize all Nodes with given object ids to XML.

Parameters
$oidsThe object ids to process
Note
This is a callback method called on a matching work package, see BatchController::addWorkPackage()

Definition at line 231 of file XMLExportController.php.

finishExport (   $oids)
protected

Finish the XML export (object ids parameter will be ignored)

Parameters
$oidsThe object ids to process
Note
This is a callback method called on a matching work package, see BatchController::addWorkPackage()

Definition at line 303 of file XMLExportController.php.

endTags (   $fileHandle,
  $curIndent 
)
protected

Ends all tags up to $curIndent level.

Parameters
$fileHandleThe file handle to write to
$curIndentThe depth of the node in the tree

Definition at line 326 of file XMLExportController.php.

writeNode (   $fileHandle,
ObjectId  $oid,
  $depth 
)
protected

Serialize a Node to XML.

Parameters
$fileHandleThe file handle to write to
$oidThe object id of the node
$depthThe depth of the node in the tree

Definition at line 357 of file XMLExportController.php.

getNumUnvisitedChildren ( Node  $node)
protected

Get number of children of the given node, that were not visited yet.

Parameters
$node
Returns
Integer

Definition at line 426 of file XMLExportController.php.

formatValue (   $value)
protected

Format a value for XML output.

Parameters
$valueThe value to format
Returns
The formatted value
Note
Subclasses may overrite this for special application requirements

Definition at line 459 of file XMLExportController.php.

Member Data Documentation

const CACHE_KEY_ROOT_OIDS = 'rootOids'

Definition at line 56 of file XMLExportController.php.

const CACHE_KEY_EXPORTED_OIDS = 'exportedOids'

Definition at line 57 of file XMLExportController.php.

const CACHE_KEY_LAST_INDENT = 'lastIndent'

Definition at line 58 of file XMLExportController.php.

const CACHE_KEY_TAGS_TO_CLOSE = 'tagsToClose'

Definition at line 59 of file XMLExportController.php.

const ITERATOR_ID_VAR = 'XMLExportController.iteratorid'

Definition at line 62 of file XMLExportController.php.