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 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
1   -<?
  1 +<?php
2 2 /**
3 3 * $Id$
4 4 *
... ... @@ -575,7 +575,13 @@ class KTAPI
575 575 }
576 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 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 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
... ... @@ -420,19 +433,19 @@ class KTWebService
420 433 // checkin_document
421 434 $this->__dispatch_map['checkin_document'] =
422 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 439 // checkin_small_document
427 440 $this->__dispatch_map['checkin_small_document'] =
428 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 445 // checkin_base64_document
433 446 $this->__dispatch_map['checkin_base64_document'] =
434 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 449 'alias' => 'checkin_small_document'
437 450 );
438 451  
... ... @@ -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 *
... ...