ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestExportPlugin Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (\ilDBInterface $db, \ilComponentRepositoryWrite $component_repository, string $id)
 
 setTest ($test)
 
 setTimestmap ($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 ()
 
 readEventListening ()
 
 clearEventListening ()
 

Protected Attributes

 $test
 
 $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
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 25 of file class.ilTestExportPlugin.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References ILIAS\GlobalScreen\Provider\__construct().

49  {
51  }
string $id
ilComponentRepositoryWrite $component_repository
ilDBInterface $db
__construct(Container $dic, ilPlugin $plugin)
+ 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
Returns
string
Exceptions
ilException

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

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

89  : string
90  {
91  $format_id = $this->getFormatIdentifier();
92 
93  if (!is_string($format_id)) {
94  throw new ilException('The format must be of type string.');
95  }
96 
97  if (!strlen($format_id)) {
98  throw new ilException('The format is empty.');
99  }
100 
101  if (strtolower($format_id) != $format_id) {
102  throw new ilException('Please use a lowercase format.');
103  }
104 
105  if (in_array($format_id, self::$reserved_formats)) {
106  throw new ilException('The format must not be one of: ' . implode(', ', self::$reserved_formats));
107  }
108 
109  return $format_id;
110  }
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
Returns
ilObjTest

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

References $test.

Referenced by getFormat().

+ Here is the caller graph for this function:

◆ getTimestmap()

ilTestExportPlugin::getTimestmap ( )
Returns
int

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

References $timestmap.

80  : int
81  {
82  return $this->timestmap;
83  }

◆ setTest()

ilTestExportPlugin::setTest (   $test)
final
Parameters
ilObjTest$test

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

References $test.

57  {
58  $this->test = $test;
59  }

◆ setTimestmap()

ilTestExportPlugin::setTimestmap (   $timestmap)
Parameters
int$timestmap

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

References $timestmap.

73  {
74  $this->timestmap = $timestmap;
75  }

Field Documentation

◆ $reserved_formats

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

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

◆ $test

ilTestExportPlugin::$test
protected

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

Referenced by getTest(), and setTest().

◆ $timestmap

ilTestExportPlugin::$timestmap = -1
protected

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

Referenced by getTimestmap(), and setTimestmap().


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