Commit 8ce0035d4e16d7751dcb6dcbc096e73138155afb
1 parent
b707bcb7
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. Committed By: Isaac Lundall Reviewed By: Martin Kirsten git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7106 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
4 changed files
with
62 additions
and
1 deletions
config/config.ini
| ... | ... | @@ -290,3 +290,9 @@ safemode = on |
| 290 | 290 | |
| 291 | 291 | ; Identify the location of the mysql.exe and mysqldump.exe |
| 292 | 292 | ;mysqlDirectory=c:/program files/ktdms/mysql/bin |
| 293 | + | |
| 294 | +[KTtoolsSettings] | |
| 295 | +;These two settings control whether or not the client is prompted for metadata when a | |
| 296 | +;document is added to knowledgetree via KTtools. They default to true. | |
| 297 | +explorerMetadataCapture = true | |
| 298 | +officeMetadataCapture = true | ... | ... |
config/dmsDefaults.php
| ... | ... | @@ -450,6 +450,10 @@ class KTInit { |
| 450 | 450 | $oKTConfig->setdefaultns('webservice', 'uploadExpiry', '30'); |
| 451 | 451 | $oKTConfig->setdefaultns('webservice', 'downloadExpiry', '30'); |
| 452 | 452 | $oKTConfig->setdefaultns('webservice', 'randomKeyText', 'bkdfjhg23yskjdhf2iu'); |
| 453 | + | |
| 454 | + $oKTConfig->setdefaultns('KTtoolsSettings', 'explorerMetadataCapture', true); | |
| 455 | + $oKTConfig->setdefaultns('KTtoolsSettings', 'officeMetadataCapture', true); | |
| 456 | + | |
| 453 | 457 | |
| 454 | 458 | $res = $this->readConfig(); |
| 455 | 459 | if (PEAR::isError($res)) { return $res; } | ... | ... |
ktapi/ktapi.inc.php
ktwebservice/webservice.php
| ... | ... | @@ -323,6 +323,19 @@ class KTWebService |
| 323 | 323 | 'document_types' => "{urn:$this->namespace}kt_document_types_array" |
| 324 | 324 | ); |
| 325 | 325 | |
| 326 | + $this->__typedef["{urn:$this->namespace}kt_server_settings"] = | |
| 327 | + array( | |
| 328 | + 'explorer_metadata_capture' => 'boolean', | |
| 329 | + 'office_metadata_capture' => 'boolean' | |
| 330 | + ); | |
| 331 | + | |
| 332 | + $this->__typedef["{urn:$this->namespace}kt_server_settings_response"] = | |
| 333 | + array( | |
| 334 | + 'status_code' => 'int', | |
| 335 | + 'message' => 'string', | |
| 336 | + 'settings' => "{urn:$this->namespace}kt_server_settings" | |
| 337 | + ); | |
| 338 | + | |
| 326 | 339 | /* methods */ |
| 327 | 340 | |
| 328 | 341 | // login |
| ... | ... | @@ -615,12 +628,19 @@ class KTWebService |
| 615 | 628 | array('in' => array('session_id'=>'string' ), |
| 616 | 629 | 'out' => array( 'return' => "{urn:$this->namespace}kt_document_types_response" ), |
| 617 | 630 | ); |
| 631 | + | |
| 618 | 632 | // get_document_link_types |
| 619 | 633 | $this->__dispatch_map['get_document_link_types'] = |
| 620 | 634 | array('in' => array('session_id'=>'string' ), |
| 621 | 635 | 'out' => array( 'return' => "{urn:$this->namespace}kt_document_types_response" ), |
| 622 | 636 | ); |
| 623 | 637 | |
| 638 | + // get_server_settings | |
| 639 | + $this->__dispatch_map['get_server_settings'] = | |
| 640 | + array('in' => array('session_id'=>'string' ), | |
| 641 | + 'out' => array( 'return' => "{urn:$this->namespace}kt_server_settings_response" ), | |
| 642 | + ); | |
| 643 | + | |
| 624 | 644 | |
| 625 | 645 | } |
| 626 | 646 | |
| ... | ... | @@ -2954,6 +2974,31 @@ class KTWebService |
| 2954 | 2974 | return $response; |
| 2955 | 2975 | } |
| 2956 | 2976 | |
| 2977 | + /** | |
| 2978 | + * Retrieves the server settings for this server | |
| 2979 | + * | |
| 2980 | + * @param string $session_id | |
| 2981 | + * @return kt_server_settings_response | |
| 2982 | + */ | |
| 2983 | + function get_server_settings($session_id) | |
| 2984 | + { | |
| 2985 | + $kt = &$this->get_ktapi($session_id ); | |
| 2986 | + if (is_array($kt)) | |
| 2987 | + { | |
| 2988 | + return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $kt); | |
| 2989 | + } | |
| 2990 | + | |
| 2991 | + $dms_defaults = $kt->get_dms_defaults(); | |
| 2992 | + $response['settings'] = array( | |
| 2993 | + 'explorer_metadata_capture' => $dms_defaults->explorerMetadataCapture, | |
| 2994 | + 'office_metadata_capture' => $dms_defaults->officeMetadataCapture | |
| 2995 | + ); | |
| 2996 | + $response['message'] = 'Knowledgetree server settings retrieval succeeded.'; | |
| 2997 | + $response['status_code'] = KTWS_SUCCESS; | |
| 2998 | + | |
| 2999 | + return $response; | |
| 3000 | + } | |
| 3001 | + | |
| 2957 | 3002 | /** |
| 2958 | 3003 | * This runs the web service |
| 2959 | 3004 | * | ... | ... |