http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/add_tenant.jsp ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/add_tenant.jsp b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/add_tenant.jsp deleted file mode 100644 index f466a8b..0000000 --- a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/add_tenant.jsp +++ /dev/null @@ -1,387 +0,0 @@ -<%-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --%> -<%@ page import="org.apache.stratos.common.util.CommonUtil" %> -<%@ page import="org.apache.stratos.tenant.mgt.stub.beans.xsd.TenantInfoBean" %> -<%@ page import="org.apache.stratos.tenant.mgt.ui.utils.TenantMgtUtil" %> -<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %> -<%@ page import="org.wso2.carbon.base.ServerConfiguration" %> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %> - -<carbon:jsi18n - resourceBundle="org.apache.stratos.tenant.mgt.ui.i18n.JSResources" - request="<%=request%>"/> -<% - String domainName = request.getParameter("domain"); - String firstname = ""; - String lastname = ""; - String admin = ""; - String usagePlan = ""; - boolean isActive = false; - int tenantId = -1; - String error1 = "Tenant with the domain : " + domainName + " doesn't exist."; - boolean isUpdating = false; - boolean isPublicCloud = CommonUtil.isPublicCloudSetup(); - String isCloudDeployment = ServerConfiguration.getInstance().getFirstProperty("IsCloudDeployment"); - String email = ""; - if (domainName != null && !domainName.equals("")) { - try { - TenantInfoBean infoBean = TenantMgtUtil.getTenant(request, config, session); - admin = infoBean.getAdmin(); - tenantId = infoBean.getTenantId(); - email = infoBean.getEmail(); - firstname = infoBean.getFirstname(); - lastname = infoBean.getLastname(); - isActive = infoBean.getActive(); - usagePlan = infoBean.getUsagePlan(); - isUpdating = true; - session.setAttribute("isActivatedTenant", isActive); - } catch (Exception e) { - CarbonUIMessage uiMsg = new CarbonUIMessage(CarbonUIMessage.ERROR, e.getMessage(), e); - request.setAttribute(CarbonUIMessage.ID, uiMsg); -%> -<jsp:forward page="../admin/error.jsp"/> -<% - return; - } - } - - if (domainName == null) { - domainName = ""; - } - if (firstname == null) { - firstname = admin; - } - if (lastname == null) { - lastname = ""; - } -%> - -<fmt:bundle basename="org.apache.stratos.tenant.mgt.ui.i18n.Resources"> -<carbon:breadcrumb - label="govern.add_tenants.menu" - resourceBundle="org.apache.stratos.tenant.mgt.ui.i18n.Resources" - topPage="true" - request="<%=request%>"/> -<jsp:include page="../registry_common/registry_common-i18n-ajaxprocessor.jsp"/> -<script type="text/javascript" src="../registry_common/js/registry_validation.js"></script> -<script type="text/javascript" src="../registry_common/js/registry_common.js"></script> -<script type="text/javascript" src="../ajax/js/prototype.js"></script> -<script type="text/javascript" src="js/tenant_config.js"></script> - -<div id="middle"> -<%if (tenantId != 0) {%> -<h2><%if (isUpdating) {%><fmt:message key="update.tenant"/> - - <%} else {%> <fmt:message - key="register.new.organization"/><%}%></h2> - -<div id="workArea"> - -<div id="activityReason" style="display: none;"></div> -<form id="addTenantForm" action="submit_tenant_ajaxprocessor.jsp" method="post"> - <input type="hidden" name="isUpdating" id="isUpdating" value="false"> - <table class="styledLeft"> - <thead> - <tr> - <th> - <fmt:message key="domain.information"/> - </th> - </tr> - </thead> - <tbody> - <tr> - <td class="nopadding"> - <table class="normal-nopadding" cellspacing="0"> - <tbody> - <tr> - <td><fmt:message key="domain"/> - <%if (!isUpdating) { %> <span class="required">*</span> <% }%> - </td> - <td colspan="2"><input - onchange="fillAdminValue();" <%if (isUpdating) { %> - readonly="true" <% }%> type="text" name="domain" - id="domain" style="width:400px" - value="<%=domainName%>"/> - </td> - </tr> - <%if (!isUpdating) { %> - <tr> - <td></td> - <td colspan="2">Use a domain for your organization,in the format - "example.com",This domain should be unique. - </td> - </tr> - <% }%> - - <%if (isUpdating) { %> - <tr> - <td><fmt:message key="tenant.id"/> - </td> - <td colspan="2"><input - onchange="fillAdminValue();" - readonly="true" type="text" name="tenantId" - id="tenantId" style="width:400px" - value="<%=tenantId%>"/> - </td> - </tr> - <% } - - %> - - <tr> - <td colspan="3" class="middle-header"><fmt:message - key="usage.plan.information"/></td> - - </tr> - <tr> - <td> - <fmt:message key="select.usage.plan.for.tenant"/><span - class="required">*</span> - </td> - <td> - <select name="usage-plan-name" id="usage-plan-name"> - </select> - <% - if (!CommonUtil.getStratosConfig().getUsagePlanURL().equals("")) { - %> - <a href=<%=CommonUtil.getStratosConfig().getUsagePlanURL()%> - target=<%=CommonUtil.getStratosConfig().getUsagePlanURL()%>> - <b>More info</b></a> - <% } %> - </td> - <td> - <% if (usagePlan.length() > 2) { - %> - Your Current Usage Plan is : <%=usagePlan%> - <%}%> - </td> - <tr> - <td></td> - <td colspan="2"><fmt:message key="select.package.message"/> - </td> - </tr> - - - <tr> - <td colspan="3" class="middle-header"><fmt:message - key="tenant.admin"/></td> - </tr> - <tr> - <td><fmt:message key="admin.firstname"/><span - class="required">*</span></td> - <td colspan="2"><input type="text" name="admin-firstname" - id="admin-firstname" style="width:400px" - value="<%=firstname%>"/></td> - </tr> - <tr> - <td><fmt:message key="admin.lastname"/><span - class="required">*</span></td> - <td colspan="2"><input type="text" name="admin-lastname" - id="admin-lastname" style="width:400px" - value="<%=lastname%>"/></td> - </tr> - - - <tr> - <td><fmt:message key="admin.username"/> - <%if (!isUpdating) { %> - <span class="required">*</span></td> - <%}%> - <td colspan="2"><input <%if (isUpdating) {%> - readonly="true" <%}%> type="text" name="admin" - id="admin" style="width:400px" value="<%=admin%>" - onchange="isDomainNameAvailable();"/><span - id="adminValue"></span></td> - </tr> - - <tr> - <td><%if (isUpdating) {%><fmt:message - key="new.admin.password"/><%} else {%><fmt:message - key="admin.password"/><%}%> - <%if (!isUpdating) {%><span class="required">*</span></td> - <%}%> - <td colspan="2"><input type="password" name="admin-password" - id="admin-password" style="width:400px"/> - </td> - </tr> - <tr> - <td><%if (isUpdating) {%><fmt:message - key="new.admin.password.repeat"/><%} else {%><fmt:message - key="admin.password.repeat"/><%}%> - <%if (!isUpdating) {%><span class="required">*</span></td> - <%}%> - <td colspan="2"><input type="password" - name="admin-password-repeat" - id="admin-password-repeat" - style="width:400px"/></td> - </tr> - <tr> - <td colspan="3" class="middle-header"><fmt:message - key="contact.details"/></td> - </tr> - <tr> - <td><fmt:message key="admin.email"/><span - class="required">*</span></td> - <td colspan="2"><input type="text" name="admin-email" - id="admin-email" style="width:400px" - value="<%=email%>"/></td> - </tr> - </tbody> - </table> - </td> - </tr> - <tr id="buttonRow"> - <td class="buttonRow"> - <input class="button" type="button" - <% if (isUpdating) { %> value="Update" <% } else { %> - value="Save" <% }%> - onclick="addTenant(<%=isUpdating?"true":"false"%>, <%=isPublicCloud?"true":"false"%>)"/> - </td> - </tr> - <tr id="waitMessage" style="display:none"> - <td> - <div style="font-size:13px !important;margin-top:10px;margin-bottom:10px;"> - <img - src="images/ajax-loader.gif" align="left" hspace="20"/>Please - wait until the Service is - importing to the Registry... - </div> - </td> - </tr> - </tbody> - </table> - <% - // the tenantId field appears only for an update of existing tenant - if (isUpdating) { - %> - <input name="tenantId" type="hidden" value="<%=tenantId%>"/> - <% - } - %> - <%} else {%> - <tr> - <th> - <%=error1 %> - </th> - </tr> - <%}%> -</form> - -<form id="activateTenantForm" action="activate_tenant_ajaxprocessor.jsp" method="post"> - <%if ((isUpdating) && (tenantId > 0)) {%> - <table class="styledLeft"> - <thead> - <tr> - <th> - <fmt:message key="activate.deactivate"/> - </th> - </tr> - </thead> - <tbody> - - <% if (isActive) { %> - <tr> - <td colspan="3"><fmt:message key="deactivate.account.msg"/></td> - </tr> - <% } else {%> - <tr> - <td colspan="3"><fmt:message key="activate.account.msg"/></td> - </tr> - <% }%> - - <tr id="buttonRow2"> - <td class="buttonRow"> - <input class="button" type="button" name="activateButton" id="activateButton" - onclick="return activateDeactivate('<%=domainName%>','<%=isActive%>');" - <% if (isActive) { %> value="<fmt:message key="deactivate.account.btn"/>" - <% } else { %> value="<fmt:message key="activate.account.btn"/>" <% } %>/> - </td> - - <input type="hidden" name="activatingDomain" id="activatingDomain" value="<%=domainName%>"/> - - </tr> - </tbody> - </table> - <% - } - %> -</form> - -<br/> -<script type="text/javascript">refreshFillAdminValue()</script> - -</div> -</div> -</fmt:bundle> -<script type="text/javascript"> - var packageInfo; - jQuery(document).ready( - function() { -// jQuery.ajax({ -// type: 'POST', -// url: 'get_package_info_ajaxprocessor.jsp', -// dataType: 'json', -// data: 'plan=0', -// async: false, -// success: function(data) { -// packageInfo = data; -// }, -// error:function (xhr, ajaxOptions, thrownError) { -// CARBON.showErrorDialog('Could not get package information.'); -// } -// }); - - var charge; - var name; - var isCloud = <%= isCloudDeployment %>; - - if (!isCloud) { - String - demoOption = "Demo" - option = document.createElement("option"); - option.value = demoOption; - option.selected = demoOption; - option.innerHTML = demoOption; - document.getElementById('usage-plan-name').appendChild(option); - - } else { - for (var i = 0; i < packageInfo.length; i++) { - charge = packageInfo[i].subscriptionCharge; - name = packageInfo[i].name; - if (name == '<%=usagePlan%>') { - option = document.createElement("option"); - option.value = name; - option.selected = name; - option.innerHTML = name; - document.getElementById('usage-plan-name').appendChild(option); - - } - else { - option = document.createElement("option"); - option.value = name; - option.innerHTML = name - document.getElementById('usage-plan-name').appendChild(option); - } - } - } - } - ); -</script>
http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/check_domain_availability_ajaxprocessor.jsp ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/check_domain_availability_ajaxprocessor.jsp b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/check_domain_availability_ajaxprocessor.jsp deleted file mode 100644 index 9dbbe35..0000000 --- a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/check_domain_availability_ajaxprocessor.jsp +++ /dev/null @@ -1,38 +0,0 @@ -<%-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --%> - -<%@ page import="org.apache.axis2.AxisFault" %> -<%@ page import="org.apache.stratos.common.util.CommonUtil" %> -<%@ page import="org.json.JSONException" %> -<%@ page import="org.json.JSONObject" %> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<% - String tenantDomain = request.getParameter("domain"); - boolean isDomainAvailable = CommonUtil.isDomainNameAvailable(tenantDomain); - JSONObject jsonObject = new JSONObject(); - - if (isDomainAvailable) { - jsonObject.put("available", "true"); - - } else { - jsonObject.put("available", "false"); - } - out.println(jsonObject); - -%> http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/css/tenant.css ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/css/tenant.css b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/css/tenant.css deleted file mode 100644 index 6a371ee..0000000 --- a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/css/tenant.css +++ /dev/null @@ -1,83 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -/*css editor styles */ -.csseditor-top-line{ - background-color:black; - height:5px; -} -.csseditor-leftbox{ - background-color:#9a9a9a; - padding-left:5px; - padding-right:5px; - padding-bottom:5px; - padding-top:15px; - height:380px; -} -.csseditor-leftbox-top{ - color:#ffffff; - font-size:18px; - height:30px; -} -.csseditor-textbox{ - background-color:#dfe7ed; - border:solid 1px #ffffff; - width:100%; -} -.csseditor-rightbox{ - background-color:#c9c9c9; - border:solid 1px #ffffff; - height:400px; -} -.csseditor-rightbox-title{ - background-color:#9a9a9a; - height:25px; - color:#ffffff; - padding-left:10px; - padding-top:5px; -} -.csseditor-searchbox{ - padding-left:10px; - padding-top:10px; -} -#flickr_results{ - height:300px; - overflow-y:auto; - overflow-x:hidden; - margin-left:5px; - margin-right:5px; - border:solid 1px #ffffff; -} -.imageList{ -} -.imageList li { - padding-top: 3px !important; - padding-left: 5px !important; - background-color: #e1e9ec; - border: solid 1px #b5bdc1; -} - -.imageList li a { - background-image: url(../images/images.gif); - background-repeat: no-repeat; - padding-left: 20px; - text-indent: 50px; -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/aboutUsagePlans.html ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/aboutUsagePlans.html b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/aboutUsagePlans.html deleted file mode 100644 index 7c00906..0000000 --- a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/aboutUsagePlans.html +++ /dev/null @@ -1,105 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> - <title>Select Usage Plan For Tenant - User Guide</title> - <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" /> -</head> - -<body> - - - <h1>Select Usage Plan For Tenant</h1> - - - <h2> <b> Usage Plans(Subscriptions)</b></h2> - -<p> - According to the usage plan that you selected you will get different volume of service and registry - bandwidths other services that available for tenants.By selecting right usage plan that suits - your requirements you can get maximum profit -</p> - - -<h2><b>Multitenancy Free</b></h2> -<p> - This is the free usage plan.You will get limited amount of resources.This package is - best suite for evaluation and tests. -</p> - <h2><b>Multitenancy Small</b></h2> -<p> - This package is best suite for small business. -</p> -<h2><b>Multitenancy Medium</b></h2> -<p> - This usage plan suites for medium scale business.You will get average amount of resources - with this package. -</p> -<h2><b>Multitenancy Large</b></h2> -<p> - This is the premium usage plan.You will get maximum resources form this plan. - This is best suite to large scale business. -</p> - -<p> - - Usage Plan summery -<table border="1"> -<tr> -<td>Usage Plan Name</td> -<td>Number Of Users</td> -<td>Registry Bandwidth (Mb) </td> -<td>Service BandWidth (Mb) </td> -<td>Cost Per Month ($)</td> -</tr> -<tr> -<td>Multitenancy Free</td> -<td>5</td> -<td>10</td> -<td>10</td> -<td>10</td> -</tr> -<tr> -<td>Multitenancy Small</td> -<td>10</td> -<td>25</td> -<td>25</td> -<td>25</td> -</tr> -<tr> -<td>Multitenancy Medium</td> -<td>20</td> -<td>100</td> -<td>100</td> -<td>100</td> -</tr> -<tr> -<td>Multitenancy Large</td> -<td>50</td> -<td>200</td> -<td>200</td> -<td>200</td> -</tr> -</table> -<div><strong>Figure1: Usage Plan Summery Table</strong></div> -</p> -</body> - -</html> http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-org.png ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-org.png b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-org.png deleted file mode 100644 index fc710f8..0000000 Binary files a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-org.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-tenant.png ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-tenant.png b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-tenant.png deleted file mode 100644 index 7fbb894..0000000 Binary files a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/add-tenant.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/view-tenants.png ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/view-tenants.png b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/view-tenants.png deleted file mode 100644 index 03c4e83..0000000 Binary files a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/images/view-tenants.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/userguide.html ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/userguide.html b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/userguide.html deleted file mode 100644 index 6b660b9..0000000 --- a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/docs/userguide.html +++ /dev/null @@ -1,57 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> - <title>Multitenancy Registry Tenant Configuration - User Guide</title> - <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" /> -</head> - -<body> - - - <h1>Multitenancy Add new Tenants and View Tenants</h1> - - - <h2> <b> Add New Tenants</b></h2> - -<p> - Following form can be used to add new tenants.You are required to fill all the requested details. - <img src="images/add-tenant.png" alt="Add new tenant form"/> - <div><strong>Figure1: Add New Tenants Form</strong></div> - - -</p> - - -<h2><b>Multitenancy View Tenants</b></h2> - - -<p> - - You can view a list of available tenants from this page. - -<img src="images/view-tenants.png" alt="Register New Organization Form"/> -<div><strong>Figure2: View tenants Form</strong></div> -</p> - - -</body> - -</html> http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/get_package_info_ajaxprocessor.jsp ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/get_package_info_ajaxprocessor.jsp b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/get_package_info_ajaxprocessor.jsp deleted file mode 100644 index 3d4e339..0000000 --- a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/get_package_info_ajaxprocessor.jsp +++ /dev/null @@ -1,40 +0,0 @@ -<%-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --%> -<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %> -<%@ page import="org.json.JSONArray" %> -<%@ page import="org.apache.stratos.tenant.mgt.ui.clients.PackageInfoServiceClient" %> -<%@ page import="org.wso2.carbon.utils.ServerConstants" %> -<%@ page import="org.apache.axis2.context.ConfigurationContext" %> -<%@ page import="org.wso2.carbon.CarbonConstants" %> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %> - -<% - - String backendServerUrl = CarbonUIUtil.getServerURL(config.getServletContext(), session); - String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE); - ConfigurationContext configContext = - (ConfigurationContext)config.getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT); - - PackageInfoServiceClient client = new PackageInfoServiceClient(cookie, backendServerUrl,configContext); - JSONArray packageInfoArray = client.getBillingPackagesJsonArray(); - - out.write(packageInfoArray.toString()); -%> http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/multi_tenancy.png ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/multi_tenancy.png b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/multi_tenancy.png deleted file mode 100644 index 9e186e2..0000000 Binary files a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/multi_tenancy.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services.gif ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services.gif b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services.gif deleted file mode 100755 index 9883116..0000000 Binary files a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services.gif and /dev/null differ http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services1.gif ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services1.gif b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services1.gif deleted file mode 100644 index d40a7a3..0000000 Binary files a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/images/services1.gif and /dev/null differ http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/js/tenant_config.js ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/js/tenant_config.js b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/js/tenant_config.js deleted file mode 100644 index 32543a0..0000000 --- a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/js/tenant_config.js +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -function addTenant(isUpdating, isPublicCloud) { - - var reason = ""; - var addTenantForm = document.getElementById('addTenantForm'); - var adminPassword = document.getElementById('admin-password'); - var adminPasswordRepeat = document.getElementById('admin-password-repeat'); - var email = document.getElementById('admin-email'); - var firstname = document.getElementById('admin-firstname'); - var lastname = document.getElementById('admin-lastname'); - - if (isUpdating) { - - // only the given values will be updated, so no need to fill all the values. - if (reason == "") { - reason += validateEmpty(firstname, "First Name"); - } - if (reason == "") { - reason += validateIllegal(firstname, "First Name"); - } - if (reason == "") { - reason += validateEmpty(lastname, "Last Name"); - } - if (reason == "") { - reason += validateIllegal(lastname, "Last Name"); - } - if (adminPassword.value != null && adminPassword.value != "") { - if (adminPassword.value != adminPasswordRepeat.value) { - reason += jsi18n["password.mismatched"]; - } - } - } - else { - var domain = document.getElementById('domain'); - var adminName = document.getElementById('admin'); - - if (reason == "") { - reason += validateEmpty(domain, "Domain"); - } - if (reason == "") { - reason += validateDomain(domain, isPublicCloud); - } - - if (reason == "") { - reason +=domainAvailability(domain); - } - - if (reason == "") { - reason += validateEmpty(firstname, "First Name"); - } - if (reason == "") { - reason += validateIllegal(firstname, "First Name"); - } - if (reason == "") { - reason += validateEmpty(lastname, "Last Name"); - } - if (reason == "") { - reason += validateIllegal(lastname, "Last Name"); - } - if (reason == "") { - reason += validateEmpty(adminName, "Admin Name"); - } - if (reason == "") { - reason += validateIllegal(adminName, "Admin Name"); - } - if (reason == "") { - reason += validateUsername(adminName); - } - if (reason == "") { - reason += validateEmpty(adminPassword, "AdminPassword"); - } - if (reason == "") { - reason += validateEmpty(adminPasswordRepeat, "AdminPasswordRepeat"); - } - if (reason == "") { - reason += validateEmpty(email, "Email"); - } - if (reason == "") { - reason += validateEmail(email); - } - - if (reason == "") { - if (adminPassword.value != adminPasswordRepeat.value) { - reason += jsi18n["password.mismatched"]; - } - if (adminPassword.value.length < 6) { - reason += jsi18n["password.length"]; - } - } - } - - if (reason != "") { - CARBON.showErrorDialog(reason); - return; - } - document.getElementById("isUpdating").value=isUpdating; - addTenantForm.submit(); -} -function showSuccessRegisterMessage() { - var message = "You have registered the Organization Successfully"; - CARBON.showInfoDialog(message); - return; -} -function showSuccessUpdateMessage() { - var message = "Your changes saved Successfully!"; - CARBON.showInfoDialog(message); - return; -} -function activationChanged(cbox, domain) { - if (!cbox.checked) { - CARBON.showConfirmationDialog("Are you sure you want to deactivate the domain: " + - domain + ".", function() { - var submitForm = document.getElementById(domain + "_form"); - submitForm.submit(); - }, function() { - cbox.checked = "on"; - }); - } else { - var submitForm = document.getElementById(domain + "_form"); - submitForm.submit(); - } -} - -function fillAdminValue() { - var adminValue = $('adminValue'); - var domain = $('domain'); - - var reason = validateIllegal(domain, "Domain"); - if (reason != "") { - CARBON.showErrorDialog(reason); - adminValue.innerHTML = ''; - return; - } - - - if (domain.value == "") { - adminValue.innerHTML = '' + domain.value; - } - else { - adminValue.innerHTML = '@' + domain.value; - } -} -function refreshFillAdminValue() { - //Call this method at loading time - fillAdminValue(); -} - -function validateDomain(fld, isPublicCloudSetup) { - var error = ""; - var domain = fld.value; - var lastIndexOfDot = domain.lastIndexOf("."); - var indexOfDot = domain.indexOf("."); - var extension = domain.substring(lastIndexOfDot, domain.length); - - var illegalChars = /([^a-zA-Z0-9\._\-])/; // allow only letters and numbers . - _and period - if (extension.indexOf("-trial") >= 0 || extension.indexOf("-unverified") >= 0) { - // we are not allowing to create a domain with -trial or -unverified is in the extension - error = "The domain name you entered is not valid. Please enter a valid domain name."; - } - else if (isPublicCloudSetup && (lastIndexOfDot <= 0)) { - error = "Invalid domain: " + domain + ". You should have an extension to your domain."; - } - else if (indexOfDot == 0) { - error = "Invalid domain, starting with '.'"; - } - else if (illegalChars.test(fld.value)) { - error = "The domain only allows letters, numbers, '.', '-' and '_'. <br />"; - } else { - fld.style.background = 'White'; - } - return error; -} - -function domainSelected() { - var findDomainForm = document.getElementById('findTenantForm'); - findDomainForm.submit(); -} - - -function domainAvailability(domain) { - var error = ""; - jQuery.ajax({ - type: 'POST', - url: 'check_domain_availability_ajaxprocessor.jsp?', - dataType: 'json', - data: 'domain=' + domain.value, - success: function(result) { - var available = result.available; - if (available == 'false') { - error = "Sorry!. The Domain is already registered. Please choose a different domain."; - return error; - }else{ - error =""; - } - - }, - error:function (xhr, ajaxOptions, thrownError) { - error = "Error in checking domain availability"; - - }, - async: false - }); - - return error; -} - -function activateDeactivate(domain, isActive) { - if (isActive == 'true') { - CARBON.showConfirmationDialog("Are you sure you want to deactivate the domain: " + - domain + "?", function() { - var submitForm = document.getElementById("activateTenantForm"); - submitForm.submit(); - }, function() { - }); - } else { - var submitForm = document.getElementById("activateTenantForm"); - submitForm.submit(); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/js/theme_resource_util.js ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/js/theme_resource_util.js b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/js/theme_resource_util.js deleted file mode 100644 index c576de7..0000000 --- a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/js/theme_resource_util.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/submit_tenant_ajaxprocessor.jsp ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/submit_tenant_ajaxprocessor.jsp b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/submit_tenant_ajaxprocessor.jsp deleted file mode 100644 index 6fd878e..0000000 --- a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/submit_tenant_ajaxprocessor.jsp +++ /dev/null @@ -1,84 +0,0 @@ -<%-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --%> -<%@ page import="org.apache.stratos.common.util.CommonUtil" %> -<%@ page import="org.apache.stratos.tenant.mgt.ui.utils.TenantMgtUtil" %> -<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<script type="text/javascript" src="../admin/js/jquery.js"></script> -<script type="text/javascript" src="../admin/js/jquery.form.js"></script> -<script type="text/javascript" src="../dialog/js/jqueryui/jquery-ui.min.js"></script> - -<%--<carbon:jsi18n--%> - <%--resourceBundle="org.apache.stratos.tenant.mgt.ui.i18n.JSResources"--%> - <%--request="<%=request%>" />--%> - -<div id="middle"> -<% -// First remove captcha images first stored in webapps - String error1 = "Error in adding the tenant."; - String error2 = "Error in updating the tenant."; - boolean isUpdating = false; - String tenantId = ""; - String tenantDomain = ""; - String paramvalue = "addTenant=Success"; - try { - tenantId = request.getParameter("tenantId"); - tenantDomain = request.getParameter("domain"); - isUpdating = Boolean.parseBoolean(request.getParameter("isUpdating")); - - boolean isDomainAvailable=false; - if(!isUpdating){ - isDomainAvailable = CommonUtil.isDomainNameAvailable(tenantDomain); - } - - //if the request is for creating a new tenant and if the domain name is not available, show a warning - - if(tenantId == null && !isDomainAvailable){ - -%> - <script type="text/javascript"> - jQuery(document).ready(function() { - CARBON.showErrorDialog("Sorry!. The Domain '<%=tenantDomain%>'is already registered. Please choose a different domain."); - }); - </script> - -<% - }else if (tenantId == null && isDomainAvailable) { - - // if the request is for creating a new tenant and if th domain name is available. add the tenant - TenantMgtUtil.addTenantConfigBean(request,config,session); - response.sendRedirect("../tenant-mgt/view_tenants.jsp?region=region3&item=govern_view_tenants_menu&"+paramvalue); - }else if (tenantId !=null){ - //if the tenant id is given, it is a request to update.hence update the tenant info - TenantMgtUtil.updateTenantConfigBean(request,config,session); - isUpdating = true; - paramvalue = "addTenant=SuccessUpdate"; - response.sendRedirect("../tenant-mgt/view_tenants.jsp?region=region3&item=govern_view_tenants_menu&"+paramvalue); - } - - } catch (Exception e) { - CarbonUIMessage uiMsg = new CarbonUIMessage(CarbonUIMessage.ERROR, e.getMessage(), e); - request.setAttribute(CarbonUIMessage.ID, uiMsg); - %> - <jsp:forward page="../admin/error.jsp"/> - <% - return; - } -%> - </div> http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/view_tenants.jsp ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/view_tenants.jsp b/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/view_tenants.jsp deleted file mode 100644 index 26a930d..0000000 --- a/components/org.apache.stratos.tenant.mgt.ui/src/main/resources/web/tenant-mgt/view_tenants.jsp +++ /dev/null @@ -1,237 +0,0 @@ -<%-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --%> -<%@ page import="org.apache.axis2.context.ConfigurationContext" %> -<%@ page import="org.wso2.carbon.CarbonConstants" %> -<%@ page import="org.apache.stratos.tenant.mgt.stub.beans.xsd.PaginatedTenantInfoBean" %> -<%@ page import="org.apache.stratos.tenant.mgt.stub.beans.xsd.TenantInfoBean" %> -<%@ page import="org.apache.stratos.tenant.mgt.ui.clients.TenantServiceClient" %> -<%@ page import="org.apache.stratos.tenant.mgt.ui.utils.TenantMgtUtil" %> -<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %> -<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %> -<%@ page import="org.wso2.carbon.utils.ServerConstants" %> -<%@ page import="java.text.SimpleDateFormat" %> -<%@ page import="java.util.Calendar" %> -<%@ page import="java.util.Date" %> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar" prefix="carbon" %> -<jsp:include page="../registry_common/registry_common-i18n-ajaxprocessor.jsp"/> -<script type="text/javascript" src="../registry_common/js/registry_validation.js"></script> -<script type="text/javascript" src="../registry_common/js/registry_common.js"></script> -<script type="text/javascript" src="../ajax/js/prototype.js"></script> -<script type="text/javascript" src="js/tenant_config.js"></script> - - -<% - if ("Success".equals(request.getParameter("addTenant"))) { -%> -<script type="text/javascript">showSuccessRegisterMessage()</script> -<% - } - if ("SuccessUpdate".equals(request.getParameter("addTenant"))) { -%> -<script type="text/javascript">showSuccessUpdateMessage()</script> -<% - } - -%> -<carbon:jsi18n - resourceBundle="org.apache.stratos.tenant.mgt.ui.i18n.JSResources" - request="<%=request%>"/> - -<fmt:bundle basename="org.apache.stratos.tenant.mgt.ui.i18n.Resources"> - <carbon:breadcrumb - label="govern.view_tenants.menu" - resourceBundle="org.apache.stratos.tenant.mgt.ui.i18n.Resources" - topPage="true" - request="<%=request%>"/> - - <div id="top"> - <form id="findTenantForm" action="view_tenants.jsp?action=search" method="post"> - <table class="normal-nopadding" cellspacing="0"> - <tbody> - <tr> - <td><fmt:message key="enter.tenant.domain"/></td> - <td colspan="2"><input type="text" name="domain" id="domain" - style="width:400px"/> - <input type="button" onclick="domainSelected()" value="Find"/> - </td> - </tr> - </tbody> - </table> - </form> - </div> - - <br/> - - <div id="middle"> - - <% - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); - String activatingDomain = request.getParameter("activate.domain"); - String action = request.getParameter("action"); - String domainName = request.getParameter("domain"); - if (activatingDomain != null) { - // try to activate deactive the tenant - String activate = request.getParameter("activate"); - try { - if (activate != null && activate.equalsIgnoreCase("on")) { - TenantMgtUtil.activateTenant(request, config, session); - } else { - TenantMgtUtil.deactivateTenant(request, config, session); - } - } catch (Exception e) { - String error1 = "Error in activating/deactivating tenant"; - request.setAttribute(CarbonUIMessage.ID, - new CarbonUIMessage(error1, error1, null)); - - %> - - <jsp:forward page="../admin/error.jsp?<%=error1%>"/> - - <% - return; - } - } - - String pageNumberStr = request.getParameter("pageNumber"); - if (pageNumberStr == null) { - pageNumberStr = "0"; - } - int pageNumber = 0; - try { - pageNumber = Integer.parseInt(pageNumberStr); - } catch (NumberFormatException ignored) { - // page number format exception - } - int numberOfPages; - int noOfPageLinksToDisplay = 5; //default value is set to 5 - - String backendServerURL = CarbonUIUtil.getServerURL( - config.getServletContext(), session); - ConfigurationContext configContext = (ConfigurationContext) config - .getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT); - - String cookie = (String) session.getAttribute - (ServerConstants.ADMIN_SERVICE_COOKIE); - TenantServiceClient client; - PaginatedTenantInfoBean tenantsInfo; - TenantInfoBean[] tenantInfoArr; - try { - client = new TenantServiceClient(cookie, backendServerURL, configContext); - if (action != null && action.equals("search")) { - tenantsInfo = client.retrievePaginatedPartialSearchTenants(domainName,pageNumber); - } else { - tenantsInfo = client.retrievePaginatedTenants(pageNumber); - } - - - tenantInfoArr = tenantsInfo.getTenantInfoBeans(); - numberOfPages = tenantsInfo.getNumberOfPages(); - - } catch (Exception e) { - String error1 = "Error in retrieving tenants"; - request.setAttribute(CarbonUIMessage.ID, new CarbonUIMessage(error1, error1, null)); - %> - - <jsp:forward page="../admin/error.jsp"/> - - <% - return; - } - %> - - <h2><fmt:message key="tenants.list"/></h2> - <br/> - <carbon:paginator pageNumber="<%=pageNumber%>" numberOfPages="<%=numberOfPages%>" - noOfPageLinksToDisplay="<%=noOfPageLinksToDisplay%>" - page="view_tenants.jsp" pageNumberParameterName="pageNumber"/> - - <div id="workArea"> - - - <% - if (tenantInfoArr != null && tenantInfoArr.length>0 && tenantInfoArr[0]!=null) { - %> - - <table cellpadding="0" cellspacing="0" border="0" style="width:100%" class="styledLeft"> - <thead> - <tr> - <th style="padding-left:5px;text-align:left;"><fmt:message key="domain"/></th> - <th style="padding-left:5px;text-align:left;"><fmt:message - key="admin.email"/></th> - <th style="padding-left:5px;text-align:left;"><fmt:message - key="created.date"/></th> - <th style="padding-left:5px;text-align:left;"><fmt:message key="active"/></th> - <th style="padding-left:5px;text-align:left;"><fmt:message key="edit"/></th> - </tr> - </thead> - <tbody> - - <% - for (TenantInfoBean tenantInfo : tenantInfoArr) { - if (tenantInfo == null) { - continue; - } - String tenantDomain = TenantMgtUtil.removeHtmlElements( - tenantInfo.getTenantDomain()); - String email = TenantMgtUtil.removeHtmlElements(tenantInfo.getEmail()); - boolean isActive = tenantInfo.getActive(); - Calendar createdDateCal = tenantInfo.getCreatedDate(); - Date createdDate = new Date(createdDateCal.getTimeInMillis()); - String createdDateStr = dateFormat.format(createdDate); - %> - - <tr id="1"> - <td style="padding-left:5px;padding-top:3px;text-align:left;"><%=tenantDomain%> - </td> - <td style="padding-left:5px;padding-top:3px;text-align:left;"><%=email%> - </td> - <td style="padding-left:5px;padding-top:3px;text-align:left;"><%=createdDateStr%> - </td> - <td style="padding-left:5px;padding-top:3px;text-align:left;"> - <form id="<%=tenantDomain%>_form" action="view_tenants.jsp" method="post"> - <input type="checkbox" name="activate" - onchange="javascript:activationChanged(this, '<%=tenantDomain%>')" - <%if (isActive) {%>checked="true"<%}%>/> - <input type="hidden" name="activate.domain" value="<%=tenantDomain%>"/> - </form> - </td> - <td style="padding-left:5px;padding-top:3px;text-align:left;"><a - href="add_tenant.jsp?domain=<%=tenantInfo.getTenantDomain()%>">Edit</a> - </td> - </tr> - <% } - %> - </tbody> - </table> - <% - }else{ - %> - <div><fmt:message key="no.tenants.available"/></div> - <% - } - %> - - </div> - <carbon:paginator pageNumber="<%=pageNumber%>" numberOfPages="<%=numberOfPages%>" - noOfPageLinksToDisplay="<%=noOfPageLinksToDisplay%>" - page="view_tenants.jsp" pageNumberParameterName="pageNumber"/> - </div> -</fmt:bundle> http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt/pom.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt/pom.xml b/components/org.apache.stratos.tenant.mgt/pom.xml deleted file mode 100644 index 2deb587..0000000 --- a/components/org.apache.stratos.tenant.mgt/pom.xml +++ /dev/null @@ -1,124 +0,0 @@ -<!-- - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <parent> - <groupId>org.apache.stratos</groupId> - <artifactId>stratos-components-parent</artifactId> - <version>4.1.0-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>org.apache.stratos.tenant.mgt</artifactId> - <packaging>bundle</packaging> - <name>Apache Stratos - Tenant Managment</name> - - <build> - - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-scr-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <extensions>true</extensions> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Name>${project.artifactId}</Bundle-Name> - <Private-Package> - org.apache.stratos.tenant.mgt.internal.*, - org.apache.stratos.tenant.mgt.persistence.*, - </Private-Package> - <Import-Package> - org.apache.stratos.common.*, - org.wso2.carbon.registry.core.*;version=1.0.1, - org.wso2.carbon.captcha.mgt.*, - !javax.xml.namespace, - javax.xml.namespace; version=0.0.0, - javax.servlet;version="${imp.pkg.version.javax.servlet}", - javax.servlet.http;version="${imp.pkg.version.javax.servlet}", - org.apache.axiom.*; version="${axiom.osgi.version.range}", - *;resolution:=optional - </Import-Package> - <Export-Package> - org.apache.stratos.tenant.mgt.beans.*, - org.apache.stratos.tenant.mgt.exception.*, - org.apache.stratos.tenant.mgt.realm.*, - org.apache.stratos.tenant.mgt.services.*, - org.apache.stratos.tenant.mgt.util.*, - </Export-Package> - <DynamicImport-Package>*</DynamicImport-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.wso2.carbon</groupId> - <artifactId>org.wso2.carbon.user.core</artifactId> - <version>${wso2carbon.version}</version> - </dependency> - <dependency> - <groupId>org.apache.stratos</groupId> - <artifactId>org.apache.stratos.tenant.mgt.core</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.wso2.carbon</groupId> - <artifactId>org.wso2.carbon.registry.core</artifactId> - <version>${wso2carbon.version}</version> - </dependency> - <dependency> - <groupId>org.wso2.carbon</groupId> - <artifactId>org.wso2.carbon.um.ws.api</artifactId> - <version>${wso2carbon.version}</version> - </dependency> - <dependency> - <groupId>org.wso2.carbon</groupId> - <artifactId>org.wso2.carbon.captcha.mgt</artifactId> - <version>${wso2carbon.version}</version> - </dependency> - <dependency> - <groupId>org.apache.stratos</groupId> - <artifactId>org.apache.stratos.common</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.wso2.carbon</groupId> - <artifactId>org.wso2.carbon.admin.mgt</artifactId> - <version>${wso2carbon.version}</version> - </dependency> - <dependency> - <groupId>org.apache.rampart.wso2</groupId> - <artifactId>rampart-policy</artifactId> - <version>${rampart.wso2.version}</version> - </dependency> - <dependency> - <groupId>org.apache.rampart.wso2</groupId> - <artifactId>rampart-core</artifactId> - <version>${rampart.wso2.version}</version> - </dependency> - </dependencies> -</project> http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/beans/PaginatedTenantInfoBean.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/beans/PaginatedTenantInfoBean.java b/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/beans/PaginatedTenantInfoBean.java deleted file mode 100644 index a5eb668..0000000 --- a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/beans/PaginatedTenantInfoBean.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.tenant.mgt.beans; - -import org.apache.stratos.common.beans.TenantInfoBean; -import org.wso2.carbon.utils.Pageable; - -import java.util.Arrays; -import java.util.List; - -/** - * Bean for paginated tenant information - */ -public class PaginatedTenantInfoBean implements Pageable { - private TenantInfoBean[] tenantInfoBeans; - private int numberOfPages; - - public TenantInfoBean[] getTenantInfoBeans() { - return tenantInfoBeans; - } - - public void setTenantInfoBeans(TenantInfoBean[] tenantInfoBeans) { - if(tenantInfoBeans == null) { - this.tenantInfoBeans = new TenantInfoBean[0]; - } else { - this.tenantInfoBeans = Arrays.copyOf(tenantInfoBeans, tenantInfoBeans.length); - } - } - - public int getNumberOfPages() { - return numberOfPages; - } - - public void setNumberOfPages(int numberOfPages) { - this.numberOfPages = numberOfPages; - } - - public <T> void set(List<T> items) { - this.tenantInfoBeans = items.toArray(new TenantInfoBean[items.size()]); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/exception/TenantManagementException.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/exception/TenantManagementException.java b/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/exception/TenantManagementException.java deleted file mode 100644 index fa6ca9b..0000000 --- a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/exception/TenantManagementException.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.tenant.mgt.exception; - -/** - * Tenant Management Specific Exception. - */ -public class TenantManagementException extends Exception { - - public TenantManagementException(String msg, Exception e) { - super(msg, e); - } - - public TenantManagementException(String msg) { - super(msg); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/internal/TenantMgtServiceComponent.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/internal/TenantMgtServiceComponent.java b/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/internal/TenantMgtServiceComponent.java deleted file mode 100644 index d9822cb..0000000 --- a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/internal/TenantMgtServiceComponent.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.tenant.mgt.internal; - -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.description.AxisService; -import org.apache.axis2.engine.AxisConfiguration; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.neethi.Policy; -import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.registry.core.exceptions.RegistryException; -import org.wso2.carbon.registry.core.service.RegistryService; -import org.wso2.carbon.registry.core.session.UserRegistry; -import org.apache.stratos.common.TenantBillingService; -import org.apache.stratos.common.listeners.TenantMgtListener; -import org.apache.stratos.common.util.CommonUtil; -import org.apache.stratos.common.util.StratosConfiguration; -import org.apache.stratos.tenant.mgt.internal.util.TenantMgtRampartUtil; -import org.wso2.carbon.user.api.RealmConfiguration; -import org.wso2.carbon.user.core.service.RealmService; -import org.wso2.carbon.user.core.tenant.TenantManager; -import org.wso2.carbon.utils.ConfigurationContextService; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -/** - * @scr.component name="org.apache.stratos.tenant.mgt" immediate="true" - * @scr.reference name="registry.service" - * interface="org.wso2.carbon.registry.core.service.RegistryService" - * cardinality="1..1" policy="dynamic" bind="setRegistryService" - * unbind="unsetRegistryService" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" policy="dynamic" bind="setRealmService" - * unbind="unsetRealmService" - * @scr.reference name="configuration.context.service" - * interface="org.wso2.carbon.utils.ConfigurationContextService" - * cardinality="1..1" policy="dynamic" - * bind="setConfigurationContextService" - * unbind="unsetConfigurationContextService" - * @scr.reference name="org.apache.stratos.tenant.mgt.listener.service" - * interface="org.apache.stratos.common.listeners.TenantMgtListener" - * cardinality="0..n" policy="dynamic" - * bind="setTenantMgtListenerService" - * unbind="unsetTenantMgtListenerService" - * @scr.reference name="default.tenant.billing.service" - * interface="org.apache.stratos.common.TenantBillingService" - * cardinality="0..1" policy="dynamic" - * bind="setTenantBillingService" - * unbind="unsetTenantBillingService" - */ -public class TenantMgtServiceComponent { - private static Log log = LogFactory.getLog(TenantMgtServiceComponent.class); - - private static final String GAPP_TENANT_REG_SERVICE_NAME = "GAppTenantRegistrationService"; - - private static RealmService realmService; - private static RegistryService registryService; - - private static ConfigurationContextService configurationContextService; - - private static List<TenantMgtListener> tenantMgtListeners = new ArrayList<TenantMgtListener>(); - private static TenantBillingService billingService = null; - - protected void activate(ComponentContext context) { - try { - - // Loading the stratos configurations from Stratos.xml - if (CommonUtil.getStratosConfig() == null) { - StratosConfiguration stratosConfig = CommonUtil.loadStratosConfiguration(); - CommonUtil.setStratosConfig(stratosConfig); - } - - // Loading the EULA - if (CommonUtil.getEula() == null) { - String eula = CommonUtil.loadTermsOfUsage(); - CommonUtil.setEula(eula); - } - - populateRampartConfig(configurationContextService. - getServerConfigContext().getAxisConfiguration()); - - log.debug("******* Tenant Config bundle is activated ******* "); - } catch (Exception e) { - log.error("******* Tenant Config bundle failed activating ****", e); - } - } - - protected void setTenantMgtListenerService(TenantMgtListener tenantMgtListener) { - addTenantMgtListener(tenantMgtListener); - } - - protected void unsetTenantMgtListenerService(TenantMgtListener tenantMgtListener) { - removeTenantMgtListener(tenantMgtListener); - } - - protected void deactivate(ComponentContext context) { - log.debug("******* Governance Tenant Config bundle is deactivated ******* "); - } - - protected void setRegistryService(RegistryService registryService) { - TenantMgtServiceComponent.registryService = registryService; - } - - protected void unsetRegistryService(RegistryService registryService) { - setRegistryService(null); - } - - protected void setRealmService(RealmService realmService) { - TenantMgtServiceComponent.realmService = realmService; - } - - protected void unsetRealmService(RealmService realmService) { - setRealmService(null); - } - - protected void setConfigurationContextService(ConfigurationContextService configurationContextService) { - log.debug("Receiving ConfigurationContext Service"); - TenantMgtServiceComponent.configurationContextService = configurationContextService; - - } - - protected void unsetConfigurationContextService(ConfigurationContextService configurationContextService) { - log.debug("Unsetting ConfigurationContext Service"); - setConfigurationContextService(null); - } - - public static void addTenantMgtListener(TenantMgtListener tenantMgtListener) { - tenantMgtListeners.add(tenantMgtListener); - sortTenantMgtListeners(); - } - - public static void removeTenantMgtListener(TenantMgtListener tenantMgtListener) { - tenantMgtListeners.remove(tenantMgtListener); - sortTenantMgtListeners(); - } - - public static void sortTenantMgtListeners() { - Collections.sort(tenantMgtListeners, new Comparator<TenantMgtListener>() { - public int compare(TenantMgtListener o1, TenantMgtListener o2) { - return o1.getListenerOrder() - o2.getListenerOrder(); - } - }); - } - - public static List<TenantMgtListener> getTenantMgtListeners() { - return tenantMgtListeners; - } - - public static ConfigurationContextService getConfigurationContextService() { - return configurationContextService; - } - - public static ConfigurationContext getConfigurationContext() { - if (configurationContextService.getServerConfigContext() == null) { - return null; - } - return configurationContextService.getServerConfigContext(); - } - - public static RegistryService getRegistryService() { - return registryService; - } - - - public static RealmService getRealmService() { - return realmService; - } - - public static TenantManager getTenantManager() { - return realmService.getTenantManager(); - } - - public static RealmConfiguration getBootstrapRealmConfiguration() { - return realmService.getBootstrapRealmConfiguration(); - } - - public static UserRegistry getGovernanceSystemRegistry(int tenantId) throws RegistryException { - return registryService.getGovernanceSystemRegistry(tenantId); - } - - public static UserRegistry getConfigSystemRegistry(int tenantId) throws RegistryException { - return registryService.getConfigSystemRegistry(tenantId); - } - - - /** Updates RelyingPartyService with Crypto information - * - * @param config AxisConfiguration - * @throws Exception - */ - private void populateRampartConfig(AxisConfiguration config) throws Exception { - AxisService service; - // Get the RelyingParty Service to update security policy with keystore information - service = config.getService(GAPP_TENANT_REG_SERVICE_NAME); - if (service == null) { - String msg = GAPP_TENANT_REG_SERVICE_NAME + " is not available in the Configuration Context"; - log.error(msg); - throw new Exception(msg); - } - // Create a Rampart Config with default crypto information - Policy rampartConfig = TenantMgtRampartUtil.getDefaultRampartConfig(); - // Add the RampartConfig to service policy - service.getPolicySubject().attachPolicy(rampartConfig); - - } - - protected void setTenantBillingService(TenantBillingService tenantBillingService) { - billingService = tenantBillingService; - } - - protected void unsetTenantBillingService(TenantBillingService tenantBilling) { - setTenantBillingService(null); - } - - public static TenantBillingService getBillingService() { - return billingService; - } - - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/internal/util/TenantMgtRampartUtil.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/internal/util/TenantMgtRampartUtil.java b/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/internal/util/TenantMgtRampartUtil.java deleted file mode 100644 index 2f74caf..0000000 --- a/components/org.apache.stratos.tenant.mgt/src/main/java/org/apache/stratos/tenant/mgt/internal/util/TenantMgtRampartUtil.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.apache.stratos.tenant.mgt.internal.util; -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - - -import java.util.Properties; - -import org.apache.stratos.tenant.mgt.services.InMemoryPasswordcallbackHandler; -import org.apache.neethi.Policy; -import org.apache.rampart.policy.model.CryptoConfig; -import org.apache.rampart.policy.model.RampartConfig; -import org.wso2.carbon.base.ServerConfiguration; - -public class TenantMgtRampartUtil { - - public static Policy getDefaultRampartConfig() { - //Extract the primary keystore information from server configuration - ServerConfiguration serverConfig = ServerConfiguration.getInstance(); - String keyStore = serverConfig.getFirstProperty("Security.KeyStore.Location"); - String keyStoreType = serverConfig.getFirstProperty("Security.KeyStore.Type"); - String keyStorePassword = serverConfig.getFirstProperty("Security.KeyStore.Password"); - String privateKeyAlias = serverConfig.getFirstProperty("Security.KeyStore.KeyAlias"); - String privateKeyPassword = serverConfig.getFirstProperty("Security.KeyStore.KeyPassword"); - - //Populate Rampart Configuration - RampartConfig rampartConfig = new RampartConfig(); - rampartConfig.setUser(privateKeyAlias); - rampartConfig.setPwCbClass("org.apache.stratos.tenant.mgt.services.InMemoryPasswordcallbackHandler"); - - //Set the private key alias and private key password in the password callback handler - InMemoryPasswordcallbackHandler.addUser(privateKeyAlias, privateKeyPassword); - - CryptoConfig sigCrypto = new CryptoConfig(); - Properties props = new Properties(); - sigCrypto.setProvider("org.apache.ws.security.components.crypto.Merlin"); - props.setProperty("org.apache.ws.security.crypto.merlin.keystore.type", keyStoreType); - props.setProperty("org.apache.ws.security.crypto.merlin.file", keyStore); - props.setProperty("org.apache.ws.security.crypto.merlin.keystore.password", keyStorePassword); - sigCrypto.setProp(props); - - rampartConfig.setSigCryptoConfig(sigCrypto); - Policy policy = new Policy(); - policy.addAssertion(rampartConfig); - - return policy; - - } - - -} -
