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