if (class_exists($class) && ($obj = t3lib_div::makeInstance($class)) instanceof tx_dlf_format) {
t3lib_div::devLog('[tx_dlf_document->getMetadata('.$id.', '.$_cPid.')] Unsupported metadata format "'.$this->dmdSec[$dmdId]['type'].'" in dmdSec with @ID "'.$dmdId.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
t3lib_div::devLog('[tx_dlf_document->getMetadata('.$id.', '.$_cPid.')] Invalid class/method "'.$class.'->extractMetadata()" for metadata format "'.$this->dmdSec[$dmdId]['type'].'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
t3lib_div::devLog('[tx_dlf_document->getMetadata('.$id.', '.$_cPid.')] Unsupported metadata format "'.$this->dmdSec[$dmdId]['type'].'" in dmdSec with @ID "'.$dmdId.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
if (empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_helper->decrypt('.$encrypted.', '.$hash.')] No encryption key set in TYPO3 configuration', $this->extKey, SYSLOG_SEVERITY_ERROR);
t3lib_div::devLog('[tx_dlf_solr->solrConnect('.$_core.')] Invalid UID "'.$_core.'" for Apache Solr core', $this->extKey, SYSLOG_SEVERITY_ERROR);
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'tx_dlf_metadata.index_name AS index_name,tx_dlf_metadata.tokenized AS tokenized,tx_dlf_metadata.indexed AS indexed,tx_dlf_metadata.is_listed AS is_listed,tx_dlf_metadata.is_sortable AS is_sortable',
'tx_dlf_metadata',
'(tx_dlf_metadata.is_listed=1 OR tx_dlf_metadata.is_sortable=1) AND tx_dlf_metadata.pid='.intval($this->cPid).tx_dlf_helper::whereClause('tx_dlf_metadata'),
'',
'tx_dlf_metadata.sorting ASC',
''
);
$metadata = array ();
$sorting = array ();
while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
// Clear entry if there is no (accessible) toplevel document.
unset ($toplevel[$check]);
}
}
}
// Save list of documents.
$list = t3lib_div::makeInstance('tx_dlf_list');
$list->reset();
$list->add(array_values($toplevel));
// Set metadata for search.
$list->metadata = array (
'label' => '',
'description' => '',
'options' => array (
'source' => 'search',
'select' => $query,
'filter' => $this->filter,
'order' => 'relevance'
)
);
return $list;
}
/**
* This returns $this->numberOfHits via __get()
*
* @access protected
*
* @return integer Total number of hits for last search
*/
protected function _getNumberOfHits() {
return $this->numberOfHits;
}
/**
* This returns $this->ready via __get()
*
* @access protected
*
* @return boolean Is the search instantiated successfully?
*/
protected function _getReady() {
return $this->ready;
}
/**
* This returns $this->service via __get()
*
* @access protected
*
* @return Apache_Solr_Service Apache Solr service object
*/
protected function _getService() {
return $this->service;
}
/**
* This sets $this->cPid via __set()
*
* @access protected
*
* @param integer $value: The new PID for the metadata definitions
*
* @return void
*/
protected function _setCPid($value) {
$this->cPid = max(intval($value), 0);
}
/**
* This sets $this->filter via __set()
*
* @access protected
*
* @param array $value: The filter query
*
* @return void
*/
protected function _setFilter(array $value) {
$this->filter = $value;
}
/**
* This sets $this->limit via __set()
*
* @access protected
*
* @param integer $value: The max number of results
*
* @return void
*/
protected function _setLimit($value) {
$this->limit = max(intval($value), 0);
}
/**
* This magic method is called each time an invisible property is referenced from the object
*
* @access public
*
* @param string $var: Name of variable to get
*
* @return mixed Value of $this->$var
*/
public function __get($var) {
$method = '_get'.ucfirst($var);
if (!property_exists($this, $var) || !method_exists($this, $method)) {
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_solr->solrConnect('.$_core.')] Could not connect to Apache Solr server with core "'.$core.'"', $this->extKey, SYSLOG_SEVERITY_ERROR);
t3lib_div::devLog('[tx_dlf_solr->__get('.$var.')] There is no getter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
return;
} else {
return $this->$method();
}
}
/**
* Get next unused Solr core number
* This magic method is called each time an invisible property is referenced from the object
*
* @access public
*
* @param integer $start: Number to start with
* @param string $var: Name of variable to set
* @param mixed $value: New value of variable
*
* @return integer First unused core number found
* @return void
*/
public static function solrGetCoreNumber($start = 0) {
public function __set($var, $value) {
$start = max(intval($start), 0);
$method = '_set'.ucfirst($var);
// Check if core already exists.
if (self::solrConnect('dlfCore'.$start) === NULL) {
if (!property_exists($this, $var) || !method_exists($this, $method)) {
return $start;
if (TYPO3_DLOG) {
t3lib_div::devLog('[tx_dlf_solr->__set('.$var.', '.$value.')] There is no setter function for property "'.$var.'"', $this->extKey, SYSLOG_SEVERITY_WARNING);
}
} else {
return self::solrGetCoreNumber($start + 1);
$this->$method($value);
}
}
/**
* This is a static class, thus no instances should be created
* This is a singleton class, thus the constructor should be private/protected
*
* @access protected
*
* @param string $core: The name of the core to use
'tx_dlf_collections.label AS collLabel,tx_dlf_collections.description AS collDesc,tx_dlf_documents.uid AS uid,tx_dlf_documents.metadata AS metadata,tx_dlf_documents.metadata_sorting AS metadata_sorting,tx_dlf_documents.volume_sorting AS volume_sorting,tx_dlf_documents.partof AS partof',
'tx_dlf_collections.index_name AS index_name,tx_dlf_collections.label AS collLabel,tx_dlf_collections.description AS collDesc,tx_dlf_documents.uid AS uid,tx_dlf_documents.metadata AS metadata,tx_dlf_documents.metadata_sorting AS metadata_sorting,tx_dlf_documents.volume_sorting AS volume_sorting,tx_dlf_documents.partof AS partof',
'tx_dlf_documents',
'tx_dlf_relations',
'tx_dlf_collections',
@ -283,6 +283,7 @@ class tx_dlf_collection extends tx_dlf_plugin {