mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +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>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>2018-07-03</date>
|
||||
<time>09:19:24</time>
|
||||
<date>2018-11-13</date>
|
||||
<time>07:31:17</time>
|
||||
<version>
|
||||
<release>6.0.6</release>
|
||||
<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
|
||||
either executing one of the shell wrappers `seeddms-*` or by calling
|
||||
`php -f <scriptname> -- <script options>`.
|
||||
If you run the adddoc.php script make sure to run it with the permissions
|
||||
of the user running your web server. It will copy files right into
|
||||
your 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.
|
||||
`php -f <scriptname> -- <script options>`. Most scripts have an option
|
||||
`-h` or `--help` which list the available script options.
|
||||
|
||||
Be aware that this scripts are not officially supported. Use them with
|
||||
care and always ensure to have a backup of your data before running
|
||||
any of them.
|
||||
|
||||
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
|
||||
admin account! So anybody being allowed to run the scripts can modify
|
||||
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);
|
||||
if(!($hit = $lucenesearch->getDocument($document->getId()))) {
|
||||
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);
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'preIndexDocument')) {
|
||||
$hookObj->preIndexDocument(null, $document, $idoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
$index->addDocument($idoc);
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'preIndexDocument')) {
|
||||
$hookObj->preIndexDocument(null, $document, $idoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
$index->addDocument($idoc);
|
||||
echo " (Document added)\n";
|
||||
} catch(Exception $e) {
|
||||
echo " (Timeout)\n";
|
||||
|
@ -111,17 +110,15 @@ function tree($dms, $index, $indexconf, $folder, $indent='') { /* {{{ */
|
|||
} else {
|
||||
$index->delete($hit->id);
|
||||
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);
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'preIndexDocument')) {
|
||||
$hookObj->preIndexDocument(null, $document, $idoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
$index->addDocument($idoc);
|
||||
|
||||
$idoc = new $indexconf['IndexedDocument']($dms, $document, isset($settings->_converters['fulltext']) ? $settings->_converters['fulltext'] : null, false, $settings->_cmdTimeout);
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['indexDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['indexDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'preIndexDocument')) {
|
||||
$hookObj->preIndexDocument(null, $document, $idoc);
|
||||
}
|
||||
}
|
||||
}
|
||||
$index->addDocument($idoc);
|
||||
echo " (Document updated)\n";
|
||||
} catch(Exception $e) {
|
||||
echo " (Timeout)\n";
|
||||
|
|
Loading…
Reference in New Issue
Block a user