AI助手支持GPT4.0
Catenis API Client for WordPress enables (JavaScript) code on WordPress pages to interact with the Catenis Enterprise API.
适用于WordPress的Catenis API客户端使WordPress页面上的(JavaScript)代码能够与Catenis Enterprise API进行交互。 p>
To enable the Catenis API client for a given WordPress page, go to the page’s edit page and look for a section (meta box) named “Catenis API Client” below the page’s main editing panel.
要为给定的WordPress页面启用Catenis API客户端,请转到页面的编辑页面,然后在页面的主编辑面板下查找名为“ Catenis API Client”的部分(元框)。
Make sure the section is expanded, and check the Load Catenis API Client checkbox.
Load Catenis API Client
确保该部分已展开,并选中加载Catenis API客户端 code>复选框。 p>You can then choose to override the global settings used for instantiating the Catenis API client on that given page, like using a different device ID and its associated API access secret.然后,您可以选择覆盖用于在给定页面上实例化Catenis API客户端的全局设置,例如使用其他设备ID及其关联的API访问密码。Otherwise, whatever is configured in the plugin’s global settings — configured under “Settings” |否则,插件全局设置中配置的所有内容-在“设置” |“Catenis API Client” — is going to be used.将使用“ Catenis API客户端”。 p>Using the Catenis API client使用Catenis API客户端 h4>Once enabled, a global JavaScript variable named ctnApiClient is made available on the page.启用后,将在页面上提供名为 ctnApiClient code>的全局JavaScript变量。That variable holds the instantiated Catenis API client object.该变量保存实例化的Catenis API客户端对象。 p>Use the ctnApiClient variable to call the Catenis Enterprise API methods by invoking the corresponding method on that object.使用 ctnApiClient em>变量通过在该对象上调用相应的方法来调用Catenis Enterprise API方法。 p>For a reference of the available methods, please refer to the Catenis API JavaScript Client as it is functionally有关可用方法的参考,请从功能上参考 Catenis API JavaScript客户端identical to the Catenis API Client for WordPress, except for notifications support and error handling.除了通知支持和错误处理之外,与Catenis API for WordPress相同。 p>Notifications support通知支持 h4>The notification feature on Catenis API Client for WordPress is almost identical to the one found on the Catenis API JavaScript client. Catenis API Client for WordPress的通知功能几乎与Catenis API JavaScript客户端上的通知功能相同。The two noticeable differences are:两个明显的区别是: p>The Catenis API client object can emit a comm-error event. Catenis API客户端对象可以发出 comm-error code>事件。 li>The open event emitted by the WebSocket notification channel object may return an error. WebSocket通知通道对象发出的 open code>事件可能返回错误。 li> ol>Please refer to the “Receiving Notifications” section below for detailed information on how to receive Catenis notifications from within WordPress pages.有关如何从WordPress页面内接收Catenis通知的详细信息,请参阅下面的“接收通知”部分。 p>Error handling错误处理 h4>Errors that take place while calling the Catenis API methods are returned as standard JavaScript Error objects.调用Catenis API方法时发生的错误将作为标准JavaScript错误对象返回。 p>Receiving Notifications接收通知 h3>= Instantiate WebSocket notification channel object =实例化WebSocket通知通道对象 p>Create a WebSocket notification channel for a given Catenis notification event.为给定的Catenis通知事件创建WebSocket通知通道。 p>var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); code> pre>Add listeners添加听众 h4>Add event listeners to monitor activity on the notification channel.添加事件监听器以监视通知通道上的活动。 p>ctnApiClient.on('comm-error', function (error) { ctnApiClient.on('comm-error',function(error){ // Error communicating with Catenis notification process//与Catenis通知流程通信时出错});});wsNotifyChannel.on('open', function (error) { wsNotifyChannel.on('open',function(error){ if (error) { 如果(错误){ // Error establishing underlying WebSocket connection //建立基础WebSocket连接时出错 } } else { 其他{ // Notification channel successfully open //通知频道成功打开 }}});});wsNotifyChannel.on('error', function (error) { wsNotifyChannel.on('错误',函数(错误){ // Error in the underlying WebSocket connection//基础WebSocket连接中的错误});});wsNotifyChannel.on('close', function (code, reason) { wsNotifyChannel.on('close',函数(代码,原因){ // Underlying WebSocket connection has been closed//基础WebSocket连接已关闭});});wsNotifyChannel.on('notify', function (eventData) { wsNotifyChannel.on('notify',function(eventData){ // Received notification//收到通知});}); code> pre>Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object. 注意 strong>:“通信错误”事件是由Catenis API客户端对象发出的,而所有其他事件都是由WebSocket通知通道对象发出的。 p> blockquote>Open the notification channel打开通知通道 h4>Open the WebSocket notification channel to start receiving notifications.打开WebSocket通知通道以开始接收通知。 p>wsNotifyChannel.open(function (error) { wsNotifyChannel.open(function(error){ if (err) { 如果(错误){ // Error sending command to open notification channel //错误发送命令以打开通知通道 }}});}); code> pre>Close the notification channel关闭通知频道 h4>Close the WebSocket notification channel to stop receiving notifications.关闭WebSocket通知通道以停止接收通知。 p>wsNotifyChannel.close(function (error) { wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});}); code> pre>
加载Catenis API客户端 code>复选框。 p>You can then choose to override the global settings used for instantiating the Catenis API client on that given page, like using a different device ID and its associated API access secret.然后,您可以选择覆盖用于在给定页面上实例化Catenis API客户端的全局设置,例如使用其他设备ID及其关联的API访问密码。Otherwise, whatever is configured in the plugin’s global settings — configured under “Settings” |否则,插件全局设置中配置的所有内容-在“设置” |“Catenis API Client” — is going to be used.将使用“ Catenis API客户端”。 p>Using the Catenis API client使用Catenis API客户端 h4>Once enabled, a global JavaScript variable named ctnApiClient is made available on the page.启用后,将在页面上提供名为 ctnApiClient code>的全局JavaScript变量。That variable holds the instantiated Catenis API client object.该变量保存实例化的Catenis API客户端对象。 p>Use the ctnApiClient variable to call the Catenis Enterprise API methods by invoking the corresponding method on that object.使用 ctnApiClient em>变量通过在该对象上调用相应的方法来调用Catenis Enterprise API方法。 p>For a reference of the available methods, please refer to the Catenis API JavaScript Client as it is functionally有关可用方法的参考,请从功能上参考 Catenis API JavaScript客户端identical to the Catenis API Client for WordPress, except for notifications support and error handling.除了通知支持和错误处理之外,与Catenis API for WordPress相同。 p>Notifications support通知支持 h4>The notification feature on Catenis API Client for WordPress is almost identical to the one found on the Catenis API JavaScript client. Catenis API Client for WordPress的通知功能几乎与Catenis API JavaScript客户端上的通知功能相同。The two noticeable differences are:两个明显的区别是: p>The Catenis API client object can emit a comm-error event. Catenis API客户端对象可以发出 comm-error code>事件。 li>The open event emitted by the WebSocket notification channel object may return an error. WebSocket通知通道对象发出的 open code>事件可能返回错误。 li> ol>Please refer to the “Receiving Notifications” section below for detailed information on how to receive Catenis notifications from within WordPress pages.有关如何从WordPress页面内接收Catenis通知的详细信息,请参阅下面的“接收通知”部分。 p>Error handling错误处理 h4>Errors that take place while calling the Catenis API methods are returned as standard JavaScript Error objects.调用Catenis API方法时发生的错误将作为标准JavaScript错误对象返回。 p>Receiving Notifications接收通知 h3>= Instantiate WebSocket notification channel object =实例化WebSocket通知通道对象 p>Create a WebSocket notification channel for a given Catenis notification event.为给定的Catenis通知事件创建WebSocket通知通道。 p>var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); code> pre>Add listeners添加听众 h4>Add event listeners to monitor activity on the notification channel.添加事件监听器以监视通知通道上的活动。 p>ctnApiClient.on('comm-error', function (error) { ctnApiClient.on('comm-error',function(error){ // Error communicating with Catenis notification process//与Catenis通知流程通信时出错});});wsNotifyChannel.on('open', function (error) { wsNotifyChannel.on('open',function(error){ if (error) { 如果(错误){ // Error establishing underlying WebSocket connection //建立基础WebSocket连接时出错 } } else { 其他{ // Notification channel successfully open //通知频道成功打开 }}});});wsNotifyChannel.on('error', function (error) { wsNotifyChannel.on('错误',函数(错误){ // Error in the underlying WebSocket connection//基础WebSocket连接中的错误});});wsNotifyChannel.on('close', function (code, reason) { wsNotifyChannel.on('close',函数(代码,原因){ // Underlying WebSocket connection has been closed//基础WebSocket连接已关闭});});wsNotifyChannel.on('notify', function (eventData) { wsNotifyChannel.on('notify',function(eventData){ // Received notification//收到通知});}); code> pre>Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object. 注意 strong>:“通信错误”事件是由Catenis API客户端对象发出的,而所有其他事件都是由WebSocket通知通道对象发出的。 p> blockquote>Open the notification channel打开通知通道 h4>Open the WebSocket notification channel to start receiving notifications.打开WebSocket通知通道以开始接收通知。 p>wsNotifyChannel.open(function (error) { wsNotifyChannel.open(function(error){ if (err) { 如果(错误){ // Error sending command to open notification channel //错误发送命令以打开通知通道 }}});}); code> pre>Close the notification channel关闭通知频道 h4>Close the WebSocket notification channel to stop receiving notifications.关闭WebSocket通知通道以停止接收通知。 p>wsNotifyChannel.close(function (error) { wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});}); code> pre>
You can then choose to override the global settings used for instantiating the Catenis API client on that given page, like using a different device ID and its associated API access secret.
然后,您可以选择覆盖用于在给定页面上实例化Catenis API客户端的全局设置,例如使用其他设备ID及其关联的API访问密码。
Otherwise, whatever is configured in the plugin’s global settings — configured under “Settings” |
否则,插件全局设置中配置的所有内容-在“设置” |
“Catenis API Client” — is going to be used.
将使用“ Catenis API客户端”。 p>
Once enabled, a global JavaScript variable named ctnApiClient is made available on the page.
ctnApiClient
启用后,将在页面上提供名为 ctnApiClient code>的全局JavaScript变量。That variable holds the instantiated Catenis API client object.该变量保存实例化的Catenis API客户端对象。 p>Use the ctnApiClient variable to call the Catenis Enterprise API methods by invoking the corresponding method on that object.使用 ctnApiClient em>变量通过在该对象上调用相应的方法来调用Catenis Enterprise API方法。 p>For a reference of the available methods, please refer to the Catenis API JavaScript Client as it is functionally有关可用方法的参考,请从功能上参考 Catenis API JavaScript客户端identical to the Catenis API Client for WordPress, except for notifications support and error handling.除了通知支持和错误处理之外,与Catenis API for WordPress相同。 p>Notifications support通知支持 h4>The notification feature on Catenis API Client for WordPress is almost identical to the one found on the Catenis API JavaScript client. Catenis API Client for WordPress的通知功能几乎与Catenis API JavaScript客户端上的通知功能相同。The two noticeable differences are:两个明显的区别是: p>The Catenis API client object can emit a comm-error event. Catenis API客户端对象可以发出 comm-error code>事件。 li>The open event emitted by the WebSocket notification channel object may return an error. WebSocket通知通道对象发出的 open code>事件可能返回错误。 li> ol>Please refer to the “Receiving Notifications” section below for detailed information on how to receive Catenis notifications from within WordPress pages.有关如何从WordPress页面内接收Catenis通知的详细信息,请参阅下面的“接收通知”部分。 p>Error handling错误处理 h4>Errors that take place while calling the Catenis API methods are returned as standard JavaScript Error objects.调用Catenis API方法时发生的错误将作为标准JavaScript错误对象返回。 p>Receiving Notifications接收通知 h3>= Instantiate WebSocket notification channel object =实例化WebSocket通知通道对象 p>Create a WebSocket notification channel for a given Catenis notification event.为给定的Catenis通知事件创建WebSocket通知通道。 p>var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); code> pre>Add listeners添加听众 h4>Add event listeners to monitor activity on the notification channel.添加事件监听器以监视通知通道上的活动。 p>ctnApiClient.on('comm-error', function (error) { ctnApiClient.on('comm-error',function(error){ // Error communicating with Catenis notification process//与Catenis通知流程通信时出错});});wsNotifyChannel.on('open', function (error) { wsNotifyChannel.on('open',function(error){ if (error) { 如果(错误){ // Error establishing underlying WebSocket connection //建立基础WebSocket连接时出错 } } else { 其他{ // Notification channel successfully open //通知频道成功打开 }}});});wsNotifyChannel.on('error', function (error) { wsNotifyChannel.on('错误',函数(错误){ // Error in the underlying WebSocket connection//基础WebSocket连接中的错误});});wsNotifyChannel.on('close', function (code, reason) { wsNotifyChannel.on('close',函数(代码,原因){ // Underlying WebSocket connection has been closed//基础WebSocket连接已关闭});});wsNotifyChannel.on('notify', function (eventData) { wsNotifyChannel.on('notify',function(eventData){ // Received notification//收到通知});}); code> pre>Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object. 注意 strong>:“通信错误”事件是由Catenis API客户端对象发出的,而所有其他事件都是由WebSocket通知通道对象发出的。 p> blockquote>Open the notification channel打开通知通道 h4>Open the WebSocket notification channel to start receiving notifications.打开WebSocket通知通道以开始接收通知。 p>wsNotifyChannel.open(function (error) { wsNotifyChannel.open(function(error){ if (err) { 如果(错误){ // Error sending command to open notification channel //错误发送命令以打开通知通道 }}});}); code> pre>Close the notification channel关闭通知频道 h4>Close the WebSocket notification channel to stop receiving notifications.关闭WebSocket通知通道以停止接收通知。 p>wsNotifyChannel.close(function (error) { wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});}); code> pre>
ctnApiClient code>的全局JavaScript变量。That variable holds the instantiated Catenis API client object.该变量保存实例化的Catenis API客户端对象。 p>Use the ctnApiClient variable to call the Catenis Enterprise API methods by invoking the corresponding method on that object.使用 ctnApiClient em>变量通过在该对象上调用相应的方法来调用Catenis Enterprise API方法。 p>For a reference of the available methods, please refer to the Catenis API JavaScript Client as it is functionally有关可用方法的参考,请从功能上参考 Catenis API JavaScript客户端identical to the Catenis API Client for WordPress, except for notifications support and error handling.除了通知支持和错误处理之外,与Catenis API for WordPress相同。 p>Notifications support通知支持 h4>The notification feature on Catenis API Client for WordPress is almost identical to the one found on the Catenis API JavaScript client. Catenis API Client for WordPress的通知功能几乎与Catenis API JavaScript客户端上的通知功能相同。The two noticeable differences are:两个明显的区别是: p>The Catenis API client object can emit a comm-error event. Catenis API客户端对象可以发出 comm-error code>事件。 li>The open event emitted by the WebSocket notification channel object may return an error. WebSocket通知通道对象发出的 open code>事件可能返回错误。 li> ol>Please refer to the “Receiving Notifications” section below for detailed information on how to receive Catenis notifications from within WordPress pages.有关如何从WordPress页面内接收Catenis通知的详细信息,请参阅下面的“接收通知”部分。 p>Error handling错误处理 h4>Errors that take place while calling the Catenis API methods are returned as standard JavaScript Error objects.调用Catenis API方法时发生的错误将作为标准JavaScript错误对象返回。 p>Receiving Notifications接收通知 h3>= Instantiate WebSocket notification channel object =实例化WebSocket通知通道对象 p>Create a WebSocket notification channel for a given Catenis notification event.为给定的Catenis通知事件创建WebSocket通知通道。 p>var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); code> pre>Add listeners添加听众 h4>Add event listeners to monitor activity on the notification channel.添加事件监听器以监视通知通道上的活动。 p>ctnApiClient.on('comm-error', function (error) { ctnApiClient.on('comm-error',function(error){ // Error communicating with Catenis notification process//与Catenis通知流程通信时出错});});wsNotifyChannel.on('open', function (error) { wsNotifyChannel.on('open',function(error){ if (error) { 如果(错误){ // Error establishing underlying WebSocket connection //建立基础WebSocket连接时出错 } } else { 其他{ // Notification channel successfully open //通知频道成功打开 }}});});wsNotifyChannel.on('error', function (error) { wsNotifyChannel.on('错误',函数(错误){ // Error in the underlying WebSocket connection//基础WebSocket连接中的错误});});wsNotifyChannel.on('close', function (code, reason) { wsNotifyChannel.on('close',函数(代码,原因){ // Underlying WebSocket connection has been closed//基础WebSocket连接已关闭});});wsNotifyChannel.on('notify', function (eventData) { wsNotifyChannel.on('notify',function(eventData){ // Received notification//收到通知});}); code> pre>Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object. 注意 strong>:“通信错误”事件是由Catenis API客户端对象发出的,而所有其他事件都是由WebSocket通知通道对象发出的。 p> blockquote>Open the notification channel打开通知通道 h4>Open the WebSocket notification channel to start receiving notifications.打开WebSocket通知通道以开始接收通知。 p>wsNotifyChannel.open(function (error) { wsNotifyChannel.open(function(error){ if (err) { 如果(错误){ // Error sending command to open notification channel //错误发送命令以打开通知通道 }}});}); code> pre>Close the notification channel关闭通知频道 h4>Close the WebSocket notification channel to stop receiving notifications.关闭WebSocket通知通道以停止接收通知。 p>wsNotifyChannel.close(function (error) { wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});}); code> pre>
That variable holds the instantiated Catenis API client object.
该变量保存实例化的Catenis API客户端对象。 p>
Use the ctnApiClient variable to call the Catenis Enterprise API methods by invoking the corresponding method on that object.
使用 ctnApiClient em>变量通过在该对象上调用相应的方法来调用Catenis Enterprise API方法。 p>For a reference of the available methods, please refer to the Catenis API JavaScript Client as it is functionally有关可用方法的参考,请从功能上参考 Catenis API JavaScript客户端identical to the Catenis API Client for WordPress, except for notifications support and error handling.除了通知支持和错误处理之外,与Catenis API for WordPress相同。 p>Notifications support通知支持 h4>The notification feature on Catenis API Client for WordPress is almost identical to the one found on the Catenis API JavaScript client. Catenis API Client for WordPress的通知功能几乎与Catenis API JavaScript客户端上的通知功能相同。The two noticeable differences are:两个明显的区别是: p>The Catenis API client object can emit a comm-error event. Catenis API客户端对象可以发出 comm-error code>事件。 li>The open event emitted by the WebSocket notification channel object may return an error. WebSocket通知通道对象发出的 open code>事件可能返回错误。 li> ol>Please refer to the “Receiving Notifications” section below for detailed information on how to receive Catenis notifications from within WordPress pages.有关如何从WordPress页面内接收Catenis通知的详细信息,请参阅下面的“接收通知”部分。 p>Error handling错误处理 h4>Errors that take place while calling the Catenis API methods are returned as standard JavaScript Error objects.调用Catenis API方法时发生的错误将作为标准JavaScript错误对象返回。 p>Receiving Notifications接收通知 h3>= Instantiate WebSocket notification channel object =实例化WebSocket通知通道对象 p>Create a WebSocket notification channel for a given Catenis notification event.为给定的Catenis通知事件创建WebSocket通知通道。 p>var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); code> pre>Add listeners添加听众 h4>Add event listeners to monitor activity on the notification channel.添加事件监听器以监视通知通道上的活动。 p>ctnApiClient.on('comm-error', function (error) { ctnApiClient.on('comm-error',function(error){ // Error communicating with Catenis notification process//与Catenis通知流程通信时出错});});wsNotifyChannel.on('open', function (error) { wsNotifyChannel.on('open',function(error){ if (error) { 如果(错误){ // Error establishing underlying WebSocket connection //建立基础WebSocket连接时出错 } } else { 其他{ // Notification channel successfully open //通知频道成功打开 }}});});wsNotifyChannel.on('error', function (error) { wsNotifyChannel.on('错误',函数(错误){ // Error in the underlying WebSocket connection//基础WebSocket连接中的错误});});wsNotifyChannel.on('close', function (code, reason) { wsNotifyChannel.on('close',函数(代码,原因){ // Underlying WebSocket connection has been closed//基础WebSocket连接已关闭});});wsNotifyChannel.on('notify', function (eventData) { wsNotifyChannel.on('notify',function(eventData){ // Received notification//收到通知});}); code> pre>Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object. 注意 strong>:“通信错误”事件是由Catenis API客户端对象发出的,而所有其他事件都是由WebSocket通知通道对象发出的。 p> blockquote>Open the notification channel打开通知通道 h4>Open the WebSocket notification channel to start receiving notifications.打开WebSocket通知通道以开始接收通知。 p>wsNotifyChannel.open(function (error) { wsNotifyChannel.open(function(error){ if (err) { 如果(错误){ // Error sending command to open notification channel //错误发送命令以打开通知通道 }}});}); code> pre>Close the notification channel关闭通知频道 h4>Close the WebSocket notification channel to stop receiving notifications.关闭WebSocket通知通道以停止接收通知。 p>wsNotifyChannel.close(function (error) { wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});}); code> pre>
For a reference of the available methods, please refer to the Catenis API JavaScript Client as it is functionally
有关可用方法的参考,请从功能上参考 Catenis API JavaScript客户端
identical to the Catenis API Client for WordPress, except for notifications support and error handling.
除了通知支持和错误处理之外,与Catenis API for WordPress相同。 p>
The notification feature on Catenis API Client for WordPress is almost identical to the one found on the Catenis API JavaScript client.
Catenis API Client for WordPress的通知功能几乎与Catenis API JavaScript客户端上的通知功能相同。
The two noticeable differences are:
两个明显的区别是: p>
comm-error
comm-error code>事件。 li>The open event emitted by the WebSocket notification channel object may return an error. WebSocket通知通道对象发出的 open code>事件可能返回错误。 li>
open
open code>事件可能返回错误。 li>
ol>
Please refer to the “Receiving Notifications” section below for detailed information on how to receive Catenis notifications from within WordPress pages.
有关如何从WordPress页面内接收Catenis通知的详细信息,请参阅下面的“接收通知”部分。 p>
Errors that take place while calling the Catenis API methods are returned as standard JavaScript Error objects.
调用Catenis API方法时发生的错误将作为标准JavaScript错误对象返回。 p>
= Instantiate WebSocket notification channel object
=实例化WebSocket通知通道对象 p>
Create a WebSocket notification channel for a given Catenis notification event.
为给定的Catenis通知事件创建WebSocket通知通道。 p>
var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName); code> pre>Add listeners添加听众 h4>Add event listeners to monitor activity on the notification channel.添加事件监听器以监视通知通道上的活动。 p>ctnApiClient.on('comm-error', function (error) { ctnApiClient.on('comm-error',function(error){ // Error communicating with Catenis notification process//与Catenis通知流程通信时出错});});wsNotifyChannel.on('open', function (error) { wsNotifyChannel.on('open',function(error){ if (error) { 如果(错误){ // Error establishing underlying WebSocket connection //建立基础WebSocket连接时出错 } } else { 其他{ // Notification channel successfully open //通知频道成功打开 }}});});wsNotifyChannel.on('error', function (error) { wsNotifyChannel.on('错误',函数(错误){ // Error in the underlying WebSocket connection//基础WebSocket连接中的错误});});wsNotifyChannel.on('close', function (code, reason) { wsNotifyChannel.on('close',函数(代码,原因){ // Underlying WebSocket connection has been closed//基础WebSocket连接已关闭});});wsNotifyChannel.on('notify', function (eventData) { wsNotifyChannel.on('notify',function(eventData){ // Received notification//收到通知});}); code> pre>Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object. 注意 strong>:“通信错误”事件是由Catenis API客户端对象发出的,而所有其他事件都是由WebSocket通知通道对象发出的。 p> blockquote>Open the notification channel打开通知通道 h4>Open the WebSocket notification channel to start receiving notifications.打开WebSocket通知通道以开始接收通知。 p>wsNotifyChannel.open(function (error) { wsNotifyChannel.open(function(error){ if (err) { 如果(错误){ // Error sending command to open notification channel //错误发送命令以打开通知通道 }}});}); code> pre>Close the notification channel关闭通知频道 h4>Close the WebSocket notification channel to stop receiving notifications.关闭WebSocket通知通道以停止接收通知。 p>wsNotifyChannel.close(function (error) { wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});}); code> pre>
var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName);
code> pre>
Add event listeners to monitor activity on the notification channel.
添加事件监听器以监视通知通道上的活动。 p>
ctnApiClient.on('comm-error', function (error) { ctnApiClient.on('comm-error',function(error){ // Error communicating with Catenis notification process//与Catenis通知流程通信时出错});});wsNotifyChannel.on('open', function (error) { wsNotifyChannel.on('open',function(error){ if (error) { 如果(错误){ // Error establishing underlying WebSocket connection //建立基础WebSocket连接时出错 } } else { 其他{ // Notification channel successfully open //通知频道成功打开 }}});});wsNotifyChannel.on('error', function (error) { wsNotifyChannel.on('错误',函数(错误){ // Error in the underlying WebSocket connection//基础WebSocket连接中的错误});});wsNotifyChannel.on('close', function (code, reason) { wsNotifyChannel.on('close',函数(代码,原因){ // Underlying WebSocket connection has been closed//基础WebSocket连接已关闭});});wsNotifyChannel.on('notify', function (eventData) { wsNotifyChannel.on('notify',function(eventData){ // Received notification//收到通知});}); code> pre>Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object. 注意 strong>:“通信错误”事件是由Catenis API客户端对象发出的,而所有其他事件都是由WebSocket通知通道对象发出的。 p> blockquote>Open the notification channel打开通知通道 h4>Open the WebSocket notification channel to start receiving notifications.打开WebSocket通知通道以开始接收通知。 p>wsNotifyChannel.open(function (error) { wsNotifyChannel.open(function(error){ if (err) { 如果(错误){ // Error sending command to open notification channel //错误发送命令以打开通知通道 }}});}); code> pre>Close the notification channel关闭通知频道 h4>Close the WebSocket notification channel to stop receiving notifications.关闭WebSocket通知通道以停止接收通知。 p>wsNotifyChannel.close(function (error) { wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});}); code> pre>
ctnApiClient.on('comm-error',function(error){ // Error communicating with Catenis notification process//与Catenis通知流程通信时出错});});wsNotifyChannel.on('open', function (error) { wsNotifyChannel.on('open',function(error){ if (error) { 如果(错误){ // Error establishing underlying WebSocket connection //建立基础WebSocket连接时出错 } } else { 其他{ // Notification channel successfully open //通知频道成功打开 }}});});wsNotifyChannel.on('error', function (error) { wsNotifyChannel.on('错误',函数(错误){ // Error in the underlying WebSocket connection//基础WebSocket连接中的错误});});wsNotifyChannel.on('close', function (code, reason) { wsNotifyChannel.on('close',函数(代码,原因){ // Underlying WebSocket connection has been closed//基础WebSocket连接已关闭});});wsNotifyChannel.on('notify', function (eventData) { wsNotifyChannel.on('notify',function(eventData){ // Received notification//收到通知});});
// Error communicating with Catenis notification process
//与Catenis通知流程通信时出错
});
});
wsNotifyChannel.on('open', function (error) {
wsNotifyChannel.on('open',function(error){
if (error) {
如果(错误){
// Error establishing underlying WebSocket connection
//建立基础WebSocket连接时出错
}
else {
其他{
// Notification channel successfully open
//通知频道成功打开
wsNotifyChannel.on('error', function (error) {
wsNotifyChannel.on('错误',函数(错误){
// Error in the underlying WebSocket connection
//基础WebSocket连接中的错误
wsNotifyChannel.on('close', function (code, reason) {
wsNotifyChannel.on('close',函数(代码,原因){
// Underlying WebSocket connection has been closed
//基础WebSocket连接已关闭
wsNotifyChannel.on('notify', function (eventData) {
wsNotifyChannel.on('notify',function(eventData){
// Received notification
//收到通知
Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object. 注意 strong>:“通信错误”事件是由Catenis API客户端对象发出的,而所有其他事件都是由WebSocket通知通道对象发出的。 p> blockquote>Open the notification channel打开通知通道 h4>Open the WebSocket notification channel to start receiving notifications.打开WebSocket通知通道以开始接收通知。 p>wsNotifyChannel.open(function (error) { wsNotifyChannel.open(function(error){ if (err) { 如果(错误){ // Error sending command to open notification channel //错误发送命令以打开通知通道 }}});}); code> pre>Close the notification channel关闭通知频道 h4>Close the WebSocket notification channel to stop receiving notifications.关闭WebSocket通知通道以停止接收通知。 p>wsNotifyChannel.close(function (error) { wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});}); code> pre>
Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object. 注意 strong>:“通信错误”事件是由Catenis API客户端对象发出的,而所有其他事件都是由WebSocket通知通道对象发出的。 p>
Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object.
注意 strong>:“通信错误”事件是由Catenis API客户端对象发出的,而所有其他事件都是由WebSocket通知通道对象发出的。 p>
blockquote>
Open the WebSocket notification channel to start receiving notifications.
打开WebSocket通知通道以开始接收通知。 p>
wsNotifyChannel.open(function (error) { wsNotifyChannel.open(function(error){ if (err) { 如果(错误){ // Error sending command to open notification channel //错误发送命令以打开通知通道 }}});}); code> pre>Close the notification channel关闭通知频道 h4>Close the WebSocket notification channel to stop receiving notifications.关闭WebSocket通知通道以停止接收通知。 p>wsNotifyChannel.close(function (error) { wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});}); code> pre>
wsNotifyChannel.open(function(error){ if (err) { 如果(错误){ // Error sending command to open notification channel //错误发送命令以打开通知通道 }}});});
if (err) {
// Error sending command to open notification channel
//错误发送命令以打开通知通道
Close the WebSocket notification channel to stop receiving notifications.
关闭WebSocket通知通道以停止接收通知。 p>
wsNotifyChannel.close(function (error) { wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});}); code> pre>
wsNotifyChannel.close(function(error){ if (err) { 如果(错误){ // Error sending command to close notification channel //错误发送命令以关闭通知通道 }}});});
// Error sending command to close notification channel
//错误发送命令以关闭通知通道
The PHP executable should be in the system PATH so that the plugin can spawn the process used to handle notifications.
PHP可执行文件应位于系统PATH中,以便插件可以产生用于处理通知的过程。 p>
“Catenis API Client” to configure the global settings for instantiating the Catenis API client.
“ Catenis API客户端”配置用于实例化Catenis API客户端的全局设置。 li>
Use it to make the Catenis API client available from a given page, and optionally configure custom settings for instantiating the Catenis API client for that given page.
使用它可以使Catenis API客户端可从给定页面访问,并可以选择配置自定义设置以实例化该给定页面的Catenis API客户端。 li>
Please refer to Catenis Enterprise API documentation for further information on accessing the Catenis Enterprise API.<
有关访问Catenis Enterprise API的更多信息,请参考 Catenis Enterprise API文档。<
/p>
/ p>
原文出处:http://www.sanshu.cn/a/6613.html
群主管理都是支付大佬