ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDclTableEditGUI Class Reference

Class ilDclBaseFieldModel. More...

+ Collaboration diagram for ilDclTableEditGUI:

Public Member Functions

 __construct (ilDclTableListGUI $a_parent_obj)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 create ()
 create table add form More...
 
 edit ()
 create field edit form More...
 
 getValues ()
 getFieldValues More...
 
 getStandardValues ()
 getStandardValues More...
 
 cancel ()
 
 initForm ($a_mode="create")
 initEditCustomForm More...
 
 doTableSwitch ()
 
 save ($a_mode="create")
 save More...
 
 accessDenied ()
 
 confirmDelete ()
 confirmDelete More...
 
 cancelDelete ()
 cancelDelete More...
 
 delete ()
 

Protected Member Functions

 checkInput ($a_mode)
 Custom checks for the form input. More...
 
 checkAccess ()
 
 createTableSwitcher ()
 

Protected Attributes

 $lng
 
 $ctrl
 
 $tpl
 
 $toolbar
 
 $form
 

Private Attributes

 $table_id
 
 $table
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDclTableEditGUI::__construct ( ilDclTableListGUI  $a_parent_obj)

Constructor.

Parameters
ilDclTableListGUI$a_parent_obj

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

References $_GET, $DIC, $ilCtrl, $lng, $toolbar, $tpl, checkAccess(), ilDclCache\getTableCache(), and ilUtil\sendFailure().

54  {
55  global $DIC;
56  $ilCtrl = $DIC['ilCtrl'];
57  $lng = $DIC['lng'];
58  $tpl = $DIC['tpl'];
59  $toolbar = $DIC['ilToolbar'];
60  $locator = $DIC['ilLocator'];
61 
62  $this->ctrl = $ilCtrl;
63  $this->lng = $lng;
64  $this->tpl = $tpl;
65  $this->toolbar = $toolbar;
66  $this->parent_object = $a_parent_obj;
67  $this->obj_id = $a_parent_obj->obj_id;
68  $this->table_id = $_GET['table_id'];
69  $this->table = ilDclCache::getTableCache($this->table_id);
70 
71  $this->ctrl->saveParameter($this, 'table_id');
72  $locator->addItem($this->table->getTitle(), $this->ctrl->getLinkTarget($this, 'edit'));
73  $this->tpl->setLocator();
74 
75  if (!$this->checkAccess()) {
76  ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
77  $this->ctrl->redirectByClass('ildclrecordlistgui', 'listRecords');
78  }
79  }
$_GET["client_id"]
static getTableCache($table_id=0)
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $DIC
+ Here is the call graph for this function:

Member Function Documentation

◆ accessDenied()

ilDclTableEditGUI::accessDenied ( )

Definition at line 414 of file class.ilDclTableEditGUI.php.

Referenced by save().

414  {
415  $this->tpl->setContent("Access denied.");
416  }
+ Here is the caller graph for this function:

◆ cancel()

ilDclTableEditGUI::cancel ( )

Definition at line 185 of file class.ilDclTableEditGUI.php.

185  {
186  $this->ctrl->redirectByClass("ilDclTableListGUI", "listTables");
187  }

◆ cancelDelete()

ilDclTableEditGUI::cancelDelete ( )

cancelDelete

Definition at line 440 of file class.ilDclTableEditGUI.php.

440  {
441  $this->ctrl->redirectByClass("ilDclTableListGUI", "listTables");
442  }

◆ checkAccess()

ilDclTableEditGUI::checkAccess ( )
protected
Returns
bool

Definition at line 462 of file class.ilDclTableEditGUI.php.

References $ref_id, ilObjDataCollectionAccess\hasAccessToEditTable(), and ilObjDataCollectionAccess\hasWriteAccess().

Referenced by __construct().

462  {
463  $ref_id = $this->parent_object->getDataCollectionObject()->getRefId();
464  return $this->table_id ? ilObjDataCollectionAccess::hasAccessToEditTable($ref_id, $this->table_id) : ilObjDataCollectionAccess::hasWriteAccess($ref_id);
465  }
static hasAccessToEditTable($ref_id, $table_id)
$ref_id
Definition: sahs_server.php:39
Class ilObjDataCollectionAccess.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkInput()

ilDclTableEditGUI::checkInput (   $a_mode)
protected

Custom checks for the form input.

Parameters
$a_mode'create' | 'update'
Returns
bool

Definition at line 389 of file class.ilDclTableEditGUI.php.

References $title, ilObjDataCollection\_hasTableByTitle(), and ilUtil\sendFailure().

Referenced by save().

389  {
390  $return = $this->form->checkInput();
391 
392  // Title of table must be unique in one DC
393  if ($a_mode == 'create') {
394  if ($title = $this->form->getInput('title')) {
395  if (ilObjDataCollection::_hasTableByTitle($title, $this->obj_id)) {
396  $inputObj = $this->form->getItemByPostVar('title');
397  $inputObj->setAlert($this->lng->txt("dcl_table_title_unique"));
398  $return = false;
399  }
400  }
401  }
402 
403  if (! $return) {
404  ilUtil::sendFailure($this->lng->txt("form_input_not_valid"));
405  }
406 
407  return $return;
408  }
static _hasTableByTitle($title, $obj_id)
Checks if a DataCollection has a table with a given title.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDelete()

ilDclTableEditGUI::confirmDelete ( )

confirmDelete

Definition at line 422 of file class.ilDclTableEditGUI.php.

422  {
423  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
424  $conf = new ilConfirmationGUI();
425  $conf->setFormAction($this->ctrl->getFormAction($this));
426  $conf->setHeaderText($this->lng->txt('dcl_confirm_delete_table'));
427 
428  $conf->addItem('table', (int)$this->table->getId(), $this->table->getTitle());
429 
430  $conf->setConfirm($this->lng->txt('delete'), 'delete');
431  $conf->setCancel($this->lng->txt('cancel'), 'cancelDelete');
432 
433  $this->tpl->setContent($conf->getHTML());
434  }
Confirmation screen class.

◆ create()

ilDclTableEditGUI::create ( )

create table add form

Definition at line 104 of file class.ilDclTableEditGUI.php.

References getStandardValues(), and initForm().

104  {
105  $this->initForm();
106  $this->getStandardValues();
107  $this->tpl->setContent($this->form->getHTML());
108  }
initForm($a_mode="create")
initEditCustomForm
getStandardValues()
getStandardValues
+ Here is the call graph for this function:

◆ createTableSwitcher()

ilDclTableEditGUI::createTableSwitcher ( )
protected
Parameters
$options
Returns
mixed

Definition at line 473 of file class.ilDclTableEditGUI.php.

References $options, $table, and ilSubmitButton\getInstance().

Referenced by initForm().

473  {
474  // Show tables
475  $tables = $this->parent_object->getDataCollectionObject()->getTables();
476 
477  foreach ($tables as $table) {
478  $options[$table->getId()] = $table->getTitle();
479  }
480  include_once './Services/Form/classes/class.ilSelectInputGUI.php';
481  $table_selection = new ilSelectInputGUI('', 'table_id');
482  $table_selection->setOptions($options);
483  $table_selection->setValue($this->table->getId());
484 
485  $this->toolbar->setFormAction($this->ctrl->getFormActionByClass("ilDclTableEditGUI", "doTableSwitch"));
486  $this->toolbar->addText($this->lng->txt("dcl_select"));
487  $this->toolbar->addInputItem($table_selection);
488  $button = ilSubmitButton::getInstance();
489  $button->setCommand("doTableSwitch");
490  $button->setCaption('change');
491  $this->toolbar->addButtonInstance($button);
492 
493  return $options;
494  }
This class represents a selection list property in a property form.
if(!is_array($argv)) $options
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilDclTableEditGUI::delete ( )

Definition at line 447 of file class.ilDclTableEditGUI.php.

References ilUtil\sendFailure().

447  {
448  if (count($this->table->getCollectionObject()->getTables()) < 2) {
449  ilUtil::sendFailure($this->lng->txt("dcl_cant_delete_last_table"), true); //TODO change lng var
450  $this->table->doDelete(true);
451  } else {
452  $this->table->doDelete(false);
453  }
454 
455  $this->ctrl->redirectByClass("ildcltablelistgui", "listtables");
456  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ doTableSwitch()

ilDclTableEditGUI::doTableSwitch ( )

Definition at line 308 of file class.ilDclTableEditGUI.php.

References $_POST.

309  {
310  $this->ctrl->setParameter($this, "table_id", $_POST['table_id']);
311  $this->ctrl->redirect($this, "edit");
312  }
$_POST["username"]

◆ edit()

ilDclTableEditGUI::edit ( )

create field edit form

Definition at line 114 of file class.ilDclTableEditGUI.php.

References ilDclCache\getTableCache(), getValues(), and initForm().

114  {
115  if (!$this->table_id) {
116  $this->ctrl->redirectByClass("ildclfieldeditgui", "listFields");
117 
118  return;
119  } else {
120  $this->table = ilDclCache::getTableCache($this->table_id);
121  }
122  $this->initForm("edit");
123  $this->getValues();
124  $this->tpl->setContent($this->form->getHTML());
125  }
initForm($a_mode="create")
initEditCustomForm
static getTableCache($table_id=0)
+ Here is the call graph for this function:

◆ executeCommand()

ilDclTableEditGUI::executeCommand ( )

execute command

Definition at line 85 of file class.ilDclTableEditGUI.php.

References $cmd, and save().

85  {
86  $cmd = $this->ctrl->getCmd();
87 
88  switch ($cmd) {
89  case 'update':
90  $this->save("update");
91  break;
92  default:
93  $this->$cmd();
94  break;
95  }
96 
97  return true;
98  }
$cmd
Definition: sahs_server.php:35
save($a_mode="create")
save
+ Here is the call graph for this function:

◆ getStandardValues()

ilDclTableEditGUI::getStandardValues ( )

getStandardValues

Definition at line 163 of file class.ilDclTableEditGUI.php.

References array.

Referenced by create().

163  {
164  $values = array(
165  'title' => "",
166  'add_perm' => 1,
167  'edit_perm' => 1,
168  'edit_perm_mode' => 'own',
169  'delete_perm_mode' => 'own',
170  'delete_perm' => 1,
171  'edit_by_owner' => 1,
172  'export_enabled' => 0,
173  'import_enabled' => 0,
174  'limited' => 0,
175  'limit_start' => NULL,
176  'limit_end' => NULL
177  );
178  $this->form->setValuesByArray($values);
179  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getValues()

ilDclTableEditGUI::getValues ( )

getFieldValues

Definition at line 131 of file class.ilDclTableEditGUI.php.

References array.

Referenced by edit().

131  {
132  $values = array(
133  'title' => $this->table->getTitle(),
134  'add_perm' => (int) $this->table->getAddPerm(),
135  'edit_perm' => (int) $this->table->getEditPerm(),
136  'edit_perm_mode' => $this->table->getEditByOwner() ? 'own' : 'all',
137  'delete_perm' => (int) $this->table->getDeletePerm(),
138  'delete_perm_mode' => $this->table->getDeleteByOwner() ? 'own' : 'all',
139  'export_enabled' => $this->table->getExportEnabled(),
140  'import_enabled' => $this->table->getImportEnabled(),
141  'limited' => $this->table->getLimited(),
142  'limit_start' => substr($this->table->getLimitStart(), 0, 10) . " " . substr($this->table->getLimitStart(), - 8),
143  'limit_end' => substr($this->table->getLimitEnd(), 0, 10) . " " . substr($this->table->getLimitEnd(), - 8),
144  'default_sort_field' => $this->table->getDefaultSortField(),
145  'default_sort_field_order' => $this->table->getDefaultSortFieldOrder(),
146  'description' => $this->table->getDescription(),
147  'view_own_records_perm' => $this->table->getViewOwnRecordsPerm(),
148  'save_confirmation' => $this->table->getSaveConfirmation(),
149  );
150  if (!$this->table->getLimitStart()) {
151  $values['limit_start'] = NULL;
152  }
153  if (!$this->table->getLimitEnd()) {
154  $values['limit_end'] = NULL;
155  }
156  $this->form->setValuesByArray($values);
157  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ initForm()

ilDclTableEditGUI::initForm (   $a_mode = "create")

initEditCustomForm

Parameters
string$a_mode

Definition at line 195 of file class.ilDclTableEditGUI.php.

References $options, $section, array, createTableSwitcher(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilDateTimeInputGUI\setShowTime(), and ilTextAreaInputGUI\setUseRte().

Referenced by create(), edit(), and save().

195  {
196  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
197  $this->form = new ilPropertyFormGUI();
198 
199  $item = new ilTextInputGUI($this->lng->txt('title'), 'title');
200  $item->setRequired(true);
201  $this->form->addItem($item);
202 
203  // Show default order field, direction and tableswitcher only in edit mode, because table id is not yet given and there are no fields to select
204  if ($a_mode != 'create') {
205  $this->createTableSwitcher();
206 
207  $item = new ilSelectInputGUI($this->lng->txt('dcl_default_sort_field'), 'default_sort_field');
208  $item->setInfo($this->lng->txt('dcl_default_sort_field_desc'));
209  $fields = $this->table->getFields();
210  $options = array( 0 => $this->lng->txt('dcl_please_select') );
211  foreach ($fields as $field) {
212  if ($field->getId() == 'comments') {
213  continue;
214  }
215  $options[$field->getId()] = $field->getTitle();
216  }
217  $item->setOptions($options);
218  $this->form->addItem($item);
219 
220  $item = new ilSelectInputGUI($this->lng->txt('dcl_default_sort_field_order'), 'default_sort_field_order');
221  $options = array( 'asc' => $this->lng->txt('dcl_asc'), 'desc' => $this->lng->txt('dcl_desc') );
222  $item->setOptions($options);
223  $this->form->addItem($item);
224  }
225 
226  $item = new ilTextAreaInputGUI($this->lng->txt('additional_info'), 'description');
227  $item->setUseRte(true);
228  $item->setInfo($this->lng->txt('dcl_additional_info_desc'));
229  // $item->setRTESupport($this->table->getId(), 'dcl', 'table_settings');
230  $item->setRteTagSet('mini');
231  $this->form->addItem($item);
232 
234  $section->setTitle($this->lng->txt('dcl_permissions_form'));
235  $this->form->addItem($section);
236 
237  $item = new ilCustomInputGUI();
238  $item->setHtml($this->lng->txt('dcl_table_info'));
239  $item->setTitle($this->lng->txt('dcl_table_info_title'));
240  $this->form->addItem($item);
241 
242  $item = new ilCheckboxInputGUI($this->lng->txt('dcl_add_perm'), 'add_perm');
243  $item->setInfo($this->lng->txt("dcl_add_perm_desc"));
244  $this->form->addItem($item);
245 
246  $item = new ilCheckboxInputGUI($this->lng->txt('dcl_save_confirmation'), 'save_confirmation');
247  $item->setInfo($this->lng->txt('dcl_save_confirmation_desc'));
248  $this->form->addItem($item);
249 
250  $item = new ilCheckboxInputGUI($this->lng->txt('dcl_edit_perm'), 'edit_perm');
251  // $item->setInfo($this->lng->txt("dcl_edit_perm_info"));
252  $this->form->addItem($item);
253 
254  $radios = new ilRadioGroupInputGUI('', 'edit_perm_mode');
255  $radios->addOption(new ilRadioOption($this->lng->txt('dcl_all_entries'), 'all'));
256  $radios->addOption(new ilRadioOption($this->lng->txt('dcl_own_entries'), 'own'));
257  $item->addSubItem($radios);
258 
259  $item = new ilCheckboxInputGUI($this->lng->txt('dcl_delete_perm'), 'delete_perm');
260  // $item->setInfo($this->lng->txt("dcl_delete_perm_info"));
261  $this->form->addItem($item);
262 
263  $radios = new ilRadioGroupInputGUI('', 'delete_perm_mode');
264  $radios->addOption(new ilRadioOption($this->lng->txt('dcl_all_entries'), 'all'));
265  $radios->addOption(new ilRadioOption($this->lng->txt('dcl_own_entries'), 'own'));
266  $item->addSubItem($radios);
267 
268  $item = new ilCheckboxInputGUI($this->lng->txt('dcl_view_own_records_perm'), 'view_own_records_perm');
269  // $item->setInfo($this->lng->txt("dcl_edit_by_owner_info"));
270  $this->form->addItem($item);
271 
272  $item = new ilCheckboxInputGUI($this->lng->txt('dcl_export_enabled'), 'export_enabled');
273  $item->setInfo($this->lng->txt('dcl_export_enabled_desc'));
274  $this->form->addItem($item);
275 
276  $item = new ilCheckboxInputGUI($this->lng->txt('dcl_import_enabled'), 'import_enabled');
277  $item->setInfo($this->lng->txt('dcl_import_enabled_desc'));
278  $this->form->addItem($item);
279 
280  $item = new ilCheckboxInputGUI($this->lng->txt('dcl_limited'), 'limited');
281  $sitem1 = new ilDateTimeInputGUI($this->lng->txt('dcl_limit_start'), 'limit_start');
282  $sitem1->setShowTime(true);
283  $sitem2 = new ilDateTimeInputGUI($this->lng->txt('dcl_limit_end'), 'limit_end');
284  $sitem2->setShowTime(true);
285  $item->setInfo($this->lng->txt("dcl_limited_desc"));
286  $item->addSubItem($sitem1);
287  $item->addSubItem($sitem2);
288  $this->form->addItem($item);
289 
290  if ($a_mode == "edit") {
291  $this->form->addCommandButton('update', $this->lng->txt('dcl_table_' . $a_mode));
292  } else {
293  $this->form->addCommandButton('save', $this->lng->txt('dcl_table_' . $a_mode));
294  }
295 
296  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
297  $this->form->setFormAction($this->ctrl->getFormAction($this, $a_mode));
298  if ($a_mode == "edit") {
299  $this->form->setTitle($this->lng->txt('dcl_edit_table'));
300  } else {
301  $this->form->setTitle($this->lng->txt('dcl_new_table'));
302  }
303  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a section header in a property form.
setUseRte($a_usert, $version='')
Set Use Rich Text Editing.
This class represents a checkbox property in a property form.
This class represents a date/time property in a property form.
setInfo($a_info)
Set Information Text.
$section
Definition: Utf8Test.php:83
This class represents a property in a property form.
if(!is_array($argv)) $options
This class represents a text property in a property form.
Create styles array
The data for the language used.
This class represents a custom property in a property form.
This class represents a text area property in a property form.
setRequired($a_required)
Set Required.
setShowTime($a_showtime)
Set Show Time Information.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilDclTableEditGUI::save (   $a_mode = "create")

save

Parameters
string$a_modevalues: create | edit

Definition at line 319 of file class.ilDclTableEditGUI.php.

References $DIC, accessDenied(), ilObjDataCollectionAccess\checkActionForObjId(), checkInput(), ilDclCache\getTableCache(), initForm(), and ilUtil\sendSuccess().

Referenced by executeCommand().

319  {
320  global $DIC;
321  $ilTabs = $DIC['ilTabs'];
322 
323  if (!ilObjDataCollectionAccess::checkActionForObjId('write', $this->obj_id)) {
324  $this->accessDenied();
325  return;
326  }
327 
328  $ilTabs->activateTab("id_fields");
329  $this->initForm($a_mode);
330 
331  if ($this->checkInput($a_mode)) {
332  if ($a_mode != "update") {
333  $this->table = ilDclCache::getTableCache();
334  } elseif ($this->table_id) {
335  $this->table = ilDclCache::getTableCache($this->table_id);
336  } else {
337  $this->ctrl->redirectByClass("ildclfieldeditgui", "listFields");
338  }
339 
340  $this->table->setTitle($this->form->getInput("title"));
341  $this->table->setObjId($this->obj_id);
342  $this->table->setSaveConfirmation((bool)$this->form->getInput('save_confirmation'));
343  $this->table->setAddPerm((bool)$this->form->getInput("add_perm"));
344  $this->table->setEditPerm((bool)$this->form->getInput("edit_perm"));
345  if ($this->table->getEditPerm()) {
346  $edit_by_owner = ($this->form->getInput('edit_perm_mode') == 'own');
347  $this->table->setEditByOwner($edit_by_owner);
348  }
349  $this->table->setDeletePerm((bool)$this->form->getInput("delete_perm"));
350  if ($this->table->getDeletePerm()) {
351  $delete_by_owner = ($this->form->getInput('delete_perm_mode') == 'own');
352  $this->table->setDeleteByOwner($delete_by_owner);
353  }
354  $this->table->setViewOwnRecordsPerm($this->form->getInput('view_own_records_perm'));
355  $this->table->setExportEnabled($this->form->getInput("export_enabled"));
356  $this->table->setImportEnabled($this->form->getInput("import_enabled"));
357  $this->table->setDefaultSortField($this->form->getInput("default_sort_field"));
358  $this->table->setDefaultSortFieldOrder($this->form->getInput("default_sort_field_order"));
359  $this->table->setLimited($this->form->getInput("limited"));
360  $this->table->setDescription($this->form->getInput('description'));
361  $limit_start = $this->form->getInput("limit_start");
362  $limit_end = $this->form->getInput("limit_end");
363  $this->table->setLimitStart($limit_start);
364  $this->table->setLimitEnd($limit_end);
365  if ($a_mode == "update") {
366  $this->table->doUpdate();
367  ilUtil::sendSuccess($this->lng->txt("dcl_msg_table_edited"), true);
368  $this->ctrl->redirectByClass("ildcltableeditgui", "edit");
369  } else {
370  $this->table->doCreate();
371  ilUtil::sendSuccess($this->lng->txt("dcl_msg_table_created"), true);
372  $this->ctrl->setParameterByClass("ildclfieldlistgui", "table_id", $this->table->getId());
373  $this->ctrl->redirectByClass("ildclfieldlistgui", "listFields");
374  }
375  } else {
376  $this->form->setValuesByPost();
377  $this->tpl->setContent($this->form->getHTML());
378  }
379  }
initForm($a_mode="create")
initEditCustomForm
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkInput($a_mode)
Custom checks for the form input.
static getTableCache($table_id=0)
global $DIC
static checkActionForObjId($action, $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilDclTableEditGUI::$ctrl
protected

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

◆ $form

ilDclTableEditGUI::$form
protected

Definition at line 47 of file class.ilDclTableEditGUI.php.

◆ $lng

ilDclTableEditGUI::$lng
protected

Definition at line 31 of file class.ilDclTableEditGUI.php.

Referenced by __construct().

◆ $table

ilDclTableEditGUI::$table
private

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

Referenced by createTableSwitcher().

◆ $table_id

ilDclTableEditGUI::$table_id
private

Definition at line 23 of file class.ilDclTableEditGUI.php.

◆ $toolbar

ilDclTableEditGUI::$toolbar
protected

Definition at line 43 of file class.ilDclTableEditGUI.php.

Referenced by __construct().

◆ $tpl

ilDclTableEditGUI::$tpl
protected

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

Referenced by __construct().


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