Main.js 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654
  1. MWF.xApplication.AppCenter = MWF.xApplication.AppCenter || {};
  2. MWF.xDesktop.requireApp("AppCenter", "lp."+MWF.language, null, false);
  3. MWF.xApplication.AppCenter.Main = new Class({
  4. Extends: MWF.xApplication.Common.Main,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "name": "AppCenter",
  9. "icon": "icon.png",
  10. "width": "1000",
  11. "height": "700",
  12. "title": MWF.xApplication.AppCenter.LP.title
  13. },
  14. onQueryLoad: function(){
  15. this.lp = MWF.xApplication.AppCenter.LP;
  16. this.actions = MWF.Actions.get("x_program_center");
  17. },
  18. loadApplication: function(callback){
  19. this.components = [];
  20. //this.node = new Element("div", {"styles": {"width": "100%", "height": "100%", "overflow": "hidden"}}).inject(this.content);
  21. this.loadTitle();
  22. this.contentNode = new Element("div", {"styles": this.css.contentNode}).inject(this.content);
  23. this.contentModuleArea = new Element("div", {"styles": this.css.contentModuleArea}).inject(this.contentNode);
  24. this.setContentSize();
  25. this.addEvent("resize", this.setContentSize);
  26. this.loadModuleContent();
  27. },
  28. loadTitle: function(){
  29. this.titleBar = new Element("div", {"styles": this.css.titleBar}).inject(this.content);
  30. if (MWF.AC.isProcessPlatformCreator()){
  31. this.createApplicationNode = new Element("div", {
  32. "styles": this.css.createApplicationNode,
  33. "title": this.lp.export
  34. }).inject(this.titleBar);
  35. this.createApplicationNode.addEvent("click", function(){
  36. this.createApplication();
  37. }.bind(this));
  38. this.importApplicationNode = new Element("div", {
  39. "styles": this.css.setupApplicationNode,
  40. "title": this.lp.setup
  41. }).inject(this.titleBar);
  42. this.importApplicationNode.addEvent("click", function(){
  43. this.implodeLocal();
  44. }.bind(this));
  45. }
  46. this.taskTitleTextNode = new Element("div", {"styles": this.css.titleTextNode,"text": this.lp.title}).inject(this.titleBar);
  47. },
  48. implodeLocal: function(){
  49. if (!this.uploadFileAreaNode){
  50. this.uploadFileAreaNode = new Element("div");
  51. var html = "<input name=\"file\" type=\"file\" accept=\".xapp\"/>";
  52. this.uploadFileAreaNode.set("html", html);
  53. this.fileUploadNode = this.uploadFileAreaNode.getFirst();
  54. this.fileUploadNode.addEvent("change", this.implodeLocalFile.bind(this));
  55. }else{
  56. if (this.fileUploadNode) this.fileUploadNode.destroy();
  57. this.uploadFileAreaNode.empty();
  58. var html = "<input name=\"file\" type=\"file\" accept=\".xapp\"/>";
  59. this.uploadFileAreaNode.set("html", html);
  60. this.fileUploadNode = this.uploadFileAreaNode.getFirst();
  61. this.fileUploadNode.addEvent("change", this.implodeLocalFile.bind(this));
  62. }
  63. this.fileUploadNode.click();
  64. },
  65. implodeLocalFile: function(){
  66. var files = this.fileUploadNode.files;
  67. if (files.length){
  68. var file = files[0];
  69. var position = this.titleBar.getPosition(this.content);
  70. var size = this.contentNode.getSize();
  71. var width = size.x*0.9;
  72. if (width>600) width = 600;
  73. var height = size.y*0.9;
  74. var x = (size.x-width)/2;
  75. var y = (size.y-height)/2;
  76. var setupModule = null;
  77. MWF.require("MWF.xDesktop.Dialog", function(){
  78. var dlg = new MWF.xDesktop.Dialog({
  79. "title": this.lp.setupTitle,
  80. "style": "appMarket",
  81. "top": y+20,
  82. "left": x,
  83. "fromTop":position.y,
  84. "fromLeft": position.x,
  85. "width": width,
  86. "height": height,
  87. "html": "",
  88. "maskNode": this.content,
  89. "container": this.content,
  90. "buttonList": [
  91. {
  92. "text": this.lp.ok,
  93. "action": function(){
  94. if (setupModule) setupModule.setup();
  95. this.close();
  96. }
  97. },
  98. {
  99. "text": this.lp.cancel,
  100. "action": function(){this.close();}
  101. }
  102. ]
  103. });
  104. dlg.show();
  105. setupModule = new MWF.xApplication.AppCenter.Module.SetupLocal(file, dlg, this);
  106. }.bind(this));
  107. }
  108. },
  109. setContentSize: function(){
  110. var size = this.content.getSize();
  111. var titleSize = this.titleBar.getSize();
  112. var height = size.y-titleSize.y;
  113. this.contentNode.setStyles({"height": ""+height+"px", "overflow": "auto"});
  114. var max = size.x*0.98;
  115. var n = (size.x/320).toInt();
  116. var x = n*320;
  117. while (x>max){
  118. n--;
  119. x = n*320;
  120. }
  121. this.contentModuleArea.setStyle("width", ""+x+"px");
  122. },
  123. loadModuleContent: function(){
  124. this.actions.listStructure(function(json){
  125. this.moduleList = json.data;
  126. if (this.moduleList.length){
  127. this.moduleList.each(function(module){
  128. new MWF.xApplication.AppCenter.Module(this, module);
  129. }.bind(this));
  130. }else{
  131. this.createEmptyElement();
  132. }
  133. }.bind(this));
  134. },
  135. createEmptyElement: function(){
  136. this.emptyNode = new Element("div", {"styles": this.css.emptyNode}).inject(this.contentModuleArea);
  137. if (MWF.AC.isProcessPlatformCreator()){
  138. this.emptyNode.set("text", this.lp.emptyModuleManagerInfo);
  139. this.emptyNode.addEvent("click", function(){
  140. this.createApplication();
  141. }.bind(this));
  142. }else{
  143. this.emptyNode.set("text", this.lp.emptyModuleInfo);
  144. }
  145. },
  146. createApplication: function(target,id){
  147. if(id) this.curAppId = id;
  148. if(target) this.content = target;
  149. new MWF.xApplication.AppCenter.Exporter(this);
  150. }
  151. });
  152. MWF.xApplication.AppCenter.Module = new Class({
  153. initialize: function(app, data){
  154. this.app = app;
  155. this.data = data;
  156. this.json = JSON.decode(this.data.data);
  157. this.json.structure = this.data.id;
  158. this.lp = this.app.lp;
  159. this.css = this.app.css;
  160. this.content = this.app.contentModuleArea;
  161. this.load();
  162. },
  163. load: function(){
  164. this.node = new Element("div", {"styles": this.css.moduleNode}).inject(this.content);
  165. this.iconNode = new Element("div", {"styles": this.css.moduleIconNode}).inject(this.node);
  166. this.contentNode = new Element("div", {"styles": this.css.moduleContentNode}).inject(this.node);
  167. this.nameNode = new Element("div", {"styles": this.css.moduleNameNode}).inject(this.contentNode);
  168. this.categoryNode = new Element("div", {"styles": this.css.moduleCategoryNode}).inject(this.contentNode);
  169. this.descriptionNode = new Element("div", {"styles": this.css.moduleDescriptionNode}).inject(this.contentNode);
  170. this.actionNode = new Element("div", {"styles": this.css.moduleActionNode}).inject(this.contentNode);
  171. this.viewActionNode = new Element("div", {"styles": this.css.moduleActionNode}).inject(this.contentNode);
  172. this.deleteActionNode = new Element("div", {"styles": this.css.moduleDeleteActionNode}).inject(this.contentNode);
  173. this.deleteActionNode.set("text", this.lp.delete);
  174. this.nameNode.set("text", this.data.name);
  175. this.categoryNode.set("text", this.data.createTime);
  176. this.descriptionNode.set("text", this.data.description);
  177. this.actionNode.set("text", this.lp.output);
  178. this.viewActionNode.set("text", this.lp.outputView);
  179. this.viewActionNode.setStyle("margin-left", "10px");
  180. this.loadEvent();
  181. },
  182. loadEvent: function(){
  183. this.actionNode.addEvent("click", function(e){
  184. var uri = this.app.actions.action.actions["download"].uri;
  185. uri = uri.replace("{flag}", this.json.structure);
  186. window.open(o2.filterUrl(this.app.actions.action.address+uri));
  187. }.bind(this));
  188. this.viewActionNode.addEvent("click", function(e){
  189. this.outputApp();
  190. e.stopPropagation();
  191. }.bind(this));
  192. this.node.addEvent("click", function(){
  193. this.openApp();
  194. }.bind(this));
  195. var _self = this;
  196. this.deleteActionNode.addEvent("click",function (e) {
  197. this.app.confirm("warn", e, "tip", "confirm delete?", 300, 120, function(){
  198. this.structureRes = _self.app.actions.removeStructure(_self.json.structure,function(json){
  199. _self.app.notice("success");
  200. _self.node.destroy();
  201. }.bind(this));
  202. this.close();
  203. }, function(){
  204. this.close();
  205. }, null);
  206. }.bind(this));
  207. },
  208. outputApp: function(){
  209. new MWF.xApplication.AppCenter.Exporter(this.app, this.json)
  210. },
  211. openApp: function(){
  212. }
  213. });
  214. MWF.xApplication.AppCenter.Exporter = new Class({
  215. initialize: function(app, selectData){
  216. this.app = app;
  217. this.lp = this.app.lp;
  218. this.css = this.app.css;
  219. this.structure = null;
  220. this.dlg = null;
  221. this.selectData = selectData || {
  222. "structure": "",
  223. "name": "",
  224. "description": "",
  225. "processPlatformList": [],
  226. "portalList": [],
  227. "queryList": [],
  228. "serviceModuleList": [],
  229. "cmsList": []
  230. };
  231. this.setp = 1;
  232. this.load();
  233. },
  234. loadStructure: function(){
  235. this.structureRes = this.app.actions.outputStructure(function(json){
  236. if(this.app.curAppId){
  237. var cmsList = json.data.cmsList;
  238. var portalList = json.data.portalList;
  239. var processPlatformList = json.data.processPlatformList;
  240. var queryList = json.data.queryList;
  241. var serviceModuleList = json.data.serviceModuleList;
  242. var curAppData = {
  243. "portalList":[],
  244. "cmsList":[],
  245. "processPlatformList":[],
  246. "queryList":[],
  247. "serviceModuleList":[]
  248. };
  249. cmsList.each(function (cms) {
  250. if(cms.id===this.app.curAppId) {
  251. curAppData.cmsList.push(cms);
  252. }
  253. }.bind(this));
  254. portalList.each(function (portal) {
  255. if(portal.id === this.app.curAppId){
  256. curAppData.portalList.push(portal);
  257. }
  258. }.bind(this));
  259. processPlatformList.each(function (processPlatform) {
  260. if(processPlatform.id===this.app.curAppId){
  261. curAppData.processPlatformList.push(processPlatform)
  262. }
  263. }.bind(this));
  264. queryList.each(function (query) {
  265. if(query.id===this.app.curAppId) {
  266. curAppData.queryList.push(query);
  267. }
  268. }.bind(this));
  269. serviceModuleList.each(function (service) {
  270. if(service.id===this.app.curAppId) {
  271. curAppData.serviceModuleList.push(service);
  272. }
  273. }.bind(this));
  274. this.structure = curAppData;
  275. }else{
  276. this.structure = json.data;
  277. }
  278. this.createContent();
  279. }.bind(this));
  280. },
  281. showDlg: function(callback){
  282. var position = this.app.createApplicationNode.getPosition(this.app.content);
  283. var size = this.app.content.getSize();
  284. var width = size.x*0.9;
  285. if (width>600) width = 600;
  286. var height = size.y*0.8;
  287. var x = (size.x-width)/2;
  288. var y = (size.y-height)/2;
  289. if (y<80) y = 80;
  290. var _self = this;
  291. MWF.require("MWF.xDesktop.Dialog", function(){
  292. this.dlg = new MWF.xDesktop.Dialog({
  293. "title": this.lp.exportTitle,
  294. "style": "appCenter",
  295. "top": y+20,
  296. "left": x,
  297. "fromTop":position.y,
  298. "fromLeft": position.x,
  299. "width": width,
  300. "height": height,
  301. "html": "",
  302. "maskNode": this.app.content,
  303. "container": this.app.content,
  304. "buttonList": [
  305. {
  306. "text": this.lp.next,
  307. "action": function(){
  308. _self.next();
  309. //this.close();
  310. }
  311. },
  312. {
  313. "text": this.lp.prev,
  314. "action": function(){
  315. _self.prev();
  316. //this.close();
  317. }
  318. },
  319. {
  320. "text": this.lp.ok,
  321. "action": function(){
  322. _self.output();
  323. //this.close();
  324. }
  325. },
  326. {
  327. "text": this.lp.cancel,
  328. "action": function(){
  329. this.close();
  330. if (_self.structureRes){
  331. if (_self.structureRes.isRunning()){_self.structureRes.cancel();}
  332. _self.structureRes = null;
  333. }
  334. }
  335. }
  336. ],
  337. "onPostShow": function(){
  338. if (callback) callback();
  339. }.bind(this),
  340. "onPostClose": function() {
  341. if(_self.app){
  342. _self.app.fireEvent("exporterClose");
  343. }
  344. MWF.release(_self);
  345. }
  346. });
  347. this.dlg.show();
  348. }.bind(this));
  349. },
  350. checkInput: function(){
  351. var name = this.moduleNameInput.get("value");
  352. var category = this.moduleCategoryInput.get("value");
  353. var description = this.moduleDescriptionInput.get("value");
  354. if (!name){
  355. this.app.notice(this.lp.noNameError, "error");
  356. return false;
  357. }
  358. if (!this.selectData.processPlatformList.length &&
  359. !this.selectData.portalList.length &&
  360. !this.selectData.queryList.length &&
  361. !this.selectData.serviceModuleList.length &&
  362. !this.selectData.cmsList.length){
  363. this.app.notice(this.lp.noModuleError, "error");
  364. return false;
  365. }
  366. this.selectData.name = name;
  367. this.selectData.category = category;
  368. this.selectData.description = description;
  369. return true;
  370. },
  371. next: function(){
  372. if (this.setp==1){
  373. if (this.checkInput()) this.showStatus();
  374. }
  375. },
  376. prev: function(){
  377. if (this.step==2){
  378. if (this.statusContentNode){
  379. this.statusContentNode.destroy();
  380. this.statusContentNode = null;
  381. }
  382. this.contentNode.setStyle("display", "block");
  383. this.okBut.setStyle("display", "none");
  384. this.prevBut.setStyle("display", "nonde");
  385. this.nextBut.setStyle("display", "inline");
  386. }
  387. },
  388. output: function(){
  389. if (this.step==2){
  390. if (this.checkInput()){
  391. MWF.require("o2.widget.Mask", function(){
  392. this.mask = new o2.widget.Mask();
  393. this.mask.loadNode(this.dlg.node);
  394. this.app.actions.output(this.selectData, function(json){
  395. var uri = this.app.actions.action.actions["download"].uri;
  396. uri = uri.replace("{flag}", json.data.flag);
  397. if (this.mask) this.mask.hide();
  398. this.dlg.close();
  399. window.open(o2.filterUrl(this.app.actions.action.address+uri));
  400. this.app.fireEvent("exporterClose");
  401. MWF.release(this);
  402. }.bind(this), function(xhr, text, error){
  403. if (xhr.status!=0){
  404. var errorText = error;
  405. if (xhr){
  406. var json = JSON.decode(xhr.responseText);
  407. if (json){
  408. errorText = json.message.trim() || "request json error";
  409. }else{
  410. errorText = "request json error: "+xhr.responseText;
  411. }
  412. }
  413. MWF.xDesktop.notice("error", {x: "right", y:"top"}, errorText);
  414. }
  415. if (this.mask) this.mask.hide();
  416. }.bind(this));
  417. }.bind(this));
  418. }
  419. }
  420. },
  421. showStatus: function(){
  422. this.statusContentNode = new Element("div", {"styles": this.css.moduleSelectContentAreaNode}).inject(this.contentNode, "after");
  423. this.statusTitleNode = new Element("div", {"styles": this.css.moduleSelectTitleNode, "text": this.lp.selected}).inject(this.statusContentNode);
  424. this.statusInfoNode = new Element("div", {"styles": this.css.moduleSelectContentNode}).inject(this.statusContentNode);
  425. var size = this.contentNode.getSize();
  426. var position = this.contentNode.getPosition(this.contentNode.getOffsetParent());
  427. var css = {
  428. "height": ""+size.y+"px",
  429. "width": ""+size.x+"px",
  430. "top": ""+position.y+"px",
  431. "left": ""+position.x+"px",
  432. "background-color": "#eeeeee"
  433. };
  434. this.statusContentNode.setStyles(css);
  435. var titleSize = this.statusTitleNode.getSize();
  436. var h = size.y-titleSize.y-20;
  437. this.statusInfoNode.setStyle("height", ""+h+"px");
  438. this.showStatusList();
  439. this.contentNode.setStyle("display", "none");
  440. this.okBut.setStyle("display", "inline");
  441. this.prevBut.setStyle("display", "inline");
  442. this.nextBut.setStyle("display", "none");
  443. this.step = 2;
  444. },
  445. showStatusList: function(){
  446. this.showStatusItemList("processPlatformList", ["processList", "formList", "applicationDictList", "scriptList", "fileList"]);
  447. this.showStatusItemList("portalList", ["pageList", "scriptList", "widgetList", "fileList"]);
  448. this.showStatusItemList("cmsList", ["categoryInfoList", "formList", "appDictList", "scriptList"]);
  449. this.showStatusItemList("queryList", ["viewList", "statList", "revealList", "tableList", "statementList"]);
  450. this.showStatusItemList("serviceModuleList", ["agentList", "invokeList"]);
  451. },
  452. showStatusItemList: function(listName, subList){
  453. this.selectData[listName].each(function(app){
  454. new Element("div", {"styles": this.css.moduleStatusInforNode1, "text": "["+this.lp[listName]+"] "+(app.name || app.appName)}).inject(this.statusInfoNode);
  455. subList.each(function(name){
  456. if (app[name] && app[name].length) app[name].each(function(process){
  457. new Element("div", {"styles": this.css.moduleStatusInforNode2, "text": "["+this.lp[name]+"] "+(process.name || process.categoryName)}).inject(this.statusInfoNode);
  458. }.bind(this));
  459. }.bind(this));
  460. }.bind(this));
  461. },
  462. load: function(){
  463. this.showDlg(function(){
  464. this.createLayout();
  465. this.loadStructure();
  466. }.bind(this));
  467. },
  468. createLayout: function(){
  469. this.nextBut = this.dlg.button.getFirst("input");
  470. this.prevBut = this.nextBut.getNext("input");
  471. this.okBut = this.prevBut.getNext("input");
  472. if (this.setp==1){
  473. this.okBut.setStyle("display", "none");
  474. this.prevBut.setStyle("display", "none");
  475. }
  476. this.node = new Element("div", {"styles": this.css.moduleSetupContentNode}).inject(this.dlg.content);
  477. this.titleNode = new Element("div", {"styles": this.css.moduleSetupTitleNode}).inject(this.node);
  478. var iconNode = new Element("div", {"styles": this.css.moduleIconNode}).inject(this.titleNode);
  479. var contentNode = new Element("div", {"styles": this.css.moduleSetupTitleContentNode}).inject(this.titleNode);
  480. var nameNode = new Element("div", {"styles": this.css.moduleSetupNameNode}).inject(contentNode);
  481. var categoryNode = new Element("div", {"styles": this.css.moduleSetupCategoryNode}).inject(contentNode);
  482. categoryNode.hide();
  483. var descriptionNode = new Element("div", {"styles": this.css.moduleSetupDescriptionNode}).inject(contentNode);
  484. var nameTitleNode = new Element("div", {"styles": this.css.moduleInputTitleNode, "text": this.lp.moduleName}).inject(nameNode);
  485. var nameContentNode = new Element("div", {"styles": this.css.moduleInputContentNode}).inject(nameNode);
  486. this.moduleNameInput = new Element("input", {"styles": this.css.moduleInputNode}).inject(nameContentNode);
  487. var categoryTitleNode = new Element("div", {"styles": this.css.moduleInputTitleNode, "text": this.lp.moduleCategory}).inject(categoryNode);
  488. var categoryContentNode = new Element("div", {"styles": this.css.moduleInputContentNode}).inject(categoryNode);
  489. this.moduleCategoryInput = new Element("input", {"styles": this.css.moduleInputNode}).inject(categoryContentNode);
  490. var descriptionTitleNode = new Element("div", {"styles": this.css.moduleInputTitleNode, "text": this.lp.moduleDescription}).inject(descriptionNode);
  491. var descriptionContentNode = new Element("div", {"styles": this.css.moduleInputContentNode}).inject(descriptionNode);
  492. this.moduleDescriptionInput = new Element("input", {"styles": this.css.moduleInputNode}).inject(descriptionContentNode);
  493. this.moduleNameInput.set("value", this.selectData.name);
  494. this.moduleCategoryInput.set("value", this.selectData.category);
  495. this.moduleDescriptionInput.set("value", this.selectData.description);
  496. this.contentNode = new Element("div", {"styles": this.css.moduleSetupCompareContentNode}).inject(this.node);
  497. this.setListContentSize();
  498. this.createLoading(this.contentNode);
  499. },
  500. setListContentSize: function(){
  501. var size = this.dlg.content.getSize();
  502. var h = size.y;
  503. var titleH = this.titleNode.getSize().y+10;
  504. var contentH = h-titleH-10;
  505. this.contentNode.setStyle("height", ""+contentH+"px");
  506. },
  507. createLoading: function(node){
  508. //this.okBut.setStyle("display", "none");
  509. this.nextBut.setStyle("display", "none");
  510. this.loadingAreaNode = new Element("div", {"styles": this.css.moduleLoadingAreaNode}).inject(node);
  511. var img = new Element("img", {
  512. "styles": this.css.moduleLoadingImgNode,
  513. "src": this.app.path+this.app.options.style+"/icon/loading.gif"
  514. }).inject(this.loadingAreaNode);
  515. },
  516. clearLoading: function(){
  517. if (this.loadingAreaNode){
  518. this.loadingAreaNode.destroy();
  519. this.loadingAreaNode = null;
  520. }
  521. //this.okBut.setStyle("display", "inline");
  522. this.nextBut.setStyle("display", "inline");
  523. },
  524. createContent: function(){
  525. this.clearLoading();
  526. this.createListArea();
  527. this.loadProcessList();
  528. this.loadPortalList();
  529. this.loadCMSList();
  530. this.loadQueryList();
  531. this.loadServiceList();
  532. //this.structure
  533. },
  534. createListArea: function(){
  535. this.contentAreaNode = new Element("div").inject(this.contentNode);
  536. // this.contentInforNode = new Element("div", {"styles": this.css.moduleSetupContentInforNode, "text": this.lp.selectModules}).inject(this.contentAreaNode);
  537. // //this.processArea = new Element("div", {"styles": this.css.moduleSetupListAreaNode}).inject(this.contentNode);
  538. //
  539. // this.listAreaNode = new Element("div").inject(this.contentAreaNode);
  540. this.processAreaTitle = new Element("div", {"styles": this.css.moduleSetupListAreaTitleNode, "text": this.lp.process}).inject(this.contentAreaNode);
  541. this.processAreaContent = new Element("div", {"styles": this.css.moduleSetupListAreaContentNode}).inject(this.contentAreaNode);
  542. this.portalAreaTitle = new Element("div", {"styles": this.css.moduleSetupListAreaTitleNode, "text": this.lp.portal}).inject(this.contentAreaNode);
  543. this.portalAreaContent = new Element("div", {"styles": this.css.moduleSetupListAreaContentNode}).inject(this.contentAreaNode);
  544. this.cmsAreaTitle = new Element("div", {"styles": this.css.moduleSetupListAreaTitleNode, "text": this.lp.cms}).inject(this.contentAreaNode);
  545. this.cmsAreaContent = new Element("div", {"styles": this.css.moduleSetupListAreaContentNode}).inject(this.contentAreaNode);
  546. this.queryAreaTitle = new Element("div", {"styles": this.css.moduleSetupListAreaTitleNode, "text": this.lp.query}).inject(this.contentAreaNode);
  547. this.queryAreaContent = new Element("div", {"styles": this.css.moduleSetupListAreaContentNode}).inject(this.contentAreaNode);
  548. this.serviceAreaTitle = new Element("div", {"styles": this.css.moduleSetupListAreaTitleNode, "text": this.lp.service}).inject(this.contentAreaNode);
  549. this.serviceAreaContent = new Element("div", {"styles": this.css.moduleSetupListAreaContentNode}).inject(this.contentAreaNode);
  550. },
  551. loadProcessList: function(){
  552. this.processListNodes = [];
  553. this.structure.processPlatformList.each(function(item){
  554. var postData = null;
  555. for (var i=0; i<this.selectData.processPlatformList.length; i++){
  556. if (this.selectData.processPlatformList[i].id == item.id){
  557. postData = this.selectData.processPlatformList[i];
  558. break;
  559. }
  560. }
  561. this.processListNodes.push(new MWF.xApplication.AppCenter.Exporter.ProcessElement(this, this.processAreaContent, item, postData));
  562. }.bind(this));
  563. },
  564. loadPortalList: function(){
  565. this.portalListNodes = [];
  566. this.structure.portalList.each(function(item){
  567. this.portalListNodes.push(new MWF.xApplication.AppCenter.Exporter.PortalElement(this, this.portalAreaContent, item));
  568. }.bind(this));
  569. },
  570. loadCMSList: function(){
  571. this.cmsListNodes = [];
  572. this.structure.cmsList.each(function(item){
  573. this.cmsListNodes.push(new MWF.xApplication.AppCenter.Exporter.CmsElement(this, this.cmsAreaContent, item));
  574. }.bind(this));
  575. },
  576. loadQueryList: function(){
  577. this.queryListNodes = [];
  578. this.structure.queryList.each(function(item){
  579. this.queryListNodes.push(new MWF.xApplication.AppCenter.Exporter.QueryElement(this, this.queryAreaContent, item));
  580. }.bind(this));
  581. },
  582. loadServiceList: function(){
  583. this.serviceListNodes = [];
  584. this.structure.serviceModuleList.each(function(item){
  585. this.serviceListNodes.push(new MWF.xApplication.AppCenter.Exporter.ServiceElement(this, this.serviceAreaContent, item));
  586. }.bind(this));
  587. }
  588. });
  589. MWF.xApplication.AppCenter.Exporter.Element = new Class({
  590. initialize: function(exporter, content, data, postData){
  591. this.exporter = exporter;
  592. this.app = this.exporter.app;
  593. this.data = data;
  594. this.lp = this.app.lp;
  595. this.css = this.app.css;
  596. this.content = content;
  597. this.initPostData(postData);
  598. //this.selectStatus = selectStatus || "none";
  599. this.load();
  600. },
  601. initPostData: function(postData){
  602. this.postData = postData || {
  603. "id": this.data.id,
  604. "name": this.data.name || this.data.appName,
  605. "alias": this.data.alias,
  606. "description": this.data.description,
  607. "processList": [],
  608. "formList": [],
  609. "applicationDictList": [],
  610. "scriptList": [],
  611. "fileList": []
  612. };
  613. },
  614. load: function(){
  615. this.contentNode = new Element("div", {"styles": this.css.moduleSetupListContentNode}).inject(this.content);
  616. this.iconNode = new Element("div", {"styles": this.css.moduleSetupListIconNode}).inject(this.contentNode);
  617. this.actionNode = new Element("div", {"styles": this.css.moduleSetupListActionNode}).inject(this.contentNode);
  618. this.inforNode = new Element("div", {"styles": this.css.moduleSetupListInforNode}).inject(this.contentNode);
  619. this.nameNode = new Element("div", {"styles": this.css.moduleSetupListNameNode}).inject(this.contentNode);
  620. this.nameNode.set(this.getNameContent());
  621. // switch (this.selectStatus){
  622. // case "all":
  623. // this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_all.png) center center no-repeat");
  624. // break;
  625. // case "part":
  626. // this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_part.png) center center no-repeat");
  627. // break;
  628. // default:
  629. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_none.png) center center no-repeat");
  630. //}
  631. this.action = new Element("div", {"styles": this.css.moduleSelectActionNode, "text": this.lp.select}).inject(this.actionNode);
  632. this.setEvent();
  633. this.checkSelect(this.postData);
  634. },
  635. setEvent: function(){
  636. this.contentNode.addEvents({
  637. "mouseover": function(){this.contentNode.setStyles(this.css.moduleSetupListContentNode_over);}.bind(this),
  638. "mouseout": function(){this.contentNode.setStyles(this.css.moduleSetupListContentNode);}.bind(this)
  639. });
  640. this.iconNode.addEvent("click", this.selectAll.bind(this));
  641. this.action.addEvent("click", function(){
  642. this.selectElements();
  643. }.bind(this));
  644. this.nameNode.addEvent("click", function(){
  645. this.selectElements();
  646. }.bind(this));
  647. },
  648. selectAll: function(){
  649. var selectData = this.postData;
  650. if (selectData.processList.length || selectData.formList.length || selectData.applicationDictList.length || selectData.scriptList.length || selectData.fileList.length){
  651. if (selectData.processList.length===this.data.processList.length &&
  652. selectData.formList.length===this.data.formList.length &&
  653. selectData.applicationDictList.length===this.data.applicationDictList.length &&
  654. selectData.scriptList.length===this.data.scriptList.length &&
  655. selectData.fileList.length===this.data.fileList.length){
  656. selectData = {
  657. "processList": [],
  658. "formList": [],
  659. "applicationDictList": [],
  660. "scriptList": [],
  661. "fileList": []
  662. };
  663. }else{
  664. selectData = {
  665. "processList": this.data.processList,
  666. "formList": this.data.formList,
  667. "applicationDictList": this.data.applicationDictList,
  668. "scriptList": this.data.scriptList,
  669. "fileList": this.data.fileList
  670. };
  671. }
  672. }else{
  673. selectData = {
  674. "processList": this.data.processList,
  675. "formList": this.data.formList,
  676. "applicationDictList": this.data.applicationDictList,
  677. "scriptList": this.data.scriptList,
  678. "fileList": this.data.fileList
  679. };
  680. }
  681. this.checkSelect(selectData);
  682. },
  683. getNameContent: function(){
  684. return {
  685. "title": this.lp.name+": "+this.data.name+" "+this.lp.id+": "+this.data.id,
  686. "text": this.data.name
  687. }
  688. },
  689. selectElements: function(){
  690. new MWF.xApplication.AppCenter.Exporter.Element.Selector(this, this.data);
  691. },
  692. checkSelect: function(selectData){
  693. this.postData.processList = selectData.processList;
  694. this.postData.formList = selectData.formList;
  695. this.postData.applicationDictList = selectData.applicationDictList;
  696. this.postData.scriptList = selectData.scriptList;
  697. this.postData.fileList = selectData.fileList;
  698. this.exporter.selectData.processPlatformList.erase(this.postData);
  699. if (selectData.processList.length || selectData.formList.length || selectData.applicationDictList.length || selectData.scriptList.length || selectData.fileList.length){
  700. this.exporter.selectData.processPlatformList.push(this.postData);
  701. if (selectData.processList.length==this.data.processList.length &&
  702. selectData.formList.length==this.data.formList.length &&
  703. selectData.applicationDictList.length==this.data.applicationDictList.length &&
  704. selectData.scriptList.length==this.data.scriptList.length &&
  705. selectData.fileList.length==this.data.fileList.length){
  706. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_all.png) center center no-repeat");
  707. }else{
  708. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_part.png) center center no-repeat");
  709. }
  710. }else{
  711. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_none.png) center center no-repeat");
  712. }
  713. }
  714. });
  715. MWF.xApplication.AppCenter.Exporter.ProcessElement = new Class({
  716. Extends: MWF.xApplication.AppCenter.Exporter.Element
  717. });
  718. MWF.xApplication.AppCenter.Exporter.PortalElement = new Class({
  719. Extends: MWF.xApplication.AppCenter.Exporter.Element,
  720. initPostData: function(postData){
  721. this.postData = postData || {
  722. "id": this.data.id,
  723. "name": this.data.name || this.data.appName,
  724. "alias": this.data.alias,
  725. "description": this.data.description,
  726. "pageList": [],
  727. "scriptList": [],
  728. "widgetList": [],
  729. "fileList": []
  730. };
  731. },
  732. selectAll: function(){
  733. var selectData = this.postData;
  734. if (selectData.pageList.length || selectData.scriptList.length || selectData.widgetList.length || selectData.fileList.length){
  735. if (selectData.pageList.length===this.data.pageList.length &&
  736. selectData.scriptList.length===this.data.scriptList.length &&
  737. selectData.widgetList.length===this.data.widgetList.length &&
  738. selectData.fileList.length===this.data.fileList.length){
  739. selectData = {
  740. "pageList": [],
  741. "scriptList": [],
  742. "widgetList": [],
  743. "fileList": []
  744. };
  745. }else{
  746. selectData = {
  747. "pageList": this.data.pageList,
  748. "scriptList": this.data.scriptList,
  749. "widgetList": this.data.widgetList,
  750. "fileList": this.data.fileList
  751. };
  752. }
  753. }else{
  754. selectData = {
  755. "pageList": this.data.pageList,
  756. "scriptList": this.data.scriptList,
  757. "widgetList": this.data.widgetList,
  758. "fileList": this.data.fileList
  759. };
  760. }
  761. this.checkSelect(selectData);
  762. },
  763. selectElements: function(){
  764. new MWF.xApplication.AppCenter.Exporter.Element.PortalSelector(this, this.data);
  765. },
  766. checkSelect: function(selectData){
  767. this.postData.pageList = selectData.pageList;
  768. this.postData.scriptList = selectData.scriptList;
  769. this.postData.widgetList = selectData.widgetList;
  770. this.postData.fileList = selectData.fileList;
  771. this.exporter.selectData.portalList.erase(this.postData);
  772. if (selectData.pageList.length || selectData.scriptList.length || selectData.widgetList.length || selectData.fileList.length){
  773. this.exporter.selectData.portalList.push(this.postData);
  774. if (selectData.pageList.length==this.data.pageList.length &&
  775. selectData.scriptList.length==this.data.scriptList.length &&
  776. selectData.widgetList.length==this.data.widgetList.length &&
  777. selectData.fileList.length==this.data.fileList.length){
  778. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_all.png) center center no-repeat");
  779. }else{
  780. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_part.png) center center no-repeat");
  781. }
  782. }else{
  783. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_none.png) center center no-repeat");
  784. }
  785. }
  786. });
  787. MWF.xApplication.AppCenter.Exporter.CmsElement = new Class({
  788. Extends: MWF.xApplication.AppCenter.Exporter.Element,
  789. getNameContent: function(){
  790. return {
  791. "title": this.lp.name+": "+this.data.appName+" "+this.lp.id+": "+this.data.id,
  792. "text": this.data.appName
  793. }
  794. },
  795. initPostData: function(postData){
  796. this.postData = postData || {
  797. "id": this.data.id,
  798. "name": this.data.name || this.data.appName,
  799. "alias": this.data.alias,
  800. "description": this.data.description,
  801. "categoryInfoList": [],
  802. "formList": [],
  803. "appDictList": [],
  804. "scriptList": [],
  805. "fileList": []
  806. };
  807. },
  808. selectElements: function(){
  809. new MWF.xApplication.AppCenter.Exporter.Element.CmsSelector(this, this.data);
  810. },
  811. selectAll: function(){
  812. var selectData = this.postData;
  813. if (selectData.categoryInfoList.length || selectData.formList.length || selectData.appDictList.length || selectData.scriptList.length || selectData.fileList.length){
  814. if (selectData.categoryInfoList.length===this.data.categoryInfoList.length &&
  815. selectData.formList.length===this.data.formList.length &&
  816. selectData.appDictList.length===this.data.appDictList.length &&
  817. selectData.scriptList.length===this.data.scriptList.length &&
  818. selectData.fileList.length===this.data.fileList.length){
  819. selectData = {
  820. "categoryInfoList": [],
  821. "formList": [],
  822. "appDictList": [],
  823. "scriptList": [],
  824. "fileList": []
  825. };
  826. }else{
  827. selectData = {
  828. "categoryInfoList": this.data.categoryInfoList,
  829. "formList": this.data.formList,
  830. "appDictList": this.data.appDictList,
  831. "scriptList": this.data.scriptList,
  832. "fileList": this.data.fileList
  833. };
  834. }
  835. }else{
  836. selectData = {
  837. "categoryInfoList": this.data.categoryInfoList,
  838. "formList": this.data.formList,
  839. "appDictList": this.data.appDictList,
  840. "scriptList": this.data.scriptList,
  841. "fileList": this.data.fileList
  842. };
  843. }
  844. this.checkSelect(selectData);
  845. },
  846. checkSelect: function(selectData){
  847. this.postData.categoryInfoList = selectData.categoryInfoList;
  848. this.postData.formList = selectData.formList;
  849. this.postData.appDictList = selectData.appDictList;
  850. this.postData.scriptList = selectData.scriptList;
  851. this.postData.fileList = selectData.fileList;
  852. this.exporter.selectData.cmsList.erase(this.postData);
  853. if (selectData.categoryInfoList.length || selectData.formList.length || selectData.appDictList.length || selectData.scriptList.length || selectData.fileList.length){
  854. this.exporter.selectData.cmsList.push(this.postData);
  855. if (selectData.categoryInfoList.length===this.data.categoryInfoList.length &&
  856. selectData.formList.length===this.data.formList.length &&
  857. selectData.appDictList.length===this.data.appDictList.length &&
  858. selectData.scriptList.length===this.data.scriptList.length &&
  859. selectData.fileList.length===this.data.fileList.length){
  860. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_all.png) center center no-repeat");
  861. }else{
  862. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_part.png) center center no-repeat");
  863. }
  864. }else{
  865. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_none.png) center center no-repeat");
  866. }
  867. }
  868. });
  869. MWF.xApplication.AppCenter.Exporter.QueryElement = new Class({
  870. Extends: MWF.xApplication.AppCenter.Exporter.Element,
  871. initPostData: function(postData){
  872. this.postData = postData || {
  873. "id": this.data.id,
  874. "name": this.data.name || this.data.appName,
  875. "alias": this.data.alias,
  876. "description": this.data.description,
  877. "viewList": [],
  878. "statList": [],
  879. "revealList": [],
  880. "statementList": [],
  881. "tableList": []
  882. };
  883. },
  884. selectElements: function(){
  885. new MWF.xApplication.AppCenter.Exporter.Element.QuerySelector(this, this.data);
  886. },
  887. selectAll: function(){
  888. var selectData = this.postData;
  889. if (selectData.viewList.length || selectData.statList.length || selectData.revealList.length|| selectData.statementList.length|| selectData.tableList.length){
  890. if (selectData.viewList.length===this.data.viewList.length &&
  891. selectData.statList.length===this.data.statList.length &&
  892. selectData.statementList.length===this.data.statementList.length &&
  893. selectData.tableList.length===this.data.tableList.length &&
  894. selectData.revealList.length===this.data.revealList.length){
  895. selectData = {
  896. "viewList": this.data.viewList,
  897. "statList": this.data.statList,
  898. "revealList": this.data.revealList,
  899. "statementList": this.data.statementList,
  900. "tableList": this.data.tableList
  901. };
  902. }else{
  903. selectData = {
  904. "viewList": this.data.viewList,
  905. "statList": this.data.statList,
  906. "revealList": this.data.revealList,
  907. "statementList": this.data.statementList,
  908. "tableList": this.data.tableList
  909. };
  910. }
  911. }else{
  912. selectData = {
  913. "viewList": this.data.viewList,
  914. "statList": this.data.statList,
  915. "revealList": this.data.revealList,
  916. "statementList": this.data.statementList,
  917. "tableList": this.data.tableList
  918. };
  919. }
  920. this.checkSelect(selectData);
  921. },
  922. checkSelect: function(selectData){
  923. this.postData.viewList = selectData.viewList;
  924. this.postData.statList = selectData.statList;
  925. this.postData.revealList = selectData.revealList;
  926. this.postData.statementList = selectData.statementList;
  927. this.postData.tableList = selectData.tableList;
  928. this.exporter.selectData.queryList.erase(this.postData);
  929. if (selectData.viewList.length || selectData.statList.length || selectData.revealList.length|| selectData.statementList.length|| selectData.tableList.length){
  930. this.exporter.selectData.queryList.push(this.postData);
  931. if (selectData.viewList.length==this.data.viewList.length &&
  932. selectData.statList.length==this.data.statList.length &&
  933. selectData.statementList.length==this.data.statementList.length &&
  934. selectData.tableList.length==this.data.tableList.length &&
  935. selectData.revealList.length==this.data.revealList.length){
  936. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_all.png) center center no-repeat");
  937. }else{
  938. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_part.png) center center no-repeat");
  939. }
  940. }else{
  941. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_none.png) center center no-repeat");
  942. }
  943. }
  944. });
  945. MWF.xApplication.AppCenter.Exporter.ServiceElement = new Class({
  946. Extends: MWF.xApplication.AppCenter.Exporter.Element,
  947. initPostData: function(postData){
  948. this.postData = postData || {
  949. "id": this.data.id,
  950. "name": this.data.name || this.data.appName,
  951. "alias": this.data.alias,
  952. "description": this.data.description,
  953. "agentList": [],
  954. "invokeList": []
  955. };
  956. },
  957. selectElements: function(){
  958. new MWF.xApplication.AppCenter.Exporter.Element.ServiceSelector(this, this.data);
  959. },
  960. selectAll: function(){
  961. var selectData = this.postData;
  962. if (selectData.agentList.length || selectData.invokeList.length){
  963. if (selectData.agentList.length===this.data.invokeList.length ){
  964. selectData = {
  965. "agentList": [],
  966. "invokeList": []
  967. };
  968. }else{
  969. selectData = {
  970. "agentList": this.data.agentList,
  971. "invokeList": this.data.invokeList
  972. };
  973. }
  974. }else{
  975. selectData = {
  976. "agentList": this.data.agentList,
  977. "invokeList": this.data.invokeList
  978. };
  979. }
  980. this.checkSelect(selectData);
  981. },
  982. checkSelect: function(selectData){
  983. this.postData.agentList = selectData.agentList;
  984. this.postData.invokeList = selectData.invokeList;
  985. this.exporter.selectData.serviceModuleList.erase(this.postData);
  986. if (selectData.agentList.length || selectData.invokeList.length ){
  987. this.exporter.selectData.serviceModuleList.push(this.postData);
  988. if (selectData.agentList.length===this.data.agentList.length &&
  989. selectData.invokeList.length===this.data.invokeList.length
  990. ){
  991. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_all.png) center center no-repeat");
  992. }else{
  993. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_part.png) center center no-repeat");
  994. }
  995. }else{
  996. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/sel_none.png) center center no-repeat");
  997. }
  998. }
  999. });
  1000. MWF.xApplication.AppCenter.Exporter.Element.Selector = new Class({
  1001. initialize: function(element, data){
  1002. this.element = element;
  1003. this.app = this.element.app;
  1004. this.data = data;
  1005. this.lp = this.app.lp;
  1006. this.css = this.app.css;
  1007. this.content = this.element.contentNode;
  1008. this.areaNode = this.element.exporter.contentNode;
  1009. this.selectData = this.initData();
  1010. this.load();
  1011. },
  1012. initData: function(){
  1013. return {
  1014. "processList": [],
  1015. "formList": [],
  1016. "applicationDictList": [],
  1017. "scriptList": [],
  1018. "fileList": []
  1019. }
  1020. },
  1021. load: function(){
  1022. this.node = new Element("div", {"styles": this.css.moduleSelectContentAreaNode}).inject(this.areaNode, "after");
  1023. this.titleNode = new Element("div", {"styles": this.css.moduleSelectTitleNode, "text": this.data.name}).inject(this.node);
  1024. var size = this.content.getSize();
  1025. this.node.setStyle("width", ""+size.x+"px");
  1026. this.node.position({
  1027. "relativeTo": this.content,
  1028. "position": "topLeft",
  1029. "edge": "topLeft"
  1030. });
  1031. this.element.exporter.dlg.button.setStyle("display", "none");
  1032. this.show();
  1033. },
  1034. show: function(){
  1035. var size = this.areaNode.getSize();
  1036. var height = size.y+40;
  1037. var width = size.x;
  1038. var position = this.areaNode.getPosition(this.areaNode.getOffsetParent());
  1039. //var oStyles = this.node.getStyles("height", "width", "top", "left", "background-color");
  1040. //this.node.store("ostyles", oStyles);
  1041. var css = {
  1042. "height": ""+height+"px",
  1043. "width": ""+width+"px",
  1044. "top": ""+position.y+"px",
  1045. "left": ""+position.x+"px",
  1046. "background-color": "#eeeeee"
  1047. };
  1048. this.morph = new Fx.Morph(this.node, {"duration": 100});
  1049. this.morph.start(css).chain(function(){
  1050. this.loadContent();
  1051. }.bind(this));
  1052. },
  1053. hide: function(){
  1054. if (!this.morph) this.morph = new Fx.Morph(this.node, {"duration": 100});
  1055. this.areaNode.setStyle("display", "block");
  1056. this.element.exporter.dlg.button.setStyle("display", "block");
  1057. var size = this.content.getSize();
  1058. var height = size.y;
  1059. var width = size.x;
  1060. var position = this.content.getPosition(this.areaNode);
  1061. var thisPosition = this.node.getPosition(this.node.getOffsetParent());
  1062. var x = thisPosition.x+position.x;
  1063. var y = thisPosition.y+position.y;
  1064. var css = {
  1065. "height": ""+height+"px",
  1066. "width": ""+width+"px",
  1067. "top": ""+y+"px",
  1068. "left": ""+x+"px"
  1069. };
  1070. this.contentNode.destroy();
  1071. this.morph.start(css).chain(function(){
  1072. this.node.destroy();
  1073. MWF.release(this);
  1074. }.bind(this));
  1075. },
  1076. loadContent: function(){
  1077. this.areaNode.setStyle("display", "none");
  1078. this.contentNode = new Element("div", {"styles": this.css.moduleSelectContentNode}).inject(this.node);
  1079. this.buttonNode = new Element("div", {"styles": this.css.moduleSelectButtonNode}).inject(this.node);
  1080. this.cancelButton = new Element("div", {"styles": this.css.moduleSelectButtonActionNode, "text": this.lp.cancel}).inject(this.buttonNode);
  1081. this.okButton = new Element("div", {"styles": this.css.moduleSelectButtonActionNode, "text": this.lp.ok}).inject(this.buttonNode);
  1082. this.setContentHeight();
  1083. this.loadContentList();
  1084. this.cancelButton.addEvent("click", function(){
  1085. this.hide();
  1086. }.bind(this));
  1087. this.okButton.addEvent("click", function(){
  1088. this.checkSelect();
  1089. }.bind(this));
  1090. },
  1091. checkSelect: function() {
  1092. this.selectData.processList = this.getCheckedList(this.listProcessContent);
  1093. this.selectData.formList = this.getCheckedList(this.listFormContent);
  1094. this.selectData.applicationDictList = this.getCheckedList(this.listDictContent);
  1095. this.selectData.scriptList = this.getCheckedList(this.listScriptContent);
  1096. this.selectData.fileList = this.getCheckedList(this.listFileContent);
  1097. this.element.checkSelect(this.selectData);
  1098. this.hide();
  1099. },
  1100. getCheckedList: function(node){
  1101. var list = [];
  1102. node.getElements("input").each(function(input){
  1103. if (input.checked){
  1104. list.push(input.retrieve("data"));
  1105. }
  1106. }.bind());
  1107. return list;
  1108. },
  1109. setContentHeight: function(){
  1110. var size = this.node.getSize();
  1111. var titleSize = this.titleNode.getSize();
  1112. var buttonSize = this.buttonNode.getSize();
  1113. var h = size.y-titleSize.y-buttonSize.y;
  1114. this.contentNode.setStyle("height", ""+h+"px");
  1115. },
  1116. loadContentList: function(){
  1117. this.contentAreaNode = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.contentNode);
  1118. this.listProcessContent = this.listProcess("processList");
  1119. this.listFormContent = this.listProcess("formList");
  1120. this.listDictContent = this.listProcess("applicationDictList");
  1121. this.listScriptContent = this.listProcess("scriptList");
  1122. this.listFileContent = this.listProcess("fileList");
  1123. },
  1124. listProcess: function(name){
  1125. var title = new Element("div", {"styles": this.css.moduleSelectContentTitleNode}).inject(this.contentAreaNode);
  1126. var titleActionNode = new Element("div", {"styles": this.css.moduleSelectContentTitleButtonNode}).inject(title);
  1127. var inverseAction = new Element("div", {"styles": this.css.moduleSelectContentTitleButtonActionNode, "text": this.lp.inverse}).inject(titleActionNode);
  1128. var selectAllAction = new Element("div", {"styles": this.css.moduleSelectContentTitleButtonActionNode, "text": this.lp.selectAll}).inject(titleActionNode);
  1129. var titleText = new Element("div", {"styles": this.css.moduleSelectContentTitleTextNode, "text": this.lp[name]}).inject(title);
  1130. //moduleSelectContentTitleButtonActionNode
  1131. var listContent = new Element("div", {"styles": this.css.moduleSelectContentListNode}).inject(this.contentAreaNode);
  1132. this.listProcessItems(name, listContent);
  1133. inverseAction.addEvent("click", function(){
  1134. inputs = listContent.getElements("input");
  1135. inputs.each(function(checkbox){
  1136. checkbox.set("checked", !checkbox.get("checked"));
  1137. });
  1138. });
  1139. selectAllAction.addEvent("click", function(){
  1140. inputs = listContent.getElements("input");
  1141. inputs.each(function(checkbox){
  1142. checkbox.set("checked", true);
  1143. });
  1144. });
  1145. return listContent;
  1146. },
  1147. listProcessItems: function(name, listContent){
  1148. this.data[name].each(function(item){
  1149. var div = new Element("div", {"styles": this.css.moduleSelectContentListItemNode}).inject(listContent);
  1150. var flag = false;
  1151. var selectedList = this.element.postData[name];
  1152. if (selectedList){
  1153. for (var i=0; i<selectedList.length; i++){
  1154. if (selectedList[i].id==item.id){
  1155. flag = true;
  1156. break;
  1157. }
  1158. }
  1159. }
  1160. var checkNode = new Element("input", {
  1161. "styles": {"float": "left"},
  1162. "type": "checkbox",
  1163. //"checked": (this.element.postData[name] && this.element.postData[name].indexOf(item)!=-1),
  1164. "checked": flag,
  1165. "value": item.id
  1166. }).inject(div);
  1167. new Element("div", {
  1168. "styles": {"float": "left"},
  1169. "text": this.getItemName(item),
  1170. "events": {
  1171. "click": function(){checkNode.click();}
  1172. }
  1173. }).inject(div);
  1174. checkNode.store("data", item);
  1175. }.bind(this));
  1176. },
  1177. getItemName: function(item){
  1178. return item.name;
  1179. }
  1180. });
  1181. MWF.xApplication.AppCenter.Exporter.Element.ProcessSelector = new Class({
  1182. Extends: MWF.xApplication.AppCenter.Exporter.Element.Selector
  1183. });
  1184. MWF.xApplication.AppCenter.Exporter.Element.PortalSelector = new Class({
  1185. Extends: MWF.xApplication.AppCenter.Exporter.Element.Selector,
  1186. initData: function(){
  1187. return {
  1188. "pageList": [],
  1189. "scriptList": [],
  1190. "widgetList": [],
  1191. "fileList": []
  1192. }
  1193. },
  1194. checkSelect: function() {
  1195. this.selectData.pageList = this.getCheckedList(this.listPageContent);
  1196. this.selectData.scriptList = this.getCheckedList(this.listScriptContent);
  1197. this.selectData.widgetList = this.getCheckedList(this.listWidgetContent);
  1198. this.selectData.fileList = this.getCheckedList(this.listFileContent);
  1199. this.element.checkSelect(this.selectData);
  1200. this.hide();
  1201. },
  1202. loadContentList: function(){
  1203. this.contentAreaNode = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.contentNode);
  1204. this.listPageContent = this.listProcess("pageList");
  1205. this.listScriptContent = this.listProcess("scriptList");
  1206. this.listWidgetContent = this.listProcess("widgetList");
  1207. this.listFileContent = this.listProcess("fileList");
  1208. }
  1209. });
  1210. MWF.xApplication.AppCenter.Exporter.Element.CmsSelector = new Class({
  1211. Extends: MWF.xApplication.AppCenter.Exporter.Element.Selector,
  1212. initData: function(){
  1213. return {
  1214. "categoryInfoList": [],
  1215. "formList": [],
  1216. "appDictList": [],
  1217. "scriptList": [],
  1218. "fileList": []
  1219. }
  1220. },
  1221. checkSelect: function() {
  1222. this.selectData.categoryInfoList = this.getCheckedList(this.listCategoryInfoContent);
  1223. this.selectData.formList = this.getCheckedList(this.listFormContent);
  1224. this.selectData.appDictList = this.getCheckedList(this.listDictContent);
  1225. this.selectData.scriptList = this.getCheckedList(this.listScriptContent);
  1226. this.selectData.fileList = this.getCheckedList(this.listFileContent);
  1227. this.element.checkSelect(this.selectData);
  1228. this.hide();
  1229. },
  1230. loadContentList: function(){
  1231. this.contentAreaNode = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.contentNode);
  1232. this.listCategoryInfoContent = this.listProcess("categoryInfoList");
  1233. this.listFormContent = this.listProcess("formList");
  1234. this.listDictContent = this.listProcess("appDictList");
  1235. this.listScriptContent = this.listProcess("scriptList");
  1236. this.listFileContent = this.listProcess("fileList");
  1237. },
  1238. getItemName: function(item){
  1239. return item.name || item.categoryName;
  1240. }
  1241. });
  1242. MWF.xApplication.AppCenter.Exporter.Element.QuerySelector = new Class({
  1243. Extends: MWF.xApplication.AppCenter.Exporter.Element.Selector,
  1244. initData: function(){
  1245. return {
  1246. "viewList": [],
  1247. "statList": [],
  1248. "revealList": [],
  1249. "tableList": [],
  1250. "statementList": []
  1251. }
  1252. },
  1253. checkSelect: function() {
  1254. this.selectData.viewList = this.getCheckedList(this.listViewContent);
  1255. this.selectData.statList = this.getCheckedList(this.listStatContent);
  1256. this.selectData.revealList = this.getCheckedList(this.listRevealContent);
  1257. this.selectData.statementList = this.getCheckedList(this.listRevealContent);
  1258. this.selectData.tableList = this.getCheckedList(this.listRevealContent);
  1259. this.element.checkSelect(this.selectData);
  1260. this.hide();
  1261. },
  1262. loadContentList: function(){
  1263. this.contentAreaNode = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.contentNode);
  1264. this.listViewContent = this.listProcess("viewList");
  1265. this.listStatContent = this.listProcess("statList");
  1266. this.listRevealContent = this.listProcess("revealList");
  1267. this.listRevealContent = this.listProcess("tableList");
  1268. this.listRevealContent = this.listProcess("statementList");
  1269. }
  1270. });
  1271. MWF.xApplication.AppCenter.Exporter.Element.ServiceSelector = new Class({
  1272. Extends: MWF.xApplication.AppCenter.Exporter.Element.Selector,
  1273. initData: function(){
  1274. return {
  1275. "agentList": [],
  1276. "invokeList": []
  1277. }
  1278. },
  1279. checkSelect: function() {
  1280. this.selectData.agentList = this.getCheckedList(this.listAgentContent);
  1281. this.selectData.invokeList = this.getCheckedList(this.listInvokeContent);
  1282. this.element.checkSelect(this.selectData);
  1283. this.hide();
  1284. },
  1285. loadContentList: function(){
  1286. this.contentAreaNode = new Element("div", {"styles": {"overflow": "hidden"}}).inject(this.contentNode);
  1287. this.listAgentContent = this.listProcess("agentList");
  1288. this.listInvokeContent = this.listProcess("invokeList");
  1289. },
  1290. getItemName: function(item){
  1291. return item.name
  1292. }
  1293. });
  1294. MWF.xApplication.AppCenter.Module.Setup = new Class({
  1295. initialize: function(module, dlg){
  1296. this.module = module;
  1297. this.app = this.module.app;
  1298. this.data = this.module.data;
  1299. this.lp = this.module.lp;
  1300. this.css = this.app.css;
  1301. this.dlg = dlg;
  1302. this.content = this.dlg.content;
  1303. this.setupData = {};
  1304. this.compareData = null;
  1305. this.load();
  1306. },
  1307. load: function(){
  1308. this.node = new Element("div", {"styles": this.css.moduleSetupContentNode}).inject(this.content);
  1309. this.loadTitle();
  1310. this.loadContent();
  1311. },
  1312. loadTitle: function(){
  1313. this.titleNode = new Element("div", {"styles": this.css.moduleSetupTitleNode2}).inject(this.node);
  1314. this.iconAreaNode = new Element("div", {"styles": this.css.moduleSetupIconAreaNode}).inject(this.titleNode);
  1315. var iconNode = new Element("div", {"styles": this.css.moduleSetupIconNode}).inject(this.iconAreaNode);
  1316. if (this.data.icon){
  1317. iconNode.setStyle("background-image", "url(data:image/png;base64,"+this.data.icon+")");
  1318. iconNode.setStyle("background-size", "cover");
  1319. }
  1320. var contentNode = new Element("div", {"styles": this.css.moduleSetupTitleContentNode2}).inject(this.titleNode);
  1321. var nameNode = new Element("div", {"styles": this.css.moduleSetupNameNode2}).inject(contentNode);
  1322. var categoryNode = new Element("div", {"styles": this.css.moduleSetupCategoryNode2}).inject(contentNode);
  1323. var descriptionNode = new Element("div", {"styles": this.css.moduleSetupDescriptionNode2}).inject(contentNode);
  1324. nameNode.set("text", this.data.name);
  1325. categoryNode.set("text", this.data.category);
  1326. descriptionNode.set("text", this.data.description);
  1327. },
  1328. loadContent: function(){
  1329. this.contentNode = new Element("div", {"styles": this.css.moduleSetupCompareContentNode}).inject(this.node);
  1330. this.createLoading(this.contentNode);
  1331. this.loadCompare();
  1332. },
  1333. createLoading: function(node){
  1334. this.dlg.button.setStyle("display", "none");
  1335. this.loadingAreaNode = new Element("div", {"styles": this.css.moduleLoadingAreaNode}).inject(node);
  1336. var img = new Element("img", {
  1337. "styles": this.css.moduleLoadingImgNode,
  1338. "src": this.app.path+this.app.options.style+"/icon/loading.gif"
  1339. }).inject(this.loadingAreaNode);
  1340. },
  1341. clearLoading: function(){
  1342. if (this.loadingAreaNode){
  1343. this.loadingAreaNode.destroy();
  1344. this.loadingAreaNode = null;
  1345. }
  1346. this.dlg.button.setStyle("display", "block");
  1347. },
  1348. loadCompare: function(){
  1349. this.app.actions.compareModule(this.data.id, function(json){
  1350. this.clearLoading();
  1351. this.setupData.flag = json.data.flag;
  1352. this.createListArea();
  1353. this.compareData = json.data;
  1354. this.loadProcessList();
  1355. this.loadPortalList();
  1356. this.loadCMSList();
  1357. this.loadQueryList();
  1358. this.loadServiceList();
  1359. //json.data.processPlatformList
  1360. }.bind(this));
  1361. },
  1362. createListArea: function(){
  1363. this.contentAreaNode = new Element("div").inject(this.contentNode);
  1364. this.contentInforNode = new Element("div", {"styles": this.css.moduleSetupContentInforNode, "text": this.lp.downloadInfor}).inject(this.contentAreaNode);
  1365. //this.processArea = new Element("div", {"styles": this.css.moduleSetupListAreaNode}).inject(this.contentNode);
  1366. this.processAreaTitle = new Element("div", {"styles": this.css.moduleSetupListAreaTitleNode2, "text": this.lp.process}).inject(this.contentAreaNode);
  1367. this.processAreaContent = new Element("div", {"styles": this.css.moduleSetupListAreaContentNode}).inject(this.contentAreaNode);
  1368. this.portalAreaTitle = new Element("div", {"styles": this.css.moduleSetupListAreaTitleNode, "text": this.lp.portal}).inject(this.contentAreaNode);
  1369. this.portalAreaContent = new Element("div", {"styles": this.css.moduleSetupListAreaContentNode2}).inject(this.contentAreaNode);
  1370. this.cmsAreaTitle = new Element("div", {"styles": this.css.moduleSetupListAreaTitleNode, "text": this.lp.cms}).inject(this.contentAreaNode);
  1371. this.cmsAreaContent = new Element("div", {"styles": this.css.moduleSetupListAreaContentNode2}).inject(this.contentAreaNode);
  1372. this.queryAreaTitle = new Element("div", {"styles": this.css.moduleSetupListAreaTitleNode, "text": this.lp.query}).inject(this.contentAreaNode);
  1373. this.queryAreaContent = new Element("div", {"styles": this.css.moduleSetupListAreaContentNode2}).inject(this.contentAreaNode);
  1374. this.serviceAreaTitle = new Element("div", {"styles": this.css.moduleSetupListAreaTitleNode, "text": this.lp.service}).inject(this.contentAreaNode);
  1375. this.serviceAreaContent = new Element("div", {"styles": this.css.moduleSetupListAreaContentNode2}).inject(this.contentAreaNode);
  1376. },
  1377. loadProcessList: function(){
  1378. this.processListNodes = [];
  1379. this.compareData.processPlatformList.each(function(item){
  1380. this.processListNodes.push(new MWF.xApplication.AppCenter.Module.Setup.ProcessElement(this, this.processAreaContent, item));
  1381. }.bind(this));
  1382. },
  1383. loadPortalList: function(){
  1384. this.portalListNodes = [];
  1385. this.compareData.portalList.each(function(item){
  1386. this.portalListNodes.push(new MWF.xApplication.AppCenter.Module.Setup.PortalElement(this, this.portalAreaContent, item));
  1387. }.bind(this));
  1388. },
  1389. loadCMSList: function(){
  1390. this.cmsListNodes = [];
  1391. this.compareData.cmsList.each(function(item){
  1392. this.cmsListNodes.push(new MWF.xApplication.AppCenter.Module.Setup.CmsElement(this, this.cmsAreaContent, item));
  1393. }.bind(this));
  1394. },
  1395. loadQueryList: function(){
  1396. this.queryListNodes = [];
  1397. this.compareData.queryList.each(function(item){
  1398. this.queryListNodes.push(new MWF.xApplication.AppCenter.Module.Setup.QueryElement(this, this.queryAreaContent, item));
  1399. }.bind(this));
  1400. },
  1401. loadServiceList: function(){
  1402. this.serviceListNodes = [];
  1403. this.compareData.serviceModuleList.each(function(item){
  1404. this.serviceListNodes.push(new MWF.xApplication.AppCenter.Module.Setup.ServiceElement(this, this.serviceAreaContent, item));
  1405. }.bind(this));
  1406. },
  1407. setup: function(){
  1408. this.setupData.flag = this.compareData.flag;
  1409. this.setupData.processPlatformList = [];
  1410. this.setupData.portalList = [];
  1411. this.setupData.queryList = [];
  1412. this.setupData.serviceModuleList = [];
  1413. this.setupData.cmsList = [];
  1414. this.getWriteData(this.processListNodes, this.setupData.processPlatformList);
  1415. this.getWriteData(this.portalListNodes, this.setupData.portalList);
  1416. this.getWriteData(this.cmsListNodes, this.setupData.cmsList);
  1417. this.getWriteData(this.queryListNodes, this.setupData.queryList);
  1418. this.getWriteData(this.serviceListNodes, this.setupData.serviceModuleList);
  1419. this.contentAreaNode.setStyle("display", "none");
  1420. this.createLoading(this.contentNode);
  1421. this.app.actions.importModule(this.compareData.flag, this.setupData, function(){
  1422. this.app.notice(this.module.data.name+" "+this.lp.setupSuccess, "success");
  1423. this.clearLoading();
  1424. }.bind(this));
  1425. },
  1426. getWriteData: function(nodes, json){
  1427. nodes.each(function(item){
  1428. if (item.action){
  1429. var v = item.action.options[item.action.selectedIndex].get("value");
  1430. if (v!="ignore"){
  1431. json.push({"id": item.data.id, "method":v});
  1432. }
  1433. }else{
  1434. json.push({"id": item.data.id});
  1435. }
  1436. }.bind(this));
  1437. }
  1438. });
  1439. MWF.xApplication.AppCenter.Module.SetupLocal = new Class({
  1440. Extends: MWF.xApplication.AppCenter.Module.Setup,
  1441. initialize: function(file, dlg, app){
  1442. this.app = app;
  1443. this.file = file;
  1444. this.lp = this.app.lp;
  1445. this.module = {
  1446. "data": {
  1447. "name": this.lp.localApp,
  1448. "category": "",
  1449. "description": ""
  1450. }
  1451. };
  1452. this.data = this.module.data;
  1453. this.css = this.app.css;
  1454. this.dlg = dlg;
  1455. this.content = this.dlg.content;
  1456. this.setupData = {};
  1457. this.compareData = null;
  1458. this.load();
  1459. },
  1460. loadCompare: function(){
  1461. var formData = new FormData();
  1462. formData.append('file', this.file);
  1463. debugger;
  1464. this.app.actions.compareUpload(formData, this.file, function(json){
  1465. this.clearLoading();
  1466. this.setupData.flag = json.data.flag;
  1467. this.createListArea();
  1468. this.compareData = json.data;
  1469. this.loadProcessList();
  1470. this.loadPortalList();
  1471. this.loadCMSList();
  1472. this.loadQueryList();
  1473. this.loadServiceList();
  1474. //json.data.processPlatformList
  1475. }.bind(this));
  1476. }
  1477. });
  1478. MWF.xApplication.AppCenter.Module.Setup.Element = new Class({
  1479. initialize: function(setup, content, data){
  1480. this.setup = setup;
  1481. this.app = this.setup.app;
  1482. this.data = data;
  1483. this.lp = this.app.lp;
  1484. this.css = this.app.css;
  1485. this.content = content;
  1486. this.load();
  1487. },
  1488. load: function(){
  1489. this.contentNode = new Element("div", {"styles": this.css.moduleSetupListContentNode}).inject(this.content);
  1490. this.iconNode = new Element("div", {"styles": this.css.moduleSetupListIconNode}).inject(this.contentNode);
  1491. this.actionNode = new Element("div", {"styles": this.css.moduleSetupListActionNode}).inject(this.contentNode);
  1492. this.inforNode = new Element("div", {"styles": this.css.moduleSetupListInforNode}).inject(this.contentNode);
  1493. this.nameNode = new Element("div", {"styles": this.css.moduleSetupListNameNode}).inject(this.contentNode);
  1494. this.nameNode.set(this.getNameContent());
  1495. if (this.data.exist){
  1496. this.iconNode.setStyle("background", "url("+this.app.path+this.app.options.style+"/icon/conflict.png) center center no-repeat");
  1497. this.contentNode.setStyle("color", "#e86a58");
  1498. this.inforNode.set("text", this.lp.conflict);
  1499. this.action = new Element("select", {"styles": this.css.moduleSetupListActionSelectNode}).inject(this.actionNode);
  1500. var options = "<option value='cover' selected>"+this.lp.cover+"</option>";
  1501. options += "<option value='create'>"+this.lp.create+"</option>";
  1502. options += "<option value='ignore'>"+this.lp.ignore+"</option>";
  1503. this.action.set("html", options);
  1504. // this.action.addEvent("change", function(e){
  1505. //
  1506. // }.bind(this));
  1507. }else{
  1508. this.action = new Element("select", {"styles": this.css.moduleSetupListActionSelectNode}).inject(this.actionNode);
  1509. var options = "<option value='ignore'>"+this.lp.ignore+"</option>";
  1510. options += "<option value='create' selected>"+this.lp.create+"</option>";
  1511. this.action.set("html", options);
  1512. //this.inforNode.set("text", this.lp.setup);
  1513. }
  1514. },
  1515. getNameContent: function(){
  1516. return {
  1517. "title": this.lp.name+": "+this.data.name+" "+this.lp.id+": "+this.data.id,
  1518. "text": this.data.name
  1519. }
  1520. }
  1521. });
  1522. MWF.xApplication.AppCenter.Module.Setup.ProcessElement = new Class({
  1523. Extends: MWF.xApplication.AppCenter.Module.Setup.Element
  1524. });
  1525. MWF.xApplication.AppCenter.Module.Setup.PortalElement = new Class({
  1526. Extends: MWF.xApplication.AppCenter.Module.Setup.Element
  1527. });
  1528. MWF.xApplication.AppCenter.Module.Setup.CmsElement = new Class({
  1529. Extends: MWF.xApplication.AppCenter.Module.Setup.Element
  1530. });
  1531. MWF.xApplication.AppCenter.Module.Setup.QueryElement = new Class({
  1532. Extends: MWF.xApplication.AppCenter.Module.Setup.Element
  1533. });
  1534. MWF.xApplication.AppCenter.Module.Setup.ServiceElement = new Class({
  1535. Extends: MWF.xApplication.AppCenter.Module.Setup.Element
  1536. });