mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
- restore task interfaces
- remove task "phraseanet-indexer" todo : task "recordmover"
This commit is contained in:
@@ -103,7 +103,7 @@ class BuildSubdefs extends Command
|
||||
$sqlCount .= " AND (s.substit = 0)";
|
||||
}
|
||||
} elseif ($substitutionOnly) {
|
||||
throw new InvalidArgumentException('Conflict, you can not ask for --substituion-only && --with-substitution parameters at the same time');
|
||||
throw new InvalidArgumentException('Conflict, you can not ask for --substitution-only && --with-substitution parameters at the same time');
|
||||
}
|
||||
|
||||
list($sqlCount, $stmtParams) = SQLParserUtils::expandListParameters($sqlCount, $params, $types);
|
||||
|
@@ -82,7 +82,6 @@ class TasksServiceProvider implements ServiceProviderInterface
|
||||
new SubdefsJob($app['dispatcher'], $logger, $app['translator']),
|
||||
new WriteMetadataJob($app['dispatcher'], $logger, $app['translator']),
|
||||
new WebhookJob($app['dispatcher'], $logger, $app['translator']),
|
||||
new IndexerJob($app['dispatcher'], $logger, $app['translator']),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
@@ -39,7 +39,17 @@ class SubdefsEditor extends AbstractEditor
|
||||
return <<<EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tasksettings>
|
||||
<embedded>0</embedded>
|
||||
<embedded>1</embedded>
|
||||
<sbas>0</sbas>
|
||||
<type_image>1</type_image>
|
||||
<type_video>1</type_video>
|
||||
<type_audio>1</type_audio>
|
||||
<type_document>1</type_document>
|
||||
<type_flash>1</type_flash>
|
||||
<type_unknown>1</type_unknown>
|
||||
<flush>5</flush>
|
||||
<maxrecs>20</maxrecs>
|
||||
<maxmegs>256</maxmegs>
|
||||
</tasksettings>
|
||||
EOF;
|
||||
}
|
||||
@@ -50,7 +60,17 @@ EOF;
|
||||
protected function getFormProperties()
|
||||
{
|
||||
return [
|
||||
'embedded' => static::FORM_TYPE_BOOLEAN,
|
||||
'sbas' => static::FORM_TYPE_INTEGER,
|
||||
'type_image' => static::FORM_TYPE_BOOLEAN,
|
||||
'type_video' => static::FORM_TYPE_BOOLEAN,
|
||||
'type_audio' => static::FORM_TYPE_BOOLEAN,
|
||||
'type_document' => static::FORM_TYPE_BOOLEAN,
|
||||
'type_flash' => static::FORM_TYPE_BOOLEAN,
|
||||
'type_unknown' => static::FORM_TYPE_BOOLEAN,
|
||||
'flush' => static::FORM_TYPE_INTEGER,
|
||||
'maxrecs' => static::FORM_TYPE_INTEGER,
|
||||
'maxmegs' => static::FORM_TYPE_INTEGER,
|
||||
'embedded' => static::FORM_TYPE_BOOLEAN
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -1,58 +0,0 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
@@ -1 +0,0 @@
|
||||
{% extends 'admin/task-manager/task-editor/task.html.twig' %}
|
@@ -1,162 +0,0 @@
|
||||
{% extends 'admin/task-manager/task-editor/task.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'MySQL Host' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="host" value="">
|
||||
</div>
|
||||
<label class="control-label">{{ 'MySQL Port' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="port" value="">
|
||||
</div>
|
||||
<label class="control-label">{{ 'MySQL Database' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="base" value="">
|
||||
</div>
|
||||
<label class="control-label">{{ 'MySQL Login' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="user" value="">
|
||||
</div>
|
||||
<label class="control-label">{{ 'MySQL password' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="password" value="">
|
||||
</div>
|
||||
<label class="control-label">{{ 'MySQL connection charset' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="charset" class="input-small" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Socket port' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="socket" class="input-small" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Debug binary mask' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="debugmask" class="input-small" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Default language for thesaurus candidates' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="clng" class="input-small" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Enable stemming languages' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input type="text" name="stem" class="input-small" value="">
|
||||
<span class="help-inline">{{ 'example : fr,en' | trans }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Sort records with an empty field' | trans }}</label>
|
||||
<div class="controls">
|
||||
<select name="sortempty">
|
||||
<option value="">{{ 'Hide records' | trans }}</option>
|
||||
<option value="A">{{ 'At the beginning' | trans }}</option>
|
||||
<option value="Z">{{ 'At the end' | trans }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="nolog">
|
||||
{{ 'Do not log, output to console' | trans }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="winsvc_run">
|
||||
{{ 'Run as application, not as service' | trans }}
|
||||
<span class="help-inline">({{ 'Windows specific' | trans }})</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<center>
|
||||
<div style="margin:10px; padding:5px; border:1px #000000 solid; font-family:monospace; font-size:14px; text-align:left; color:#00e000; background-color:#404040" id="cmd">cmd</div>
|
||||
</center>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block javascript %}
|
||||
function taskFillGraphic(xml)
|
||||
{
|
||||
if (xml) {
|
||||
xml = $.parseXML(xml);
|
||||
xml = $(xml);
|
||||
|
||||
var isyes = function(v) {
|
||||
v = v.toUpperCase().trim();
|
||||
|
||||
return v=='O' || v=='Y' || v=='OUI' || v=='YES' || v=='1';
|
||||
}
|
||||
|
||||
with(document.forms['graphicForm'])
|
||||
{
|
||||
host.value = xml.find("host").text();
|
||||
port.value = xml.find("port").text();
|
||||
base.value = xml.find("base").text();
|
||||
user.value = xml.find("user").text();
|
||||
socket.value = xml.find("socket").text();
|
||||
password.value = xml.find("password").text();
|
||||
clng.value = xml.find("clng").text();
|
||||
nolog.checked = isyes(xml.find("nolog").text());
|
||||
winsvc_run.checked = isyes(xml.find("winsvc_run").text());
|
||||
charset.value = xml.find("charset").text();
|
||||
stem.value = xml.find("stem").text();
|
||||
sortempty.value = xml.find("sortempty").text();
|
||||
debugmask.value = 0|xml.find("debugmask").text();
|
||||
}
|
||||
|
||||
|
||||
var cmd = '';
|
||||
with(document.forms['graphicForm'])
|
||||
{
|
||||
cmd += "/path/to/indexer";
|
||||
if(host.value)
|
||||
cmd += " -h=" + host.value;
|
||||
if(port.value)
|
||||
cmd += " -P=" + port.value;
|
||||
if(base.value)
|
||||
cmd += " -b=" + base.value;
|
||||
if(user.value)
|
||||
cmd += " -u=" + user.value;
|
||||
if(password.value)
|
||||
cmd += " -p=xxxxxx"; // + password.value;
|
||||
if(socket.value)
|
||||
cmd += " --socket=" + socket.value;
|
||||
if(charset.value)
|
||||
cmd += " --default-character-set=" + charset.value;
|
||||
|
||||
cmd += " -o";
|
||||
|
||||
if(nolog.checked)
|
||||
cmd += " -n";
|
||||
if(clng.value)
|
||||
cmd += " -c=" + clng.value;
|
||||
if(stem.value)
|
||||
cmd += " --stem=" + stem.value;
|
||||
if(sortempty.value)
|
||||
cmd += " --sort-empty=" + sortempty.value;
|
||||
if(debugmask.value)
|
||||
cmd += " -d=" + debugmask.value;
|
||||
if(winsvc_run.checked)
|
||||
cmd += " --run";
|
||||
}
|
||||
$('#cmd').html(cmd);
|
||||
}
|
||||
}
|
||||
$(document).ready(function(){
|
||||
$("#graphicForm *").change(function(){
|
||||
taskFillGraphic(null);
|
||||
});
|
||||
});
|
||||
{% endblock %}
|
@@ -1,6 +1,62 @@
|
||||
{% extends 'admin/task-manager/task-editor/task.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<div class="control-group">
|
||||
<label class="control-label"> {{ 'Databox' | trans }}</label>
|
||||
<div class="controls">
|
||||
<select name="sbas">
|
||||
<option value="">{{ 'All' | trans }}</option>
|
||||
{% for databox in app['phraseanet.appbox'].get_databoxes() %}
|
||||
<option value="{{ databox.get_sbas_id() }}">
|
||||
{{ databox.get_viewname() }}
|
||||
({{ databox.get_sbas_id() }})
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"> {{ 'recordtype' | trans }}</label>
|
||||
<div class="controls">
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_image" value="image"> {{ 'image' | trans }}
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_video" value="video"> {{ 'video' | trans }}
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_audio" value="audio"> {{ 'audio' | trans }}
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_document" value="document"> {{ 'document' | trans }}
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_flash" value="flash"> {{ 'flash' | trans }}
|
||||
</label>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="type_unknown" value="unknown"> {{ 'unknown' | trans }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"> {{ 'Number of records to process per batch' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input class="formElem input-mini" type="text" name="flush" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Restart the task every X records' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input class="formElem input-mini" type="text" name="maxrecs" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">{{ 'Restart the task if memory reaches' | trans }}</label>
|
||||
<div class="controls">
|
||||
<input class="formElem input-mini" type="text" name="maxmegs" value="">
|
||||
<span class="help-inline">Mo</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
@@ -13,6 +69,18 @@
|
||||
|
||||
|
||||
{% block javascript %}
|
||||
function minmax(v, _min, _max)
|
||||
{
|
||||
if(v == NaN || v < _min)
|
||||
{
|
||||
v = _min;
|
||||
}
|
||||
else if(v > _max)
|
||||
{
|
||||
v = _max;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
function taskFillGraphic(xml)
|
||||
{
|
||||
if (xml) {
|
||||
@@ -22,6 +90,26 @@
|
||||
with(document.forms['graphicForm'])
|
||||
{
|
||||
embedded.checked = !!parseInt(xml.find("embedded").text());
|
||||
type_image.checked = !!parseInt(xml.find("type_image").text());
|
||||
type_video.checked = !!parseInt(xml.find("type_video").text());
|
||||
type_audio.checked = !!parseInt(xml.find("type_audio").text());
|
||||
type_document.checked = !!parseInt(xml.find("type_document").text());
|
||||
type_flash.checked = !!parseInt(xml.find("type_flash").text());
|
||||
type_unknown.checked = !!parseInt(xml.find("type_unknown").text());
|
||||
flush.value = minmax(parseInt(xml.find("flush").text()), 1, 100);
|
||||
maxrecs.value = minmax(parseInt(xml.find("maxrecs").text()), 10, 100);
|
||||
maxmegs.value = minmax(parseInt(xml.find("maxmegs").text()), 64, 512);
|
||||
for(i in sbas.options)
|
||||
{
|
||||
if(sbas.options[i].value == parseInt(xml.find("sbas").text()) )
|
||||
{
|
||||
sbas.options[i].selected = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sbas.options[i].selected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ define([
|
||||
|
||||
if(url && url.indexOf('#') !== 0) {
|
||||
// This is defined in admin/index.html.twig
|
||||
window.loadRightAjax(url, link.attr("method") || "GET");
|
||||
// window.loadRightAjax(url, link.attr("method") || "GET");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user