📄 webservice.php.tmp
字号:
// copy_document $this->__dispatch_map['copy_document'] = array('in' => array('session_id'=>'string','document_id'=>'int','folder_id'=>'int','reason'=>'string','newtitle'=>'string','newfilename'=>'string'), 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), ); if ($this->version >= 2) { $this->__dispatch_map['copy_document'] = array('in' => array('session_id'=>'string','document_id'=>'int','folder_id'=>'int','reason'=>'string', 'options'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_document_detail" ), ); } // move_document $this->__dispatch_map['move_document'] = array('in' => array('session_id'=>'string','document_id'=>'int','folder_id'=>'int','reason'=>'string','newtitle'=>'string','newfilename'=>'string'), 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), ); if ($this->version >= 2) { $this->__dispatch_map['move_document'] = array('in' => array('session_id'=>'string','document_id'=>'int','folder_id'=>'int','reason'=>'string', 'options'=>'string'), 'out' => array( 'return' => "{urn:$this->namespace}kt_document_detail" ), ); } // rename_document_title $this->__dispatch_map['rename_document_title'] = array('in' => array('session_id'=>'string','document_id'=>'int', 'newtitle'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), ); if ($this->version >= 2) { $this->__dispatch_map['rename_document_title']['out'] = array( 'return' => "{urn:$this->namespace}kt_document_detail" ); } // rename_document_filename $this->__dispatch_map['rename_document_filename'] = array('in' => array('session_id'=>'string','document_id'=>'int', 'newfilename'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), ); if ($this->version >= 2) { $this->__dispatch_map['rename_document_filename']['out'] = array( 'return' => "{urn:$this->namespace}kt_document_detail" ); } // change_document_type $this->__dispatch_map['change_document_type'] = array('in' => array('session_id'=>'string','document_id'=>'int', 'documenttype'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), ); if ($this->version >= 2) { $this->__dispatch_map['change_document_type']['out'] = array( 'return' => "{urn:$this->namespace}kt_document_detail" ); } // start_document_workflow $this->__dispatch_map['start_document_workflow'] = array('in' => array('session_id'=>'string','document_id'=>'int', 'workflow'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), ); if ($this->version >= 2) { $this->__dispatch_map['start_document_workflow']['out'] = array( 'return' => "{urn:$this->namespace}kt_document_detail" ); } // delete_document_workflow $this->__dispatch_map['delete_document_workflow'] = array('in' => array('session_id'=>'string','document_id'=>'int' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ) ); if ($this->version >= 2) { $this->__dispatch_map['delete_document_workflow']['out'] = array( 'return' => "{urn:$this->namespace}kt_document_detail" ); // stop_document_workflow $this->__dispatch_map['stop_document_workflow'] = array('in' => array('session_id'=>'string','document_id'=>'int' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_document_detail" ), 'alias'=>'delete_document_workflow' ); } // perform_document_workflow_transition $this->__dispatch_map['perform_document_workflow_transition'] = array('in' => array('session_id'=>'string','document_id'=>'int','transition'=>'string','reason'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), ); if ($this->version >= 2) { $this->__dispatch_map['perform_document_workflow_transition']['out'] = array( 'return' => "{urn:$this->namespace}kt_document_detail" ); } // get_document_metadata $this->__dispatch_map['get_document_metadata'] = array('in' => array('session_id'=>'string','document_id'=>'int' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_metadata_response" ), ); if ($this->version >= 3) { $this->__dispatch_map['get_document_metadata']['in'] = array('session_id'=>'string','document_id'=>'int', 'version'=>'string'); } // get_document_type_metadata $this->__dispatch_map['get_document_type_metadata'] = array('in' => array('session_id'=>'string','document_type'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_metadata_response" ), ); //update_document_metadata $this->__dispatch_map['update_document_metadata'] = array('in' => array('session_id'=>'string','document_id'=>'int','metadata'=>"{urn:$this->namespace}kt_metadata_fieldsets" ), 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), ); if ($this->version >= 2) { $this->__dispatch_map['update_document_metadata'] = array('in' => array('session_id'=>'string','document_id'=>'int','metadata'=>"{urn:$this->namespace}kt_metadata_fieldsets", 'sysdata'=>"{urn:$this->namespace}kt_sysdata" ), 'out' => array( 'return' => "{urn:$this->namespace}kt_document_detail" ) ); } //get_document_workflow_transitions $this->__dispatch_map['get_document_workflow_transitions'] = array('in' => array('session_id'=>'string','document_id'=>'int' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_workflow_transitions_response" ), ); //get_document_workflow_state $this->__dispatch_map['get_document_workflow_state'] = array('in' => array('session_id'=>'string','document_id'=>'int' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_response" ), ); // get_document_transaction_history $this->__dispatch_map['get_document_transaction_history'] = array('in' => array('session_id'=>'string','document_id'=>'int' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_document_transaction_history_response" ), ); // get_document_version_history $this->__dispatch_map['get_document_version_history'] = array('in' => array('session_id'=>'string','document_id'=>'int' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_document_version_history_response" ), ); // get_document_types $this->__dispatch_map['get_document_types'] = array('in' => array('session_id'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_document_types_response" ), ); // get_workflows $this->__dispatch_map['get_workflows'] = array('in' => array('session_id'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_workflows_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_client_policies $this->__dispatch_map['get_client_policies'] = array('in' => array('session_id'=>'string' ), 'out' => array( 'return' => "{urn:$this->namespace}kt_client_policies_response" ), ); if ($this->version >= 2) { $this->__dispatch_map['get_client_policies']['in'] = array('session_id'=>'string', 'client'=>'string'); } } function debug($msg, $function = null, $level=0) { if ($this->mustDebug === false) return; if ($this->mustDebug >= $level) { global $default; if (!is_null($function)) { $function = "$function - "; } $default->log->debug('WS - ' . $function . $msg); } } function error($msg, $function = null) { if ($this->mustDebug) { global $default; if (!is_null($function)) { $function = "$function - "; } $default->log->error('WS - ' . $function . $msg); } } function _status($code, $message='') { if (PEAR::isError($message)) { $message = $message->getMessage(); } return array('status_code'=>$code, 'message'=>$message); } /** * This is used by all exposed functions dependant on the sessionid. * * @param string $session_id * @return KTAPI This could be KTAPI or kt_response array with status_code of KTWS_ERR_INVALID_SESSION. */ function &get_ktapi($session_id) { if (!is_null($this->ktapi)) { return $this->ktapi; } $kt = new KTAPI(); $session = $kt->get_active_session($session_id, null); if ( PEAR::isError($session)) { return KTWebService::_status(KTWS_ERR_INVALID_SESSION,$session); } $this->ktapi = $kt; return $kt; } /** * Creates a new anonymous session. * * @param string $ip * @return kt_response */ function anonymous_login($ip=null) { $response = KTWebService::_status(KTWS_ERR_AUTHENTICATION_ERROR); $kt = new KTAPI(); $session = $kt->start_anonymous_session($ip); if (PEAR::isError($session)) { $response['message'] = $session->getMessage(); $this->debug($session->getMessage(),'anonymous_login'); return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $response); } $session= $session->get_session(); $response['status_code'] = KTWS_SUCCESS; $response['message'] = $session; $this->debug("anonymous_login('$ip')", $session); return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $response); } /** * Creates a new session for the user. * * @param string $username * @param string $password * @param string $ip * @return kt_response */ function login($username, $password, $ip=null) { $response = KTWebService::_status(KTWS_ERR_AUTHENTICATION_ERROR); $kt = new KTAPI(); $session = $kt->start_session($username,$password, $ip); if (PEAR::isError($session)) { $response['message'] = $session->getMessage(); $this->debug($session->getMessage(),'login'); return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $response); } $session= $session->get_session(); $response['status_code'] = KTWS_SUCCESS; $response['message'] = $session; $this->debug("login('$username','$password','$ip')", $session); return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $response); } /** * Closes an active session. * * @param string $session_id * @return kt_response. status_code can be KTWS_ERR_INVALID_SESSION or KTWS_SUCCESS. */ function logout($session_id) { $this->debug("logout('$session_id')"); $kt = &$this->get_ktapi($session_id); if (is_array($kt)) { return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $kt); } $response = KTWebService::_status(KTWS_ERR_INVALID_SESSION); $session = &$kt->get_session(); if (PEAR::isError($session)) { $response['message'] = $session->getMessage(); $this->debug("logout()", $session_id); return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $response); } $session->logout(); $response['status_code']=KTWS_SUCCESS; return new SOAP_Value('return',"{urn:$this->namespace}kt_response", $response); } /** * Returns folder detail given a folder_id. * * @param string $session_id * @param int $folder_id * @return kt_folder_detail. status_code can be KTWS_ERR_INVALID_SESSION, KTWS_ERR_INVALID_FOLDER, or KTWS_SUCCESS. */ function get_folder_detail($session_id, $folder_id) { $this->debug("get_folder_detail('$session_id',$folder_id)"); $kt = &$this->get_ktapi($session_id); if (is_array($kt)) { return new SOAP_Value('return',"{urn:$this->namespace}kt_folder_detail", $kt); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -