update logon pages, update admin pages adding detail information for

module.
This commit is contained in:
dawncx 2013-11-06 16:29:17 +08:00
parent e1457e632f
commit a4c73c3508
16 changed files with 14463 additions and 378 deletions

View File

@ -2,7 +2,7 @@ package haflow.dto.entity;
import java.util.Set;
import java.util.UUID;
import org.hibernate.annotations.Cascade;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;

View File

@ -93,40 +93,59 @@ public class FlowService {
public boolean removeFlow(UUID flowId,int userid) {
Session session = this.getSessionHelper().openSession();
Transaction transaction = session.beginTransaction();
Flow flow=(Flow) session.get(Flow.class, flowId);
MainUser user=(MainUser) session.get(MainUser.class, userid);
if(flow==null) return false;
try {
for(Flow f:user.getFlows()){
if(f.getId().equals(flowId)){
user.getFlows().remove(f);
f.setUser(null);
session.delete(f);
transaction.commit();
session.close();
return true;
for(Flow tmpFlow:user.getFlows()){
if(flow.getId().equals(tmpFlow.getId())){
user.getFlows().remove(tmpFlow);
flow.setUser(null);
session.delete(flow);
transaction.commit();
session.close();
return true;
}
}
}
return false;
//Flow flow = (Flow) session.get(Flow.class, flowId);
// if (flow == null) {
// return false;
// }
// try {
// System.out.println("remove flow before");
// session.delete(flow);
// transaction.commit();
// session.close();
// return true;
} catch (Exception e) {
return false;
}catch (Exception e) {
e.printStackTrace();
transaction.rollback();
session.close();
return false;
}
}
/*for(Flow f:user.getFlows()){
if(f.getId().equals(flowId)){
// user.getFlows().remove(f);
// f.setUser(null);
session.delete(f);
transaction.commit();
session.close();
return true;
}
}*/
/*Flow flow = (Flow) session.get(Flow.class, flowId);
if (flow == null) {
return false;
}
try {
System.out.println("remove flow before");
session.delete(flow);
transaction.commit();
session.close();
return true;
} catch (Exception e) {
e.printStackTrace();
transaction.rollback();
session.close();
return false;
}*/
@SuppressWarnings("unchecked")
public List<Flow> getFlowList(int userid) {
Session session = this.getSessionHelper().openSession();

View File

@ -37,7 +37,7 @@ public class MainLogonController {
this.userHelper = userHelper;
}
@RequestMapping("registration")
@RequestMapping(value="/registration")
public ModelAndView toRegister() {
return new ModelAndView("registration");
}

View File

@ -1,6 +1,7 @@
package haflow.ui.controller;
import haflow.ui.helper.ModuleHelper;
import haflow.ui.model.ModuleBriefModel;
import haflow.ui.model.ModuleListModel;
import java.io.File;
@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@Controller
@RequestMapping("/module")
@ -32,7 +34,11 @@ public class ModuleController {
private void setModuleHelper(ModuleHelper moduleHelper) {
this.moduleHelper = moduleHelper;
}
@RequestMapping(value="/get/{moduleId}",method=RequestMethod.GET)
@ResponseBody
public ModuleBriefModel get(@PathVariable UUID moduleId){
return this.getModuleHelper().getModule(moduleId);
}
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public ModuleListModel get() {
@ -40,7 +46,7 @@ public class ModuleController {
}
@RequestMapping(method = RequestMethod.POST)
public ModelAndView post(@RequestParam("file") CommonsMultipartFile file) {
public String post(RedirectAttributes redirectAttributes, @RequestParam("file") CommonsMultipartFile file) {
if (!file.isEmpty()) {
try {
String fileName = file.getOriginalFilename();
@ -53,16 +59,20 @@ public class ModuleController {
File toUpload = new File(filePath);
FileCopyUtils.copy(bytes, toUpload);
logger.info(fileName + " uploaded to : " + filePath);
return new ModelAndView("upload-success");
redirectAttributes.addFlashAttribute("uploadmessage","upload successed!");
return "redirect:/adminhome";
} else {
return new ModelAndView("upload-error");
redirectAttributes.addAttribute("uploadmessage","upload failed!");
return "redirect:/adminhome";
}
} catch (Exception e) {
e.printStackTrace();
return new ModelAndView("upload-error");
redirectAttributes.addAttribute("uploadmessage","upload failed!");
return "redirect:/adminhome";
}
}
return new ModelAndView("upload-error");
redirectAttributes.addFlashAttribute("uploadmessage","upload failed!");
return "redirect:/adminhome";
}
@RequestMapping(value = "/remove/{moduleId}", method = RequestMethod.GET)

View File

@ -10,6 +10,7 @@ import haflow.ui.model.ModuleEndpointModel;
import haflow.ui.model.ModuleListModel;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -41,7 +42,50 @@ public class ModuleHelper {
public ModuleHelper() {
ModuleHelper.setModuleHelper(this);
}
public ModuleBriefModel getModule(UUID moduleId){
Module m= this.getModuleUtil().getModule(moduleId);
if(m==null) return null;
ModuleBriefModel moduleBriefModel=new ModuleBriefModel();
moduleBriefModel.setId(UUID.fromString(m.id()));
moduleBriefModel.setName(m.name());
moduleBriefModel.setCategory(m.category());
ModuleConfiguration[] moduleConfigurations=m.configurations();
List<ModuleConfigurationModel> mcList=new ArrayList<ModuleConfigurationModel>();
for(ModuleConfiguration mc:moduleConfigurations){
ModuleConfigurationModel module=new ModuleConfigurationModel();
module.setKey(mc.key());
module.setDisplayName(mc.displayName());
module.setPattern(mc.pattern());
module.setType(mc.type());
mcList.add(module);
}
moduleBriefModel.setConfigurations(mcList);
ModuleEndpoint[] inputs=m.inputs();
List<ModuleEndpointModel> miList=new ArrayList<ModuleEndpointModel>();
for(ModuleEndpoint me:inputs){
ModuleEndpointModel model=new ModuleEndpointModel();
model.setName(me.name());
model.setDataType(me.dataType().toString());
model.setMaxNumber(me.maxNumber());
model.setMinNumber(me.minNumber());
miList.add(model);
}
moduleBriefModel.setInputs(miList);
ModuleEndpoint[] outputs=m.outputs();
List<ModuleEndpointModel> moList=new ArrayList<ModuleEndpointModel>();
for(ModuleEndpoint me:outputs){
ModuleEndpointModel model=new ModuleEndpointModel();
model.setName(me.name());
model.setDataType(me.dataType().toString());
model.setMaxNumber(me.maxNumber());
model.setMinNumber(me.minNumber());
moList.add(model);
}
moduleBriefModel.setOutputs(moList);
return moduleBriefModel;
}
public boolean removeModule(UUID moduleId) {
return this.getModuleUtil().removeModule(moduleId);
}

View File

@ -9,16 +9,30 @@
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>HA Flow Administration</title>
<!-- <link rel="stylesheet"
href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dijit/themes/claro/claro.css"> -->
<link rel="stylesheet" href="<%=basePath%>/style/site.css">
<body>
<!-- <script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/dojo.js"></script> -->
<script type="text/javascript">
var basePath="<%=basePath%>";
</script>
<%-- <script type="text/javascript" src="<%=basePath%>script/admin.js"></script> --%>
</head>
<body class="claro">
<h1>Haflow Administration</h1>
<h2>Module List</h2>
<table>
<table id="modulelist">
<tr>
<th>Module Id</th>
<th>Name</th>
@ -35,6 +49,7 @@
<td><%=moduleBriefModel.getCategory()%></td>
<td><a
href="module/remove/<%=moduleBriefModel.getId().toString()%>">Remove</a></td>
<td><a onclick="javascript:getModuleInfo(this); return false;" href="#">Edit</a></td>
</tr>
<%
}

View File

@ -8,6 +8,13 @@
+ path + "/";
String username = request.getSession().getAttribute("username")
.toString();
boolean isModuleUpload=false;
String moduleUploadMessage=null;
if(request.getAttribute("uploadmessage")!=null) {
isModuleUpload=true;
moduleUploadMessage=(String)request.getAttribute("uploadmessage");
}
boolean flag;
Object message = request.getAttribute("message");
if (request.getAttribute("message") != null) {
@ -50,7 +57,8 @@ html,body {
src="http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/dojo.js"></script>
<script>
require(["dojo/parser", "dijit/layout/TabContainer", "dojox/layout/ContentPane","dijit/MenuBar","dijit/layout/BorderContainer"]);
require(["dojo/parser", "dijit/Dialog","dijit/layout/TabContainer", "dojox/layout/ContentPane","dijit/MenuBar","dijit/layout/BorderContainer"]);
var flag=<%=flag%>
if(flag){
@ -58,12 +66,17 @@ require(["dojo/parser", "dijit/layout/TabContainer", "dojox/layout/ContentPane",
alert(message);
}
var basePath="<%=basePath%>";
var flag1=<%=isModuleUpload%>;
var message1="<%=moduleUploadMessage%>";
</script>
</head>
<body class="claro">
<script type="text/javascript" src="<%=basePath%>script/admin.js"></script>
<script type="text/javascript"
src="<%=basePath%>script/adminusermana.js"></script>
<div data-dojo-type="dijit/layout/BorderContainer"
data-dojo-props="design:'sidebar', gutters:true, liveSplitters:true"
id="borderContainer">

View File

@ -1,70 +0,0 @@
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
String username=request.getSession().getAttribute("username").toString();
%>
<html >
<head>
<link rel="stylesheet"
href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dijit/themes/claro/claro.css">
<style type="text/css">
html, body {
width: 100%;
height: 100%;
margin: 0;
overflow:hidden;
}
#borderContainer {
width: 100%;
height: 100%;
}
</style>
<script>dojoConfig = {parseOnLoad: true}</script>
<script src='http://dojotoolkit.org/reference-guide/1.9/_static/js/dojo/dojo.js'></script>
<script>
require(["dojo/parser", "dijit/layout/TabContainer", "dijit/layout/ContentPane","dijit/layout/BorderContainer"]);
</script>
</head>
<body class="claro">
<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar', gutters:true, liveSplitters:true" id="borderContainer">
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="splitter:true, region:'leading'" style="width: 100px;">
<h2>Haflow</h2>
<h2>Background</h2>
<h5>hello <%=username %></h5>
</div>
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="splitter:true, region:'center'">
<div data-dojo-type="dijit/layout/TabContainer" style="width: 100%; height: 100%;">
<div data-dojo-type="dijit/layout/ContentPane" title="Module List" href="admin">
</div>
<div data-dojo-type="dijit/layout/ContentPane" title="User List" href="adminusermana">
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,109 +0,0 @@
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
String username=request.getSession().getAttribute("username").toString();
%>
<html >
<head>
<link rel="stylesheet"
href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dijit/themes/claro/claro.css">
<style type="text/css">
html, body {
width: 100%;
height: 100%;
margin: 0;
overflow:hidden;
}
#borderContainer {
width: 100%;
height: 100%;
}
</style>
<script>dojoConfig = {parseOnLoad: true}</script>
<script src='http://dojotoolkit.org/reference-guide/1.9/_static/js/dojo/dojo.js'></script>
<script>
require(["dojo/parser", "dijit/layout/TabContainer", "dijit/layout/ContentPane","dijit/MenuBar","dijit/layout/BorderContainer"]);
</script>
</head>
<body class="claro">
<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar', gutters:true, liveSplitters:true" id="borderContainer">
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top', splitter:false">
<h2>Haflow Background</h2>
<h5>hello <%=username %></h5>
</div>
<div data-dojo-type="dijit/layout/TabContainer" data-dojo-props="region:'center', tabStrip:false">
<div data-dojo-type="dijit/layout/ContentPane" title="Module List" href="admin">
</div>
<div data-dojo-type="dijit/layout/ContentPane" title="User List" href="adminusermana">
</div>
</div>
</div>
<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar', gutters:true, liveSplitters:true" id="borderContainer">
<div data-dojo-type="dijit/MenuBar" data-dojo-props="region:'top', splitter:false">
<div data-dojo-type="dijit/layout/ContentPane" style="float:left"><h2>Haflow Background</h2></div>
<div data-dojo-type="dijit/layout/ContentPane" style="float:right"><h5>hello<font color=red><%=username %></font> | <a href="quit">quit</a></h5>
</div>
</div>
</div>
<div data-dojo-type="dijit/layout/TabContainer" data-dojo-props="region:'center', tabStrip:false">
<div data-dojo-type="dijit/layout/ContentPane" title="Module List" href="admin">
</div>
<div data-dojo-type="dijit/layout/ContentPane" title="User List" href="adminusermana">
</div>
</div>
<%-- <div data-dojo-type="dijit/MenuBar" data-dojo-props="region:'top'" style="width: 100px;">
<div data-dojo-type="dijit/layout/ContentPane" style="float:left">Haflow Background</div>
<div data-dojo-type="dijit/layout/ContentPane" >hello <%=username %></div>
</div>
<div data-dojo-type="dijit/layout/TabContainer" style="width: 100%;">
<div data-dojo-type="dijit/layout/ContentPane" title="Module List" href="admin">
</div>
<div data-dojo-type="dijit/layout/ContentPane" title="User List" href="adminusermana">
</div>
</div> --%>
</body>
</html>

View File

@ -1,55 +1,244 @@
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="<%=basePath%>script/logon.js"></script>
<link rel="stylesheet" href="<%=basePath%>/style/index.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Haflow Logon</title>
</head>
<body>
<div class="wrapper">
<div class="title">
<h1>大数据分析服务平台</h1>
</div>
<div class="content">
<div class="left">
<img src="<%=basePath%>/images/logon.png" />
</div>
<div class="right">
<!-- <h2>登录</h2> -->
<form id="form1" name="form1" action="" method="post">
<div class="field">
<span style="float: left; width: 80px;">用户名:</span><input type="text" id="username" name="username" />
<span id="error_username"></span>
</div><br/>
<div class="field">
<span style="float: left; width: 80px;">密码:</span><input type="password" id="password" name="password" />
<span id="error_password"></span>
</div><br/>
<div><span id="errorSpan"><%if(request.getAttribute("message")!=null) out.println(request.getAttribute("message")); %></span></div>
<div>
<button style="width: 70px;height: 35px; font-family:Arial;font-size:14px;font-weight:bold;color:#333333;" type="submit" name="main-log" onclick="fun()">登录</button>
&nbsp;&nbsp;
<button style="width: 120px;height: 35px; font-family:Arial;font-size:14px;font-weight:normal;color:#333333;" type="button" name="admin-log" onclick="fun1();">管理员登录</button>
</div>
<div class="field">
<span style="float: left; width: 120px;">还没有账户?</span><a href="registration">立即注册</a>
</div>
</form>
</div>
<div class="clear"></div>
</div>
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Start Your Free Trial | Haflow Sign In</title>
<meta name="description" content="Contact Us - Big Data Analytics - haflow" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="<%=basePath%>/script/js/logon.js"></script>
<link rel="stylesheet" href="<%=basePath%>/style/logon.css">
<script type="text/javascript" language="javascript" src="<%=basePath%>/script/js/website-min.js"></script>
<style type="text/css">
form {
width:500px;
margin-top: 50px;
}
form li label { float:left; }
input.submit_btn{
display: block;
height: 36px;
width: 322px;
font-size: 18px;
color: #fff;
position: relative;
font-family: 'OpenSans-Regular',Arial;
font-weight: normal;
border: 1px solid #77b800;
text-decoration: none !important;
background: url(images/mini-btn-green.png) repeat-x left top #0093d0;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: #D6D6D6;
cursor:pointer;
}
input.facebook{
display: block;
height: 36px;
width: 322px;
font-size: 18px;
color: #fff;
position: relative;
font-family: 'OpenSans-Regular',Arial;
border: none;
text-decoration: none !important;
background: url(images/btn-login-with-facebook.png) repeat-x left top #0093d0;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
cursor:pointer;
}
input.facebook:hover {
background-position: 0 36px;
}
ul.blocks li ul.table li {
color:#888;
width:300px;
padding:3px 35px !important;
font-size:16px;
border-bottom:0px solid #fff;
background:url(images/tick.png) no-repeat left center transparent
}
ul.blocks li p.bannerh1 {
font-size:30px;
color: #fff;
font-family: 'HelveticaNeue', Helvetica, Arial, sans-serif;
font-weight: 300;
line-height: -20px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="content_h">
<div id="menu">
<span id="logo_menu" style="display: block; margin-left: 15px;">
<img width="500" height="70" src="<%=basePath %>/images/logo.png" alt="Haflow Analytics for Hadoop">
</span>
<ul>
<li>&nbsp;</li>
</ul>
<div>
<a class="topbuynow" href="registration" style="color:#fff;">Sign up for Haflow</a>
</div>
<div class="shadow_header"></div>
</div>
<div class="clear"></div>
</div>
</div>
<div id="wrapp-content">
<div class="clear"></div>
<div id="content">
<div class="top_info">
<h1>Sign in for your secure trial of Haflow</h1>
</div>
<div class="clear"></div><br />
<ul class="blocks">
<li class="wid540">
<form class="lpeRegForm formNotEmpty" method="post" enctype="application/x-www-form-urlencoded" action="" id="form" name="form">
<ul class='mktLblLeft'>
<li class='mktField' style="width:500px;">
<table>
<tr>
<td style="width:150px; vertical-align:top;">&nbsp;</td>
<td>
<span id="errorSpan" style="color:#F00"><%if(request.getAttribute("message")!=null) out.println("*"+request.getAttribute("message")); %></span>
</td>
</tr>
</li>
<li class='mktFormReq mktField' style="width:500px;" >
<table>
<tr>
<td style="width:150px;"><label>Name:</label>
<span style="color:#F00">*</span></td>
<td><span class='mktInput'><input class='mktFormText mktFormString mktFReq' name="username" id="username" type='text' value="" maxlength='255' tabIndex='1' />
<span class='mktFormMsg' id="error_username"></span></span>
</td>
</tr>
</table>
</li>
<div class="clear"></div><br />
<li class='mktFormReq mktField' style="width:500px;" >
<table>
<tr>
<td style="width:150px;"><label>Password:</label><span style="color:#F00">*</span></td>
<td><span class='mktInput'><input class='mktFormText mktFormString mktFReq' name="password" id="password" type='password' value="" maxlength='255' tabIndex='2' />
<span class='mktFormMsg' id="error_password"></span></span>
</td>
</tr>
</table>
</li>
<div class="clear"></div><br />
<li class='mktField' style="width:500px;">
<table>
<tr>
<td style="width:150px; vertical-align:top;">&nbsp;</td>
<td><br />
<div id='mktFrmButtons'>
<input id='mktFrmSubmit' type='button' class="submit_btn" value='Sign In' name='main-log' onclick="fun()"/>
<p align="center" style="font-weight:700; padding-bottom:4px;">OR</p>
<input id='mktFrmSubmit' type='button' class="facebook" value='Administrator Sign In' name='admin-log' onclick="fun1()"/>
</div>
</td>
</tr>
</table>
</li>
<li class='mktField' style="display: none;"><label>Lead Source:</label><span class='mktInput'><input class='mktFormHidden' name="LeadSource" id="LeadSource" type='hidden' value="Website" /><span class='mktFormMsg'></span></span></li>
<div class="clear"></div><br />
</ul>
<span style="display:none;"><input type="text" name="_marketo_comments" value="" /></span>
</form>
</li>
<li class="wid340">
<img src="<%=basePath%>/images/logon.png" alt="Start Your Trial - Haflow" width="460" />
<ul class="table">
<li>Instant access to Haflow.</li>
<li>No download required.</li>
</ul>
</li>
</ul>
<div class="clear"></div>
<div class="clear"></div>
<div class="line margintop"></div>
<div id="copyright">&copy; 2013 Technology Center of Software Egnineering, Institute of Software Chinese Academy of Sciences. All rights reserved. </div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<!-- please only change if you know what you do -->
<input name="modules" value="onlineInstance" type="hidden" />
<!--[if IE]>
<input name="modules" value="ieExtention" type="hidden" />
<![endif]-->
<input name="modules" value="menueAllwaysTop" type="hidden" />
<input name="modules" value="marketoTracking" type="hidden" />
<!-- please only change if you know what you do -->
<!-- start leadlander -->
<script type="text/javascript" language="javascript">llactid=17071</script>
<!-- end leadlander -->
</body>
</html>

View File

@ -1,70 +1,267 @@
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="<%=basePath%>/style/index.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Haflow Registration</title>
</head>
<body>
<div class="wrapper">
<div class="title">
<h1>大数据分析服务平台</h1>
</div>
<div class="content">
<div class="left">
<img src="<%=basePath%>/images/logon.png" />
</div>
<div class="right">
<!-- <h2>登录</h2> -->
<form id="form2" action="regiscommit" method="post">
<div class="field">
<span style="float: left; width: 80px;">用户名:</span><input type="text" name="username" onblur="" />
<span id="username_err" ></span>
</div><br/>
<div class="field">
<span style="float: left; width: 80px;">邮箱:</span><input type="text" name="email" />
<span id="email_err" ></span>
</div><br/>
<div class="field">
<span style="float: left; width: 80px;">输入密码:</span><input type="password" name="password" />
<span id="password_err" ></span>
</div><br/>
<div class="field">
<span style="float: left; width: 80px;">确认密码:</span><input type="password" name="password1" onblur="checkPass()"/>
<span id="password1_err" ></span>
</div><br/>
<div><span id="errorSpan"><%if(request.getAttribute("message")!=null) out.println(request.getAttribute("message")); %></span></div>
<div>
<button style="width: 120px;height: 35px; font-family:Arial;font-size:14px;font-weight:bold;color:#333333;" type="button" name="main-log" onclick="fun3()">立即注册</button>
&nbsp;&nbsp;
<button style="width: 120px;height: 35px; font-family:Arial;font-size:14px;font-weight:normal;color:#333333;" type="button" name="admin-log" onclick="fun4()">管理员注册</button>
</div>
<div class="field">
<span style="float: left; width: 220px;">已有账户?<a href="/haflow">立即登陆</a></span>
</div>
<input id="mora" type="hidden" name="mora" />
</form>
</div>
<div class="clear"></div>
</div>
</div>
</body>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript" src="<%=basePath%>script/registration.js"></script>
</html>
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Start Your Free Trial | Haflow Sign Up</title>
<meta name="description" content="Contact Us - Big Data Analytics - haflow" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="<%=basePath%>/script/js/registration.js"></script>
<link rel="stylesheet" href="<%=basePath%>/style/logon.css">
<script type="text/javascript" language="javascript" src="<%=basePath%>/script/js/website-min.js"></script>
<style type="text/css">
form {
width:500px;
}
form li label { float:left; }
input.submit_btn{
display: block;
height: 36px;
width: 322px;
font-size: 18px;
color: #fff;
position: relative;
font-family: 'OpenSans-Regular',Arial;
font-weight: normal;
border: 1px solid #77b800;
text-decoration: none !important;
background: url(images/mini-btn-green.png) repeat-x left top #0093d0;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: #D6D6D6;
cursor:pointer;
}
input.facebook{
display: block;
height: 36px;
width: 322px;
font-size: 18px;
color: #fff;
position: relative;
font-family: 'OpenSans-Regular',Arial;
border: none;
text-decoration: none !important;
background: url(images/btn-login-with-facebook.png) repeat-x left top #0093d0;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
cursor:pointer;
}
input.facebook:hover {
background-position: 0 36px;
}
ul.blocks li ul.table li {
color:#888;
width:300px;
padding:3px 35px !important;
font-size:16px;
border-bottom:0px solid #fff;
background:url(images/tick.png) no-repeat left center transparent
}
ul.blocks li p.bannerh1 {
font-size:30px;
color: #fff;
font-family: 'HelveticaNeue', Helvetica, Arial, sans-serif;
font-weight: 300;
line-height: -20px;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="content_h">
<div id="menu">
<span id="logo_menu" style="display: block; margin-left: 15px;">
<img width="500" height="70" src="<%=basePath %>/images/logo.png" alt="Haflow Analytics for Hadoop">
</span>
<ul>
<li>&nbsp;</li>
</ul>
<div>
<a class="topbuynow" href="/haflow" style="color:#fff;">Already have an account?Sign in now!</a>
</div>
<div class="shadow_header"></div>
</div>
<div class="clear"></div>
</div>
</div>
<div id="wrapp-content">
<div class="clear"></div>
<div id="content">
<div class="top_info">
<h1>Sign up for your secure trial of Haflow</h1>
</div>
<div class="clear"></div><br />
<ul class="blocks">
<li class="wid540">
<form class="lpeRegForm formNotEmpty" method="post" enctype="application/x-www-form-urlencoded" action="regiscommit" id="mktForm_1116" name="mktForm_1116">
<ul class='mktLblLeft'>
<li class='mktField' style="width:500px;">
<table>
<tr>
<td style="width:150px; vertical-align:top;">&nbsp;</td>
<td>
<span id="errorSpan" style="color:#F00"><%if(request.getAttribute("message")!=null) out.println("*"+request.getAttribute("message")); %></span>
</td>
</tr>
</li>
<li class='mktFormReq mktField' style="width:500px;" >
<table>
<tr>
<td style="width:150px;"><label>Name:</label>
<span style="color:#F00">*</span></td>
<td><span class='mktInput'><input class='mktFormText mktFormString mktFReq' name="username" id="username" type='text' value="" maxlength='255' tabIndex='1' onblur=""/>
<span class='mktFormMsg' id="username_err"></span></span>
</td>
</tr>
</table>
</li>
<div class="clear"></div><br />
<li class='mktFormReq mktField' style="width:500px;" >
<table>
<tr>
<td style="width:150px;"><label>Email:</label>
<span style="color:#F00">*</span></td>
<td><span class='mktInput'><input class='mktFormText mktFormString mktFReq' name="email" id="email" type='text' value="" maxlength='255' tabIndex='1' />
<span class='mktFormMsg' id="email_err"></span></span>
</td>
</tr>
</table>
</li>
<div class="clear"></div><br />
<li class='mktFormReq mktField' style="width:500px;" >
<table>
<tr>
<td style="width:150px;"><label>Password:</label><span style="color:#F00">*</span></td>
<td><span class='mktInput'><input class='mktFormText mktFormString mktFReq' name="password" id="password" type='password' value="" maxlength='255' tabIndex='2' />
<span class='mktFormMsg' id="password_err"></span></span>
</td>
</tr>
</table>
</li>
<div class="clear"></div><br />
<li class='mktFormReq mktField' style="width:500px;" >
<table>
<tr>
<td style="width:150px;"><label>Confirm Password:</label>
<span style="color:#F00">*</span></td>
<td><span class='mktInput'><input class='mktFormText mktFormString mktFReq' name="password1" id="password1" type='password' value="" maxlength='255' tabIndex='1' />
<span class='mktFormMsg' id="password1_err"></span></span>
</td>
</tr>
</table>
</li>
<div class="clear"></div><br />
<li class='mktField' style="width:500px;">
<table>
<tr>
<td style="width:150px; vertical-align:top;">&nbsp;</td>
<td><br />
<div id='mktFrmButtons'>
<input id='mktFrmSubmit' type='button' class="submit_btn" value='Sign Up Now' name='main-log' onclick="fun3()"/>
<p align="center" style="font-weight:700; padding-bottom:4px;">OR</p>
<input id='mktFrmSubmit' type='button' class="facebook" value='Administrator Sign Up' name='admin-log' onclick="fun4()"/>
</div>
</td>
</tr>
</table>
</li>
<li class='mktField' style="display: none;"><label>Lead Source:</label><span class='mktInput'><input class='mktFormHidden' name="LeadSource" id="LeadSource" type='hidden' value="Website" /><span class='mktFormMsg'></span></span></li>
<div class="clear"></div><br />
</ul>
<span style="display:none;"><input type="text" name="_marketo_comments" value="" /></span>
<input id="mora" type="hidden" name="mora" />
</form>
</li>
<li class="wid340">
<img src="./images/logon.png" alt="Start Your Trial - Haflow" width="460" />
<ul class="table">
<li>Instant access to Haflow.</li>
<li>No download required.</li>
</ul>
</li>
</ul>
<div class="clear"></div>
<div class="clear"></div>
<div class="line margintop"></div>
<div id="copyright">&copy; 2013 Technology Center of Software Egnineering, Institute of Software Chinese Academy of Sciences. All rights reserved. </div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<!-- please only change if you know what you do -->
<input name="modules" value="onlineInstance" type="hidden" />
<!--[if IE]>
<input name="modules" value="ieExtention" type="hidden" />
<![endif]-->
<input name="modules" value="menueAllwaysTop" type="hidden" />
<input name="modules" value="marketoTracking" type="hidden" />
<!-- please only change if you know what you do -->
<!-- start leadlander -->
<script type="text/javascript" language="javascript">llactid=17071</script>
</body>
</html>

View File

@ -4,15 +4,17 @@ dojo.require("dijit.form.Button");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.Form");
dojo.require("dijit.Dialog");
var confirmdialog;
showDialog = function(title, content) {
var dialog = new dijit.Dialog({
title : title,
content : content,
style : "width:400px"
showDialog=function(title, content){
dialog = new dijit.Dialog({
title:title,
content:content,
style : "width:400px",
});
dialog.show();
};
var confirmDialog=function(){};
confirmDialog.userid;
@ -20,13 +22,10 @@ confirmDialog.init=function(){
content="Are You Sure?"+
"<br/><div><span id='yesButton'>Yes</span>" +
"<span id='noButton'>No</span></div>";
dialog=new dijit.Dialog({
confirmdialog=new dijit.Dialog({
title:"confirm",
content:content,
Style: "width:400px",
onHide : function() {
this.destroyRecursive();
}
});
@ -39,10 +38,10 @@ confirmDialog.init=function(){
var cancelButton=new dijit.form.Button({
label:"No",
},"noButton");
dialog.startup();
confirmdialog.startup();
dojo.connect(confirmButton,"onClick",delUser);
dojo.connect(cancelButton,"onClick",function(mouseEvent) {
dialog.hide();});
confirmdialog.hide();});
//dialog.addChild(confirmButton);
//dialog.addChild(cancelButton);
@ -218,17 +217,6 @@ var loadUsers = function() {
innerHTML : "<p><font color=red>NOTE: 0=users;1=administrators(Role)</font></p>"
}, dojo.byId("table_pane"));
dojo.place(table, dojo.byId("table_pane"));
/*
* var editbutton=new dijit.form.Button({ label:"edit"
* });
*/
// dojo.connect(editbutton,"onclick",null,showUserInfoDia());
/*
* for(var j=0;j<i;j++)
* editbutton.placeAt(dojo.byId("edit_user_button"+j));
* editbutton.startup();
*/
}
},
error : function(request, status, error) {
@ -241,33 +229,31 @@ var loadUsers = function() {
dojo.addOnLoad(function() {
dojo.byId("title").innerHTML="<h2>Haflow Background</h2>";
loadUsers();
newDialog.init();
confirmDialog.init();
});
function deleteRow(obj) {
var row = obj.parentNode.parentNode;
confirmDialog.userid = document.getElementById("userlist").rows[row.rowIndex].cells[0].innerHTML;
dialog.show();
confirmdialog.show();
};
var haha=function(){
alert("helo wangjie");
}
var delUser=function(){
dialog.hide();
confirmdialog.hide();
$.ajax({
url : basePath + "user/remove/"+confirmDialog.userid,
type : "DELETE",
cache : false,
dataType : "json",
success : function(data, status) {
alert(data.success);
if (data.success == true) {
showDialog("Success", "Successfully delete the user! ");
loadUsers();

View File

@ -9,14 +9,14 @@ function fun1(){
function userlogon()
{
document.getElementById("form1").action="logon";
document.getElementById("form1").submit();
document.getElementById("form").action="logon";
document.getElementById("form").submit();
}
function adminlogon()
{
document.getElementById("form1").action="adminlogon";
document.getElementById("form1").submit();
document.getElementById("form").action="adminlogon";
document.getElementById("form").submit();
}
function checkField(){

View File

@ -1,10 +1,11 @@
function fun3(){
cleanErrlog();
if(checkAll()&&RePass()){
document.getElementById("mora").value = "main";
document.getElementById("form2").submit();
document.getElementById("mktForm_1116").submit();
}
@ -14,7 +15,7 @@ if(checkAll()&&RePass()){
document.getElementById("mora").value= "admin";
document.getElementById("form2").submit();
document.getElementById("mktForm_1116").submit();
}
}
@ -36,6 +37,7 @@ function RePass(){
}
else{
document.getElementById("password1_err").innerHTML="Password doesn't match the confirmation";
document.getElementsByName('password1')[0].style.border="1px solid red";
return false;
}
@ -77,7 +79,16 @@ function checkPass() {
if((null_flag==0)) return true;
else return false;
}
function cleanErrlog(){
document.getElementById('username_err').innerHTML="";
document.getElementsByName('username')[0].style.border="";
document.getElementById('email_err').value="";
document.getElementsByName('email')[0].style.border="";
document.getElementById('password_err').value="";
document.getElementsByName('password')[0].style.border="";
document.getElementById('password1_err').value="";
document.getElementsByName('password1')[0].style.border="";
}
function clean() {
document.getElementsByName('username')[0].value="";
document.getElementsByName('password')[0].value="";

12339
src/main/webapp/script/js/website-min.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff