You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by pr...@apache.org on 2014/01/19 15:16:13 UTC
git commit: tenant management integration bits. addNew returns a
string and jaggery post fails. have to investigate. working partially
Updated Branches:
refs/heads/master ddd5558ab -> 8b7ca5c57
tenant management integration bits. addNew returns a string and jaggery post fails. have to investigate. working partially
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/8b7ca5c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/8b7ca5c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/8b7ca5c5
Branch: refs/heads/master
Commit: 8b7ca5c57c2cc26cdf41a60b7924dc0a220c40cc
Parents: ddd5558
Author: Pradeep Fernando <pr...@gmail.com>
Authored: Sun Jan 19 19:45:51 2014 +0530
Committer: Pradeep Fernando <pr...@gmail.com>
Committed: Sun Jan 19 19:45:51 2014 +0530
----------------------------------------------------------------------
.../console/controllers/addTenantSubmit.jag | 9 -------
.../console/controllers/newTenantSubmit.jag | 28 ++++++++++++++++++++
.../themes/theme1/partials/tenant_new.hbs | 24 ++++++++---------
.../console/util/utility.jag | 4 +++
4 files changed, 44 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/8b7ca5c5/components/org.apache.stratos.manager.console/console/controllers/addTenantSubmit.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/addTenantSubmit.jag b/components/org.apache.stratos.manager.console/console/controllers/addTenantSubmit.jag
deleted file mode 100644
index bf1ae1b..0000000
--- a/components/org.apache.stratos.manager.console/console/controllers/addTenantSubmit.jag
+++ /dev/null
@@ -1,9 +0,0 @@
-<%
-(function(){
- var log = new Log("controller.addTenantSubmit");
- var utils = require('/util/utility.jag');
- var policyDefinition = request.getParameter("policy-definition").trim();
- utils.consoleAppUtil.deployCartridgeDefinition(policyDefinition);
- response.sendRedirect(request.getContextPath() + '/policy_deployments.jag');
-}());
-%>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/8b7ca5c5/components/org.apache.stratos.manager.console/console/controllers/newTenantSubmit.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/controllers/newTenantSubmit.jag b/components/org.apache.stratos.manager.console/console/controllers/newTenantSubmit.jag
new file mode 100644
index 0000000..13f2f64
--- /dev/null
+++ b/components/org.apache.stratos.manager.console/console/controllers/newTenantSubmit.jag
@@ -0,0 +1,28 @@
+<%
+(function(){
+ var log = new Log("controller.newTenantSubmit");
+ var utils = require('/util/utility.jag');
+ var jsonRequest = {};
+ jsonRequest.tenantInfoBean = {};
+
+ //get user input
+ var adminName = request.getParameter("adminName");
+ var firstName = request.getParameter("firstName");
+ var lastName = request.getParameter("lastName");
+ var adminPassword = request.getParameter("adminPassword");
+ var email = request.getParameter("email");
+ var tenantDomain= request.getParameter("tenantDomain");
+
+ //create json request
+ jsonRequest.tenantInfoBean.admin = adminName;
+ jsonRequest.tenantInfoBean.firstname = firstName;
+ jsonRequest.tenantInfoBean.lastname = lastName;
+ jsonRequest.tenantInfoBean.adminPassword = adminPassword;
+ jsonRequest.tenantInfoBean.email = email;
+ jsonRequest.tenantInfoBean.tenantDomain = tenantDomain;
+
+
+ utils.consoleAppUtil.addTenant(jsonRequest);
+ response.sendRedirect(request.getContextPath() + '/tenant_management.jag');
+}());
+%>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/8b7ca5c5/components/org.apache.stratos.manager.console/console/themes/theme1/partials/tenant_new.hbs
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/tenant_new.hbs b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/tenant_new.hbs
index aecd7a9..ad88283 100644
--- a/components/org.apache.stratos.manager.console/console/themes/theme1/partials/tenant_new.hbs
+++ b/components/org.apache.stratos.manager.console/console/themes/theme1/partials/tenant_new.hbs
@@ -6,12 +6,12 @@
</div>
</div>
<div class="container">
-<div class="row">
- <div class="col-md-12">
- <form method="post" action="{{url "/tenant_management.jag" }}">
+ <div class="row">
+ <div class="col-md-12">
+ <form method="post" action="{{url "/controllers/newTenantSubmit.jag" }}">
<div class="h2-wrapper"><h2>Domain Information</h2></div>
<label class="required">Domain:</label>
- <div class="form-inline"><input type="text" placeholder="example.com"/> <button class="btn btn-default">Check Availability</button></div>
+ <div class="form-inline"><input name="tenantDomain" type="text" placeholder="example.com"/> <button class="btn btn-default">Check Availability</button></div>
<label><input type="checkbox"/> Validate the domain now (Optional)</label>
<div class="h2-wrapper"><h2>Usage Plan Information</h2></div>
@@ -25,20 +25,20 @@
<div class="col-md-3 padding-remover-left">
<label class="required">First Name:</label>
- <input type="text"/>
+ <input name="firstName" type="text"/>
</div>
<div class="col-md-3">
<label class="required">Last Name:</label>
- <input type="text"/>
+ <input name="lastName" type="text"/>
</div>
<div class="clearfix"></div>
<label class="required">Admin User Name:</label>
- <input type="text"/>
+ <input name="adminName" type="text"/>
<div class="clearfix"></div>
<div class="col-md-3 padding-remover-left">
- <label class="required">Admin Password:</label>
- <input type="text"/>
+ <label class="required">Admin Password:</label>
+ <input name="adminPassword" type="text"/>
</div>
<div class="col-md-3">
<label class="required">Admin Password (Repeat):</label>
@@ -47,7 +47,7 @@
<div class="clearfix"></div>
<label class="required">Email:</label>
- <input type="text"/>
+ <input name="email" type="text"/>
<label class="required">Are you human?</label>
<div style="padding-bottom:10px;"><i class="icons-help icons-small-size"></i> Type the characters you see in the picture below.</div>
@@ -59,9 +59,9 @@
<label><input type="checkbox"/> I agree</label>
<button class="btn btn-primary" type="submit">Add new Tenant</button>
- </form>
+ </form>
+ </div>
</div>
</div>
-</div>
<script src="{{url "/themes/theme1/ui/js/utils.js"}}"></script>
<script src="{{url "/themes/theme1/ui/js/tenant_management.js"}}"></script>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/8b7ca5c5/components/org.apache.stratos.manager.console/console/util/utility.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/util/utility.jag b/components/org.apache.stratos.manager.console/console/util/utility.jag
index 2e36360..abed6d8 100644
--- a/components/org.apache.stratos.manager.console/console/util/utility.jag
+++ b/components/org.apache.stratos.manager.console/console/util/utility.jag
@@ -113,6 +113,10 @@ consoleAppUtil = new function(){
return this.sendReceive("POST","/cartridge/subscribe", cartridgeBeanInfo).data;
}
+ this.addTenant = function(tenantInfoBean){
+ return this.sendReceive("POST","/tenant",tenantInfoBean).data;
+ }
+
this.getAutoScalePolicies = function(){
return this.sendReceive("GET","/policy/autoscale",{}).data;
}