ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLuceneHighlighterResultParser Class Reference

Parses result XML from lucene search highlight. More...

+ Collaboration diagram for ilLuceneHighlighterResultParser:

Public Member Functions

 __construct ()
 Contructor.
 setResultString ($a_res)
 set result xml string
 getResultString ()
 get result xml string
 parse ()
 parse
 getTitle ($a_obj_id, $a_sub_id)
 get title
 getDescription ($a_obj_id, $a_sub_id)
 get description
 getContent ($a_obj_id, $a_sub_id)
 get content
 getSubItemIds ($a_obj_id)
 get subitem ids

Private Attributes

 $result_string = ''
 $result = array()

Detailed Description

Parses result XML from lucene search highlight.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 34 of file class.ilLuceneHighlighterResultParser.php.

Constructor & Destructor Documentation

ilLuceneHighlighterResultParser::__construct ( )

Contructor.

Returns

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

{
}

Member Function Documentation

ilLuceneHighlighterResultParser::getContent (   $a_obj_id,
  $a_sub_id 
)

get content

Parameters
intobj_id
intsub_item
Returns

Definition at line 123 of file class.ilLuceneHighlighterResultParser.php.

{
return isset($this->result[$a_obj_id][$a_sub_id]['content']) ? $this->result[$a_obj_id][$a_sub_id]['content'] : null;
}
ilLuceneHighlighterResultParser::getDescription (   $a_obj_id,
  $a_sub_id 
)

get description

Parameters
intobj_id
intsub_item
Returns

Definition at line 112 of file class.ilLuceneHighlighterResultParser.php.

{
return isset($this->result[$a_obj_id][$a_sub_id]['description']) ? $this->result[$a_obj_id][$a_sub_id]['description'] : null;
}
ilLuceneHighlighterResultParser::getResultString ( )

get result xml string

Parameters
@return

Definition at line 63 of file class.ilLuceneHighlighterResultParser.php.

References $result_string.

Referenced by parse().

{
}

+ Here is the caller graph for this function:

ilLuceneHighlighterResultParser::getSubItemIds (   $a_obj_id)

get subitem ids

Parameters
@return

Definition at line 133 of file class.ilLuceneHighlighterResultParser.php.

References $data.

{
$sub_item_ids = array();
if(!isset($this->result[$a_obj_id]))
{
return array();
}
foreach($this->result[$a_obj_id] as $sub_item_id => $data)
{
if($sub_item_id)
{
$sub_item_ids[] = $sub_item_id;
}
}
return $sub_item_ids ? $sub_item_ids : array();
}
ilLuceneHighlighterResultParser::getTitle (   $a_obj_id,
  $a_sub_id 
)

get title

Parameters
intobj_id
intsub_item
Returns

Definition at line 101 of file class.ilLuceneHighlighterResultParser.php.

{
return isset($this->result[$a_obj_id][$a_sub_id]['title']) ? $this->result[$a_obj_id][$a_sub_id]['title'] : null;
}
ilLuceneHighlighterResultParser::parse ( )

parse

Returns

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

References getResultString().

{
if(!strlen($this->getResultString()))
{
return false;
}
$root = new SimpleXMLElement($this->getResultString());
foreach($root->children() as $object)
{
$obj_id = (string) $object['id'];
foreach($object->children() as $item)
{
$sub_id = (string) $item['id'];
foreach($item->children() as $field)
{
$name = (string) $field['name'];
$this->result[$obj_id][$sub_id][$name] = (string) $field;
}
}
}
return true;
}

+ Here is the call graph for this function:

ilLuceneHighlighterResultParser::setResultString (   $a_res)

set result xml string

Parameters
@return

Definition at line 53 of file class.ilLuceneHighlighterResultParser.php.

{
$this->result_string = $a_res;
}

Field Documentation

ilLuceneHighlighterResultParser::$result = array()
private

Definition at line 37 of file class.ilLuceneHighlighterResultParser.php.

ilLuceneHighlighterResultParser::$result_string = ''
private

Definition at line 36 of file class.ilLuceneHighlighterResultParser.php.

Referenced by getResultString().


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