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 $cache)
 
 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_SECTION = 'xmlexport'
 
const CACHE_KEY_ROOT_OIDS = 'rootOids'
 
const CACHE_KEY_EXPORTED_OIDS = 'exportedOids'
 
- Public Attributes inherited from BatchController
const ONE_CALL_SESSION_VARNAME = 'BatchController.oneCall'
 
const STEP_SESSION_VARNAME = 'BatchController.curStep'
 
const NUM_STEPS_VARNAME = 'BatchController.numSteps'
 
const DOWNLOAD_STEP = 'BatchController.downloadStep'
 
const WORK_PACKAGES_VARNAME = 'BatchController.workPackages'
 

Protected Member Functions

 getFileUtil ()
 
 getWorkPackage ($number)
 
 getDownloadFile ()
 
 initExport ($oids)
 
 exportNodes ($oids)
 
 finishExport ($oids)
 
 endTags ($fileHandle, $curIndent, &$documentInfo)
 
 writeNode ($fileHandle, ObjectId $oid, $depth, $documentInfo)
 
 getNumUnvisitedChildren (Node $node)
 
 formatValue ($value)
 
- Protected Member Functions inherited from BatchController
 doExecute ()
 
 getStepNumber ()
 
 addWorkPackage ($name, $size, $oids, $callback, $args=null)
 
 processPart ()
 
 getNumberOfSteps ()
 
 getDisplayText ($step)
 
 getDownloadFile ()
 
 getWorkPackage ($number)
 
- Protected Member Functions inherited from Controller
 validate ()
 
 executeSubAction ($action)
 
 getLogger ()
 
 getSession ()
 
 getPersistenceFacade ()
 
 getPermissionManager ()
 
 getActionMapper ()
 
 getLocalization ()
 
 getMessage ()
 
 getConfiguration ()
 
 assignResponseDefaults ()
 
 isLocalizedRequest ()
 
 checkLanguageParameter ()
 

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 91 of file XMLExportController.php.

Member Function Documentation

getFileUtil ( )
protected

Get the FileUtil instance.

Returns
FileUtil

Definition at line 108 of file XMLExportController.php.

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

Definition at line 118 of file XMLExportController.php.

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

Definition at line 145 of file XMLExportController.php.

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

Definition at line 158 of file XMLExportController.php.

initExport (   $oids)
protected

Initialize the XML export (oids parameter will be ignored)

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

Definition at line 168 of file XMLExportController.php.

exportNodes (   $oids)
protected

Serialize all Nodes with given oids to XML.

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

Definition at line 219 of file XMLExportController.php.

finishExport (   $oids)
protected

Finish the XML export (oids parameter will be ignored)

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

Definition at line 299 of file XMLExportController.php.

endTags (   $fileHandle,
  $curIndent,
$documentInfo 
)
protected

Ends all tags up to $curIndent level.

Parameters
$fileHandleThe file handle to write to
$curIndentThe depth of the node in the tree
$documentInfoA reference to an assoziative array (see DOCUMENT_INFO)

Definition at line 324 of file XMLExportController.php.

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

Serialize a Node to XML.

Parameters
$fileHandleThe file handle to write to
$oidThe oid of the node
$depthThe depth of the node in the tree
$documentInfoAn assoziative array (see DOCUMENT_INFO)
Returns
The updated document state

Definition at line 347 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 408 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 440 of file XMLExportController.php.

Member Data Documentation

const CACHE_SECTION = 'xmlexport'

Definition at line 56 of file XMLExportController.php.

const CACHE_KEY_ROOT_OIDS = 'rootOids'

Definition at line 57 of file XMLExportController.php.

const CACHE_KEY_EXPORTED_OIDS = 'exportedOids'

Definition at line 58 of file XMLExportController.php.