From 8ce0035d4e16d7751dcb6dcbc096e73138155afb Mon Sep 17 00:00:00 2001 From: ikabot-com Date: Wed, 29 Aug 2007 07:35:15 +0000 Subject: [PATCH] BBS-1036 "Option to turn off request for metadata on document upload" Added a function to the web services API to retrieve KTtools configuration from the server. --- config/config.ini | 6 ++++++ config/dmsDefaults.php | 4 ++++ ktapi/ktapi.inc.php | 8 +++++++- ktwebservice/webservice.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 1 deletion(-) diff --git a/config/config.ini b/config/config.ini index d844715..1792063 100644 --- a/config/config.ini +++ b/config/config.ini @@ -290,3 +290,9 @@ safemode = on ; Identify the location of the mysql.exe and mysqldump.exe ;mysqlDirectory=c:/program files/ktdms/mysql/bin + +[KTtoolsSettings] +;These two settings control whether or not the client is prompted for metadata when a +;document is added to knowledgetree via KTtools. They default to true. +explorerMetadataCapture = true +officeMetadataCapture = true diff --git a/config/dmsDefaults.php b/config/dmsDefaults.php index f10811a..c23246f 100644 --- a/config/dmsDefaults.php +++ b/config/dmsDefaults.php @@ -450,6 +450,10 @@ class KTInit { $oKTConfig->setdefaultns('webservice', 'uploadExpiry', '30'); $oKTConfig->setdefaultns('webservice', 'downloadExpiry', '30'); $oKTConfig->setdefaultns('webservice', 'randomKeyText', 'bkdfjhg23yskjdhf2iu'); + + $oKTConfig->setdefaultns('KTtoolsSettings', 'explorerMetadataCapture', true); + $oKTConfig->setdefaultns('KTtoolsSettings', 'officeMetadataCapture', true); + $res = $this->readConfig(); if (PEAR::isError($res)) { return $res; } diff --git a/ktapi/ktapi.inc.php b/ktapi/ktapi.inc.php index 2d82346..5e45189 100644 --- a/ktapi/ktapi.inc.php +++ b/ktapi/ktapi.inc.php @@ -575,7 +575,13 @@ class KTAPI } return $results; } + + function get_dms_defaults() + { + global $default; + return $default; + } } -?> \ No newline at end of file +?> diff --git a/ktwebservice/webservice.php b/ktwebservice/webservice.php index 645eb7f..7860508 100644 --- a/ktwebservice/webservice.php +++ b/ktwebservice/webservice.php @@ -323,6 +323,19 @@ class KTWebService 'document_types' => "{urn:$this->namespace}kt_document_types_array" ); + $this->__typedef["{urn:$this->namespace}kt_server_settings"] = + array( + 'explorer_metadata_capture' => 'boolean', + 'office_metadata_capture' => 'boolean' + ); + + $this->__typedef["{urn:$this->namespace}kt_server_settings_response"] = + array( + 'status_code' => 'int', + 'message' => 'string', + 'settings' => "{urn:$this->namespace}kt_server_settings" + ); + /* methods */ // login @@ -615,12 +628,19 @@ class KTWebService array('in' => array('session_id'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_document_types_response" ), ); + // get_document_link_types $this->__dispatch_map['get_document_link_types'] = array('in' => array('session_id'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_document_types_response" ), ); + // get_server_settings + $this->__dispatch_map['get_server_settings'] = + array('in' => array('session_id'=>'string' ), + 'out' => array( 'return' => "{urn:$this->namespace}kt_server_settings_response" ), + ); + } @@ -2954,6 +2974,31 @@ class KTWebService return $response; } + /** + * Retrieves the server settings for this server + * + * @param string $session_id + * @return kt_server_settings_response + */ + function get_server_settings($session_id) + { + $kt = &$this->get_ktapi($session_id ); + if (is_array($kt)) + { + return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $kt); + } + + $dms_defaults = $kt->get_dms_defaults(); + $response['settings'] = array( + 'explorer_metadata_capture' => $dms_defaults->explorerMetadataCapture, + 'office_metadata_capture' => $dms_defaults->officeMetadataCapture + ); + $response['message'] = 'Knowledgetree server settings retrieval succeeded.'; + $response['status_code'] = KTWS_SUCCESS; + + return $response; + } + /** * This runs the web service * -- libgit2 0.21.4