2013-12-26 12:30:29 -08:00
|
|
|
<?php
|
|
|
|
|
2014-07-23 10:03:09 +10:00
|
|
|
final class DrydockLogSearchEngine extends PhabricatorApplicationSearchEngine {
|
2013-12-26 12:30:29 -08:00
|
|
|
|
2014-06-12 13:22:20 -07:00
|
|
|
public function getResultTypeDescription() {
|
|
|
|
return pht('Drydock Logs');
|
|
|
|
}
|
|
|
|
|
2015-01-07 07:34:51 +11:00
|
|
|
protected function getApplicationClassName() {
|
2014-07-23 10:03:09 +10:00
|
|
|
return 'PhabricatorDrydockApplication';
|
2014-05-13 12:14:33 -07:00
|
|
|
}
|
|
|
|
|
2013-12-26 12:30:29 -08:00
|
|
|
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
2014-07-23 10:03:09 +10:00
|
|
|
return new PhabricatorSavedQuery();
|
2013-12-26 12:30:29 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {
|
2014-07-23 10:03:09 +10:00
|
|
|
return new DrydockLogQuery();
|
2013-12-26 12:30:29 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
public function buildSearchForm(
|
|
|
|
AphrontFormView $form,
|
2014-09-10 06:49:56 +10:00
|
|
|
PhabricatorSavedQuery $saved) {}
|
2013-12-26 12:30:29 -08:00
|
|
|
|
|
|
|
protected function getURI($path) {
|
|
|
|
return '/drydock/log/'.$path;
|
|
|
|
}
|
|
|
|
|
2015-01-07 07:34:51 +11:00
|
|
|
protected function getBuiltinQueryNames() {
|
2014-07-23 10:03:09 +10:00
|
|
|
return array(
|
2013-12-26 12:30:29 -08:00
|
|
|
'all' => pht('All Logs'),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function buildSavedQueryFromBuiltin($query_key) {
|
|
|
|
$query = $this->newSavedQuery();
|
|
|
|
$query->setQueryKey($query_key);
|
|
|
|
|
|
|
|
switch ($query_key) {
|
|
|
|
case 'all':
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
|
|
|
|
return parent::buildSavedQueryFromBuiltin($query_key);
|
|
|
|
}
|
|
|
|
|
2014-05-13 12:14:33 -07:00
|
|
|
protected function renderResultList(
|
|
|
|
array $logs,
|
|
|
|
PhabricatorSavedQuery $query,
|
|
|
|
array $handles) {
|
|
|
|
|
|
|
|
return id(new DrydockLogListView())
|
|
|
|
->setUser($this->requireViewer())
|
|
|
|
->setLogs($logs)
|
|
|
|
->render();
|
|
|
|
}
|
|
|
|
|
2013-12-26 12:30:29 -08:00
|
|
|
}
|