mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
4e0a34966c
|
@ -12,8 +12,8 @@
|
||||||
<email>uwe@steinmann.cx</email>
|
<email>uwe@steinmann.cx</email>
|
||||||
<active>yes</active>
|
<active>yes</active>
|
||||||
</lead>
|
</lead>
|
||||||
<date>2018-07-03</date>
|
<date>2018-11-13</date>
|
||||||
<time>09:19:24</time>
|
<time>07:31:17</time>
|
||||||
<version>
|
<version>
|
||||||
<release>6.0.6</release>
|
<release>6.0.6</release>
|
||||||
<api>6.0.6</api>
|
<api>6.0.6</api>
|
||||||
|
|
|
@ -3,15 +3,12 @@ Running one of the scripts
|
||||||
|
|
||||||
Scripts in this folder are ment to be called on the command line by
|
Scripts in this folder are ment to be called on the command line by
|
||||||
either executing one of the shell wrappers `seeddms-*` or by calling
|
either executing one of the shell wrappers `seeddms-*` or by calling
|
||||||
`php -f <scriptname> -- <script options>`.
|
`php -f <scriptname> -- <script options>`. Most scripts have an option
|
||||||
If you run the adddoc.php script make sure to run it with the permissions
|
`-h` or `--help` which list the available script options.
|
||||||
of the user running your web server. It will copy files right into
|
|
||||||
your content directory of your SeedDMS installation. Don't do this
|
Be aware that this scripts are not officially supported. Use them with
|
||||||
as root because you will most likely not be able to remove those documents
|
care and always ensure to have a backup of your data before running
|
||||||
via the web gui. If this happens by accident, you will still be able
|
any of them.
|
||||||
to fix it manually by setting the propper file permissions for the document
|
|
||||||
just created in your content directory. Just change the owner of the
|
|
||||||
document folder and its content to the user running the web server.
|
|
||||||
|
|
||||||
Do not allow regular users to run this scripts!
|
Do not allow regular users to run this scripts!
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
|
@ -19,3 +16,28 @@ Do not allow regular users to run this scripts!
|
||||||
None of the scripts do any authentication. They all run with a SeedDMS
|
None of the scripts do any authentication. They all run with a SeedDMS
|
||||||
admin account! So anybody being allowed to run the scripts can modify
|
admin account! So anybody being allowed to run the scripts can modify
|
||||||
your DMS content.
|
your DMS content.
|
||||||
|
|
||||||
|
Adding documents
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Single documents can be added with `seeddms-adddoc`. The script is just for
|
||||||
|
adding new documents but not for adding a new version. As the script is
|
||||||
|
just a small wrapper around the controller for adding documents by the web gui,
|
||||||
|
it will also trigger all hooks, but it will not send any notification to the
|
||||||
|
users.
|
||||||
|
|
||||||
|
If you run `seeddms-adddoc` make sure to run it with the permissions
|
||||||
|
of the user running your web server. It will copy files right into
|
||||||
|
the content directory of your SeedDMS installation. Don't do this
|
||||||
|
as root because you will most likely not be able to remove those documents
|
||||||
|
via the web gui. If this happens by accident, you will still be able
|
||||||
|
to fix it manually by setting the propper file permissions for the document
|
||||||
|
just created in your content directory. Just change the owner of the
|
||||||
|
document folder and its content to the user running the web server.
|
||||||
|
|
||||||
|
Indexing for fulltext search
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
Instead of regulary updating the full text index from the web gui, you
|
||||||
|
can as well run `seeddms-indexer` in a cron job. It will either update
|
||||||
|
or recreate the full text index.
|
||||||
|
|
|
@ -85,16 +85,15 @@ function tree($dms, $index, $indexconf, $folder, $indent='') { /* {{{ */
|
||||||
$lucenesearch = new $indexconf['Search']($index);
|
$lucenesearch = new $indexconf['Search']($index);
|
||||||
if(!($hit = $lucenesearch->getDocument($document->getId()))) {
|
if(!($hit = $lucenesearch->getDocument($document->getId()))) {
|
||||||
try {
|
try {
|
||||||
# $index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout));
|
|
||||||
$idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout);
|
$idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout);
|
||||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
||||||
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
||||||
if (method_exists($hookObj, 'preIndexDocument')) {
|
if (method_exists($hookObj, 'preIndexDocument')) {
|
||||||
$hookObj->preIndexDocument(null, $document, $idoc);
|
$hookObj->preIndexDocument(null, $document, $idoc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$index->addDocument($idoc);
|
$index->addDocument($idoc);
|
||||||
echo " (Document added)\n";
|
echo " (Document added)\n";
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
echo " (Timeout)\n";
|
echo " (Timeout)\n";
|
||||||
|
@ -111,17 +110,15 @@ function tree($dms, $index, $indexconf, $folder, $indent='') { /* {{{ */
|
||||||
} else {
|
} else {
|
||||||
$index->delete($hit->id);
|
$index->delete($hit->id);
|
||||||
try {
|
try {
|
||||||
# $index->addDocument(new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout));
|
$idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout);
|
||||||
$idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout);
|
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
||||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
||||||
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
if (method_exists($hookObj, 'preIndexDocument')) {
|
||||||
if (method_exists($hookObj, 'preIndexDocument')) {
|
$hookObj->preIndexDocument(null, $document, $idoc);
|
||||||
$hookObj->preIndexDocument(null, $document, $idoc);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
$index->addDocument($idoc);
|
||||||
$index->addDocument($idoc);
|
|
||||||
|
|
||||||
echo " (Document updated)\n";
|
echo " (Document updated)\n";
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
echo " (Timeout)\n";
|
echo " (Timeout)\n";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user