From cbf68b7ab64480e36b7a4b195d1bc158381d0cb2 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 9 Nov 2022 19:33:26 +0100 Subject: [PATCH 1/5] explain how to set an auto command in vim --- doc/README.WebDAV | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/README.WebDAV b/doc/README.WebDAV index ea0f6d003..81ce83a1d 100644 --- a/doc/README.WebDAV +++ b/doc/README.WebDAV @@ -87,6 +87,12 @@ set nobackup set nowritebackup set noswapfile +If you want to restrict the settings to the directory where the dms +is mounted by webdav, e.g. /media/webdav, you can set an auto command +in .vimrc + +autocmd BufNewFile,BufRead /media/webdav/* set nobackup nowritebackup noswapfile + Creating the backup file in a directory outside of WebDAV doesn't help in this case, because it still does the file renaming which is turned off by 'nowritebackup'. From 650339c519338b06ac0061da9d143b885139e102 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 10 Nov 2022 08:24:07 +0100 Subject: [PATCH 2/5] return id of attribute as int --- restapi/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/restapi/index.php b/restapi/index.php index b7c68cd0d..fd4274d49 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -56,14 +56,14 @@ class RestapiController { /* {{{ */ foreach($attributes as $attrdefid=>$attribute) { $attrdef = $attribute->getAttributeDefinition(); $attrvalues[] = array( - 'id'=>$attrdef->getId(), + 'id'=>(int) $attrdef->getId(), 'name'=>$attrdef->getName(), 'value'=>$attribute->getValue() ); } } return $attrvalues; - } + } /* }}} */ protected function __getDocumentData($document) { /* {{{ */ $data = array( From ebf7fb75918f10cc7aa64592e5f3aeca6df92f30 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 10 Nov 2022 08:24:52 +0100 Subject: [PATCH 3/5] change json field 'version-attributes' to 'version_attributes' --- restapi/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restapi/index.php b/restapi/index.php index fd4274d49..efa9b9a67 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -110,7 +110,7 @@ class RestapiController { /* {{{ */ } $attributes = $this->__getAttributesData($lc); if($attributes) { - $data['version-attributes'] = $attributes; + $data['version_attributes'] = $attributes; } return $data; } /* }}} */ From 25c2d0319064c932367eb1db58634c67833b5804 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 10 Nov 2022 08:27:00 +0100 Subject: [PATCH 4/5] add hook to add additional routes --- restapi/index.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/restapi/index.php b/restapi/index.php index efa9b9a67..f9fcecbce 100644 --- a/restapi/index.php +++ b/restapi/index.php @@ -2611,9 +2611,6 @@ class TestController { /* {{{ */ } /* }}} */ } /* }}} */ -//$app = new Slim(array('mode'=>'development', '_session.handler'=>null)); -$app = new \Slim\App(); - /* Middleware for authentication */ class Auth { /* {{{ */ @@ -2706,6 +2703,8 @@ class Auth { /* {{{ */ } } /* }}} */ +$app = new \Slim\App(); + $container = $app->getContainer(); $container['dms'] = $dms; $container['config'] = $settings; @@ -2798,6 +2797,14 @@ $app->get('/attributedefinitions', \RestapiController::class.':getAttributeDefin $app->put('/attributedefinitions/{id}/name', \RestapiController::class.':changeAttributeDefinitionName'); $app->get('/echo/{data}', \TestController::class.':echoData'); $app->get('/statstotal', \RestapiController::class.':getStatsTotal'); + +if(isset($GLOBALS['SEEDDMS_HOOKS']['initRestAPI'])) { + foreach($GLOBALS['SEEDDMS_HOOKS']['initRestAPI'] as $hookObj) { + if (method_exists($hookObj, 'addRoute')) { + $hookObj->addRoute($app); + } + } +} + $app->run(); -?> From 28f78baed0d528d1dc6536e8c5832d2c52690bf6 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 10 Nov 2022 08:27:39 +0100 Subject: [PATCH 5/5] add changes in 5.1.28 (mostly restapi) --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 71ef00400..2164d8de7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,9 @@ - clear login failures when login by webdav succeeds - output log of restapi in LogManagement - new hook to add more tabs for sections in LogManagement +- rest api returns version attributes as 'version_attributes' (was + 'version-attributes'), each attribute also contains the name +- new hook in rest api to add more routes in extensions -------------------------------------------------------------------------------- Changes in version 5.1.27