19 require_once(BASE.
"wcmf/application/controller/class.AsyncPagingController.php");
20 require_once(BASE.
"wcmf/lib/persistence/class.PersistenceFacade.php");
21 require_once(BASE.
"wcmf/lib/persistence/class.ObjectQuery.php");
22 require_once(BASE.
"wcmf/lib/presentation/ListboxFunctions.php");
23 require_once(BASE.
"wcmf/lib/util/class.SearchUtil.php");
55 if ($request->getAction() !=
'list')
58 $session->remove($this->HITS_VARNAME);
60 parent::initialize($request, $response);
67 if ($this->_request->getAction() ==
'list') {
80 if ($this->_request->getAction() ==
'list')
82 return parent::executeKernel();
85 $this->_response->setValue(
'searchdef', $this->_request->getValue(
'searchterm'));
86 $this->_response->setValue(
'searchterm', $this->_request->getValue(
'searchterm'));
87 $this->_response->setAction(
'ok');
93 function getObjects($type, $filter, $sortArray, &$pagingInfo)
98 if (!$session->exist($this->HITS_VARNAME))
104 $session->set($this->HITS_VARNAME, $hits);
105 $session->set($this->FILTER_VARNAME, $filter);
109 $hits = $session->get($this->HITS_VARNAME);
110 foreach ($hits as $hit) {
111 $allOIDs[] = $hit[
'oid'];
113 $allOIDs = array_unique($allOIDs);
116 $pagingInfo->setTotalCount(
sizeof($allOIDs));
119 if ($pagingInfo->getPageSize() == -1) {
120 $size = $pagingInfo->getTotalCount();
123 $size = $pagingInfo->getPageSize();
125 $oids = array_slice($allOIDs, ($pagingInfo->getPage()-1)*$size, $size);
130 foreach($oids as $oid)
132 if ($rightsManager->authorize($oid,
'',
ACTION_READ))
134 $obj = &$persistenceFacade->load($oid, BUILDEPTH_SINGLE);
147 $hits = $session->get($this->HITS_VARNAME);
150 if ($this->_request->getBooleanValue(
'completeObjects',
false) ==
false) {
151 for($i=0; $i<
sizeof($nodes); $i++) {
156 if ($this->_request->getBooleanValue(
'renderValues',
false) ==
true) {
159 for ($i=0, $count=
sizeof($nodes); $i<$count; $i++)
161 $curNode = &$nodes[$i];
162 $hit = $hits[$curNode->getOID()];
163 $curNode->setValue(
'summary', $curNode->getDisplayValue().
"<hr>... ".$hit[
'summary'].
" ...",
DATATYPE_ATTRIBUTE);
initialize(&$request, &$response)
static find($searchTerm, &$pagingInfo)
SearchController is a controller that executes a search for oids and displays them in a paged list...
renderValues(&$nodes, $language=null)
AsyncPagingController is a controller that allows to navigate lists.
removeNonDisplayValues(&$node)
getObjects($type, $filter, $sortArray, &$pagingInfo)