XMLExportController.php
41 * | _in_ `docFile` | The name of the file to write to (path relative to script main location) (default: 'export.xml')
44 * | _in_ `docRootElement` | The root element of the document (use this to enclose different root types if necessary) (default: 'Root')
64 // An assoziative array with keys 'docFile', 'docType', 'dtd', 'docLinebreak', 'docIndent', 'nodesPerCall',
65 // 'lastIndent' and 'tagsToClose' where the latter is an array of assoziative arrays with keys 'indent', 'name'
125 $docFile = $request->hasValue('docFile') ? $request->getValue('docFile') : $this->getDownloadFile();
128 $docRootElement = $request->hasValue('docRootElement') ? $request->getValue('docRootElement') : $this->_DOCROOTELEMENT;
129 $docLinebreak = $request->hasValue('docLinebreak') ? $request->getValue('docLinebreak') : $this->_DOCLINEBREAK;
130 $docIndent = $request->hasValue('docIndent') ? $request->getValue('docIndent') : $this->_DOCINDENT;
131 $nodesPerCall = $request->hasValue('nodesPerCall') ? $request->getValue('nodesPerCall') : $this->_NODES_PER_CALL;
133 $documentInfo = array('docFile' => $docFile, 'docType' => $docType, 'dtd' => $dtd, 'docRootElement' => $docRootElement,
166 * @note This is a callback method called on a matching work package, see BatchController::addWorkPackage()
182 $fileUtil->fputsUnicode($fileHandle, '<?xml version="1.0" encoding="UTF-8"?>'.$documentInfo['docLinebreak']);
184 $fileUtil->fputsUnicode($fileHandle, '<!DOCTYPE '.$documentInfo['docType'].' SYSTEM "'.$documentInfo['dtd'].'">'.$documentInfo['docLinebreak']);
186 $fileUtil->fputsUnicode($fileHandle, '<'.$documentInfo['docRootElement'].'>'.$documentInfo['docLinebreak']);
217 * @note This is a callback method called on a matching work package, see BatchController::addWorkPackage()
222 // - If there is an iterator stored in the session we are inside a tree and continue iterating (_NODES_PER_CALL nodes)
224 // - If the oids array holds one value!=null this is assumed to be an root oid and a new iterator is constructed
255 $documentInfo = $this->writeNode($fileHandle, $iterator->current(), $iterator->key()+1, $documentInfo);
297 * @note This is a callback method called on a matching work package, see BatchController::addWorkPackage()
308 $fileUtil->fputsUnicode($fileHandle, '</'.$documentInfo['docRootElement'].'>'.$documentInfo['docLinebreak']);
333 $fileUtil->fputsUnicode($fileHandle, str_repeat($documentInfo['docIndent'], $closeTag["indent"]).'</'.$closeTag["name"].'>'.$documentInfo['docLinebreak']);
368 $fileUtil->fputsUnicode($fileHandle, str_repeat($documentInfo['docIndent'], $curIndent).'<'.$elementName);
Response holds the response values that are used as output from Controller instances.
Definition: Response.php:20
const CACHE_KEY_ROOT_OIDS
Definition: XMLExportController.php:57
exportNodes($oids)
Serialize all Nodes with given oids to XML.
Definition: XMLExportController.php:219
Localization defines the interface for storing localized entity instances and retrieving them back...
Definition: Localization.php:32
const CACHE_KEY_EXPORTED_OIDS
Definition: XMLExportController.php:58
static load($persistenceFacade, $session, $uid)
Load an iterator state from the session.
Definition: PersistentIterator.php:81
addWorkPackage($name, $size, $oids, $callback, $args=null)
Add a work package to session.
Definition: BatchController.php:200
getWorkPackage($number)
Definition: XMLExportController.php:145
writeNode($fileHandle, ObjectId $oid, $depth, $documentInfo)
Serialize a Node to XML.
Definition: XMLExportController.php:347
ObjectId is the unique identifier of an object.
Definition: ObjectId.php:27
Message is used to get localized messages to be used in the user interface.
Definition: Message.php:23
Session is the interface for session implementations and defines access to session variables...
Definition: Session.php:21
initialize(Request $request, Response $response)
Definition: XMLExportController.php:118
Request holds the request values that are used as input to Controller instances.
Definition: Request.php:20
BatchController is used to process complex, longer running actions, that need to be divided into seve...
Definition: BatchController.php:69
__construct(Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration, Cache $cache)
Constructor.
Definition: XMLExportController.php:91
PermissionManager implementations are used to handle all authorization requests.
Definition: PermissionManager.php:22
Implementations of Configuration give access to the application configuration.
Definition: Configuration.php:32
initExport($oids)
Initialize the XML export (oids parameter will be ignored)
Definition: XMLExportController.php:168
endTags($fileHandle, $curIndent, &$documentInfo)
Ends all tags up to $curIndent level.
Definition: XMLExportController.php:324
getNumUnvisitedChildren(Node $node)
Get number of children of the given node, that were not visited yet.
Definition: XMLExportController.php:408
ActionMapper implementations are responsible for instantiating and executing Controllers based on the...
Definition: ActionMapper.php:21
getDownloadFile()
Definition: XMLExportController.php:158
XMLExportController exports the content tree into an XML file.
Definition: XMLExportController.php:55
const CACHE_SECTION
Definition: XMLExportController.php:56
FileUtil provides basic support for file functionality like HTTP file upload.
Definition: FileUtil.php:22
PersistenceFacade defines the interface for PersistenceFacade implementations.
Definition: PersistenceFacade.php:23
PersistentIterator is used to iterate over a tree/list built of oids using a Depth-First-Algorithm.
Definition: PersistentIterator.php:25
finishExport($oids)
Finish the XML export (oids parameter will be ignored)
Definition: XMLExportController.php:299
getValue($name, $default=null, $filter=null, $options=null)
Get a value.
getMapper()
Definition: DefaultPersistentObject.php:113