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
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 nodesPerCall The number of nodes to process in one call (default: 50)

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 49 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 ()
 

Protected Member Functions

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

Additional Inherited Members

- 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'
 

Member Function Documentation

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

Definition at line 58 of file CSVExportController.php.

validate ( )
protected
See also
Controller::validate()

Definition at line 86 of file CSVExportController.php.

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

Definition at line 122 of file CSVExportController.php.

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

Definition at line 132 of file CSVExportController.php.

initExport (   $oids)
protected

Initialize the CSV 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 141 of file CSVExportController.php.

exportNodes (   $oids)
protected

Serialize all Nodes with given object ids to CSV.

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

Definition at line 193 of file CSVExportController.php.