Detailed Description

CSVExportController exports instances of one type into a CSV file.

It uses the fputcsv function of PHP with the default values for delimiter, enclosing and escape character.

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.csv')
in className The entity type to export instances of or the source type, when exporting a relation (see sourceId, relation)
in sortFieldName The field name to sort the list by. Must be one of the fields of the type selected by the className parameter. If omitted, the sorting is undefined (optional)
in sortDirection The direction to sort the list. Must be either asc for ascending or desc for descending (optional, default: asc)
in query A query condition encoded in RQL to be used with StringQuery::setRQLConditionString()
in translateValues Boolean whether list values should be translated to their display values (optional, default: true)
in sourceId When exporting a relation: Id of the object to which the exported objects are related (determines the object id together with className)
in relation When exporting a relation: Name of the relation to the object defined by sourceId (determines the type of the returned objects)
in nodesPerCall The number of nodes to process in one call (default: 50)

For additional actions and parameters see BatchController actions.

ingo herwig

Definition at line 55 of file CSVExportController.php.

+ Inheritance diagram for CSVExportController:

Public Member Functions

 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 DOCFILE = "export.csv"
const NODES_PER_CALL = 50
- 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

 validate ()
 getWorkPackage ($number)
 getDownloadFile ()
 initExport ($oids)
 exportNodes ($oids)
 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)
 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 ()

Member Function Documentation

initialize ( Request  $request,
Response  $response 
See also

Definition at line 64 of file CSVExportController.php.

validate ( )
See also

Definition at line 94 of file CSVExportController.php.

getWorkPackage (   $number)
See also

Definition at line 153 of file CSVExportController.php.

getDownloadFile ( )
See also

Definition at line 163 of file CSVExportController.php.

initExport (   $oids)

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

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

Definition at line 172 of file CSVExportController.php.

exportNodes (   $oids)

Serialize all Nodes with given object ids to CSV.

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

Definition at line 241 of file CSVExportController.php.

cleanup ( )
See also

Definition at line 280 of file CSVExportController.php.

Member Data Documentation

const DOCFILE = "export.csv"

Definition at line 58 of file CSVExportController.php.

const NODES_PER_CALL = 50

Definition at line 59 of file CSVExportController.php.