2013-12-26 21:30:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DrydockLogSearchEngine
|
|
|
|
extends PhabricatorApplicationSearchEngine {
|
|
|
|
|
2014-06-12 22:22:20 +02:00
|
|
|
public function getResultTypeDescription() {
|
|
|
|
return pht('Drydock Logs');
|
|
|
|
}
|
|
|
|
|
2014-05-13 21:14:33 +02:00
|
|
|
public function getApplicationClassName() {
|
|
|
|
return 'PhabricatorApplicationDrydock';
|
|
|
|
}
|
|
|
|
|
2013-12-26 21:30:29 +01:00
|
|
|
public function buildSavedQueryFromRequest(AphrontRequest $request) {
|
|
|
|
$saved = new PhabricatorSavedQuery();
|
|
|
|
|
|
|
|
return $saved;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) {
|
|
|
|
$query = id(new DrydockLogQuery());
|
|
|
|
|
|
|
|
return $query;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function buildSearchForm(
|
|
|
|
AphrontFormView $form,
|
|
|
|
PhabricatorSavedQuery $saved) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getURI($path) {
|
|
|
|
return '/drydock/log/'.$path;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getBuiltinQueryNames() {
|
|
|
|
$names = array(
|
|
|
|
'all' => pht('All Logs'),
|
|
|
|
);
|
|
|
|
|
|
|
|
return $names;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|