Detailed Description

CSVImportController imports instances of one type into the storage.

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

The controller supports the following actions:

Action default
Initiate the import.

Parameter Description
in docFile The file upload as associative array with the following keys: 'name', 'type', 'tmp_name' (typically a $_FILES entry)
in className The entity type to import instances of
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 54 of file CSVImportController.php.

+ Inheritance diagram for CSVImportController:

Public Member Functions

 __construct (Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration, Cache $dynamicCache)
 
 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_KEY_STATS = 'stats'
 
- 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)
 
 initImport ($oids)
 
 importNodes ($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 ()
 

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 73 of file CSVImportController.php.

Member Function Documentation

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

Definition at line 90 of file CSVImportController.php.

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

Definition at line 132 of file CSVImportController.php.

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

Definition at line 162 of file CSVImportController.php.

initImport (   $oids)
protected

Initialize the CSV import (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 174 of file CSVImportController.php.

importNodes (   $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 212 of file CSVImportController.php.

Member Data Documentation

const CACHE_KEY_STATS = 'stats'

Definition at line 55 of file CSVImportController.php.