{"hidden":false,"children":[{"configs":{"itemId":"module","serverMethod":"com.wb.interact.Install.checkInstall","loginRequired":"false"},"expanded":true,"children":[{"configs":{"layout":"fit","itemId":"viewport1"},"expanded":true,"children":[{"configs":{"layout":"anchor","itemId":"container1","padding":"10","autoScroll":"true"},"expanded":true,"children":[{"configs":{"itemId":"descComp","width":"470","html":"<p>提示：本模块仅支持兼容于Tomcat和部分常用数据库的JNDI数据源创建，其他Web应用服务器和数据库的JNDI数据源创建请参考各自的配置文档。<\/p>"},"expanded":false,"children":[],"type":"comp"},{"configs":{"layout":"fit","itemId":"fieldset1","width":"470","title":"JNDI 数据源创建"},"expanded":true,"children":[{"configs":{"layout":"absolute","itemId":"operCon","width":"440","autoScroll":"true","height":"288"},"expanded":true,"children":[{"configs":{"allowBlank":"false","itemId":"dbType","labelAlign":"right","pickList":"[\n  ['m', 'MySQL'],\n  ['o', 'Oracle'],\n  ['s', 'SQL Server']\n]","editable":"false","fieldLabel":"数据库类型","width":"400","x":"16","y":"16","height":"22"},"expanded":false,"children":[],"type":"combo"},{"configs":{"allowBlank":"false","itemId":"jndi","labelAlign":"right","fieldLabel":"JNDI名称","validator":"if (app.jndi.getValue().indexOf('/') != -1)\n  return 'JNDI名称不允许包含\u201c/\u201d，有效值如：mydb';\nelse return true;","width":"200","x":"16","y":"48","height":"22"},"expanded":false,"children":[],"type":"text","events":{"change":"app.fullJndi.setValue('java:comp/env/jdbc/' + newValue);"}},{"configs":{"itemId":"fullJndi","width":"192","x":"224","y":"48","readOnly":"true","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"allowBlank":"false","itemId":"ip","labelAlign":"right","fieldLabel":"数据库IP","width":"400","x":"16","y":"80","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"allowBlank":"false","itemId":"port","labelAlign":"right","fieldLabel":"数据库端口","width":"400","x":"16","y":"112","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"allowBlank":"false","itemId":"dbname","labelAlign":"right","fieldLabel":"数据库名称","width":"400","x":"16","y":"144","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"allowBlank":"false","itemId":"username","labelAlign":"right","fieldLabel":"数据库用户名","width":"400","x":"16","y":"176","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"allowBlank":"false","itemId":"password","labelAlign":"right","fieldLabel":"数据库密码","width":"400","x":"16","y":"208","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"itemId":"createBtn","width":"88","x":"232","y":"248","text":"创建JNDI","height":"22"},"expanded":false,"children":[],"type":"button","events":{"click":"if (!Wb.verify(app.operCon))\n  return;\n\nfunction doCreate(overwrite) {\n  Wb.request({\n    url: 'm?xwl=sys/service/install/generate-jndi',\n    out: app.viewport1,\n    params: {\n      overwrite: overwrite\n    },\n    showError: false,\n    success: function(resp) {\n      Wb.info('已经创建JNDI数据源。请不要关闭本页面，并在重启Tomcat后点击[测试连接]按钮测试JNDI有效性。');\n    },\n    failure: function(resp) {\n      var msg = resp.responseText,\n        errMsg = Wb.getError(msg, 106);\n      if (errMsg) {\n        Wb.confirm(errMsg, function() {\n          doCreate(true);\n        });\n      } else\n        Wb.except(resp);\n    }\n  });\n}\ndoCreate(false);"}},{"configs":{"itemId":"testBtn","width":"88","x":"328","y":"248","text":"测试连接","height":"22"},"expanded":false,"children":[],"type":"button","events":{"click":" Wb.request({\n   url: 'm?xwl=sys/service/install/test-jndi',\n   showError: false,\n   timeout: -1,\n   params: {\n     jndi: 'java:comp/env/jdbc/' + app.jndi.getValue()\n   },\n   failure: function(resp) {\n     Wb.error('连接数据库失败，请确认JNDI是否已经被创建，并在检查配置后再试一次。<br>' + Wb.encodeHtml(resp.responseText));\n   },\n   success: function() {\n     Wb.info('连接数据库成功。JNDI全名为：java:comp/env/jdbc/' + app.jndi.getValue());\n   }\n });"}}],"type":"container"}],"type":"fieldset"}],"type":"container"}],"type":"viewport","events":{"afterrender":"viewport.mon(viewport.el, 'keydown', function(e) {\n  if (e.getKey() == e.ENTER) {\n    app.createBtn.fireEvent('click');\n  }\n});"}}],"type":"module"}],"roles":{"default":1},"title":"创建JNDI","iconCls":"","inframe":false,"pageLink":""}