Tariqa  3.0
 All Data Structures Namespaces Files Functions Variables Enumerations
VirageEngine Class Reference
Inheritance diagram for VirageEngine:
searchEngine

Public Member Functions

 __construct ($newsConfig)
 listArticles ($query)
 getArticle ($article_id)
 newsSection ($flavour, $filtering, $flavour_query)
 multiAjaxSearch ($query, $from, $count, $startDate=null, $endDate=null)
 getSavePost ($query_txt, $query, $start_date=null, $end_date=null, $additional_parameters=array())

Static Public Member Functions

static listChannels ()
static addCuepoint ($idx, $doc, $words)

Data Fields

const CHANNEL_AJL = 'al-jazeera'
const CHANNEL_EN = 'euronews'
const CHANNEL_BBC = 'bbc'
const CHANNEL_F24FR = 'france24-fr'
const VOICE_MATCH = 'voice'
const TEXT_MATCH = 'text'
const TIMEZONE = 'Europe/Brussels'
const IDOL_URL = 'http://s-relex-crisis:9000/'
const IDOL_HOST = 's-relex-crisis'
const ARCHIVE_URL = 'https://webgate.ec.europa.eu/tariqa/archive/'
const HOTFOLDERS_LOCATION = "\\\\s-relex-crisis\\hotfolders$"

Static Public Attributes

static $channel_names

Protected Member Functions

 splitId ($id)
 getImgIdx ($times, $time, $start=0)
 highlight ($text, $data, $template, $img_idx, $section, $text_type=self::VOICE_MATCH, $others=null)
 getDocumentSummary ($article, $path, $img_url, $img_onclick, $template= 'virage.html')
 getDocumentSummaryTest ($article)
 getFirstMatch ($doc)
 createSubtitle ($document)

Static Protected Member Functions

static headlineCompare ($h1, $h2)

Protected Attributes

 $app_config

Detailed Description

Base class for fetching the news results from the Virage engine

Author:
Cosmin Popescu

Constructor & Destructor Documentation

__construct ( newsConfig)

Constructs the object

Parameters:
array$newsConfigThe news configuration array public
Returns:
void

Reimplemented from searchEngine.


Member Function Documentation

static addCuepoint ( idx,
doc,
words 
) [static]

Used for adding the javascript code for one match in the text

Parameters:
int$idxThe match index in the text
VirageDocument$docThe virage document
int$wordsthe number of words before and after the match

public

Returns:
array
createSubtitle ( document) [protected]

Creates a subtitle for a document

Parameters:
VirageDocument$documentThe virage document protected
Returns:
void
getArticle ( article_id)

Gets a specific article

Parameters:
string$article_idThe article identifier public
Returns:
tariqaFullDocument

Reimplemented from searchEngine.

getDocumentSummary ( article,
path,
img_url,
img_onclick,
template = 'virage.html' 
) [protected]

Gets the document summary

Parameters:
VirageDocument$articleThe Virage document
string$app_pathThe path to the application
string$img_urlThe image URL
string$img_onclickThe onclick part of the images protected
Returns:
string
getDocumentSummaryTest ( article) [protected]

Gets the documents summary for testing purposes

Parameters:
VirageDocument$articleThe Virage document protected
Returns:
string
getFirstMatch ( doc) [protected]

Gets the first match in a document

Parameters:
VirageDocument$docThe document protected
Returns:
int
getImgIdx ( times,
time,
start = 0 
) [protected]

Gets the last image frame before a time key. Returns the index

Parameters:
array$timesThe images times
int$timeThe time to search
int$startStart from... [OPTIONAL] protected
Returns:
int
getSavePost ( query_txt,
query,
start_date = null,
end_date = null,
additional_parameters = array() 
)

Gets the POST data used for saving a search in the briefcase

Parameters:
string$query_txtThe query string text
Query$queryThe query
int$start_dateThe start date (unix timestamp) [OPTIONAL]
int$end_dateThe end date (unix timestamp) [OPTIONAL]
array$additional_parametersAdditional parameters [OPTIONAL] public
Returns:
string

Reimplemented from searchEngine.

static headlineCompare ( h1,
h2 
) [static, protected]

Used for comparing two headlines by their time

Parameters:
array$h1The first headline
array$h2The second headline

protected

Returns:
boolean
highlight ( text,
data,
template,
img_idx,
section,
text_type = self::VOICE_MATCH,
others = null 
) [protected]

Generates a new text highlight and adds it to the existing highlights

Parameters:
string$textThe text
array$dataThe existing highlights
string$templateThe template for which the highlights are designed (search results or article page)
int$img_idxThe corresponding thumbnail index
string$sectionThe document section
string$text_typeThe type of text (voice match or text match) [OPTIONAL]
array$othersOther highlights for the current highlight [OPTIONAL] protected
Returns:
array
listArticles ( query)

Fetches a list of articles

Parameters:
newsQuery$queryThe query public
Returns:
tariqaSearchResultSet

Reimplemented from searchEngine.

static listChannels ( ) [static]

Gets the channels list

public

Returns:
array
multiAjaxSearch ( query,
from,
count,
startDate = null,
endDate = null 
)

Gets the multi ajax search object

Parameters:
string$queryThe query string
int$fromThe first result to display
int$countThe number of results to display
DateTime$startDateThe start date [OPTIONAL]
DateTime$endDateThe end date [OPTIONAL] public
Returns:
multiAjaxSearch

Reimplemented from searchEngine.

newsSection ( flavour,
filtering,
flavour_query 
)

Gets the multi ajax search object for any page but the search page. For example country pages, home page, news wires page etc.

Parameters:
Flavour$flavourThe flavour
array$filteringThe filtering data
Query$flavour_queryThe flavour current query public
Returns:
multiAjaxSearch
splitId ( id) [protected]

Splits an id into document id and searched terms

Parameters:
string$idThe document id protected
Returns:
array

Field Documentation

$app_config [protected]
$channel_names [static]
Initial value:
 array(
        'al-jazeera' => 'Al Jazeera English',
        'euronews' => 'Euro News',
        'bbc' => 'BBC World News',
        'france24-fr' => 'France 24 (French)', 
    )
const ARCHIVE_URL = 'https://webgate.ec.europa.eu/tariqa/archive/'
const CHANNEL_AJL = 'al-jazeera'
const CHANNEL_BBC = 'bbc'
const CHANNEL_EN = 'euronews'
const CHANNEL_F24FR = 'france24-fr'
const HOTFOLDERS_LOCATION = "\\\\s-relex-crisis\\hotfolders$"
const IDOL_HOST = 's-relex-crisis'
const IDOL_URL = 'http://s-relex-crisis:9000/'
const TEXT_MATCH = 'text'
const TIMEZONE = 'Europe/Brussels'
const VOICE_MATCH = 'voice'

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