TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ImportExportController Class Reference
Inheritance diagram for ImportExportController:
BaseScriptClass

Public Member Functions

 __construct ()
 
 init ()
 
 main ()
 
 printContent ()
 
 mainAction (ServerRequestInterface $request, ResponseInterface $response)
 
 addRecordsForPid ($k, $tables, $maxNumber)
 
 makeConfigurationForm ($inData, &$row)
 
 makeAdvancedOptionsForm ($inData, &$row)
 
 makeSaveForm ($inData, &$row)
 
 getPreset ($uid)
 
 checkUpload ()
 
 renderSelectBox ($prefix, $value, $optValues)
 
 tableSelector ($prefix, $value, $excludeList= '')
 
 extensionSelector ($prefix, $value)
 
 filterPageIds ($exclude)
 
- Public Member Functions inherited from BaseScriptClass
 init ()
 
 menuConfig ()
 
 mergeExternalItems ($modName, $menuKey, $menuArr)
 
 handleExternalFunctionValue ($MM_key= 'function', $MS_value=null)
 
 getExternalItemConfig ($modName, $menuKey, $value= '')
 
 checkExtObj ()
 
 checkSubExtObj ()
 
 extObjHeader ()
 
 extObjContent ()
 

Public Attributes

 $pageinfo
 
- Public Attributes inherited from BaseScriptClass
 $MCONF = array()
 
 $id
 
 $CMD
 
 $perms_clause
 
 $MOD_MENU
 
 $MOD_SETTINGS = array()
 
 $modTSconfig
 
 $modMenu_type = ''
 
 $modMenu_dontValidateList = ''
 
 $modMenu_setDefaultList = ''
 
 $extClassConf
 
 $content = ''
 
 $doc
 
 $extObj
 

Protected Member Functions

 getButtons ()
 
 getDefaultImportExportFolder ()
 
 getBackendUser ()
 
 getDatabaseConnection ()
 
 getLanguageService ()
 
 getFile ($combinedIdentifier)
 
- Protected Member Functions inherited from BaseScriptClass
 getLanguageService ()
 
 getBackendUser ()
 
 getDatabaseConnection ()
 
 getPageRenderer ()
 

Protected Attributes

 $uploadedFiles = array()
 
 $export
 
 $import
 
 $fileProcessor
 
 $vC = ''
 
 $lang = null
 
 $treeHTML = ''
 
 $iconFactory
 
 $moduleName = 'xMOD_tximpexp'
 
 $moduleTemplate
 
 $shortcutName
 
- Protected Attributes inherited from BaseScriptClass
 $pageRenderer = null
 

Detailed Description

Main script class for the Import / Export facility

Definition at line 37 of file ImportExportController.php.

Constructor & Destructor Documentation

__construct ( )

Constructor

Definition at line 110 of file ImportExportController.php.

References GeneralUtility\makeInstance().

Member Function Documentation

addRecordsForPid (   $k,
  $tables,
  $maxNumber 
)

Adds records to the export object for a specific page id.

Parameters
int$kPage id for which to select records to add
array$tablesArray of table names to select from
int$maxNumberMax amount of records to select
Returns
void

Definition at line 571 of file ImportExportController.php.

References $GLOBALS, MathUtility\forceIntegerInRange(), ImportExportController\getBackendUser(), and ImportExportController\getDatabaseConnection().

checkUpload ( )

Check if a file has been uploaded

Exceptions
\InvalidArgumentException
\UnexpectedValueException
Returns
void

Definition at line 1457 of file ImportExportController.php.

References $GLOBALS, ImportExportController\$uploadedFiles, GeneralUtility\_GP(), DuplicationBehavior\CANCEL, ImportExportController\getBackendUser(), GeneralUtility\getIndpEnv(), GeneralUtility\makeInstance(), and DuplicationBehavior\REPLACE.

Referenced by ImportExportController\main().

extensionSelector (   $prefix,
  $value 
)

Returns a selector-box with loaded extension keys

Parameters
string$prefixForm element name prefix
array$valueThe current values selected
Returns
string HTML select element

Definition at line 1551 of file ImportExportController.php.

Referenced by ImportExportController\makeAdvancedOptionsForm().

filterPageIds (   $exclude)

Filter page IDs by traversing exclude array, finding all excluded pages (if any) and making an AND NOT IN statement for the select clause.

Parameters
array$excludeExclude array from import/export object.
Returns
string AND where clause part to filter out page uids.

Definition at line 1577 of file ImportExportController.php.

getBackendUser ( )
protected
getButtons ( )
protected

Create the panel of buttons for submitting the form or otherwise perform operations.

Returns
array all available buttons as an associated array

Definition at line 247 of file ImportExportController.php.

References GeneralUtility\_GP(), BackendUtility\BEgetRootLine(), ImportExportController\getBackendUser(), Icon\SIZE_SMALL, and BackendUtility\viewOnClick().

Referenced by ImportExportController\main().

getDatabaseConnection ( )
protected
getDefaultImportExportFolder ( )
protected

Returns a object for saving export files to the server and is also used for uploading import files.

Exceptions
\InvalidArgumentException
Returns
NULL|

Definition at line 1428 of file ImportExportController.php.

References ImportExportController\getBackendUser().

Referenced by ImportExportController\makeSaveForm().

getFile (   $combinedIdentifier)
protected

Gets a file by combined identifier.

Parameters
string$combinedIdentifier
Returns
NULL|

Definition at line 1674 of file ImportExportController.php.

Referenced by ImportExportController\makeSaveForm().

getLanguageService ( )
protected
Returns
LanguageService

Definition at line 1615 of file ImportExportController.php.

Referenced by ImportExportController\init().

getPreset (   $uid)

Get single preset record

Parameters
int$uidPreset record
Returns
array Preset record, if any (otherwise FALSE)

Definition at line 1412 of file ImportExportController.php.

References ImportExportController\getDatabaseConnection().

init ( )
main ( )

Main module function

Exceptions
\BadFunctionCallException
\InvalidArgumentException
Returns
void

Definition at line 134 of file ImportExportController.php.

References GeneralUtility\_GP(), ImportExportController\checkUpload(), ImportExportController\getButtons(), GeneralUtility\inList(), GeneralUtility\makeInstance(), and BackendUtility\readPageAccess().

Referenced by ImportExportController\mainAction().

mainAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Injects the request object for the current request and gathers all data

IMPORTING DATA:

Incoming array has syntax: GETvar 'id' = import page id (must be readable)

file = (pointing to filename relative to PATH_site)

[all relation fields are clear, but not files]

  • page-tree is written first
  • then remaining pages (to the root of import)
  • then all other records are written either to related included pages or if not found to import-root (should be a sysFolder in most cases)
  • then all internal relations are set and non-existing relations removed, relations to static tables preserved.

EXPORTING DATA:

Incoming array has syntax:

file[] = file dir[] = dir list[] = table:pid record[] = table:uid

pagetree[id] = (single id) pagetree[levels]=1,2,3, -1 = currently unpacked tree, -2 = only tables on page pagetree[tables][]=table/_ALL

external_ref[tables][]=table/_ALL

Parameters
ServerRequestInterface$requestthe current request
ResponseInterface$response
Returns
ResponseInterface the response with the content

Definition at line 232 of file ImportExportController.php.

References $GLOBALS, $response, MessageInterface\getBody(), ImportExportController\init(), and ImportExportController\main().

makeAdvancedOptionsForm (   $inData,
$row 
)

Create advanced options form Sets content in $this->content

Parameters
array$inDataForm configurat data
array$rowTable row accumulation variable. This is filled with table rows.
Returns
void

Definition at line 811 of file ImportExportController.php.

References BackendUtility\cshItem(), and ImportExportController\extensionSelector().

makeConfigurationForm (   $inData,
$row 
)

Create configuration form

Parameters
array$inDataForm configurat data
array$rowTable row accumulation variable. This is filled with table rows.
Returns
void Sets content in $this->content

Definition at line 634 of file ImportExportController.php.

References $GLOBALS, BackendUtility\cshItem(), ImportExportController\getBackendUser(), BackendUtility\getRecordTitle(), BackendUtility\getRecordWSOL(), ImportExportController\renderSelectBox(), Icon\SIZE_SMALL, and ImportExportController\tableSelector().

makeSaveForm (   $inData,
$row 
)

Create configuration form

Parameters
array$inDataForm configurat data
array$rowTable row accumulation variable. This is filled with table rows.
Returns
void Sets content in $this->content

Definition at line 869 of file ImportExportController.php.

References BackendUtility\cshItem(), ImportExportController\getBackendUser(), ImportExportController\getDatabaseConnection(), ImportExportController\getDefaultImportExportFolder(), ImportExportController\getFile(), and ImportExportController\renderSelectBox().

printContent ( )

Print the content

Returns
void
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8

Definition at line 191 of file ImportExportController.php.

References BaseScriptClass\$content, and GeneralUtility\logDeprecatedFunction().

renderSelectBox (   $prefix,
  $value,
  $optValues 
)

Makes a selector-box from optValues

Parameters
string$prefixForm element name
string$valueCurrent value
array$optValuesOptions to display (key/value pairs)
Returns
string HTML select element

Definition at line 1493 of file ImportExportController.php.

Referenced by ImportExportController\makeConfigurationForm(), and ImportExportController\makeSaveForm().

tableSelector (   $prefix,
  $value,
  $excludeList = '' 
)

Returns a selector-box with TCA tables

Parameters
string$prefixForm element name prefix
array$valueThe current values selected
string$excludeListTable names (and the string "_ALL") to exclude. Comma list
Returns
string HTML select element

Definition at line 1519 of file ImportExportController.php.

Referenced by ImportExportController\makeConfigurationForm().

Member Data Documentation

$export
protected

Definition at line 54 of file ImportExportController.php.

$fileProcessor
protected

Definition at line 64 of file ImportExportController.php.

$iconFactory
protected

Definition at line 84 of file ImportExportController.php.

$import
protected

Definition at line 59 of file ImportExportController.php.

$lang = null
protected

Definition at line 74 of file ImportExportController.php.

$moduleName = 'xMOD_tximpexp'
protected

Definition at line 91 of file ImportExportController.php.

Referenced by ImportExportController\init().

$moduleTemplate
protected

Definition at line 98 of file ImportExportController.php.

$pageinfo

Definition at line 49 of file ImportExportController.php.

$shortcutName
protected

Definition at line 105 of file ImportExportController.php.

$treeHTML = ''
protected

Definition at line 79 of file ImportExportController.php.

$uploadedFiles = array()
protected

Definition at line 42 of file ImportExportController.php.

Referenced by ImportExportController\checkUpload().

$vC = ''
protected

Definition at line 69 of file ImportExportController.php.