text
stringclasses 10
values |
|---|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>You are a Nexa-Assist which help to a nexacro developer<|eot_id|><|start_header_id|>user<|end_header_id|>
프로토콜 어댑터 개발하기<|eot_id|><|start_header_id|>assistant<|end_header_id|>
넥사크로에서 기본적으로 제공하는 데이터 통신 방식은 HTTP 프로토콜을 사용해 요청과 응답을 처리합니다. 이 과정에서 데이터 자체를 변환하지는 않습니다. 하지만 사용 환경에 따라 데이터를 암호화하거나 특정 형식의 데이터를 수신하고 변환하는 과정이 필요할 수 있습니다.
프로토콜 어댑터를 사용하면 간단한 설정만으로 데이터를 암호화하거나 데이터 구조를 변환해 원하는 동작을 구현할 수 있습니다.<|eot_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>You are a Nexa-Assist which help to a nexacro developer<|eot_id|><|start_header_id|>user<|end_header_id|>
프로토콜 어댑터 모듈 만들고 앱에서 사용하기<|eot_id|><|start_header_id|>assistant<|end_header_id|>
프로토콜 어댑터를 사용하기 위해서는 넥사크로 모듈 디벨로퍼에서 모듈을 만들고 넥사크로 스튜디오에 작성된 모듈을 등록하고 프로토콜, 서비스를 추가해야 합니다.<|eot_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>You are a Nexa-Assist which help to a nexacro developer<|eot_id|><|start_header_id|>user<|end_header_id|>
프로토콜 어댑터 모듈 만들고 앱에서 사용하기 프로토콜 어댑터 모듈 만들기<|eot_id|><|start_header_id|>assistant<|end_header_id|>
단계 1. 넥사크로 모듈 디벨로퍼에서 새로운 프로젝트를 만듭니다. 메뉴에서 [File > New > Project]를 선택합니다.
단계 2. Project Wizard가 열리면 Module 항목에서 'Protocol Adaptor'를 선택합니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|프로토콜 어댑터 모듈 만들고 앱에서 사용하기|프로토콜 어댑터 모듈 만들기/1.jpg</ImgTag>
단계 3. 프로젝트 ID를 입력하고 [Next] 버튼을 클릭합니다.
단계 4. Object ID를 입력하고 FinalClass 항목을 true로 변경합니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|프로토콜 어댑터 모듈 만들고 앱에서 사용하기|프로토콜 어댑터 모듈 만들기/2.jpg</ImgTag>
단계 5. 프로젝트가 생성되고 basicPtAdp.js 파일이 편집창에 표시됩니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|프로토콜 어댑터 모듈 만들고 앱에서 사용하기|프로토콜 어댑터 모듈 만들기/3.jpg</ImgTag><|eot_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>You are a Nexa-Assist which help to a nexacro developer<|eot_id|><|start_header_id|>user<|end_header_id|>
프로토콜 어댑터 모듈 만들고 앱에서 사용하기 프로토콜 어댑터 모듈 편집하기<|eot_id|><|start_header_id|>assistant<|end_header_id|>
프로토콜 어댑터 모듈을 새로 만들면 기본적으로 4개의 함수가 생성됩니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|프로토콜 어댑터 모듈 만들고 앱에서 사용하기|프로토콜 어댑터 모듈 편집하기/1.png</ImgTag>
initialize
<CodeTag>
nexacro.basicPtAdp.prototype.initialize = function() { trace('basicPtAdp initialize');};
</CodeTag>
외부 플러그인 모듈을 사용한 경우에는 아래와 같이 PluginElement를 사용해 초기화합니다.
<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>
initialize 함수에서 생성한 외부 모듈을 삭제 처리합니다.
<CodeTag>
nexacro.basicPtAdp.prototype.finalize = function(){ this._plugin.destroy(); delete this._plugin; }
</CodeTag>
encrypt
전송할 데이터를 변환하고 return 하는 문자열 변수에 담아서 처리합니다.
<CodeTag>
nexacro.basicPtAdp.prototype.encrypt = function(strUrl, strData) { trace('encrypt url=' + strUrl + ';data=' + strData); return strData;};
</CodeTag>
decrypt
응답으로 받은 데이터를 변환하고 호출한 앱에 전달합니다.
<CodeTag>
nexacro.basicPtAdp.prototype.decrypt = function(strUrl, strData) { trace('decrypt url=' + strUrl + ';data=' + strData); return strData;}
</CodeTag><|eot_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>You are a Nexa-Assist which help to a nexacro developer<|eot_id|><|start_header_id|>user<|end_header_id|>
프로토콜 어댑터 모듈 만들고 앱에서 사용하기 프로토콜 어댑터 모듈 배포하기<|eot_id|><|start_header_id|>assistant<|end_header_id|>
단계 1. 넥사크로 모듈 디벨로퍼 메뉴[Deploy > Module Package]를 선택하고 Deploy Wizard를 실행합니다.
단계 2. Module Information에서 Type 항목을 'protocoladaptor'으로 변경합니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|프로토콜 어댑터 모듈 만들고 앱에서 사용하기|프로토콜 어댑터 모듈 배포하기/1.jpg</ImgTag>
단계 3. [Deploy] 버튼을 클릭해 모듈을 배포합니다.<|eot_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>You are a Nexa-Assist which help to a nexacro developer<|eot_id|><|start_header_id|>user<|end_header_id|>
프로토콜 어댑터 모듈 만들고 앱에서 사용하기 모듈 설치하고 프로토콜 서비스 등록하기<|eot_id|><|start_header_id|>assistant<|end_header_id|>
단계 1. 넥사크로 스튜디오 메뉴[File > Install Module]을 선택하고 Install Module Wizard를 실행합니다.
단계 2. 넥사크로 모듈 디벨로퍼에서 만든 모듈 설치 파일을 선택하고 설치합니다.
노트:
모듈 메타인포 속성 중 registration 속성값이 기본값('deny')으로 설정됐기 때문에 설치될 모듈 목록이 보이지는 않습니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|프로토콜 어댑터 모듈 만들고 앱에서 사용하기|모듈 설치하고 프로토콜 서비스 등록하기/1.jpg</ImgTag>
단계 3. Project Explorer에서 TypeDefinition 항목을 선택하고 컨텍스트 메뉴에서 [Add > Protocol]을 선택합니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|프로토콜 어댑터 모듈 만들고 앱에서 사용하기|모듈 설치하고 프로토콜 서비스 등록하기/2.jpg</ImgTag>
단계 4. New Protocol Wizard에서 Protocol ID와 Prefix ID를 설정합니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|프로토콜 어댑터 모듈 만들고 앱에서 사용하기|모듈 설치하고 프로토콜 서비스 등록하기/3.jpg</ImgTag>
단계 5. [Next] 버튼을 클릭하고 Web Browser 항목을 체크하고 ClassName을 입력합니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|프로토콜 어댑터 모듈 만들고 앱에서 사용하기|모듈 설치하고 프로토콜 서비스 등록하기/4.jpg</ImgTag><|eot_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>You are a Nexa-Assist which help to a nexacro developer<|eot_id|><|start_header_id|>user<|end_header_id|>
프로토콜 어댑터 모듈 만들고 앱에서 사용하기 프로토콜 어댑터를 통해 서비스 호출하기<|eot_id|><|start_header_id|>assistant<|end_header_id|>
transaction 메소드 실행 시 아래와 같이 strURL 파라미터에 프로토콜 어댑터 URL 형식을 적용하면 통신 요청이 바로 서버로 전달되지 않고 프로토콜 어댑터를 거치게 됩니다.
<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>
Button 클릭 시 아래와 같은 순서로 프로토콜 어댑터 동작이 처리되는 것을 확인할 수 있습니다.
initialize
예제에서는 초기화는 없고 trace 메소드만 실행합니다.
encrypt
strArgument 파라미터로 전달한 값이 처리되는 것을 확인합니다.
decrypt
요청에 대한 응답 데이터를 확인합니다.
CallbackFunc
정상 처리 후 콜백 함수가 동작하는 것을 확인합니다.
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|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>You are a Nexa-Assist which help to a nexacro developer<|eot_id|><|start_header_id|>user<|end_header_id|>
추가로 설정할 수 있는 인터페이스 함수<|eot_id|><|start_header_id|>assistant<|end_header_id|>
프로토콜 어댑터에서는 추가로 설정할 수 있는 인터페이스 함수를 제공합니다.<|eot_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>You are a Nexa-Assist which help to a nexacro developer<|eot_id|><|start_header_id|>user<|end_header_id|>
추가로 설정할 수 있는 인터페이스 함수 재정의할 수 있는 인터페이스 함수<|eot_id|><|start_header_id|>assistant<|end_header_id|>
상속받은 nexacro.ProtocolAdp에서 제공하는 함수를 재정의할 수 있습니다. 속성창에서 추가해 사용할 수 있습니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|추가로 설정할 수 있는 인터페이스 함수|재정의할 수 있는 인터페이스 함수/1.jpg</ImgTag>
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|추가로 설정할 수 있는 인터페이스 함수|재정의할 수 있는 인터페이스 함수/1.png</ImgTag>
getCommunicationHeaders 함수는 아래와 같이 설정할 수 있습니다.
<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>
통신 시 쿠키 정보가 추가로 설정된 것을 확인할 수 있습니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|추가로 설정할 수 있는 인터페이스 함수|재정의할 수 있는 인터페이스 함수/2.jpg</ImgTag><|eot_id|>
|
<|begin_of_text|><|start_header_id|>system<|end_header_id|>You are a Nexa-Assist which help to a nexacro developer<|eot_id|><|start_header_id|>user<|end_header_id|>
추가로 설정할 수 있는 인터페이스 함수 메소드로 추가하는 함수<|eot_id|><|start_header_id|>assistant<|end_header_id|>
Project Explorer에서 오브젝트를 선택하고 컨텍스트 메뉴에서 Method를 추가해 설정합니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|추가로 설정할 수 있는 인터페이스 함수|메소드로 추가하는 함수/1.jpg</ImgTag>
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|추가로 설정할 수 있는 인터페이스 함수|메소드로 추가하는 함수/1.png</ImgTag>
getHTTPHeader, version 함수는 아래와 같이 설정할 수 있습니다.
<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>
통신 시 헤더 Accept 정보가 변경된 것을 확인할 수 있습니다.
<ImgTag>응용 개발 가이드|프로토콜 어댑터 개발하기|추가로 설정할 수 있는 인터페이스 함수|메소드로 추가하는 함수/2.jpg</ImgTag><|eot_id|>
|
README.md exists but content is empty.
- Downloads last month
- -