RESTORE-INDEXER-TASK

#time 1h
This commit is contained in:
Jean-Yves Gaulier
2015-06-03 19:21:00 +02:00
parent 06bd5d09bc
commit 74e16b4ec2
4 changed files with 97 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ class TasksServiceProvider implements ServiceProviderInterface
return $app['notification.deliverer'];
}),
new ArchiveJob($app['translator'], $app['dispatcher'], $logger),
new IndexerJob($app['translator'], $app['dispatcher'], $logger),
new BridgeJob($app['translator'], $app['dispatcher'], $logger),
new FtpPullJob($app['translator'], $app['dispatcher'], $logger),
new RecordMoverJob($app['translator'], $app['dispatcher'], $logger),

View File

@@ -0,0 +1,45 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\TaskManager\Editor;
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
class IndexerEditor extends AbstractEditor
{
/**
* {@inheritdoc}
*/
public function getTemplatePath()
{
return 'admin/task-manager/task-editor/indexer.html.twig';
}
/**
* {@inheritdoc}
*/
public function getDefaultPeriod()
{
return 10;
}
/**
* {@inheritdoc}
*/
public function getDefaultSettings(PropertyAccess $config = null)
{
return <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<tasksettings></tasksettings>
XML;
}
/**
* {@inheritdoc}
*/
protected function getFormProperties()
{
return [];
}
}

View File

@@ -0,0 +1,50 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2014 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\TaskManager\Job;
use Alchemy\Phrasea\TaskManager\Editor\IndexerEditor;
class IndexerJob extends AbstractJob
{
/**
* {@inheritdoc}
*/
public function getName()
{
return $this->translator->trans('Indexation task');
}
/**
* {@inheritdoc}
*/
public function getJobId()
{
return 'Indexer';
}
/**
* {@inheritdoc}
*/
public function getDescription()
{
return $this->translator->trans("Indexing Batch (collections/databox)");
}
/**
* {@inheritdoc}
*/
public function getEditor()
{
return new IndexerEditor($this->translator);
}
/**
* {@inheritdoc}
*/
protected function doJob(JobData $data)
{
$app = $data->getApplication();
$app['elasticsearch.indexer']->indexScheduledRecords();
}
}

View File

@@ -0,0 +1 @@
{% extends 'admin/task-manager/task-editor/task.html.twig' %}