//============================================================================== //MelitaWSDocStream //============================================================================== //============================================================================== //nexacro.Event.MelitaWSDocStreamEventInfo //MelitaWSDocStream에 요청된 작업이 성공했을 때 발생되는 이벤트에서 사용되는 EventInfo Object //============================================================================== if(!nexacro.Event.MelitaWSDocStreamEventInfo) { nexacro.Event.MelitaWSDocStreamEventInfo = function (strEventId, strSvcId, intReason, strReturnValue) { this.eventid = strEventId; // 이벤트ID this.svcid = strSvcId; // 이벤트 서비스 ID this.reason = intReason; // 이벤트 발생분류 코드 this.returnvalue = strReturnValue; // 이벤트 수행결과 (type:Variant) } _pMelitaWSDocStreamEventInfo = nexacro.Event.MelitaWSDocStreamEventInfo.prototype = nexacro._createPrototype(nexacro.Event); _pMelitaWSDocStreamEventInfo._type = "nexacroMelitaWSDocStreamEventInfo"; _pMelitaWSDocStreamEventInfo._type_name = "MelitaWSDocStreamEventInfo"; _pMelitaWSDocStreamEventInfo = null; } //============================================================================== //nexacro.Event.MelitaWSDocStreamErrorEventInfo //MelitaWSDocStream에 요청된 작업이 실패했을 때 발생되는 이벤트에서 사용되는 EventInfo Object //============================================================================== if(!nexacro.Event.MelitaWSDocStreamErrorEventInfo) { nexacro.Event.MelitaWSDocStreamErrorEventInfo = function (strEventId, strSvcId, intReason, intErrorCode, strErrorMsg) { this.eventid = strEventId; // 이벤트ID this.svcid = strSvcId; // 이벤트 서비스 ID this.reason = intReason; this.errorcode = intErrorCode; this.errormsg = strErrorMsg; } _pMelitaWSDocStreamErrorEventInfo = nexacro.Event.MelitaWSDocStreamErrorEventInfo.prototype = nexacro._createPrototype(nexacro.Event); _pMelitaWSDocStreamErrorEventInfo._type = "nexacroMelitaWSDocStreamErrorEventInfo"; _pMelitaWSDocStreamErrorEventInfo._type_name = "MelitaWSDocStreamErrorEventInfo"; _pMelitaWSDocStreamErrorEventInfo = null; } //============================================================================== //nexacro.MelitaWSDocStream //MelitaWSDocStream를 연동하기 위해 사용한다. //============================================================================== if (!nexacro.MelitaWSDocStream) { nexacro.MelitaWSDocStream = function(name, obj) { this._id = nexacro.Device.makeID(); nexacro.Device._userCreatedObj[this._id] = this; this.name = name || ""; this.enableevent = true; this.timeout = 10; this._clsnm = ["MelitaWSDocStreamPlugin"]; this._reasoncode = { constructor : {ifcls: 0, fn: "constructor"}, destroy : {ifcls: 0, fn: "destroy"}, callMethod : {ifcls: 0, fn: "callMethod"}, }; this._event_list = { "oncallback": 1, }; // native constructor var params = {} ; var fninfo = this._reasoncode.constructor; this._execFn(fninfo, params); }; var _pMelitaWSDocStream = nexacro.MelitaWSDocStream.prototype = nexacro._createPrototype(nexacro.EventSinkObject); _pMelitaWSDocStream._type = "nexacroMelitaWSDocStream"; _pMelitaWSDocStream._type_name = "MelitaWSDocStream"; _pMelitaWSDocStream.destroy = function() { var params = {}; var jsonstr; delete nexacro.Device._userCreatedObj[this._id]; var fninfo = this._reasoncode.destroy; this._execFn(fninfo, params); return true; }; //===================User Method=========================// _pMelitaWSDocStream.callMethod = function(methodid, param) { var fninfo = this._reasoncode.callMethod; var params = {}; params.serviceid = methodid; params.param = param; this._execFn(fninfo, params); }; //===================Native Call=========================// _pMelitaWSDocStream._execFn = function(_obj, _param) { if(nexacro.Device.curDevice == 0) { var jsonstr = this._getJSONStr(_obj, _param); this._log(jsonstr); nexacro.Device.exec(jsonstr); } else { var jsonstr = this._getJSONStr(_obj, _param); this._log(jsonstr); nexacro.Device.exec(jsonstr); } } _pMelitaWSDocStream._getJSONStr = function(_obj, _param) { var _id = this._id; var _clsnm = this._clsnm[_obj.ifcls]; var _fnnm = _obj.fn; var value = {}; value.id = _id; value.div = _clsnm; value.method = _fnnm; value.params = _param; return JSON.stringify(value); } _pMelitaWSDocStream._log = function(arg) { if(trace) { trace(arg); } } //===================EVENT=========================// _pMelitaWSDocStream._oncallback = function(objData) { var e = new nexacro.Event.MelitaWSDocStreamEventInfo("oncallback", objData.svcid, objData.reason, objData.returnvalue); this.$fire_oncallback(this, e); }; _pMelitaWSDocStream.$fire_oncallback = function (objMelitaWSDocStream, eMelitaWSDocStreamEventInfo) { if (this.oncallback && this.oncallback._has_handlers) { return this.oncallback._fireEvent(this, eMelitaWSDocStreamEventInfo); } return true; }; delete _pMelitaWSDocStream; }