ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestExportPlugin Class Reference

Abstract parent class for all event hook plugin classes. More...

+ Inheritance diagram for ilTestExportPlugin:
+ Collaboration diagram for ilTestExportPlugin:

Public Member Functions

 __construct (\ilDBInterface $db, \ilComponentRepositoryWrite $component_repository, string $id)
 
 setTest (ilObjTest $test)
 
 setTimestmap (int $timestmap)
 
 getTimestmap ()
 
 getFormat ()
 
 getFormatLabel ()
 This method should return a human readable label for your export. More...
 
- Public Member Functions inherited from ilPlugin
 getMessage ()
 
 __construct (\ilDBInterface $db, \ilComponentRepositoryWrite $component_repository, string $id)
 
 getPluginName ()
 
 getId ()
 
 getVersion ()
 Only very little classes seem to care about this: More...
 
 getDirectory ()
 Only very little classes seem to care about this: More...
 
 isActive ()
 Only very little classes seem to care about this: More...
 
 needsUpdate ()
 
 install ()
 
 uninstall ()
 
 activate ()
 This will update (if required) and activate the plugin. More...
 
 deactivate ()
 
 update ()
 
 loadLanguageModule ()
 Load language module for plugin. More...
 
 txt (string $a_var)
 Get Language Variable (prefix will be prepended automatically) More...
 
 getTemplate (string $a_template, bool $a_par1=true, bool $a_par2=true)
 ILIAS is moving towards UI components and plugins are expected to use these components. More...
 
 getStyleSheetLocation (string $a_css_file)
 ILIAS is moving towards UI components and plugins are expected to use these components. More...
 
 addBlockFile ($a_tpl, $a_var, $a_block, $a_tplname)
 ILIAS is moving towards UI components and plugins are expected to use these components. More...
 
 getGlobalScreenProviderCollection ()
 
 exchangeUIRendererAfterInitialization (\ILIAS\DI\Container $dic)
 This methods allows to replace the UI Renderer (see src/UI) of ILIAS after initialization by returning a closure returning a custom renderer. More...
 
 exchangeUIFactoryAfterInitialization (string $dic_key, \ILIAS\DI\Container $dic)
 This methods allows to replace some factory for UI Components (see src/UI) of ILIAS after initialization by returning a closure returning a custom factory. More...
 

Protected Member Functions

 getTest ()
 
 buildExportFile (ilTestExportFilename $export_path)
 This method is called if the user wants to export a test of YOUR export type If you throw an exception of type ilException with a respective language variable, ILIAS presents a translated failure message. More...
 
 getFormatIdentifier ()
 A unique identifier which describes your export type, e.g. More...
 
- Protected Member Functions inherited from ilPlugin
 init ()
 Object initialization. More...
 
 getPluginInfo ()
 
 getComponentInfo ()
 
 getPluginSlotInfo ()
 
 afterInstall ()
 If you cannot get rid of the requirement to use this, adjust the install method in your subclass instead. More...
 
 beforeUninstall ()
 If you cannot get rid of the requirement to use this, adjust the uninstall method in your subclass instead. More...
 
 afterUninstall ()
 If you cannot get rid of the requirement to use this, adjust the uninstall method in your subclass instead. More...
 
 beforeActivation ()
 If you cannot get rid of the requirement to use this, adjust the activate method in your subclass instead. More...
 
 afterActivation ()
 If you cannot get rid of the requirement to use this, adjust the activate method in your subclass instead. More...
 
 afterDeactivation ()
 If you cannot get rid of the requirement to use this, adjust the activate method in your subclass instead. More...
 
 updateDatabase ()
 
 beforeUpdate ()
 If you cannot get rid of the requirement to use this, adjust the update method in your subclass instead. More...
 
 afterUpdate ()
 
 getLanguageHandler ()
 
 buildLanguageHandler ()
 

Protected Attributes

ilObjTest $test
 
int $timestmap = -1
 
- Protected Attributes inherited from ilPlugin
ilDBInterface $db
 
ilComponentRepositoryWrite $component_repository
 
string $id
 
ilPluginLanguage $language_handler = null
 
bool $lang_initialised = false
 
ProviderCollection $provider_collection
 
string $message = ''
 

Static Protected Attributes

static $reserved_formats
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Abstract parent class for all event hook plugin classes.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 27 of file class.ilTestExportPlugin.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestExportPlugin::__construct ( \ilDBInterface  $db,
\ilComponentRepositoryWrite  $component_repository,
string  $id 
)

Definition at line 41 of file class.ilTestExportPlugin.php.

References ILIAS\MetaData\Repository\Validation\Data\__construct().

45  {
47  }
string $id
ilComponentRepositoryWrite $component_repository
__construct(VocabulariesInterface $vocabularies)
ilDBInterface $db
+ Here is the call graph for this function:

Member Function Documentation

◆ buildExportFile()

ilTestExportPlugin::buildExportFile ( ilTestExportFilename  $export_path)
abstractprotected

This method is called if the user wants to export a test of YOUR export type If you throw an exception of type ilException with a respective language variable, ILIAS presents a translated failure message.

Exceptions
ilException
Parameters
string$export_pathThe path to store the export file

Referenced by getFormat().

+ Here is the caller graph for this function:

◆ getFormat()

ilTestExportPlugin::getFormat ( )
final
Exceptions
ilException

Definition at line 72 of file class.ilTestExportPlugin.php.

References $DIC, Vendor\Package\$e, $lng, buildExportFile(), getFormatIdentifier(), getFormatLabel(), getTest(), and ilPlugin\txt().

72  : string
73  {
74  $format_id = $this->getFormatIdentifier();
75 
76  if (!is_string($format_id)) {
77  throw new ilException('The format must be of type string.');
78  }
79 
80  if (!strlen($format_id)) {
81  throw new ilException('The format is empty.');
82  }
83 
84  if (strtolower($format_id) != $format_id) {
85  throw new ilException('Please use a lowercase format.');
86  }
87 
88  if (in_array($format_id, self::$reserved_formats)) {
89  throw new ilException('The format must not be one of: ' . implode(', ', self::$reserved_formats));
90  }
91 
92  return $format_id;
93  }
getFormatIdentifier()
A unique identifier which describes your export type, e.g.
+ Here is the call graph for this function:

◆ getFormatIdentifier()

ilTestExportPlugin::getFormatIdentifier ( )
abstractprotected

A unique identifier which describes your export type, e.g.

imsm There is currently no mapping implemented concerning the filename. Feel free to create csv, xml, zip files ....

Returns
string

Referenced by getFormat().

+ Here is the caller graph for this function:

◆ getFormatLabel()

ilTestExportPlugin::getFormatLabel ( )
abstract

This method should return a human readable label for your export.

Returns
string

Referenced by getFormat().

+ Here is the caller graph for this function:

◆ getTest()

ilTestExportPlugin::getTest ( )
finalprotected

Definition at line 54 of file class.ilTestExportPlugin.php.

References $test.

Referenced by getFormat().

54  : ilObjTest
55  {
56  return $this->test;
57  }
+ Here is the caller graph for this function:

◆ getTimestmap()

ilTestExportPlugin::getTimestmap ( )

Definition at line 64 of file class.ilTestExportPlugin.php.

References $timestmap.

64  : int
65  {
66  return $this->timestmap;
67  }

◆ setTest()

ilTestExportPlugin::setTest ( ilObjTest  $test)
final

Definition at line 49 of file class.ilTestExportPlugin.php.

References $test.

49  : void
50  {
51  $this->test = $test;
52  }

◆ setTimestmap()

ilTestExportPlugin::setTimestmap ( int  $timestmap)

Definition at line 59 of file class.ilTestExportPlugin.php.

References $timestmap.

59  : void
60  {
61  $this->timestmap = $timestmap;
62  }

Field Documentation

◆ $main_tpl

ilGlobalTemplateInterface ilTestExportPlugin::$main_tpl
private

Definition at line 39 of file class.ilTestExportPlugin.php.

◆ $reserved_formats

ilTestExportPlugin::$reserved_formats
staticprotected
Initial value:
= array(
'xml',
'csv'
)

Definition at line 35 of file class.ilTestExportPlugin.php.

◆ $test

ilObjTest ilTestExportPlugin::$test
protected

Definition at line 29 of file class.ilTestExportPlugin.php.

Referenced by getTest(), and setTest().

◆ $timestmap

int ilTestExportPlugin::$timestmap = -1
protected

Definition at line 30 of file class.ilTestExportPlugin.php.

Referenced by getTimestmap(), and setTimestmap().


The documentation for this class was generated from the following file: