⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isc_tools.js

📁 javascript 很酷的类库
💻 JS
📖 第 1 页 / 共 3 页
字号:
,isc.A.finish=function(){if(this.getCurrentPage().ID=="SFDonePage")return this.sfFinish();if(this.getCurrentPage().ID=="KapowPickRobotPage")return this.kapowFinish();this.logWarn("passing output DS: "+this.echo(this.outputDS));var _1=this.service.getFetchDS(this.operationName,this.outputDS);_1.recordXPath=this.recordXPath;_1.recordName=this.recordName;_1.fetchSchema.defaultCriteria=isc.addProperties({},this.serviceInput.getValues());this.logWarn("created DataSource with props: "+this.echo(_1));this.showDSEditor(_1)},isc.A.showDSEditor=function(_1,_2,_3){window.showDSEditor(_1,_2,_3);window.wizardWindow.hide();this.resetWizard()},isc.A.closeClick=function(){this.Super("closeClick",arguments);this.resetWizard()},isc.A.resetWizard=function(){if(this.dsTypePicker)this.dsTypePicker.clearValues();if(this.servicePicker&&this.servicePicker.selection)this.servicePicker.selection.deselectAll();if(this.operationPicker)this.operationPicker.setData([]);if(this.callServicePage){this.serviceInput.clearValues();this.serviceOutput.setData([]);this.expressionForm.clearValues();this.selectedNodesView.setData([])}this.Super("resetWizard",arguments)});isc.B._maxIndex=isc.C+25;isc.defineClass("SchemaViewer","VLayout");isc.A=isc.SchemaViewer;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.getTreeFromService=function(_1){return isc.Tree.create({service:_1,nameProperty:"$46l",titleProperty:"name",loadChildren:function(_8){if(this.isLoaded(_8))return;if(_8==this.root){this.service.operations.setProperty("type","Operation");this.addList(this.service.operations,_8)}else if(_8.inputMessage){this.add(this.getMessageNode(_8,true),_8);this.add(this.getMessageNode(_8,false),_8)}else if(_8.isComplexType){var _2=_8.liveSchema;for(var _3 in _2.getFields()){var _4=_2.getField(_3);if(!_2.fieldIsComplexType(_3)){this.add(isc.addProperties({},_4),_8)}else{var _5=_2.getSchema(_4.type),_6={name:_4.name,type:_4.type,isComplexType:true,liveSchema:_5,minOccurs:_4.minOccurs,maxOccurs:_4.maxOccurs};this.add(_6,_8)}}}this.setLoadState(_8,isc.Tree.LOADED)},isFolder:function(_8){return(_8==this.root||_8.inputMessage||_8.isComplexType)},getMessageNode:function(_8,_9){var _7=_9?this.service.getRequestMessage(_8):this.service.getResponseMessage(_8);return{name:_7.ID,type:_7.ID,isComplexType:true,liveSchema:_7}}})});isc.B._maxIndex=isc.C+1;isc.A=isc.SchemaViewer.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.showTestUI=true;isc.A.operationIcon="[SKINIMG]/SchemaViewer/operation.png";isc.A.complexTypeIcon="[SKINIMG]/SchemaViewer/complexType.gif";isc.A.simpleTypeIcon="[SKINIMG]/SchemaViewer/simpleType.png";isc.B.push(isc.A.setWsdlURL=function(_1){this.wsdlURL=_1;this.urlForm.setValue("url",_1)},isc.A.getWsdlURLs=function(){var _1=isc.getKeys(isc.WebService.services),_2=this.wsdlURLs;if(_2==null&&_1.length==0)return;if(_2==null)_2=[];_2.addList(_1);return _2},isc.A.initWidget=function(){this.Super("initWidget",arguments);this.createChildren()},isc.A.createChildren=function(){var _1=this.getWsdlURLs();this.addAutoChild("urlForm",{numCols:4,colWidths:[100,"*",100,100],itemHoverWidth:300,saveOnEnter:true,saveData:function(){this.creator.fetchSchema()},items:[{name:"url",title:"WSDL",width:"*",defaultValue:this.wsdlURL,editorType:(_1!=null?"ComboBoxItem":"TextItem"),autoComplete:(_1!=null?"smart":null),showAllOptions:true,textMatchStyle:"substring",valueMap:_1},{type:"submit",title:"Show Messages",startRow:false,colSpan:1,endRow:false,width:"*"},{showTitle:false,startRow:false,width:"*",formItemType:"pickTree",shouldSaveValue:false,buttonProperties:{unselectedTitle:"Download",itemSelected:function(_2){this.canvasItem.form.creator.download(_2.name);return false}},valueTree:isc.Tree.create({root:{name:"download",title:"Download",children:[{name:"js",title:"as JS"},{name:"xml",title:"as XML"}]}}),icons:[{src:"[SKIN]/actions/help.png",width:16,height:16,prompt:"You can use the <b>Download</b> feature to download a SmartClient"+" WebService definition for the specified WSDL file in either XML"+" or JS format.  <p>You can achieve the same result by calling"+" <i>XMLTools.loadWSDL()</i> or by using the <code>&lt;isomorphic"+":loadWSDL&gt;</code> JSP tag, however, for non-Java backends or"+" for production use, a .js file should be obtained from this"+" interface and loaded via &lt;SCRIPT SRC=&gt; either individually"+" or combined with other files.  <p>See the reference documentation"+" for details.",click:"isc.say(this.prompt)"}]}]},isc.DynamicForm);this.addMember(isc.VLayout.create({autoDraw:false,members:[isc.HLayout.create({autoDraw:false,members:[this.addAutoChild("treeGrid",{fields:[{treeField:true},{name:"type",title:"Type",width:140},{name:"maxOccurs",width:80}],nodeClick:function(_2,_3,_4){if(this.creator.showTestUI){this.creator.updateInputStack(_3)}},getIcon:function(_2){if(_2.type=="Operation")return this.creator.operationIcon;else if(_2.isComplexType)return this.creator.complexTypeIcon;else return this.creator.simpleTypeIcon}},isc.TreeGrid),isc.VLayout.create({visibility:(this.showTestUI?"inherit":"hidden"),members:[this.addAutoChild("inputStack",{overflow:"auto",visibilityMode:"multiple",autoDraw:false,sections:[{showHeader:true,title:"Input Message (Body)",items:[this.addAutoChild("inputBodyForm",{useFlatFields:true},isc.DynamicForm)]}]},isc.SectionStack),isc.IButton.create({creator:this,autoDraw:false,title:"Invoke",click:function(){this.creator.updateResponseTree()}})]})]}),this.addAutoChild("responseStack",{visibility:(this.showTestUI?"inherit":"hidden"),autoDraw:false,visibilityMode:"multiple",sections:[this.getResponseSectionConfig()]},isc.SectionStack)]}))},isc.A.download=function(_1){var _2=this.urlForm.getValue("url");if(!_2){isc.warn("Please type in a WSDL URL");return}var _3=_2.replace(/(.*\/)?(.*)/,"$2").replace(/(.*?)\?.*/,"$1").replace(/(.*)\..*/,"$1")+"."+_1;isc.DMI.callBuiltin({methodName:"downloadWSDL",arguments:[_2,_1,_3],requestParams:{showPrompt:false,useXmlHttpRequest:false,timeout:0}})},isc.A.fetchSchema=function(){var _1=this.urlForm.getValue("url");if(_1==null||_1=="")return;if(isc.WebService.get(_1))return this.fetchSchemaReply(isc.WebService.get(_1));isc.RPCManager.addClassProperties({defaultPrompt:"Loading WSDL Schema",showPrompt:true})isc.xml.loadWSDL(_1,this.getID()+".fetchSchemaReply(service)")},isc.A.fetchSchemaReply=function(_1){isc.RPCManager.addClassProperties({defaultPrompt:"Contacting Server..."});this.service=_1;delete this.operationName;var _2=isc.SchemaViewer.getTreeFromService(_1);this.treeGrid.setData(_2);this.clearInputStack();this.clearResponseTree()},isc.A.clearInputStack=function(){var _1=this.inputStack,_2=_1.sections.duplicate(),_3=[];for(var i=0;i<_2.length;i++){if(_2[i].isHeaderSection)_1.removeSection(_2[i])}this.inputBodyForm.hide();this.inputBodyForm.clearValues()},isc.A.updateInputStack=function(_1){this.clearInputStack();var _2=_1;while(_2.type!="Operation"){_2=this.treeGrid.data.getParent(_2)}if(!_2)return;var _3=_2.name;this.operationName=_3;var _4=this.service.getInputHeaderSchema(_3);if(_4!=null){var _5=0;for(var _6 in _4){var _7=_4[_6],_8;if(isc.isA.DataSource(_7)){_8=isc.DynamicForm.create({useFlatFields:true,dataSource:_7})}else{_8=isc.DynamicForm.create({$46m:true,fields:[_7]})}this.inputStack.addSection({showHeader:true,isHeaderSection:true,schemaName:_6,title:"Header: "+_6,items:[_8]},_5);_5+=1}}var _9=this.service.getInputDS(_3);this.inputBodyForm.setDataSource(_9);if(!this.inputBodyForm.isVisible())this.inputBodyForm.show()},isc.A.updateResponseTree=function(){if(this.operationName==null)return;var _1=this.inputBodyForm.getValues(),_2,_3=this.service;for(var i=0;i<this.inputStack.sections.length;i++){var _5=this.inputStack.sections[i];if(!_5.isHeaderSection)continue;if(_2==null)_2={};var _6=_5.items[0];if(_6.$46m){_2[_5.schemaName]=_6.getValue(_6.getItem(0))}else{_2[_5.schemaName]=_6.getValues()}}if(this.logIsDebugEnabled())this.logDebug("operation:"+this.operationName+", body params:"+this.echoAll(_1)+", headerParams:"+this.echoAll(_2));_3.callOperation(this.operationName,_1,null,this.getID()+".setResponseTreeDoc(xmlDoc, rpcResponse, wsRequest)",{willHandleError:true,headerData:_2,useFlatFields:true,useFlatHeaderFields:true})},isc.A.getResponseSectionConfig=function(){return{expanded:true,title:"Service Response",headerControls:[isc.LayoutSpacer.create(),isc.IButton.create({width:200,title:"Generate Sample Response",creator:this,click:function(){if(!this.creator.operationName)return;var _1=this.creator.service.getSampleResponse(this.creator.operationName);_1=isc.XMLTools.parseXML(_1);this.creator.setResponseTreeDoc(_1);this.creator.responseStack.setSectionTitle(0,"Service Response [Generated Sample]");return false},height:16,layoutAlign:"center",extraSpace:4,autoDraw:false}),isc.IButton.create({width:200,title:"Generate Sample Request",creator:this,click:function(){if(!this.creator.operationName)return;var _1=this.creator.service.getSampleRequest(this.creator.operationName);_1=isc.XMLTools.parseXML(_1);this.creator.showSampleRequest(_1);return false},height:16,layoutAlign:"center",extraSpace:4,autoDraw:false})],items:[]}},isc.A.setResponseTreeDoc=function(_1,_2,_3){if(_2&&_2.status<0){var _4;if(_2.httpResponseCode==500){_4=_1.selectNodes("//faultstring");if(_4!=null)_4=isc.XML.toJS(_4);if(_4.length==0)_4=null}if(_4){isc.warn("<b>Server Returned HTTP Code 500 (Internal Error)</b>"+(_4&&_4.length>0?("<br><br>"+_4.join("<br>")):""))}else{isc.RPCManager.handleError(_2,_3)}return}this.logInfo("showing a tree response");if(this.logIsDebugEnabled())this.logDebug("response data:"+this.echoAll(_1));this.clearSampleRequest();this.xmlDoc=_1;var _5=isc.DOMTree.create({rootElement:_1.documentElement});if(this.responseTree){this.responseTree.setData(_5)}else{this.addAutoChild("responseTree",{data:_5},isc.DOMGrid)}if(!this.showingResponseTree){this.responseStack.removeSection(0);this.responseStack.addSection(isc.addProperties(this.getResponseSectionConfig(),{items:[this.responseTree]}),0)}this.showingResponseTree=true},isc.A.clearResponseTree=function(){this.clearSampleRequest();if(!this.showingResponseTree)return;this.responseStack.removeSection(0);this.responseStack.addSection(this.getResponseSectionConfig())delete this.showingResponseTree},isc.A.showSampleRequest=function(_1){this.logInfo("showing a sample request");if(this.logIsDebugEnabled())this.logDebug("sample request data:"+this.echoAll(_1));var _2=isc.DOMTree.create({rootElement:_1.documentElement});if(!this.showingSampleRequest){this.responseStack.addSection({isSampleRequest:true,expanded:true,resizable:true,title:"Generated Sample Service Request",items:[this.addAutoChild("requestTree",{data:_2},isc.DOMGrid)]})}else{this.requestTree.setData(_2)}this.showingSampleRequest=true},isc.A.clearSampleRequest=function(){if(this.showingSampleRequest){for(var i=0;i<this.responseStack.sections.length;i++){if(this.responseStack.sections[i].isSampleRequest){this.responseStack.removeSection(i);break}}}delete this.showingSampleRequest});isc.B._maxIndex=isc.C+15;isc._moduleEnd=isc._Tools_end=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc.Log&&isc.Log.logIsInfoEnabled('loadTime'))isc.Log.logInfo('Tools module init time: ' + (isc._moduleEnd-isc._moduleStart) + 'ms','loadTime');}else{if(window.isc && isc.Log && isc.Log.logWarn)isc.Log.logWarn("Duplicate load of module 'Tools'.");}/*  SmartClient Ajax RIA system  Version 6.5/LGPL Development Only (2008-04-30)  Copyright 2000-2007 Isomorphic Software, Inc. All rights reserved.  "SmartClient" is a trademark of Isomorphic Software, Inc.  LICENSE NOTICE     INSTALLATION OR USE OF THIS SOFTWARE INDICATES YOUR ACCEPTANCE OF THE     SOFTWARE EVALUATION LICENSE AGREEMENT. If you have received this file     without an Isomorphic Software license file, please see:         http://www.isomorphic.com/licenses/isc_eval_license_050316.html     You are not required to accept this agreement, however, nothing else     grants you the right to copy or use this software. Unauthorized copying     and use of this software is a violation of international copyright law.  EVALUATION ONLY     This software is provided for limited evaluation purposes only. You must     acquire a deployment license from Isomorphic Software in order to use     the SmartClient system, or any portion thereof, in any non-evaluation     application, including internal or non-commercial applications.  PROPRIETARY & PROTECTED MATERIAL     This software contains proprietary materials that are protected by     contract and intellectual property law. YOU ARE EXPRESSLY PROHIBITED     FROM ATTEMPTING TO REVERSE ENGINEER THIS SOFTWARE OR MODIFY THIS     SOFTWARE FOR HUMAN READABILITY.  CONTACT ISOMORPHIC     For more information regarding license rights and restrictions, or to     report possible license violations, please contact Isomorphic Software     by email (licensing@isomorphic.com) or web (www.isomorphic.com).*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -