Example #1
0
//select where search
$whereFilter = getWhereFilter($colectionData, $where);
$filter_chain = $_REQUEST["filter_chain"];
//user filter sequence (history)
$VARS["count"] = $count;
//DIA server connection object
$dia = new Dia($site, $col, $count, $output, $lang);
$page = new Page();
$initial_restricion = html_entity_decode($colectionData->restriction);
// filtro de pesquisa = restricao inicial  E filtro where  E filtro externo E filtro(s) selecionados
$filterSearch = array_merge((array) $initial_restricion, (array) $whereFilter, (array) $filter, (array) $filter_chain);
// set additiona parameters
$dia->setParam('fb', $fb);
$dia->setParam('fl', $fl);
$dia->setParam('sort', $sort);
// create a loop for export all citation
header("Content-type: application/x-Research-Info-Systems; charset=UTF-8");
header('Content-Disposition: attachment; filename="export.txt"');
// add BOM code
print pack("CCC", 0xef, 0xbb, 0xbf);
$diaResponse = $dia->search($q, $index, $filterSearch, $from);
$result = json_decode($diaResponse);
$num_found = intval($result->diaServerResponse[0]->response->numFound);
$page->export($format);
if ($option == 'all_references') {
    for ($export_from = $count + 1; $export_from <= $num_found; $export_from += $count) {
        $diaResponse = $dia->search($q, $index, $filterSearch, $export_from);
        $result = json_decode($diaResponse);
        $page->export($format);
    }
}