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 $staticCache)
 
 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)
 
 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'
 
const DOCFILE = "export.xml"
 
const DOCTYPE = ""
 
const DTD = ""
 
const DOCROOTELEMENT = "Root"
 
const DOCLINEBREAK = "\n"
 
const DOCINDENT = " "
 
const NODES_PER_CALL = 10
 
- 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)
 
 cleanup ()
 
- Protected Member Functions inherited from BatchController
 doExecute ($method=null)
 
 getStepNumber ()
 
 addWorkPackage ($name, $size, array $oids, $callback, $args=null)
 
 processPart ($step)
 
 getRequestValue ($name)
 
 getNumberOfSteps ()
 
 getDisplayText ($step)
 
- Protected Member Functions inherited from Controller
 validate ()
 
 executeSubAction ($action)
 
 redirect ($location, $key=null, $data=null)
 
 getLogger ()
 
 getSession ()
 
 getPersistenceFacade ()
 
 getPermissionManager ()
 
 getActionMapper ()
 
 getLocalization ()
 
 getMessage ()
 
 getConfiguration ()
 
 requireTransaction ()
 
 endTransaction ($commit)
 
 isLocalizedRequest ()
 
 checkLanguageParameter ()
 
 generateCsrfToken ($name, $refresh=true)
 
 validateCsrfToken ($name, $invalidate=true)
 
 getLocalSessionValue ($key, $default=null)
 
 setLocalSessionValue ($key, $value)
 
 clearLocalSessionValues ()
 

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

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

Definition at line 87 of file XMLExportController.php.

Member Function Documentation

◆ initialize()

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

Reimplemented from BatchController.

Definition at line 104 of file XMLExportController.php.

◆ getWorkPackage()

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

Reimplemented from BatchController.

Definition at line 155 of file XMLExportController.php.

◆ getDownloadFile()

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

Reimplemented from BatchController.

Definition at line 168 of file XMLExportController.php.

◆ initExport()

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 177 of file XMLExportController.php.

◆ exportNodes()

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 230 of file XMLExportController.php.

◆ finishExport()

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 302 of file XMLExportController.php.

◆ endTags()

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 325 of file XMLExportController.php.

◆ writeNode()

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 356 of file XMLExportController.php.

◆ getNumUnvisitedChildren()

getNumUnvisitedChildren ( Node  $node)
protected

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

Parameters
$node
Returns
Integer

Definition at line 425 of file XMLExportController.php.

◆ formatValue()

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 458 of file XMLExportController.php.

◆ cleanup()

cleanup ( )
protected
See also
BatchController::cleanup()

Reimplemented from BatchController.

Definition at line 465 of file XMLExportController.php.

Member Data Documentation

◆ CACHE_KEY_ROOT_OIDS

const CACHE_KEY_ROOT_OIDS = 'rootOids'

Definition at line 56 of file XMLExportController.php.

◆ CACHE_KEY_EXPORTED_OIDS

const CACHE_KEY_EXPORTED_OIDS = 'exportedOids'

Definition at line 57 of file XMLExportController.php.

◆ CACHE_KEY_LAST_INDENT

const CACHE_KEY_LAST_INDENT = 'lastIndent'

Definition at line 58 of file XMLExportController.php.

◆ CACHE_KEY_TAGS_TO_CLOSE

const CACHE_KEY_TAGS_TO_CLOSE = 'tagsToClose'

Definition at line 59 of file XMLExportController.php.

◆ ITERATOR_ID_VAR

const ITERATOR_ID_VAR = 'XMLExportController.iteratorid'

Definition at line 62 of file XMLExportController.php.

◆ DOCFILE

const DOCFILE = "export.xml"

Definition at line 65 of file XMLExportController.php.

◆ DOCTYPE

const DOCTYPE = ""

Definition at line 66 of file XMLExportController.php.

◆ DTD

const DTD = ""

Definition at line 67 of file XMLExportController.php.

◆ DOCROOTELEMENT

const DOCROOTELEMENT = "Root"

Definition at line 68 of file XMLExportController.php.

◆ DOCLINEBREAK

const DOCLINEBREAK = "\n"

Definition at line 69 of file XMLExportController.php.

◆ DOCINDENT

const DOCINDENT = " "

Definition at line 70 of file XMLExportController.php.

◆ NODES_PER_CALL

const NODES_PER_CALL = 10

Definition at line 71 of file XMLExportController.php.