ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjSearchSettingsGUI Class Reference
+ Inheritance diagram for ilObjSearchSettingsGUI:
+ Collaboration diagram for ilObjSearchSettingsGUI:

Public Member Functions

 ilObjSearchSettingsGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor public.
executeCommand ()
 execute command
 cancelObject ()
 settingsObject ()
 Show settings public.
 saveSettingsObject ()
 Save settings public.
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getTabs (&$tabs_gui)
 get tabs public
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Protected Member Functions

 initFormSettings ()
 Init settings form.
 updateSettingsObject ()
 Update Settings.
 luceneSettingsObject ()
 Lucene settings.
 initFormLuceneSettings ()
 Show lucene settings form.
 saveLuceneSettingsObject ()
 Save Lucene settings.
 advancedLuceneSettingsObject ()
 saveAdvancedLuceneSettingsObject ()
 initSubTabs ($a_section)
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false

Detailed Description

Definition at line 17 of file class.ilObjSearchSettingsGUI.php.

Member Function Documentation

ilObjSearchSettingsGUI::advancedLuceneSettingsObject ( )
protected

Definition at line 453 of file class.ilObjSearchSettingsGUI.php.

References ilLuceneAdvancedSearchSettings\getInstance(), and initSubTabs().

Referenced by saveAdvancedLuceneSettingsObject().

{
$this->initSubTabs('lucene');
$this->tabs_gui->setTabActive('lucene_advanced_settings');
include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchActivationTableGUI.php';
include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
$table = new ilLuceneAdvancedSearchActivationTableGUI($this,'advancedLuceneSettings');
$table->setTitle($this->lng->txt('lucene_advanced_settings_table'));
$this->tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSearchSettingsGUI::cancelObject ( )

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

References ilUtil\sendInfo().

{
ilUtil::sendInfo($this->lng->txt("msg_cancel"),true);
$this->ctrl->redirect($this, "settings");
}

+ Here is the call graph for this function:

& ilObjSearchSettingsGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

References $cmd, $ret, and ilObjectGUI\prepareOutput().

{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
switch($next_class)
{
case 'ilpermissiongui':
$this->tabs_gui->setTabActive('perm_settings');
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
if($cmd == "" || $cmd == "view")
{
$cmd = "settings";
}
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjSearchSettingsGUI::getAdminTabs ( $tabs_gui)

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 122 of file class.ilObjSearchSettingsGUI.php.

References getTabs().

{
$this->getTabs($tabs_gui);
}

+ Here is the call graph for this function:

ilObjSearchSettingsGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 132 of file class.ilObjSearchSettingsGUI.php.

Referenced by getAdminTabs().

{
global $rbacsystem;
if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
{
$tabs_gui->addTarget("settings",
$this->ctrl->getLinkTarget($this, "settings"), array("settings","", "view"), "", "");
}
if($rbacsystem->checkAccess('read',$this->object->getRefId()))
{
$tabs_gui->addTarget('lucene_advanced_settings',
$this->ctrl->getLinkTarget($this,'advancedLuceneSettings'));
}
if($rbacsystem->checkAccess('read',$this->object->getRefId()))
{
$tabs_gui->addTarget('lucene_settings_tab',
$this->ctrl->getLinkTarget($this,'luceneSettings'));
}
if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}

+ Here is the caller graph for this function:

ilObjSearchSettingsGUI::ilObjSearchSettingsGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor public.

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

References ilObjectGUI\ilObjectGUI().

{
$this->type = "seas";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
$this->lng->loadLanguageModule('search');
}

+ Here is the call graph for this function:

ilObjSearchSettingsGUI::initFormLuceneSettings ( )
protected

Show lucene settings form.

Parameters
@return

Definition at line 312 of file class.ilObjSearchSettingsGUI.php.

References ilSearchSettings\getInstance(), ilSearchSettings\getLuceneItemFilterDefinitions(), ilSearchSettings\OPERATOR_AND, ilSearchSettings\OPERATOR_OR, ilCheckboxInputGUI\setOptionTitle(), ilFormPropertyGUI\setRequired(), ilDateTimeInputGUI\setShowTime(), and ilCheckboxInputGUI\setValue().

Referenced by luceneSettingsObject(), and saveLuceneSettingsObject().

{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
include_once './Services/Search/classes/class.ilSearchSettings.php';
$this->settings = ilSearchSettings::getInstance();
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this,'cancel'));
$this->form->setTitle($this->lng->txt('lucene_settings_title'));
$this->form->addCommandButton('saveLuceneSettings',$this->lng->txt('save'));
$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
$operator = new ilRadioGroupInputGUI($this->lng->txt('lucene_default_operator'),'operator');
$operator->setRequired(true);
$operator->setInfo($this->lng->txt('lucene_default_operator_info'));
$operator->setValue($this->settings->getDefaultOperator());
$and = new ilRadioOption($this->lng->txt('lucene_and'),ilSearchSettings::OPERATOR_AND);
$operator->addOption($and);
$or = new ilRadioOption($this->lng->txt('lucene_or'),ilSearchSettings::OPERATOR_OR);
$operator->addOption($or);
$this->form->addItem($operator);
// Item filter
$if = new ilCheckboxInputGUI($this->lng->txt('search_item_filter_form'),'if');
$if->setValue(1);
$if->setChecked($this->settings->isLuceneItemFilterEnabled());
$if->setInfo($this->lng->txt('search_item_filter_form_info'));
$this->form->addItem($if);
$filter = $this->settings->getLuceneItemFilter();
{
$ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']),'filter['.$obj.']');
if(isset($filter[$obj]) and $filter[$obj])
{
$ch->setChecked(true);
}
$ch->setValue(1);
$if->addSubItem($ch);
}
$numFrag = new ilNumberInputGUI($this->lng->txt('lucene_num_fragments'),'fragmentCount');
$numFrag->setRequired(true);
$numFrag->setSize(2);
$numFrag->setMaxLength(2);
$numFrag->setMinValue(1);
$numFrag->setMaxValue(10);
$numFrag->setInfo($this->lng->txt('lucene_num_frag_info'));
$numFrag->setValue($this->settings->getFragmentCount());
$this->form->addItem($numFrag);
$sizeFrag = new ilNumberInputGUI($this->lng->txt('lucene_size_fragments'),'fragmentSize');
$sizeFrag->setRequired(true);
$sizeFrag->setSize(2);
$sizeFrag->setMaxLength(4);
$sizeFrag->setMinValue(10);
$sizeFrag->setMaxValue(1000);
$sizeFrag->setInfo($this->lng->txt('lucene_size_frag_info'));
$sizeFrag->setValue($this->settings->getFragmentSize());
$this->form->addItem($sizeFrag);
$maxSub = new ilNumberInputGUI($this->lng->txt('lucene_max_sub'),'maxSubitems');
$maxSub->setRequired(true);
$maxSub->setSize(2);
$maxSub->setMaxLength(2);
$maxSub->setMinValue(1);
$maxSub->setMaxValue(10);
$maxSub->setInfo($this->lng->txt('lucene_max_sub_info'));
$maxSub->setValue($this->settings->getMaxSubitems());
$this->form->addItem($maxSub);
$relevance = new ilCheckboxInputGUI($this->lng->txt('lucene_relevance'),'relevance');
$relevance->setOptionTitle($this->lng->txt('lucene_show_relevance'));
$relevance->setInfo($this->lng->txt('lucene_show_relevance_info'));
$relevance->setValue(1);
$relevance->setChecked($this->settings->isRelevanceVisible());
$this->form->addItem($relevance);
$last_index = new ilDateTimeInputGUI($this->lng->txt('lucene_last_index_time'),'last_index');
$last_index->setShowTime(true);
$last_index->setDate($this->settings->getLastIndexTime());
$last_index->setInfo($this->lng->txt('lucene_last_index_time_info'));
$this->form->addItem($last_index);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSearchSettingsGUI::initFormSettings ( )
protected

Init settings form.

Returns
void

Definition at line 167 of file class.ilObjSearchSettingsGUI.php.

References $ilDB, ilObjectGUI\$lng, ilSearchSettings\INDEX_SEARCH, ilSearchSettings\LIKE_SEARCH, ilSearchSettings\LUCENE_SEARCH, ilCheckboxInputGUI\setChecked(), ilSelectInputGUI\setOptions(), ilSelectInputGUI\setValue(), and ilRadioGroupInputGUI\setValue().

Referenced by settingsObject(), and updateSettingsObject().

{
global $lng,$ilDB;
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
include_once './Services/Search/classes/class.ilSearchSettings.php';
$settings = new ilSearchSettings();
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this,'updateSettings'));
$this->form->addCommandButton('updateSettings',$this->lng->txt('save'));
$this->form->setTitle($this->lng->txt('seas_settings'));
// Max hits
$hits = new ilSelectInputGUI($this->lng->txt('seas_max_hits'),'max_hits');
$hits->setValue($settings->getMaxHits());
$hits->setRequired(true);
for($value = 5; $value <= 15; $value += 5)
{
$values[$value] = $value;
}
$hits->setOptions($values);
$hits->setInfo($this->lng->txt('seas_max_hits_info'));
$this->form->addItem($hits);
// Search type
$type = new ilRadioGroupInputGUI($this->lng->txt('search_type'),'search_type');
if($settings->enabledLucene())
{
}
elseif($settings->enabledIndex())
{
}
else
{
}
$type->setRequired(true);
$this->form->addItem($type);
// hide advanced search
$cb = new ilCheckboxInputGUI($lng->txt("search_hide_adv_search"), "hide_adv_search");
$cb->setChecked($settings->getHideAdvancedSearch());
$this->form->addItem($cb);
// number of auto complete entries
$options = array(
5 => 5,
10 => 10,
20 => 20,
30 => 30
);
$si = new ilSelectInputGUI($lng->txt("search_auto_complete_length"), "auto_complete_length");
$si->setOptions($options);
$val = ($settings->getAutoCompleteLength() > 0)
? $settings->getAutoCompleteLength()
: 10;
$si->setValue($val);
$this->form->addItem($si);
$direct = new ilRadioOption($this->lng->txt('search_direct'),ilSearchSettings::LIKE_SEARCH,$this->lng->txt('search_like_info'));
$type->addOption($direct);
if($ilDB->getDBType() == 'mysql')
{
$index = new ilRadioOption($this->lng->txt('search_index'),ilSearchSettings::INDEX_SEARCH,$this->lng->txt('search_full_info'));
$type->addOption($index);
}
$lucene = new ilRadioOption($this->lng->txt('search_lucene'),ilSearchSettings::LUCENE_SEARCH,$this->lng->txt('java_server_info'));
$type->addOption($lucene);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSearchSettingsGUI::initSubTabs (   $a_section)
protected

Definition at line 485 of file class.ilObjSearchSettingsGUI.php.

Referenced by advancedLuceneSettingsObject(), and luceneSettingsObject().

{
switch($a_section)
{
case 'lucene':
$this->tabs_gui->addSubTabTarget('lucene_general_settings',
$this->ctrl->getLinkTarget($this,'luceneSettings'));
break;
}
}

+ Here is the caller graph for this function:

ilObjSearchSettingsGUI::luceneSettingsObject ( )
protected

Lucene settings.

Parameters
@return

Definition at line 298 of file class.ilObjSearchSettingsGUI.php.

References initFormLuceneSettings(), and initSubTabs().

Referenced by saveLuceneSettingsObject().

{
$this->initSubTabs('lucene');
$this->tabs_gui->setTabActive('lucene_settings_tab');
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSearchSettingsGUI::saveAdvancedLuceneSettingsObject ( )
protected

Definition at line 468 of file class.ilObjSearchSettingsGUI.php.

References $_POST, advancedLuceneSettingsObject(), ilLuceneAdvancedSearchFields\getFields(), ilLuceneAdvancedSearchSettings\getInstance(), and ilUtil\sendInfo().

{
include_once './Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
foreach(ilLuceneAdvancedSearchFields::getFields() as $field => $translation)
{
$settings->setActive($field,in_array($field,(array) $_POST['fid']) ? true : false);
}
$settings->save();
ilUtil::sendInfo($this->lng->txt('settings_saved'));
}

+ Here is the call graph for this function:

ilObjSearchSettingsGUI::saveLuceneSettingsObject ( )
protected

Save Lucene settings.

Returns

Definition at line 407 of file class.ilObjSearchSettingsGUI.php.

References $_POST, $ilBench, $ilLog, $ilSetting, ilRpcClientFactory\factory(), ilSearchSettings\getInstance(), initFormLuceneSettings(), luceneSettingsObject(), ilUtil\sendFailure(), and ilUtil\sendInfo().

{
$settings->setDefaultOperator((int) $_POST['operator']);
$settings->setFragmentCount((int) $_POST['fragmentCount']);
$settings->setFragmentSize((int) $_POST['fragmentSize']);
$settings->setMaxSubitems((int) $_POST['maxSubitems']);
$settings->showRelevance((int) $_POST['relevance']);
$settings->enableLuceneItemFilter((int) $_POST['if']);
$settings->setLuceneItemFilter((array) $_POST['filter']);
if($this->form->checkInput())
{
$settings->setLastIndexTime($this->form->getItemByPostVar('last_index')->getDate());
$settings->update();
// refresh lucene server
$ilBench->start('Lucene','LuceneRefreshSettings');
try {
include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
ilRpcClientFactory::factory('RPCAdministration')->refreshSettings(
CLIENT_ID.'_'.$ilSetting->get('inst_id',0));
ilUtil::sendInfo($this->lng->txt('settings_saved'));
return true;
}
catch(Exception $e)
{
$ilLog->write(__METHOD__.': '.$e->getMessage());
ilUtil::sendFailure($e->getMessage());
return false;
}
}
ilUtil::sendInfo($this->lng->txt('err_check_input'));
return false;
}

+ Here is the call graph for this function:

ilObjSearchSettingsGUI::saveSettingsObject ( )

Save settings public.

Definition at line 87 of file class.ilObjSearchSettingsGUI.php.

References $_POST, ilRPCServerSettings\getInstance(), and ilUtil\sendInfo().

{
include_once 'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
global $rbacsystem;
if(!$rbacsystem->checkAccess('write',$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
$this->object->initSettingsObject();
$this->object->settings_obj->setMaxHits((int) $_POST['max_hits']);
$this->object->settings_obj->enableIndex($_POST['search_index']);
$this->object->settings_obj->enableLucene($_POST['search_lucene']);
$this->object->settings_obj->setHideAdvancedSearch($_POST['hide_adv_search']);
$this->object->settings_obj->setAutoCompleteLength($_POST['auto_complete_length']);
if($this->object->settings_obj->enabledLucene() and !$rpc_settings->pingServer())
{
ilUtil::sendInfo($this->lng->txt('search_no_connection_lucene'),true);
$this->ctrl->redirect($this,'settings');
return false;
}
$this->object->settings_obj->update();
ilUtil::sendInfo($this->lng->txt('settings_saved'),true);
$this->ctrl->redirect($this,'settings');
return true;
}

+ Here is the call graph for this function:

ilObjSearchSettingsGUI::settingsObject ( )

Show settings public.

Definition at line 69 of file class.ilObjSearchSettingsGUI.php.

References $ilErr, and initFormSettings().

Referenced by updateSettingsObject().

{
global $ilAccess,$ilErr;
if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
}
$this->tabs_gui->setTabActive('settings');
$this->initFormSettings();
$this->tpl->setContent($this->form->getHTML());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSearchSettingsGUI::updateSettingsObject ( )
protected

Update Settings.

Returns
void

Definition at line 250 of file class.ilObjSearchSettingsGUI.php.

References $_POST, $_SESSION, $ilErr, ilSearchSettings\INDEX_SEARCH, initFormSettings(), ilSearchSettings\LIKE_SEARCH, ilSearchSettings\LUCENE_SEARCH, ilUtil\sendSuccess(), and settingsObject().

{
global $ilAccess,$ilErr;
$this->initFormSettings();
$this->form->checkInput();
if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
}
include_once './Services/Search/classes/class.ilSearchSettings.php';
$settings = new ilSearchSettings();
$settings->setMaxHits((int) $_POST['max_hits']);
switch((int) $_POST['search_type'])
{
$settings->enableIndex(false);
$settings->enableLucene(false);
break;
$settings->enableIndex(true);
$settings->enableLucene(false);
break;
$settings->enableIndex(false);
$settings->enableLucene(true);
break;
}
$settings->setHideAdvancedSearch($_POST['hide_adv_search']);
$settings->setAutoCompleteLength($_POST['auto_complete_length']);
$settings->update();
unset($_SESSION['search_last_class']);
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->settingsObject();
}

+ Here is the call graph for this function:


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