$this->setMessage(t('Missing parameter(s) "%params" for solr_index process on "%pid"', array('%params' => join(',', $missing_params), '%pid' => $pid)));
return FALSE;
}
if (!isset($parameters['xslt']) && !isset($parameters['xslt_file'])) {
$this->setMessage(t('Must include either "xslt_file" or "xslt" parameter to specify which template to apply on "%pid" for process solr_index.', array('%pid' => $pid)));
return FALSE;
}
if (module_load_include('php', 'islandora_solr_search', 'Solr/Service') === FAlSE) {
$this->setMessage(t('Unable to load Solr/Service from islandora_solr_search module on "%pid" for process solr_index.', array('%pid' => $pid)));
$this->setMessage(t('Datastream "%dsid" for template "%template" could not be found for xslt process on "%pid"', array('%template' => $parameters['xslt'], '%dsid' => $template_dsid, '%pid' => $pid)));
$this->setMessage(t('Unable to load/interpret DOM Document from "%dsid" for solr_index process on "%pid"', array('%dsid' => $parameters['dsid'], '%pid' => $pid)));
$solr = new Apache_Solr_Service($host, $port, '/'. $appName .'/');
try {
if ($solr->ping()) {
$solr->add($solrDom->saveXML());
$solr->commit();
$solr->optimize();
return TRUE;
}
else {
$this->setMessage(t('Unable to connect to Solr at "%solr" for solr_index process on "%pid".', array('%pid' => $pid, '%solr' => $host .':'. $port . '/'. $appName .'/')));
return FALSE;
}
}
catch (Exception $e) {
$this->setMessage(t('Caught exception from Solr at %solr for solr_index process on "%pid": %msg', array('%pid' => $pid, '%solr' => $host .':'. $port .'/'. $appName .'/', '%msg' => $e->getMessage())));