From 4ae070f370b2c9c14aa3aa605722c6045719539c Mon Sep 17 00:00:00 2001 From: dawncx Date: Thu, 24 Oct 2013 10:17:30 +0800 Subject: [PATCH] admin user management- add edit user information and delete user --- .../haflow/service/FlowExecuteService.java | 1 + .../java/haflow/ui/helper/FlowHelper.java | 2 ++ src/main/webapp/script/haflow.main.js | 28 +++++++++---------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/main/java/haflow/service/FlowExecuteService.java b/src/main/java/haflow/service/FlowExecuteService.java index 22a177c..b3bf0fb 100644 --- a/src/main/java/haflow/service/FlowExecuteService.java +++ b/src/main/java/haflow/service/FlowExecuteService.java @@ -64,6 +64,7 @@ public class FlowExecuteService { StringBuilder messageBuilder = new StringBuilder(); Flow flow = (Flow) this.getFlowService().getFlow(flowId, userid); + if (flow == null) { messageBuilder.append("Flow " + flowId + " not found!"); result.setMessage(messageBuilder.toString()); diff --git a/src/main/java/haflow/ui/helper/FlowHelper.java b/src/main/java/haflow/ui/helper/FlowHelper.java index a011bb4..5a156b9 100644 --- a/src/main/java/haflow/ui/helper/FlowHelper.java +++ b/src/main/java/haflow/ui/helper/FlowHelper.java @@ -151,6 +151,8 @@ public class FlowHelper { node.setFlow(null); node.setId(nodeModel.getId()); node.setModuleId(nodeModel.getModuleId()); + System.out.println("return node moduleId"); + System.out.println(nodeModel.getModuleId()); node.setName(nodeModel.getName()); this.getNodeAppearanceService().mergeNodeAppearance( nodeModel.getId(), nodeModel.getPosition().getLeft(), diff --git a/src/main/webapp/script/haflow.main.js b/src/main/webapp/script/haflow.main.js index 9aa782d..1d8e438 100644 --- a/src/main/webapp/script/haflow.main.js +++ b/src/main/webapp/script/haflow.main.js @@ -195,7 +195,7 @@ HAFlow.Main.prototype.openoozie = function() { HAFlow.Main.prototype.runFlow = function(flowId) { var _currentInstance = this; - $.ajax({ + /*$.ajax({ url : _currentInstance.basePath + "flow/" + flowId, type : "PUT", dataType : "json", @@ -203,7 +203,7 @@ HAFlow.Main.prototype.runFlow = function(flowId) { data : JSON.stringify(_currentInstance.flows[flowId]), success : function(data, status) { HAFlow.showDialog("Save Flow", "Flow saved."); - _currentInstance.refreshFlowList(); + _currentInstance.refreshFlowList();*/ $.ajax({ url : _currentInstance.basePath + "run/" + flowId, type : "POST", @@ -219,12 +219,12 @@ HAFlow.Main.prototype.runFlow = function(flowId) { "An error occurred while running flow: " + error); } }); - }, + /*}, error : function(request, status, error) { HAFlow.showDialog("Error", "An error occurred while saving flow: " + error); } - }); + });*/ }; // Flow Helper @@ -1026,7 +1026,7 @@ HAFlow.Main.prototype.initFlowMenu = function() { dojo.byId("user_name_text_box").innerHTML = data.name; userRealTextBox.set("value", data.realname); userEmailTextBox.set("value", data.email); - if(data.realname==null) tmp="尚未填写"; + if(data.realname==null) tmp="灏氭湭濉啓"; else tmp=data.realname dojo.byId("user_real_text_box").innerHTML=tmp; dojo.byId("user_email_text_box").innerHTML=data.email; @@ -1207,8 +1207,7 @@ HAFlow.Main.prototype.initHdfsFileListTree = function() { if(result.total==0) { dojo.io.iframe.send({ - form: "hdfsfilepath", //ij��formԪ�ذ���ļ�·�� - handleAs: "xml", //������������htmlҳ�� + form: "hdfsfilepath", //某锟斤拷form元锟截帮拷锟斤拷募锟铰凤拷锟� handleAs: "xml", //锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷html页锟斤拷 url:_currentInstance.basePath+"/hdfs/upload?remotePath="+path, load: function(response){ var success = response.getElementsByTagName("success")[0].childNodes[0].nodeValue; @@ -1226,10 +1225,10 @@ HAFlow.Main.prototype.initHdfsFileListTree = function() { } else HAFlow.showDialog("Upload", "Upload failure."); - }, //�ύ�ɹ� + }, //锟结交锟缴癸拷 error: function(e){ HAFlow.showDialog("Upload", "Upload failure."); - }//�ύʧ�� + }//锟结交失锟斤拷 }); } else{ @@ -1372,10 +1371,9 @@ HAFlow.Main.prototype.initHdfsFileListTree = function() { var isDirectory=tn.item.isDirectory; if(isDirectory==false) { - var form = $("
"); //����һ��form�? - - form.attr('style','display:none'); //��form�?����Ӳ�ѯ���� + var form = $(""); //锟斤拷锟斤拷一锟斤拷form锟� + form.attr('style','display:none'); //锟斤拷form锟�锟斤拷锟斤拷硬锟窖拷锟斤拷锟� form.attr('target',''); form.attr('method','post'); @@ -1401,11 +1399,11 @@ HAFlow.Main.prototype.initHdfsFileListTree = function() { input2.attr('value',name); - $('body').append(form); //���?������web�� + $('body').append(form); //锟斤拷锟�锟斤拷锟斤拷锟斤拷web锟斤拷 - form.append(input1); //����ѯ����ؼ��ύ���?�� + form.append(input1); //锟斤拷锟斤拷询锟斤拷锟斤拷丶锟斤拷峤伙拷锟斤拷?锟斤拷 form.append(input2); - form.submit(); //�?�ύ + form.submit(); //锟�锟结交 $("#form1").ajaxForm(function(){ HAFlow.showDialog("Download", "Succeed to download it."); });