text
stringclasses 10
values |
|---|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
Today Date: 26 Jul 2024
This is information about NEXACRO<|eot_id|><|start_header_id|>user<|end_header_id|>
Developing Protocol Adaptor<|eot_id|><|start_header_id|>assistant<|end_header_id|>
Nexacro basically uses HTTP to handle requests and responses. The platform does not convert data itself during the process. Depending on environments, however, you may need to encrypt data while receiving and converting certain types of data.
Protocol adapters allow you to encrypt data or change data structure with simple settings. In that way, they help you to achieve your intentions.<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
Today Date: 26 Jul 2024
This is information about NEXACRO<|eot_id|><|start_header_id|>user<|end_header_id|>
Creating Protocol Adaptor Module & Using It in the App<|eot_id|><|start_header_id|>assistant<|end_header_id|>
To use a protocol adapter, you need to write a module, register it in Nexacro Studio and add it as a protocol and service.<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
Today Date: 26 Jul 2024
This is information about NEXACRO<|eot_id|><|start_header_id|>user<|end_header_id|>
Creating Protocol Adaptor Module & Using It in the App Creating Protocol Adaptor Module<|eot_id|><|start_header_id|>assistant<|end_header_id|>
Step 1. Create a new project in the Nexacro Module Developer. Select [File > New > Project] from the menu.
Step 2. When Project Wizard is opened, select the 'Protocol Adaptor' from the Module item.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Creating Protocol Adaptor Module & Using It in the App|Creating Protocol Adaptor Module/1.jpg</ImgTag>
Step 3. Enter the project ID and then click the [Next] button.
Step 4. Enter the Object ID and then change the FinalClass item to true.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Creating Protocol Adaptor Module & Using It in the App|Creating Protocol Adaptor Module/2.jpg</ImgTag>
Step 5. The project is created and the basicPtAdp.js file is displayed in the edit window.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Creating Protocol Adaptor Module & Using It in the App|Creating Protocol Adaptor Module/3.jpg</ImgTag><|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
Today Date: 26 Jul 2024
This is information about NEXACRO<|eot_id|><|start_header_id|>user<|end_header_id|>
Creating Protocol Adaptor Module & Using It in the App Editing Protocol Adaptor Module<|eot_id|><|start_header_id|>assistant<|end_header_id|>
When you create a new protocol adaptor module, 4 functions are created by default.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Creating Protocol Adaptor Module & Using It in the App|Editing Protocol Adaptor Module/1.png</ImgTag>
initialize
<CodeTag>
nexacro.basicPtAdp.prototype.initialize = function() { trace('basicPtAdp initialize');};
</CodeTag>
In the case of the external plug-in module being used, initialize it using PluginElement as shown below.
<CodeTag>
nexacro.basicPtAdp.prototype.initialize = function() { this._plugin = new nexacro.PluginElement(); this._plugin.setElementClassId('Microsoft.XMLDOM'); //this._plugin.setElementClassId('{7E9FDB80-5316-11D4-B02C-00C04F0CD404}'); this._plugin.create(); };
</CodeTag>
finalize
<CodeTag>
nexacro.basicPtAdp.prototype.finalize = function() { trace('basicPtAdp finalize');};
</CodeTag>
The external module created through the initialize function is deleted.
<CodeTag>
nexacro.basicPtAdp.prototype.finalize = function(){ this._plugin.destroy(); delete this._plugin; }
</CodeTag>
encrypt
The data to be transmitted is converted and processed by being put into the return string variable.
<CodeTag>
nexacro.basicPtAdp.prototype.encrypt = function(strUrl, strData) { trace('encrypt url=' + strUrl + ';data=' + strData); return strData;};
</CodeTag>
decrypt
The data received in response is converted and passed to the calling app.
<CodeTag>
nexacro.basicPtAdp.prototype.decrypt = function(strUrl, strData) { trace('decrypt url=' + strUrl + ';data=' + strData); return strData;}
</CodeTag><|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
Today Date: 26 Jul 2024
This is information about NEXACRO<|eot_id|><|start_header_id|>user<|end_header_id|>
Creating Protocol Adaptor Module & Using It in the App Deploying the Protocol Adaptor Module<|eot_id|><|start_header_id|>assistant<|end_header_id|>
Step 1. Select the Nexacro Module Developer menu [Deploy > Module Package] and then run the Deploy Wizard.
Step 2. Change the Type item to 'protocoladaptor' in the Module Information.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Creating Protocol Adaptor Module & Using It in the App|Deploying the Protocol Adaptor Module/1.jpg</ImgTag>
Step 3. Click the [Deploy] button to deploy the module.<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
Today Date: 26 Jul 2024
This is information about NEXACRO<|eot_id|><|start_header_id|>user<|end_header_id|>
Creating Protocol Adaptor Module & Using It in the App Installing the Module & Registering the Protocol Service<|eot_id|><|start_header_id|>assistant<|end_header_id|>
Step 1. Select the Nexacro Studio menu [File > Install Module] and then run the Install Module Wizard.
Step 2. Select and install the module installation file created in the Nexacro Module Developer.
Note:
Since the registration property value among the module meta-info properties is set to the default value ('deny'), the list of modules to be installed is not displayed.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Creating Protocol Adaptor Module & Using It in the App|Installing the Module & Registering the Protocol Service/1.jpg</ImgTag>
Step 3. Select the TypeDefinition item in the Project Explorer and then select [Add > Protocol] from the context menu.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Creating Protocol Adaptor Module & Using It in the App|Installing the Module & Registering the Protocol Service/2.jpg</ImgTag>
Step 4. Set the Protocol ID and the Prefix ID in the New Protocol Wizard.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Creating Protocol Adaptor Module & Using It in the App|Installing the Module & Registering the Protocol Service/3.jpg</ImgTag>
Step 5. Click the [Next] button to check the Web Browser item and then enter the ClassName.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Creating Protocol Adaptor Module & Using It in the App|Installing the Module & Registering the Protocol Service/4.jpg</ImgTag><|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
Today Date: 26 Jul 2024
This is information about NEXACRO<|eot_id|><|start_header_id|>user<|end_header_id|>
Creating Protocol Adaptor Module & Using It in the App Calling Service through the Protocol Adaptor<|eot_id|><|start_header_id|>assistant<|end_header_id|>
When executing the transaction method, if the protocol adaptor URL format is applied to the strURL parameter as shown below, then the communication request is not directly passed to the server, but rather passes through the protocol adaptor.
<CodeTag>
this.Button00_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo){ this.transaction('srv00', 'basicPtAdp://127.0.0.1:4098/test.xml', '','dsOut=Dataset00','value=a','fnCallback');};this.fnCallback = function(id, code, message){ trace('Error['+code+']:'+message);}
</CodeTag>
When you click the button, you can see that the protocol adaptor operation is processed in the following order.
initialize
There is no initialization in the example, and only the trace method is executed.
encrypt
Check that the value passed to the strArgument parameter is processed.
decrypt
Check the response data for the request.
CallbackFunc
Check that the callback function is operating after normal processing.
basicPtAdp initialize
encrypt url=basicPtAdp://127.0.0.1:8080/test.xml;data=<?xml version='1.0' encoding='UTF-8'?>
<Root xmlns='http://www.nexacroplatform.com/platform/dataset'>
<Parameters>
<Parameter id='value'>b</Parameter>
</Parameters>
</Root>
decrypt url=basicPtAdp://127.0.0.1:8080/test.xml;data=<?xml version='1.0' encoding='utf-8'?>
<Root xmlns='http://www.nexacroplatform.com/platform/dataset' ver='5000' >
<Parameters>
<Parameter id='ErrorCode' type='int'>0</Parameter>
<Parameter id='ErrorMsg' type='string'>SUCC</Parameter>
</Parameters>
<Dataset id='customers'>
<ColumnInfo>
<Column id='id' type='STRING' size='4'/>
...
Error[0]:SAUCC<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
Today Date: 26 Jul 2024
This is information about NEXACRO<|eot_id|><|start_header_id|>user<|end_header_id|>
Additional Configurable Interface Functions<|eot_id|><|start_header_id|>assistant<|end_header_id|>
The protocol adaptor provides additional configurable interface functions.<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
Today Date: 26 Jul 2024
This is information about NEXACRO<|eot_id|><|start_header_id|>user<|end_header_id|>
Additional Configurable Interface Functions Redefinable Interface Functions<|eot_id|><|start_header_id|>assistant<|end_header_id|>
The functions provided by the inherited nexacro.ProtocolAdp can be redefined. They can be added and used in the properties window.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Additional Configurable Interface Functions|Redefinable Interface Functions/1.jpg</ImgTag>
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Additional Configurable Interface Functions|Redefinable Interface Functions/1.png</ImgTag>
The getCommunicationHeaders function can be set as follows.
<CodeTag>
nexacro.basicPtAdp.prototype.getCommunicationHeaders = function (strUrl){ var ret = nexacro.ProtocolAdp.prototype.getCommunicationHeaders.call(this, strUrl); ret.push({id:'PHPSESSID', value:'298zf09hf012fh2'}); ret.push({id:'csrftoken', value:'u32t4o3tb3gg43'}); return ret;};
</CodeTag>
You can see that additional cookie information has been set when communicating.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Additional Configurable Interface Functions|Redefinable Interface Functions/2.jpg</ImgTag><|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Cutting Knowledge Date: December 2023
Today Date: 26 Jul 2024
This is information about NEXACRO<|eot_id|><|start_header_id|>user<|end_header_id|>
Additional Configurable Interface Functions Functions Added as Methods<|eot_id|><|start_header_id|>assistant<|end_header_id|>
Select the object in the Project Explorer and then set it by adding the method from the context menu.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Additional Configurable Interface Functions|Functions Added as Methods/1.jpg</ImgTag>
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Additional Configurable Interface Functions|Functions Added as Methods/1.png</ImgTag>
The getHTTPHeader, version function can be set as follows.
<CodeTag>
nexacro.basicPtAdp.prototype.initialize = function() { this._httpheaders = []; this._httpheaders.push({ id: 'Accept', value: 'application/json, text/json, */*'});}; nexacro.basicPtAdp.prototype.version = function (){ return '1.1';}; nexacro.basicPtAdp.prototype.getHTTPHeader = function (){ return this._httpheaders;};
</CodeTag>
You can see that the header Accept information has been changed when communicating.
<ImgTag>Advanced Development Guide 21.0.0.300|Developing Protocol Adaptor|Additional Configurable Interface Functions|Functions Added as Methods/2.jpg</ImgTag><|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
README.md exists but content is empty.
- Downloads last month
- 2