Exemplo n.º 1
0
 public function __viewIndex()
 {
     // create a DS and filter on System ID of the current entry to build the entry's XML
     $ds = new ReindexDataSource(Administration::instance(), NULL, FALSE);
     $ds->dsSource = (string) $_GET['section'];
     $ds->dsParamFILTERS = $this->_index['filters'];
     $param_pool = array();
     $grab_xml = $ds->grab($param_pool);
     $xml = $grab_xml->generate();
     $dom = new DomDocument();
     $dom->loadXML($xml);
     $xpath = new DomXPath($dom);
     foreach ($xpath->query("//entry") as $entry) {
         $context = (object) array('section' => $this->_section, 'entry' => reset($this->_entryManager->fetch($entry->getAttribute('id'))));
         SearchIndex::indexEntry($context->entry, $context->section);
     }
     header('Content-type: text/xml');
     echo $xml;
     exit;
 }
Exemplo n.º 2
0
 public function __viewIndex()
 {
     // create a DS and filter on System ID of the current entry to build the entry's XML
     $ds = new ReindexDataSource(NULL, FALSE);
     $ds->dsSource = (string) $_GET['section'];
     $ds->dsParamFILTERS = $this->_index['filters'];
     $param_pool = array();
     $grab_xml = $ds->grab($param_pool);
     $xml = $grab_xml->generate();
     $dom = new DomDocument();
     $dom->loadXML($xml);
     $xpath = new DomXPath($dom);
     $entry_ids = array();
     foreach ($xpath->query("//entry") as $entry) {
         $entry_ids[] = $entry->getAttribute('id');
     }
     SearchIndex::indexEntry($entry_ids, $ds->dsSource, FALSE);
     header('Content-type: text/xml');
     echo $xml;
     exit;
 }