Commit a200db82fba072e72ccf8035e70762ca96c8236f

Authored by kevin_fourie
1 parent 7c0e44e3

Merged in from DEV trunk...

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/STABLE/trunk@7107 c91229c3-7414-0410-bfa2-8a42b809f60b
config/config.ini
@@ -290,3 +290,9 @@ safemode = on @@ -290,3 +290,9 @@ safemode = on
290 290
291 ; Identify the location of the mysql.exe and mysqldump.exe 291 ; Identify the location of the mysql.exe and mysqldump.exe
292 ;mysqlDirectory=c:/program files/ktdms/mysql/bin 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,6 +450,10 @@ class KTInit {
450 $oKTConfig->setdefaultns('webservice', 'uploadExpiry', '30'); 450 $oKTConfig->setdefaultns('webservice', 'uploadExpiry', '30');
451 $oKTConfig->setdefaultns('webservice', 'downloadExpiry', '30'); 451 $oKTConfig->setdefaultns('webservice', 'downloadExpiry', '30');
452 $oKTConfig->setdefaultns('webservice', 'randomKeyText', 'bkdfjhg23yskjdhf2iu'); 452 $oKTConfig->setdefaultns('webservice', 'randomKeyText', 'bkdfjhg23yskjdhf2iu');
  453 +
  454 + $oKTConfig->setdefaultns('KTtoolsSettings', 'explorerMetadataCapture', true);
  455 + $oKTConfig->setdefaultns('KTtoolsSettings', 'officeMetadataCapture', true);
  456 +
453 457
454 $res = $this->readConfig(); 458 $res = $this->readConfig();
455 if (PEAR::isError($res)) { return $res; } 459 if (PEAR::isError($res)) { return $res; }
ktapi/ktapi.inc.php
1 -<? 1 +<?php
2 /** 2 /**
3 * $Id$ 3 * $Id$
4 * 4 *
@@ -575,7 +575,13 @@ class KTAPI @@ -575,7 +575,13 @@ class KTAPI
575 } 575 }
576 return $results; 576 return $results;
577 } 577 }
  578 +
  579 + function get_dms_defaults()
  580 + {
  581 + global $default;
  582 + return $default;
  583 + }
578 584
579 } 585 }
580 586
581 -?>  
582 \ No newline at end of file 587 \ No newline at end of file
  588 +?>
ktwebservice/webservice.php
1 -<? 1 +<?php
2 2
3 /** 3 /**
4 * 4 *
@@ -323,6 +323,19 @@ class KTWebService @@ -323,6 +323,19 @@ class KTWebService
323 'document_types' => "{urn:$this->namespace}kt_document_types_array" 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 /* methods */ 339 /* methods */
327 340
328 // login 341 // login
@@ -420,19 +433,19 @@ class KTWebService @@ -420,19 +433,19 @@ class KTWebService
420 // checkin_document 433 // checkin_document
421 $this->__dispatch_map['checkin_document'] = 434 $this->__dispatch_map['checkin_document'] =
422 array('in' => array('session_id'=>'string','document_id'=>'int','filename'=>'string','reason' =>'string','tempfilename' =>'string', 'major_update'=>'boolean' ), 435 array('in' => array('session_id'=>'string','document_id'=>'int','filename'=>'string','reason' =>'string','tempfilename' =>'string', 'major_update'=>'boolean' ),
423 - 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), 436 + 'out' => array( 'return' => "{urn:$this->namespace}kt_document_detail" ),
424 ); 437 );
425 438
426 // checkin_small_document 439 // checkin_small_document
427 $this->__dispatch_map['checkin_small_document'] = 440 $this->__dispatch_map['checkin_small_document'] =
428 array('in' => array('session_id'=>'string','document_id'=>'int','filename'=>'string','reason' =>'string','base64' =>'string', 'major_update'=>'boolean' ), 441 array('in' => array('session_id'=>'string','document_id'=>'int','filename'=>'string','reason' =>'string','base64' =>'string', 'major_update'=>'boolean' ),
429 - 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), 442 + 'out' => array( 'return' => "{urn:$this->namespace}kt_document_detail" ),
430 ); 443 );
431 444
432 // checkin_base64_document 445 // checkin_base64_document
433 $this->__dispatch_map['checkin_base64_document'] = 446 $this->__dispatch_map['checkin_base64_document'] =
434 array('in' => array('session_id'=>'string','document_id'=>'int','filename'=>'string','reason' =>'string','base64' =>'string', 'major_update'=>'boolean' ), 447 array('in' => array('session_id'=>'string','document_id'=>'int','filename'=>'string','reason' =>'string','base64' =>'string', 'major_update'=>'boolean' ),
435 - 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), 448 + 'out' => array( 'return' => "{urn:$this->namespace}kt_document_detail" ),
436 'alias' => 'checkin_small_document' 449 'alias' => 'checkin_small_document'
437 ); 450 );
438 451
@@ -615,12 +628,19 @@ class KTWebService @@ -615,12 +628,19 @@ class KTWebService
615 array('in' => array('session_id'=>'string' ), 628 array('in' => array('session_id'=>'string' ),
616 'out' => array( 'return' => "{urn:$this->namespace}kt_document_types_response" ), 629 'out' => array( 'return' => "{urn:$this->namespace}kt_document_types_response" ),
617 ); 630 );
  631 +
618 // get_document_link_types 632 // get_document_link_types
619 $this->__dispatch_map['get_document_link_types'] = 633 $this->__dispatch_map['get_document_link_types'] =
620 array('in' => array('session_id'=>'string' ), 634 array('in' => array('session_id'=>'string' ),
621 'out' => array( 'return' => "{urn:$this->namespace}kt_document_types_response" ), 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,6 +2974,31 @@ class KTWebService
2954 return $response; 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 * This runs the web service 3003 * This runs the web service
2959 * 3004 *