25include_once 
'./Services/Search/classes/Lucene/class.ilLuceneAdvancedSearchSettings.php';
 
   62        $this->lng->loadLanguageModule(
'meta');
 
   73        if (isset(self::$instance) and self::$instance) {
 
   88        $lng->loadLanguageModule(
'meta');
 
   92        include_once 
'./Services/Search/classes/class.ilSearchSettings.php';
 
   94            $fields[
'general_offline'] = 
$lng->txt(
'lucene_offline_filter');
 
   99        $fields[
'lom_coverage'] = 
$lng->txt(
'meta_coverage');
 
  100        $fields[
'lom_structure'] = 
$lng->txt(
'meta_structure');
 
  102        $fields[
'lom_version'] = 
$lng->txt(
'meta_version');
 
  103        $fields[
'lom_contribute'] = 
$lng->txt(
'meta_contribute');
 
  105        $fields[
'lom_operating_system'] = 
$lng->txt(
'meta_operating_system');
 
  106        $fields[
'lom_browser'] = 
$lng->txt(
'meta_browser');
 
  107        $fields[
'lom_interactivity'] = 
$lng->txt(
'meta_interactivity_type');
 
  108        $fields[
'lom_resource'] = 
$lng->txt(
'meta_learning_resource_type');
 
  109        $fields[
'lom_level'] = 
$lng->txt(
'meta_interactivity_level');
 
  110        $fields[
'lom_density'] = 
$lng->txt(
'meta_semantic_density');
 
  111        $fields[
'lom_user_role'] = 
$lng->txt(
'meta_intended_end_user_role');
 
  112        $fields[
'lom_context'] = 
$lng->txt(
'meta_context');
 
  113        $fields[
'lom_difficulty'] = 
$lng->txt(
'meta_difficulty');
 
  115        $fields[
'lom_copyright'] = 
$lng->txt(
'meta_copyright_and_other_restrictions');
 
  116        $fields[
'lom_purpose'] = 
$lng->txt(
'meta_purpose');
 
  120        include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
 
  121        include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  135        return $this->active_fields ? $this->active_fields : array();
 
  140        return $this->active_sections ? $this->active_sections : array();
 
  145        include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  147        $a_post_name = 
'query[' . $a_field_name . 
']';
 
  150        if (!is_array($a_query)) {
 
  154        switch ($a_field_name) {
 
  155            case 'general_offline':
 
  156                $offline_options = array(
 
  157                    '0' => $this->lng->txt(
'search_any'),
 
  158                    self::ONLINE_QUERY => $this->lng->txt(
'search_option_online'),
 
  159                    self::OFFLINE_QUERY => $this->lng->txt(
'search_option_offline')
 
  161                $offline = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  162                $offline->setOptions($offline_options);
 
  163                $offline->setValue($a_query[
'general_offline']);
 
  168                $text->setSubmitFormOnEnter(
true);
 
  169                $text->setValue($a_query[
'lom_content']);
 
  171                $text->setMaxLength(255);
 
  176                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  177                $select->setValue($a_query[
'lom_language']);
 
  181                    array(0 => $this->lng->txt(
'search_any')),
 
  188                $text->setSubmitFormOnEnter(
true);
 
  189                $text->setValue($a_query[
'lom_keyword']);
 
  191                $text->setMaxLength(255);
 
  196                $text->setSubmitFormOnEnter(
true);
 
  197                $text->setValue($a_query[
'lom_coverage']);
 
  199                $text->setMaxLength(255);
 
  202            case 'lom_structure':
 
  203                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  204                $select->setValue($a_query[
'lom_structure']);
 
  208                    array(0 => $this->lng->txt(
'search_any')),
 
  215                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  216                $select->setValue($a_query[
'lom_status']);
 
  220                    array(0 => $this->lng->txt(
'search_any')),
 
  227                $text->setSubmitFormOnEnter(
true);
 
  228                $text->setValue($a_query[
'lom_version']);
 
  230                $text->setMaxLength(255);
 
  233            case 'lom_contribute':
 
  234                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], 
'query[' . 
'lom_role' . 
']');
 
  235                $select->setValue($a_query[
'lom_role']);
 
  239                    array(0 => $this->lng->txt(
'search_any')),
 
  243                    $text = 
new ilTextInputGUI($this->lng->txt(
'meta_entry'), 
'query[' . 
'lom_role_entry' . 
']');
 
  244                    $text->setValue($a_query[
'lom_role_entry']);
 
  246                    $text->setMaxLength(255);
 
  248                $select->addSubItem(
$text);
 
  253                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  254                $select->setValue($a_query[
'lom_format']);
 
  258                    array(0 => $this->lng->txt(
'search_any')),
 
  263            case 'lom_operating_system':
 
  264                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  265                $select->setValue($a_query[
'lom_operating_system']);
 
  269                    array(0 => $this->lng->txt(
'search_any')),
 
  275                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  276                $select->setValue($a_query[
'lom_browser']);
 
  280                    array(0 => $this->lng->txt(
'search_any')),
 
  286            case 'lom_interactivity':
 
  287                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  288                $select->setValue($a_query[
'lom_interactivity']);
 
  292                    array(0 => $this->lng->txt(
'search_any')),
 
  298                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  299                $select->setValue($a_query[
'lom_resource']);
 
  303                    array(0 => $this->lng->txt(
'search_any')),
 
  311                    $this->lng->txt(
'from'),
 
  313                        $a_query[
'lom_level_start'],
 
  314                        'query[' . 
'lom_level_start' . 
']',
 
  315                        array(0 => $this->lng->txt(
'search_any'))
 
  317                    $this->lng->txt(
'until'),
 
  319                        $a_query[
'lom_level_end'],
 
  320                        'query[' . 
'lom_level_end' . 
']',
 
  321                        array(0 => $this->lng->txt(
'search_any'))
 
  324                $range->setHTML(
$html);
 
  330                    $this->lng->txt(
'from'),
 
  332                        $a_query[
'lom_density_start'],
 
  333                        'query[' . 
'lom_density_start' . 
']',
 
  334                        array(0 => $this->lng->txt(
'search_any'))
 
  336                    $this->lng->txt(
'until'),
 
  338                        $a_query[
'lom_density_end'],
 
  339                        'query[' . 
'lom_density_end' . 
']',
 
  340                        array(0 => $this->lng->txt(
'search_any'))
 
  343                $range->setHTML(
$html);
 
  347            case 'lom_user_role':
 
  348                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  349                $select->setValue($a_query[
'lom_user_role']);
 
  353                    array(0 => $this->lng->txt(
'search_any')),
 
  359                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  360                $select->setValue($a_query[
'lom_context']);
 
  364                    array(0 => $this->lng->txt(
'search_any')),
 
  369            case 'lom_difficulty':
 
  372                    $this->lng->txt(
'from'),
 
  374                        $a_query[
'lom_difficulty_start'],
 
  375                        'query[' . 
'lom_difficulty_start' . 
']',
 
  376                        array(0 => $this->lng->txt(
'search_any'))
 
  378                    $this->lng->txt(
'until'),
 
  380                        $a_query[
'lom_difficulty_end'],
 
  381                        'query[' . 
'lom_difficulty_end' . 
']',
 
  382                        array(0 => $this->lng->txt(
'search_any'))
 
  385                $range->setHTML(
$html);
 
  390                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  391                $select->setValue($a_query[
'lom_costs']);
 
  395                    array(0 => $this->lng->txt(
'search_any')),
 
  400            case 'lom_copyright':
 
  401                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  402                $select->setValue($a_query[
'lom_copyright']);
 
  406                    array(0 => $this->lng->txt(
'search_any')),
 
  415                $select = 
new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
 
  416                $select->setValue($a_query[
'lom_purpose']);
 
  420                    array(0 => $this->lng->txt(
'search_any')),
 
  427                $text->setSubmitFormOnEnter(
true);
 
  428                $text->setValue($a_query[
'lom_taxon']);
 
  430                $text->setMaxLength(255);
 
  434                if (substr($a_field_name, 0, 3) != 
'adv') {
 
  439                $field_id = substr($a_field_name, 4);
 
  440                include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  443                $field_form = 
ilADTFactory::getInstance()->getSearchBridgeForDefinitionInstance($field->getADTDefinition(), 
true, 
false);
 
  444                $field_form->setForm($a_form);
 
  445                $field_form->setElementId($a_post_name);
 
  446                $field_form->setTitle($this->active_fields[$a_field_name]);
 
  447                $field_form->addToForm();
 
  450                if (is_array($a_query) &&
 
  451                    array_key_exists($a_field_name, $a_query)) {
 
  452                    $field_form->importFromPost($a_query);
 
  453                    $field_form->validate();
 
  472            case 'general_offline':
 
  486                return 'lomLanguage:' . $a_query;
 
  489                return 'lomKeyword:' . $a_query;
 
  492                return 'lomCoverage:' . $a_query;
 
  494            case 'lom_structure':
 
  495                return 'lomStructure:' . $a_query;
 
  499                return 'lomStatus:' . $a_query;
 
  502                return 'lomVersion:' . $a_query;
 
  506                return 'lomRole:' . $a_query;
 
  508            case 'lom_role_entry':
 
  509                return 'lomRoleEntity:' . $a_query;
 
  514                return 'lomFormat:' . $a_query;
 
  516            case 'lom_operating_system':
 
  517                return 'lomOS:' . $a_query;
 
  520                return 'lomBrowser:' . $a_query;
 
  523            case 'lom_interactivity':
 
  524                return 'lomInteractivity:' . $a_query;
 
  527                return 'lomResource:' . $a_query;
 
  529            case 'lom_level_start':
 
  531                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  534                    if (strlen($q_string)) {
 
  537                    $q_string .= (
'lomLevel:"' . 
$options[
$i] . 
'" ');
 
  541            case 'lom_level_end':
 
  543                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  545                for (
$i = 1; 
$i <= $a_query; 
$i++) {
 
  546                    if (strlen($q_string)) {
 
  549                    $q_string .= (
'lomLevel:"' . 
$options[
$i] . 
'" ');
 
  553            case 'lom_density_start':
 
  555                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  558                    if (strlen($q_string)) {
 
  561                    $q_string .= (
'lomDensity:"' . 
$options[
$i] . 
'" ');
 
  565            case 'lom_density_end':
 
  567                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  569                for (
$i = 1; 
$i <= $a_query; 
$i++) {
 
  570                    if (strlen($q_string)) {
 
  573                    $q_string .= (
'lomDensity:"' . 
$options[
$i] . 
'" ');
 
  577            case 'lom_user_role':
 
  578                return 'lomUserRole:' . $a_query;
 
  581                return 'lomContext:' . $a_query;
 
  583            case 'lom_difficulty_start':
 
  585                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  588                    if (strlen($q_string)) {
 
  591                    $q_string .= (
'lomDifficulty:"' . 
$options[
$i] . 
'" ');
 
  595            case 'lom_difficulty_end':
 
  597                include_once 
'./Services/MetaData/classes/class.ilMDUtilSelect.php';
 
  599                for (
$i = 1; 
$i <= $a_query; 
$i++) {
 
  600                    if (strlen($q_string)) {
 
  603                    $q_string .= (
'lomDifficulty:"' . 
$options[
$i] . 
'" ');
 
  609                return 'lomCosts:' . $a_query;
 
  611            case 'lom_copyright':
 
  612                return 'lomCopyright:' . $a_query;
 
  616                return 'lomPurpose:' . $a_query;
 
  619                return 'lomTaxon:' . $a_query;
 
  622                if (substr($a_field, 0, 3) != 
'adv') {
 
  627                $field_id = substr($a_field, 4);
 
  628                include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  632                } 
catch (Exception $ex) {
 
  636                $adv_query = $field->getLuceneSearchString($a_query);
 
  639                    if (!is_array($adv_query)) {
 
  640                        return 'advancedMetaData_' . $field_id . 
': ' . $adv_query;
 
  643                        foreach ($adv_query as $adv_query_item) {
 
  644                            $res[] = 
'advancedMetaData_' . $field_id . 
': ' . $adv_query_item;
 
  646                        return '(' . implode(
' OR ', 
$res) . 
')';
 
  658        foreach (self::getFields() as 
$name => $translation) {
 
  660                $this->active_fields[
$name] = $translation;
 
  671            switch ($field_name) {
 
  674                    $this->active_sections[
'default'][
'fields'][] = 
'lom_content';
 
  675                    $this->active_sections[
'default'][
'name'] = 
'';
 
  678                case 'general_offline':
 
  679                    $this->active_sections[
'default'][
'fields'][] = 
'general_offline';
 
  680                    $this->active_sections[
'default'][
'name'] = 
'';
 
  684                    $this->active_sections[
'default'][
'fields'][] = 
'lom_type';
 
  685                    $this->active_sections[
'default'][
'name'] = 
'';
 
  690                    $this->active_sections[
'general'][
'fields'][] = 
'lom_language';
 
  691                    $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  694                    $this->active_sections[
'general'][
'fields'][] = 
'lom_keyword';
 
  695                    $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  698                    $this->active_sections[
'general'][
'fields'][] = 
'lom_coverage';
 
  699                    $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  701                case 'lom_structure':
 
  702                    $this->active_sections[
'general'][
'fields'][] = 
'lom_structure';
 
  703                    $this->active_sections[
'general'][
'name'] = $this->lng->txt(
'meta_general');
 
  708                    $this->active_sections[
'lifecycle'][
'fields'][] = 
'lom_status';
 
  709                    $this->active_sections[
'lifecycle'][
'name'] = $this->lng->txt(
'meta_lifecycle');
 
  712                    $this->active_sections[
'lifecycle'][
'fields'][] = 
'lom_version';
 
  713                    $this->active_sections[
'lifecycle'][
'name'] = $this->lng->txt(
'meta_lifecycle');
 
  715                case 'lom_contribute':
 
  716                    $this->active_sections[
'lifecycle'][
'fields'][] = 
'lom_contribute';
 
  717                    $this->active_sections[
'lifecycle'][
'name'] = $this->lng->txt(
'meta_lifecycle');
 
  722                    $this->active_sections[
'technical'][
'fields'][] = 
'lom_format';
 
  723                    $this->active_sections[
'technical'][
'name'] = $this->lng->txt(
'meta_technical');
 
  725                case 'lom_operating_system':
 
  726                    $this->active_sections[
'technical'][
'fields'][] = 
'lom_operating_system';
 
  727                    $this->active_sections[
'technical'][
'name'] = $this->lng->txt(
'meta_technical');
 
  730                    $this->active_sections[
'technical'][
'fields'][] = 
'lom_browser';
 
  731                    $this->active_sections[
'technical'][
'name'] = $this->lng->txt(
'meta_technical');
 
  735                case 'lom_interactivity':
 
  736                    $this->active_sections[
'education'][
'fields'][] = 
'lom_interactivity';
 
  737                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  740                    $this->active_sections[
'education'][
'fields'][] = 
'lom_resource';
 
  741                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  744                    $this->active_sections[
'education'][
'fields'][] = 
'lom_level';
 
  745                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  748                    $this->active_sections[
'education'][
'fields'][] = 
'lom_density';
 
  749                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  751                case 'lom_user_role':
 
  752                    $this->active_sections[
'education'][
'fields'][] = 
'lom_user_role';
 
  753                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  756                    $this->active_sections[
'education'][
'fields'][] = 
'lom_context';
 
  757                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  759                case 'lom_difficulty':
 
  760                    $this->active_sections[
'education'][
'fields'][] = 
'lom_difficulty';
 
  761                    $this->active_sections[
'education'][
'name'] = $this->lng->txt(
'meta_education');
 
  766                    $this->active_sections[
'rights'][
'fields'][] = 
'lom_costs';
 
  767                    $this->active_sections[
'rights'][
'name'] = $this->lng->txt(
'meta_rights');
 
  769                case 'lom_copyright':
 
  770                    $this->active_sections[
'rights'][
'fields'][] = 
'lom_copyright';
 
  771                    $this->active_sections[
'rights'][
'name'] = $this->lng->txt(
'meta_rights');
 
  776                    $this->active_sections[
'classification'][
'fields'][] = 
'lom_purpose';
 
  777                    $this->active_sections[
'classification'][
'name'] = $this->lng->txt(
'meta_classification');
 
  780                    $this->active_sections[
'classification'][
'fields'][] = 
'lom_taxon';
 
  781                    $this->active_sections[
'classification'][
'name'] = $this->lng->txt(
'meta_classification');
 
  785                    if (substr($field_name, 0, 3) != 
'adv') {
 
  790                    $field_id = substr($field_name, 4);
 
  791                    include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
 
  792                    include_once 
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
 
  794                    $record_id = $field->getRecordId();
 
  796                    $this->active_sections[
'adv_record_' . $record_id][
'fields'][] = $field_name;
 
  806    protected function getRangeSelect($txt_from, $select_from, $txt_until, $select_until)
 
  808        $tpl = 
new ilTemplate(
'tpl.range_search.html', 
true, 
true, 
'Services/Search');
 
  809        $tpl->setVariable(
'TXT_FROM', $txt_from);
 
  810        $tpl->setVariable(
'FROM', $select_from);
 
  811        $tpl->setVariable(
'TXT_UPTO', $txt_until);
 
  812        $tpl->setVariable(
'UPTO', $select_until);
 
An exception for terminatinating execution or to throw for unit testing.
static getInstance()
Get singleton.
static getInstance($a_field_id, $a_type=null)
Get definition instance by type.
static getInstancesByRecordId($a_record_id, $a_only_searchable=false)
Get definitions by record id.
static _lookupTitle($a_record_id)
Lookup title.
static _getRecords()
Get records.
static getLogger($a_component_id)
Get component logger.
Field definitions of advanced meta data search.
readSections()
Read active sections.
readFields()
Read active fields.
getFormElement($a_query, $a_field_name, ilPropertyFormGUI $a_form)
getActiveFields()
Get all active fields.
static getInstance()
Get singleton instance.
static getFields()
Return an array of all meta data fields.
getRangeSelect($txt_from, $select_from, $txt_until, $select_until)
get a range selection
parseFieldQuery($a_field, $a_query)
Called from ilLuceneAdvancedQueryParser Parse a field specific query.
static _getInteractivityTypeSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational interactivity type All possible entries in meta_format are shown.
static _getInteractivityLevelSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational interactivity level All possible entries in meta_format are shown.
static _getCopyrightAndOtherRestrictionsSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta rights copyright and other restrictions All possible entries in meta_format are shown.
static _getOperatingSystemSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta technical os selector.
static _getStatusSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta lifecycle status selector.
static _getCostsSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta rights costs All possible entries in meta_format are shown.
static _getPurposeSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta rights copyright and other restrictions All possible entries in meta_format are shown.
static _getLearningResourceTypeSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational learning resource type All possible entries in meta_format are shown.
static _getBrowserSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta technical browser selector.
static _getFormatSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta technical format selector All possible entries in meta_format are shown.
static _getLanguageSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta data language selector.
static _getStructureSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta general structure selector.
static _getContextSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta context.
static _getSemanticDensitySelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational semantic density All possible entries in meta_format are shown.
static _getIntendedEndUserRoleSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational intended end user role All possible entries in meta_format are shown.
static _getRoleSelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta lifecycle status selector.
static _getDifficultySelect($a_selected, $a_name, $prepend=array(), $a_options_only=false)
Prepare a meta educational difficulty All possible entries in meta_format are shown.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
foreach($_POST as $key=> $value) $res