|
|
@@ -10,6 +10,7 @@ MWF.xApplication.FindDesigner.Main = new Class({
|
|
|
"icon": "icon.png",
|
|
|
"width": "1200",
|
|
|
"height": "800",
|
|
|
+ "filter": null,
|
|
|
"isResize": true,
|
|
|
"isMax": true,
|
|
|
"layout": {
|
|
|
@@ -39,9 +40,35 @@ MWF.xApplication.FindDesigner.Main = new Class({
|
|
|
this.content.loadHtml(url, {"bind": {"lp": this.lp}, "module": this}, function(){
|
|
|
this.setSizeNode();
|
|
|
this.createToolbar();
|
|
|
+debugger;
|
|
|
+ this.initFilter();
|
|
|
+
|
|
|
if (callback) callback();
|
|
|
}.bind(this));
|
|
|
},
|
|
|
+ initFilter: function(){
|
|
|
+ if (this.options.filter){
|
|
|
+ if (this.options.filter.moduleList){
|
|
|
+ var inputs = this.rangeContentNode.getElements("input");
|
|
|
+ inputs.forEach(function(input){
|
|
|
+ if (input.get("value").indexOf(this.options.filter.moduleList) !== -1){
|
|
|
+ input.set("checked", true);
|
|
|
+ }else{
|
|
|
+ input.set("checked", false);
|
|
|
+ }
|
|
|
+ }.bind(this));
|
|
|
+ }
|
|
|
+ if (this.options.filter.appList){
|
|
|
+ o2.require("o2.widget.O2Identity", function(){
|
|
|
+ this.options.filter.appList.each(function(app){
|
|
|
+ app.name = this.lp[app.moduleType] + "-" + app.name;
|
|
|
+ var item = new o2.widget.O2Other(app, this.rangeSelectedContentNode, {"canRemove": true, "style": "find", "onRemove": function(item){this.removeRangeItem(item);}.bind(this)});
|
|
|
+ item.node.store("data", item.data);
|
|
|
+ }.bind(this));
|
|
|
+ }.bind(this));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
createToolbar: function(){
|
|
|
o2.require("o2.widget.Toolbar", function(){
|
|
|
this.previewToolbar = new o2.widget.Toolbar(this.previewTitleToolbar, {"style": "findDesigner"}, this);
|
|
|
@@ -286,7 +313,8 @@ MWF.xApplication.FindDesigner.Main = new Class({
|
|
|
o2.require("o2.widget.O2Identity", function(){
|
|
|
list.each(function(app){
|
|
|
//this.selectedModules.push(app.data);
|
|
|
- app.data.name = this.lp.service + "-" + app.data.name;
|
|
|
+ debugger;
|
|
|
+ app.data.name = this.lp[app.data.moduleType] + "-" + app.data.name;
|
|
|
var item = new o2.widget.O2Other(app.data, this.rangeSelectedContentNode, {"canRemove": true, "style": "find", "onRemove": function(item){this.removeRangeItem(item);}.bind(this)});
|
|
|
item.node.store("data", item.data);
|
|
|
}.bind(this));
|
|
|
@@ -364,8 +392,22 @@ MWF.xApplication.FindDesigner.Main = new Class({
|
|
|
if (e.data && e.data.type=="ready") this.setReadyMessage(e.data);
|
|
|
if (e.data && e.data.type=="done") this.doFindOptionResult(e.data);
|
|
|
if (e.data && e.data.type=="find") this.doFindResult(e.data);
|
|
|
+ if (e.data && e.data.type=="completed") this.doFindCompleted(e.data);
|
|
|
}.bind(this);
|
|
|
},
|
|
|
+ doFindCompleted: function(){
|
|
|
+ if (!this.tree || !this.tree.children.length){
|
|
|
+ //not find
|
|
|
+ this.listContentNode.hide();
|
|
|
+ this.listContentNode.empty();
|
|
|
+ this.listInfoNode.removeClass("loadding");
|
|
|
+ this.listInfoNode.show().getFirst().set("text", this.lp.nothingFind);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!this.patternCount) this.patternCount = 0;
|
|
|
+ var t = this.lp.findPatternCountCompleted.replace("{n}", this.patternCount);
|
|
|
+ this.listTitleInfoNode.set("text", t);
|
|
|
+ },
|
|
|
doFindOptionResult: function(){
|
|
|
// this.listInfoNode.hide();
|
|
|
// this.listContentNode.show();
|
|
|
@@ -795,7 +837,7 @@ MWF.xApplication.FindDesigner.Main = new Class({
|
|
|
break;
|
|
|
}
|
|
|
if (node.pattern.designerType==="statement"){
|
|
|
- m = o2.Actions.load("x_portal_assemble_designer").StatementAction.get;
|
|
|
+ m = o2.Actions.load("x_query_assemble_designer").StatementAction.get;
|
|
|
break;
|
|
|
}
|
|
|
break;
|
|
|
@@ -804,11 +846,8 @@ MWF.xApplication.FindDesigner.Main = new Class({
|
|
|
//m = (node.pattern.appId==="invoke") ? o2.Actions.load("x_program_center").InvokeAction.get : o2.Actions.load("x_program_center").AgentAction.get;
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
if (m) this.openPatternFormWithData(m, node);
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
resetFormEditor: function(pattern){
|
|
|
switch (pattern.pattern.propertyType){
|
|
|
@@ -868,6 +907,12 @@ MWF.xApplication.FindDesigner.Main = new Class({
|
|
|
d.applicationName = d.queryName;
|
|
|
d.data = dataJson;
|
|
|
}
|
|
|
+ if (node.pattern.designerType=="statement"){
|
|
|
+ d.application = d.query
|
|
|
+ d.applicationName = d.queryName;
|
|
|
+ var viewJson = JSON.decode(d.view);
|
|
|
+ d.view = viewJson;
|
|
|
+ }
|
|
|
|
|
|
if (!this.designerDataObject) this.designerDataObject = {};
|
|
|
this.designerDataObject[node.pattern.designerId] = d;
|
|
|
@@ -1669,6 +1714,29 @@ debugger;
|
|
|
}.bind(this), function(){});
|
|
|
|
|
|
break;
|
|
|
+
|
|
|
+ case "statement":
|
|
|
+ var action = MWF.Actions.get("x_query_assemble_designer");
|
|
|
+ m = action.saveStatement.bind(action);
|
|
|
+ if (this.designerDataObject && this.designerDataObject[this.editor.pattern.designerId]) {
|
|
|
+ var d = this.designerDataObject[this.editor.pattern.designerId];
|
|
|
+ if (this.editor.getValue){
|
|
|
+ if (this.editor.pattern.pattern.path){
|
|
|
+ var path = this.editor.pattern.pattern.path;
|
|
|
+ for (var i=0; i<path.length-1; i++){
|
|
|
+ d = d[path[i]];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ d[path[path.length-1]] = this.editor.getValue();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var viewText = JSON.stringify(data.view);
|
|
|
+ data.view = viewText;
|
|
|
+
|
|
|
+ if (m) m(data, function(){
|
|
|
+ this.notice(this.lp.notice.save_success, "success", this.previewContentNode, {"x": "left", "y": "bottom"});
|
|
|
+ }.bind(this), function(){});
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -1785,7 +1853,6 @@ debugger;
|
|
|
layout.openApplication(null, "portal.WidgetDesigner", options);
|
|
|
break;
|
|
|
case "view":
|
|
|
- debugger;
|
|
|
var _self = this;
|
|
|
var options = {
|
|
|
"appId": "query.ViewDesigner"+pattern.designerId,
|
|
|
@@ -1797,6 +1864,15 @@ debugger;
|
|
|
};
|
|
|
layout.openApplication(null, "query.ViewDesigner", options);
|
|
|
break;
|
|
|
+ case "statement":
|
|
|
+ var _self = this;
|
|
|
+ var options = {
|
|
|
+ "appId": "query.StatementDesigner"+pattern.designerId,
|
|
|
+ "id": pattern.designerId,
|
|
|
+ "application": pattern.appId
|
|
|
+ };
|
|
|
+ layout.openApplication(null, "query.StatementDesigner", options);
|
|
|
+ break;
|
|
|
}
|
|
|
if (this.editor.getValue) window.setTimeout(function(){
|
|
|
if (this.scriptDesignerDataObject && this.scriptDesignerDataObject[this.editor.pattern.designerId]){
|
|
|
@@ -2084,246 +2160,246 @@ debugger;
|
|
|
|
|
|
|
|
|
|
|
|
- findDesigner_bak: function(){
|
|
|
- this.listContentNode.hide();
|
|
|
- this.listInfoNode.show().getFirst().set("text", "");
|
|
|
- this.listInfoNode.addClass("loadding")
|
|
|
- o2.Actions.load("x_query_service_processing").DesignAction.search(this.filterOption, function(json){
|
|
|
- if ((json.data.processPlatformList && json.data.processPlatformList.length) ||
|
|
|
- (json.data.cmsList && json.data.cmsList.length) ||
|
|
|
- (json.data.portalList && json.data.portalList.length) ||
|
|
|
- (json.data.queryList && json.data.queryList.length) ||
|
|
|
- (json.data.serviceList && json.data.serviceList.length)){
|
|
|
-
|
|
|
- this.listInfoNode.hide();
|
|
|
- this.listFindResult(json.data);
|
|
|
-
|
|
|
- }else{
|
|
|
- this.listInfoNode.show().removeClass("loadding").getFirst().set("text", this.lp.nothingFind);
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- createResultAppItem: function(text, title, tree){
|
|
|
- var obj = {
|
|
|
- "title": title,
|
|
|
- "text": "<span style='font-weight: bold; color: #4A90E2'>"+text+"</span>",
|
|
|
- "icon": ""
|
|
|
- }
|
|
|
- return tree.appendChild(obj);
|
|
|
- },
|
|
|
- // createResultDesignerItem: function(designer, tree){
|
|
|
- // var title = this.lp[designer.designerType]+ ": "+ designer.designerName + " ("+designer.designerId+")";
|
|
|
- // var text = this.lp[designer.designerType]+ ": <b>"+ designer.designerName+"</b>";
|
|
|
+ // findDesigner_bak: function(){
|
|
|
+ // this.listContentNode.hide();
|
|
|
+ // this.listInfoNode.show().getFirst().set("text", "");
|
|
|
+ // this.listInfoNode.addClass("loadding")
|
|
|
+ // o2.Actions.load("x_query_service_processing").DesignAction.search(this.filterOption, function(json){
|
|
|
+ // if ((json.data.processPlatformList && json.data.processPlatformList.length) ||
|
|
|
+ // (json.data.cmsList && json.data.cmsList.length) ||
|
|
|
+ // (json.data.portalList && json.data.portalList.length) ||
|
|
|
+ // (json.data.queryList && json.data.queryList.length) ||
|
|
|
+ // (json.data.serviceList && json.data.serviceList.length)){
|
|
|
+ //
|
|
|
+ // this.listInfoNode.hide();
|
|
|
+ // this.listFindResult(json.data);
|
|
|
+ //
|
|
|
+ // }else{
|
|
|
+ // this.listInfoNode.show().removeClass("loadding").getFirst().set("text", this.lp.nothingFind);
|
|
|
+ // }
|
|
|
+ // }.bind(this));
|
|
|
+ // },
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // createResultAppItem: function(text, title, tree){
|
|
|
// var obj = {
|
|
|
- // "expand": false,
|
|
|
// "title": title,
|
|
|
- // "text": text,
|
|
|
+ // "text": "<span style='font-weight: bold; color: #4A90E2'>"+text+"</span>",
|
|
|
// "icon": ""
|
|
|
// }
|
|
|
- // var item = tree.appendChild(obj);
|
|
|
- // item.designer = designer;
|
|
|
- // item.appendChild({ "expand": false, "text": "loading...", "icon": "" });
|
|
|
- // return item;
|
|
|
+ // return tree.appendChild(obj);
|
|
|
// },
|
|
|
- listFindResult: function(data){
|
|
|
- this.listContentNode.empty();
|
|
|
- this.listContentNode.show();
|
|
|
- o2.require("o2.widget.Tree", function(){
|
|
|
- var tree = new o2.widget.Tree(this.listContentNode, {
|
|
|
- "onQueryExpand": function(item){
|
|
|
- if (item.designer) this.loadDesignerPattern(item);
|
|
|
- }.bind(this)
|
|
|
- });
|
|
|
- tree.load();
|
|
|
- if (data.processPlatformList && data.processPlatformList.length){
|
|
|
- var platformItem = this.createResultCategroyItem(this.lp.processPlatform, this.lp.processPlatform, tree);
|
|
|
- this.listProcessResult(platformItem, data.processPlatformList, "processPlatform");
|
|
|
- }
|
|
|
- if (data.cmsList && data.cmsList.length){
|
|
|
- var platformItem = this.createResultCategroyItem(this.lp.cms, this.lp.cms, tree);
|
|
|
- //this.listProcessResult(categroyItem, data.cmsList);
|
|
|
- }
|
|
|
- if (data.portalList && data.portalList.length){
|
|
|
- var platformItem = this.createResultCategroyItem(this.lp.portal, this.lp.portal, tree);
|
|
|
-
|
|
|
- }
|
|
|
- if (data.queryList && data.queryList.length){
|
|
|
- var platformItem = this.createResultCategroyItem(this.lp.query, this.lp.query, tree);
|
|
|
- }
|
|
|
- if (data.serviceList && data.serviceList.length){
|
|
|
- var platformItem = this.createResultCategroyItem(this.lp.service, this.lp.service, tree);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
- addPatternCount: function(item, count){
|
|
|
- if (!item.count) item.count = 0;
|
|
|
- item.count += count;
|
|
|
- var t = this.lp.patternCount.replace("{n}", item.count);
|
|
|
- var textDivNode = item.textNode.getElement("div");
|
|
|
- if (textDivNode){
|
|
|
- var html = item.options.text;
|
|
|
- textDivNode.set("html", html+" <span style=''>( "+t+" )</span>");
|
|
|
- }
|
|
|
- },
|
|
|
- listProcessResult: function(platformItem, list, platform){
|
|
|
- var applicationItems = {};
|
|
|
- list.each(function(designer){
|
|
|
- if (designer.patternList && designer.patternList.length){
|
|
|
- var appItem = applicationItems[designer.appId];
|
|
|
- if (!appItem){
|
|
|
- applicationItems[designer.appId] = appItem = this.createResultAppItem(designer.appName, designer.appName+" ("+designer.appId+")", platformItem);
|
|
|
- }
|
|
|
- designer.platform = platform;
|
|
|
- var designerItem = this.createResultDesignerItem(designer, appItem);
|
|
|
- var count=0;
|
|
|
- designer.patternList.each(function(p){
|
|
|
- if (p.lines && p.lines.length){
|
|
|
- count += p.lines.length;
|
|
|
- }else{
|
|
|
- count++;
|
|
|
- }
|
|
|
- });
|
|
|
- // var count = designer.patternList.length;
|
|
|
-
|
|
|
- this.addPatternCount(designerItem, count);
|
|
|
- this.addPatternCount(appItem, count);
|
|
|
- this.addPatternCount(platformItem, count);
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
-
|
|
|
- getDesignerObject: function(designer){
|
|
|
- switch (designer.platform){
|
|
|
- case "processPlatform":
|
|
|
- var action = this.Actions.load("x_processplatform_assemble_designer");
|
|
|
- switch (designer.designerType){
|
|
|
- case "script":
|
|
|
- return action.ScriptAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- case "form":
|
|
|
- return action.FomrAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- case "process":
|
|
|
- return action.ProcessAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- }
|
|
|
- case "cms":
|
|
|
- var action = this.Actions.load("x_cms_assemble_control");
|
|
|
- switch (designer.designerType){
|
|
|
- case "script":
|
|
|
- return action.ScriptAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- case "form":
|
|
|
- return action.FormAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- }
|
|
|
-
|
|
|
- case "portal":
|
|
|
- var action = this.Actions.load("x_portal_assemble_designer");
|
|
|
- switch (designer.designerType){
|
|
|
- case "script":
|
|
|
- return action.ScriptAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- case "page":
|
|
|
- return action.PageAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- case "widget":
|
|
|
- return action.WidgetAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- }
|
|
|
- case "query":
|
|
|
- var action = this.Actions.load("x_query_assemble_designer");
|
|
|
- switch (designer.designerType){
|
|
|
- case "view":
|
|
|
- return action.ViewAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- case "statement":
|
|
|
- return action.StatementAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- case "stat":
|
|
|
- return action.StatAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- }
|
|
|
- case "service":
|
|
|
- var action = this.Actions.load("x_program_center");
|
|
|
- switch (designer.appId){
|
|
|
- case "invoke":
|
|
|
- return action.InvokeAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- case "agent":
|
|
|
- return action.AgentAction.get(designer.designerId, function(json){return json.data;});
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- loadDesignerPattern: function(item){
|
|
|
- if (item.firstChild && item.firstChild.options.text==="loading..."){
|
|
|
- item.firstChild.destroy();
|
|
|
-
|
|
|
- var root, actionName, fun;
|
|
|
- switch (designer.platform) {
|
|
|
- case "processPlatform":
|
|
|
- root = "x_processplatform_assemble_designer";
|
|
|
- switch (designer.designerType) {
|
|
|
- case "script": actionName = "ScriptAction"; fun = "listProcessScriptPattern";
|
|
|
- case "form": actionName = "FomrAction"; fun = "listProcessFormPattern";
|
|
|
- case "process": actionName = "ProcessAction"; fun = "listProcessProcessPattern";
|
|
|
- }
|
|
|
- case "cms":
|
|
|
- root = "x_cms_assemble_control";
|
|
|
- switch (designer.designerType) {
|
|
|
- case "script": actionName = "ScriptAction"; fun = "listCmsScriptPattern";
|
|
|
- case "form": actionName = "FormAction"; fun = "listCmsFormPattern";
|
|
|
- }
|
|
|
-
|
|
|
- case "portal":
|
|
|
- root = "x_portal_assemble_designer";
|
|
|
- switch (designer.designerType) {
|
|
|
- case "script": actionName = "ScriptAction"; fun = "listPortalScriptPattern";
|
|
|
- case "page": actionName = "PageAction"; fun = "listPortalPagePattern";
|
|
|
- case "widget": actionName = "WidgetAction"; fun = "listPortalWidgetPattern";
|
|
|
- }
|
|
|
- case "query":
|
|
|
- root = "x_query_assemble_designer";
|
|
|
- switch (designer.designerType) {
|
|
|
- case "view": actionName = "ViewAction"; fun = "listQueryViewPattern";
|
|
|
- case "statement": actionName = "StatementAction"; fun = "listQueryStatementPattern";
|
|
|
- case "stat": actionName = "StatAction"; fun = "listQueryStatPattern";
|
|
|
- }
|
|
|
- case "service":
|
|
|
- root = "x_program_center";
|
|
|
- switch (designer.appId) {
|
|
|
- case "invoke": actionName = "InvokeAction"; fun = "listServiceInvokePattern";
|
|
|
- case "agent": actionName = "AgentAction"; fun = "listServiceAgentPattern";
|
|
|
- }
|
|
|
- }
|
|
|
- this.Actions.load(root)[actionName].get(designer.designerId, function(json){
|
|
|
- this[fun](json.data, designer.patternList, item);
|
|
|
- }.bind(this))
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- getFindRegExp: function(){
|
|
|
- var flag = "gm";
|
|
|
- var keyword = this.filterOption.keyword;
|
|
|
- if (!this.filterOption.caseSensitive) flag+="i";
|
|
|
- if (this.filterOption.matchRegExp){
|
|
|
- return new RegExp(keyword, flag)
|
|
|
- }else{
|
|
|
- if (this.filterOption.matchWholeWord) keyword = "\\b"+keyword+"\\b";
|
|
|
- return new RegExp(keyword, flag)
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- //启动一个webworker处理
|
|
|
- listProcessScriptPattern: function (data, patternList, item){
|
|
|
- patternList.each(function(pattern){
|
|
|
- if (pattern.property == "text"){
|
|
|
- var textArr = data.split("\n");
|
|
|
- var regex = this.getFindRegExp();
|
|
|
- pattern.lines.each(function(line){
|
|
|
- var text = textArr[line];
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }.bind(this));
|
|
|
- }else{
|
|
|
-
|
|
|
- }
|
|
|
- }.bind(this));
|
|
|
- }
|
|
|
+ // // createResultDesignerItem: function(designer, tree){
|
|
|
+ // // var title = this.lp[designer.designerType]+ ": "+ designer.designerName + " ("+designer.designerId+")";
|
|
|
+ // // var text = this.lp[designer.designerType]+ ": <b>"+ designer.designerName+"</b>";
|
|
|
+ // // var obj = {
|
|
|
+ // // "expand": false,
|
|
|
+ // // "title": title,
|
|
|
+ // // "text": text,
|
|
|
+ // // "icon": ""
|
|
|
+ // // }
|
|
|
+ // // var item = tree.appendChild(obj);
|
|
|
+ // // item.designer = designer;
|
|
|
+ // // item.appendChild({ "expand": false, "text": "loading...", "icon": "" });
|
|
|
+ // // return item;
|
|
|
+ // // },
|
|
|
+ // listFindResult: function(data){
|
|
|
+ // this.listContentNode.empty();
|
|
|
+ // this.listContentNode.show();
|
|
|
+ // o2.require("o2.widget.Tree", function(){
|
|
|
+ // var tree = new o2.widget.Tree(this.listContentNode, {
|
|
|
+ // "onQueryExpand": function(item){
|
|
|
+ // if (item.designer) this.loadDesignerPattern(item);
|
|
|
+ // }.bind(this)
|
|
|
+ // });
|
|
|
+ // tree.load();
|
|
|
+ // if (data.processPlatformList && data.processPlatformList.length){
|
|
|
+ // var platformItem = this.createResultCategroyItem(this.lp.processPlatform, this.lp.processPlatform, tree);
|
|
|
+ // this.listProcessResult(platformItem, data.processPlatformList, "processPlatform");
|
|
|
+ // }
|
|
|
+ // if (data.cmsList && data.cmsList.length){
|
|
|
+ // var platformItem = this.createResultCategroyItem(this.lp.cms, this.lp.cms, tree);
|
|
|
+ // //this.listProcessResult(categroyItem, data.cmsList);
|
|
|
+ // }
|
|
|
+ // if (data.portalList && data.portalList.length){
|
|
|
+ // var platformItem = this.createResultCategroyItem(this.lp.portal, this.lp.portal, tree);
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // if (data.queryList && data.queryList.length){
|
|
|
+ // var platformItem = this.createResultCategroyItem(this.lp.query, this.lp.query, tree);
|
|
|
+ // }
|
|
|
+ // if (data.serviceList && data.serviceList.length){
|
|
|
+ // var platformItem = this.createResultCategroyItem(this.lp.service, this.lp.service, tree);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // }.bind(this));
|
|
|
+ // },
|
|
|
+ // addPatternCount: function(item, count){
|
|
|
+ // if (!item.count) item.count = 0;
|
|
|
+ // item.count += count;
|
|
|
+ // var t = this.lp.patternCount.replace("{n}", item.count);
|
|
|
+ // var textDivNode = item.textNode.getElement("div");
|
|
|
+ // if (textDivNode){
|
|
|
+ // var html = item.options.text;
|
|
|
+ // textDivNode.set("html", html+" <span style=''>( "+t+" )</span>");
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // listProcessResult: function(platformItem, list, platform){
|
|
|
+ // var applicationItems = {};
|
|
|
+ // list.each(function(designer){
|
|
|
+ // if (designer.patternList && designer.patternList.length){
|
|
|
+ // var appItem = applicationItems[designer.appId];
|
|
|
+ // if (!appItem){
|
|
|
+ // applicationItems[designer.appId] = appItem = this.createResultAppItem(designer.appName, designer.appName+" ("+designer.appId+")", platformItem);
|
|
|
+ // }
|
|
|
+ // designer.platform = platform;
|
|
|
+ // var designerItem = this.createResultDesignerItem(designer, appItem);
|
|
|
+ // var count=0;
|
|
|
+ // designer.patternList.each(function(p){
|
|
|
+ // if (p.lines && p.lines.length){
|
|
|
+ // count += p.lines.length;
|
|
|
+ // }else{
|
|
|
+ // count++;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // // var count = designer.patternList.length;
|
|
|
+ //
|
|
|
+ // this.addPatternCount(designerItem, count);
|
|
|
+ // this.addPatternCount(appItem, count);
|
|
|
+ // this.addPatternCount(platformItem, count);
|
|
|
+ // }
|
|
|
+ // }.bind(this));
|
|
|
+ // },
|
|
|
+ //
|
|
|
+ // getDesignerObject: function(designer){
|
|
|
+ // switch (designer.platform){
|
|
|
+ // case "processPlatform":
|
|
|
+ // var action = this.Actions.load("x_processplatform_assemble_designer");
|
|
|
+ // switch (designer.designerType){
|
|
|
+ // case "script":
|
|
|
+ // return action.ScriptAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // case "form":
|
|
|
+ // return action.FomrAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // case "process":
|
|
|
+ // return action.ProcessAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // }
|
|
|
+ // case "cms":
|
|
|
+ // var action = this.Actions.load("x_cms_assemble_control");
|
|
|
+ // switch (designer.designerType){
|
|
|
+ // case "script":
|
|
|
+ // return action.ScriptAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // case "form":
|
|
|
+ // return action.FormAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // case "portal":
|
|
|
+ // var action = this.Actions.load("x_portal_assemble_designer");
|
|
|
+ // switch (designer.designerType){
|
|
|
+ // case "script":
|
|
|
+ // return action.ScriptAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // case "page":
|
|
|
+ // return action.PageAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // case "widget":
|
|
|
+ // return action.WidgetAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // }
|
|
|
+ // case "query":
|
|
|
+ // var action = this.Actions.load("x_query_assemble_designer");
|
|
|
+ // switch (designer.designerType){
|
|
|
+ // case "view":
|
|
|
+ // return action.ViewAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // case "statement":
|
|
|
+ // return action.StatementAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // case "stat":
|
|
|
+ // return action.StatAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // }
|
|
|
+ // case "service":
|
|
|
+ // var action = this.Actions.load("x_program_center");
|
|
|
+ // switch (designer.appId){
|
|
|
+ // case "invoke":
|
|
|
+ // return action.InvokeAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // case "agent":
|
|
|
+ // return action.AgentAction.get(designer.designerId, function(json){return json.data;});
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // loadDesignerPattern: function(item){
|
|
|
+ // if (item.firstChild && item.firstChild.options.text==="loading..."){
|
|
|
+ // item.firstChild.destroy();
|
|
|
+ //
|
|
|
+ // var root, actionName, fun;
|
|
|
+ // switch (designer.platform) {
|
|
|
+ // case "processPlatform":
|
|
|
+ // root = "x_processplatform_assemble_designer";
|
|
|
+ // switch (designer.designerType) {
|
|
|
+ // case "script": actionName = "ScriptAction"; fun = "listProcessScriptPattern";
|
|
|
+ // case "form": actionName = "FomrAction"; fun = "listProcessFormPattern";
|
|
|
+ // case "process": actionName = "ProcessAction"; fun = "listProcessProcessPattern";
|
|
|
+ // }
|
|
|
+ // case "cms":
|
|
|
+ // root = "x_cms_assemble_control";
|
|
|
+ // switch (designer.designerType) {
|
|
|
+ // case "script": actionName = "ScriptAction"; fun = "listCmsScriptPattern";
|
|
|
+ // case "form": actionName = "FormAction"; fun = "listCmsFormPattern";
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // case "portal":
|
|
|
+ // root = "x_portal_assemble_designer";
|
|
|
+ // switch (designer.designerType) {
|
|
|
+ // case "script": actionName = "ScriptAction"; fun = "listPortalScriptPattern";
|
|
|
+ // case "page": actionName = "PageAction"; fun = "listPortalPagePattern";
|
|
|
+ // case "widget": actionName = "WidgetAction"; fun = "listPortalWidgetPattern";
|
|
|
+ // }
|
|
|
+ // case "query":
|
|
|
+ // root = "x_query_assemble_designer";
|
|
|
+ // switch (designer.designerType) {
|
|
|
+ // case "view": actionName = "ViewAction"; fun = "listQueryViewPattern";
|
|
|
+ // case "statement": actionName = "StatementAction"; fun = "listQueryStatementPattern";
|
|
|
+ // case "stat": actionName = "StatAction"; fun = "listQueryStatPattern";
|
|
|
+ // }
|
|
|
+ // case "service":
|
|
|
+ // root = "x_program_center";
|
|
|
+ // switch (designer.appId) {
|
|
|
+ // case "invoke": actionName = "InvokeAction"; fun = "listServiceInvokePattern";
|
|
|
+ // case "agent": actionName = "AgentAction"; fun = "listServiceAgentPattern";
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.Actions.load(root)[actionName].get(designer.designerId, function(json){
|
|
|
+ // this[fun](json.data, designer.patternList, item);
|
|
|
+ // }.bind(this))
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ //
|
|
|
+ // getFindRegExp: function(){
|
|
|
+ // var flag = "gm";
|
|
|
+ // var keyword = this.filterOption.keyword;
|
|
|
+ // if (!this.filterOption.caseSensitive) flag+="i";
|
|
|
+ // if (this.filterOption.matchRegExp){
|
|
|
+ // return new RegExp(keyword, flag)
|
|
|
+ // }else{
|
|
|
+ // if (this.filterOption.matchWholeWord) keyword = "\\b"+keyword+"\\b";
|
|
|
+ // return new RegExp(keyword, flag)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // //启动一个webworker处理
|
|
|
+ // listProcessScriptPattern: function (data, patternList, item){
|
|
|
+ // patternList.each(function(pattern){
|
|
|
+ // if (pattern.property == "text"){
|
|
|
+ // var textArr = data.split("\n");
|
|
|
+ // var regex = this.getFindRegExp();
|
|
|
+ // pattern.lines.each(function(line){
|
|
|
+ // var text = textArr[line];
|
|
|
+ //
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // }.bind(this));
|
|
|
+ // }else{
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // }.bind(this));
|
|
|
+ // }
|
|
|
|
|
|
|
|
|
});
|