19 include_once (
"FDL/Class.Doc.php");
20 include_once (
"FDL/Class.TaskRequest.php");
21 include_once (
"WHAT/Class.TEClient.php");
39 if (!
$tid) $
$err = _(
"no task identificator found");
46 if ($tr->isAffected()) {
48 $outfile = $info[
"outfile"];
49 $status = $info[
"status"];
50 $sem = fopen(
getTmpDir() .
"/fdl$docid.lck",
"a+");
52 if (flock($sem, LOCK_EX)) {
55 if (!
$doc->isAffected()) $err = sprintf(_(
"cannot see unknow reference %s") ,
$docid);
58 if (($status ==
'D') && ($outfile !=
'')) {
63 $at = $attrid .
'_txt';
64 if (file_exists(
$filename) && $info[
'status'] ==
'D') {
68 if (
$doc->AffectColumn(array(
74 $av = $attrid .
'_vec';
75 $doc->fields[$av] = $av;
79 $doc->fields[$at] = $at;
80 $doc->fields[
'fulltext'] =
'fulltext';
81 $err =
$doc->modify(
true, array(
86 $doc->AddComment(sprintf(_(
"text conversion done for file %s") ,
$doc->vault_filename($attrid,
false, $index)) ,
HISTO_NOTICE);
87 if (($err ==
"") && (
$doc->locked == - 1)) {
89 $idl =
$doc->latestId();
91 if (
$doc->getValue($attrid) ==
$ldoc->getValue($attrid)) {
95 $ldoc->fields[$at] = $at;
96 $ldoc->fields[$av] = $av;
97 $ldoc->fields[
'fulltext'] =
'fulltext';
98 $err =
$ldoc->modify(
true, array(
106 $err = sprintf(_(
"output file [%s] not found") ,
$filename);
111 $err = sprintf(_(
"task %s is not done correctly") ,
$tid);
113 if ($err !=
"")
$doc->AddComment(sprintf(_(
"conversion failed for %s: ") . $err,
$doc->vault_filename($attrid,
false, $index)) ,
HISTO_NOTICE);
115 $err = sprintf(_(
"document [%s] not found") ,
$docid);
120 $err = sprintf(_(
"semaphore block") ,
$docid);
123 $err = sprintf(_(
"task %s is not recorded") ,
$tid);
129 else $action->lay->template =
"OK : " . sprintf(_(
"doc %d indexed") ,
$docid);