You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2013/07/12 09:01:23 UTC

[3/3] git commit: applying 0001-Domain-validater-and-UI-component-refactor.patch

applying 0001-Domain-validater-and-UI-component-refactor.patch


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/a875aabb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/a875aabb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/a875aabb

Branch: refs/heads/master
Commit: a875aabb7c0298ee81ee75bb992aaba2fe4bc67c
Parents: 316ba6c
Author: Lakmal Warusawithana <la...@wso2.com>
Authored: Fri Jul 12 12:31:03 2013 +0530
Committer: Lakmal Warusawithana <la...@wso2.com>
Committed: Fri Jul 12 12:31:03 2013 +0530

----------------------------------------------------------------------
 .../pom.xml                                     | 103 ++++++
 .../ui/clients/ValidateDomainAdminClient.java   | 117 +++++++
 .../domain/ui/clients/ValidateDomainClient.java |  27 ++
 .../clients/ValidateDomainNonAdminClient.java   | 115 +++++++
 .../stratos/validate/domain/ui/utils/Util.java  |  40 +++
 .../src/main/resources/META-INF/component.xml   |  21 ++
 .../resources/ValidateDomainAdminService.wsdl   | 238 ++++++++++++++
 .../main/resources/ValidateDomainService.wsdl   | 238 ++++++++++++++
 .../domain/ui/i18n/JSResources.properties       |   7 +
 .../domain/ui/i18n/Resources.properties         |   3 +
 .../web/validate-domain/css/validate_domain.css |  31 ++
 .../docs/images/domain-validation.png           | Bin 0 -> 56415 bytes
 .../web/validate-domain/docs/userguide.html     |  47 +++
 .../web/validate-domain/images/ajax-loader.gif  | Bin 0 -> 673 bytes
 .../web/validate-domain/images/right.gif        | Bin 0 -> 924 bytes
 .../web/validate-domain/images/wrong.gif        | Bin 0 -> 976 bytes
 .../web/validate-domain/js/validate_domain.js   | 151 +++++++++
 .../submit_validate_domain_ajaxprocessor.jsp    |  36 +++
 .../validate_domain_logged_in.jsp               |  22 ++
 .../validate_domain_not_logged_in.jsp           |  22 ++
 .../validate_domain_template.jsp                | 204 ++++++++++++
 .../validate_with_dns_ajaxprocessor.jsp         |  22 ++
 .../validate_with_text_ajaxprocessor.jsp        |  22 ++
 .../org.apache.stratos.validate.domain/pom.xml  |  81 +++++
 .../ValidateDomainServiceComponent.java         |  87 +++++
 .../services/ValidateDomainAdminService.java    |  39 +++
 .../domain/services/ValidateDomainService.java  |  82 +++++
 .../stratos/validate/domain/util/Util.java      | 320 +++++++++++++++++++
 .../src/main/resources/META-INF/services.xml    |  39 +++
 .../2.1.0/pom.xml                               |  96 ------
 .../ui/clients/ValidateDomainAdminClient.java   | 117 -------
 .../domain/ui/clients/ValidateDomainClient.java |  27 --
 .../clients/ValidateDomainNonAdminClient.java   | 115 -------
 .../carbon/validate/domain/ui/utils/Util.java   |  40 ---
 .../src/main/resources/META-INF/component.xml   |  21 --
 .../resources/ValidateDomainAdminService.wsdl   | 238 --------------
 .../main/resources/ValidateDomainService.wsdl   | 238 --------------
 .../domain/ui/i18n/JSResources.properties       |   7 -
 .../domain/ui/i18n/Resources.properties         |   3 -
 .../web/validate-domain/css/validate_domain.css |  31 --
 .../docs/images/domain-validation.png           | Bin 56415 -> 0 bytes
 .../web/validate-domain/docs/userguide.html     |  47 ---
 .../web/validate-domain/images/ajax-loader.gif  | Bin 673 -> 0 bytes
 .../web/validate-domain/images/right.gif        | Bin 924 -> 0 bytes
 .../web/validate-domain/images/wrong.gif        | Bin 976 -> 0 bytes
 .../web/validate-domain/js/validate_domain.js   | 151 ---------
 .../submit_validate_domain_ajaxprocessor.jsp    |  36 ---
 .../validate_domain_logged_in.jsp               |  22 --
 .../validate_domain_not_logged_in.jsp           |  22 --
 .../validate_domain_template.jsp                | 204 ------------
 .../validate_with_dns_ajaxprocessor.jsp         |  22 --
 .../validate_with_text_ajaxprocessor.jsp        |  22 --
 .../2.1.0/pom.xml                               |  80 -----
 .../ValidateDomainServiceComponent.java         |  87 -----
 .../services/ValidateDomainAdminService.java    |  39 ---
 .../domain/services/ValidateDomainService.java  |  82 -----
 .../wso2/carbon/validate/domain/util/Util.java  | 320 -------------------
 .../src/main/resources/META-INF/services.xml    |  39 ---
 58 files changed, 2114 insertions(+), 2106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/pom.xml b/components/org.apache.stratos.validate.domain.ui/pom.xml
new file mode 100644
index 0000000..6dd57c2
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/pom.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+# Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+#
+# Licensed 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>3.0.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.wso2.carbon.validate.domain.ui</artifactId>
+    <packaging>bundle</packaging>
+    <name>WSO2 Stratos - Validate Domains - User Interface</name>
+
+    <build>
+
+        <plugins>
+
+            <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>
+                        <Export-Package>
+                            org.apache.stratos.validate.domain.ui.*,
+                        </Export-Package>
+                        <Import-Package>
+                            javax.servlet;version="${imp.pkg.version.javax.servlet}",
+                            javax.servlet.http;version="${imp.pkg.version.javax.servlet}",
+                            org.apache.lucene.*,
+                            org.apache.stratos.validate.domain.stub.*; version="${carbon.platform.package.import.version.range}",
+                            *;resolution:=optional
+                        </Import-Package>
+                        <Carbon-Component>UIBundle</Carbon-Component>
+                    </instructions>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.registry.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.equinox</groupId>
+            <artifactId>javax.servlet</artifactId>
+	    <version>${version.javax.servlet}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2.wso2</groupId>
+            <artifactId>axis2</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom.wso2</groupId>
+            <artifactId>axiom</artifactId>
+	    <version>${orbit.version.axiom}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.ui</artifactId>
+	    <version>${wso2carbon.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.stratos</groupId>
+            <artifactId>org.apache.stratos.validate.domain.stub</artifactId>
+	    <version>${apache.stratos.version}</version>
+        </dependency>
+    </dependencies>
+    
+    <properties>
+	<version.javax.servlet>3.0.0.v201112011016</version.javax.servlet>
+    </properties>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainAdminClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainAdminClient.java b/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainAdminClient.java
new file mode 100644
index 0000000..3ae8a09
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainAdminClient.java
@@ -0,0 +1,117 @@
+/*
+*  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+*  WSO2 Inc. 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.validate.domain.ui.clients;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.utils.ServerConstants;
+import org.apache.stratos.validate.domain.stub.services.ValidateDomainAdminServiceStub;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.http.HttpSession;
+
+public class ValidateDomainAdminClient implements ValidateDomainClient {
+    private static final Log log = LogFactory.getLog(ValidateDomainAdminClient.class);
+
+    private ValidateDomainAdminServiceStub stub;
+    private String epr;
+
+    public ValidateDomainAdminClient(String cookie, String backendServerURL,
+            ConfigurationContext configContext) throws RegistryException {
+
+        epr = backendServerURL + "ValidateDomainAdminService";
+
+        try {
+            stub = new ValidateDomainAdminServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg =
+                    "Failed to initiate Validate Domain service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public ValidateDomainAdminClient(ServletConfig config, HttpSession session)
+            throws RegistryException {
+    	
+    	String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
+        ConfigurationContext configContext =
+                (ConfigurationContext) config.getServletContext().getAttribute(
+                        CarbonConstants.CONFIGURATION_CONTEXT);
+        epr = backendServerURL + "ValidateDomainAdminService";
+        
+        try {
+            stub = new ValidateDomainAdminServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg =
+                    "Failed to initiate Add Services service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public String getDomainValidationKey(String domain) throws RegistryException {
+        try {
+            return stub.getDomainValidationKey(domain);
+        } catch (Exception e) {
+            String msg = "Failed to get domain validation keys. " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+    public String validateByDNSEntry(String domain) throws RegistryException {
+        try {
+            return stub.validateByDNSEntry(domain);
+        } catch (Exception e) {
+            String msg = "Failed to validate by dns entry. " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+    public String validateByTextInRoot(String domain) throws RegistryException {
+        try {
+            return stub.validateByTextInRoot(domain);
+        } catch (Exception e) {
+            String msg = "Failed to validate by dns entry. " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainClient.java b/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainClient.java
new file mode 100644
index 0000000..2df05d5
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainClient.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed 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.validate.domain.ui.clients;
+
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+
+public interface ValidateDomainClient {
+    public String getDomainValidationKey(String domain) throws RegistryException;
+
+    public String validateByDNSEntry(String domain) throws RegistryException;
+
+    public String validateByTextInRoot(String domain) throws RegistryException;
+   
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainNonAdminClient.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainNonAdminClient.java b/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainNonAdminClient.java
new file mode 100644
index 0000000..e214a34
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/clients/ValidateDomainNonAdminClient.java
@@ -0,0 +1,115 @@
+/*
+*  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+*  WSO2 Inc. 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.validate.domain.ui.clients;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.utils.ServerConstants;
+import org.apache.stratos.validate.domain.stub.services.ValidateDomainServiceStub;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.http.HttpSession;
+
+public class ValidateDomainNonAdminClient implements ValidateDomainClient {
+     private static final Log log = LogFactory.getLog(ValidateDomainNonAdminClient.class);
+
+    private ValidateDomainServiceStub stub;
+    private String epr;
+
+    public ValidateDomainNonAdminClient(
+            String cookie, String backendServerURL, ConfigurationContext configContext)
+            throws RegistryException {
+
+        epr = backendServerURL + "ValidateDomainService";
+
+        try {
+            stub = new ValidateDomainServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg = "Failed to initiate AddServices service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public ValidateDomainNonAdminClient(ServletConfig config, HttpSession session)
+            throws RegistryException {
+
+        String cookie = (String)session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+        String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
+        ConfigurationContext configContext = (ConfigurationContext) config.
+                getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+        epr = backendServerURL + "ValidateDomainService";
+
+        try {
+            stub = new ValidateDomainServiceStub(configContext, epr);
+
+            ServiceClient client = stub._getServiceClient();
+            Options option = client.getOptions();
+            option.setManageSession(true);
+            option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);
+
+        } catch (AxisFault axisFault) {
+            String msg = "Failed to initiate Add Services service client. " + axisFault.getMessage();
+            log.error(msg, axisFault);
+            throw new RegistryException(msg, axisFault);
+        }
+    }
+
+    public String getDomainValidationKey(String domain) throws RegistryException {
+        try {
+            return stub.getDomainValidationKey(domain);
+        } catch (Exception e) {
+            String msg = "Failed to get domain validation keys. " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+    public String validateByDNSEntry(String domain) throws RegistryException {
+        try {
+            return stub.validateByDNSEntry(domain);    
+        } catch (Exception e) {
+            String msg = "Failed to validate by dns entry. " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+
+    public String validateByTextInRoot(String domain) throws RegistryException {
+        try {
+            return stub.validateByTextInRoot(domain);   
+        } catch (Exception e) {
+            String msg = "Failed to validate by dns entry. " + e.getMessage();
+            log.error(msg, e);
+            throw new RegistryException(msg, e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/utils/Util.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/utils/Util.java b/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/utils/Util.java
new file mode 100644
index 0000000..9ed98ba
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/java/org/apache/stratos/validate/domain/ui/utils/Util.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2008, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed 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.validate.domain.ui.utils;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
+import org.apache.stratos.validate.domain.ui.clients.ValidateDomainAdminClient;
+import org.apache.stratos.validate.domain.ui.clients.ValidateDomainClient;
+import org.apache.stratos.validate.domain.ui.clients.ValidateDomainNonAdminClient;
+
+public class Util {
+    public static ValidateDomainClient getValidateDomainClient(ServletRequest request,
+            ServletConfig config, HttpSession session) throws RegistryException {
+        // this doesn't make any security hole, as even a not-logged-in user try
+        // manually put status parameter to logged_in, still the back-end service
+        // try to validate him and he will fail.
+        
+        String status = request.getParameter("status");
+        if ("logged_in".equals(status)) {
+            return new ValidateDomainAdminClient(config, session);
+        }
+        return new ValidateDomainNonAdminClient(config, session);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/META-INF/component.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/META-INF/component.xml b/components/org.apache.stratos.validate.domain.ui/src/main/resources/META-INF/component.xml
new file mode 100644
index 0000000..7d459e4
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/META-INF/component.xml
@@ -0,0 +1,21 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. 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.
+ -->
+<component xmlns="http://products.wso2.org/carbon">
+
+
+</component>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/ValidateDomainAdminService.wsdl
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/ValidateDomainAdminService.wsdl b/components/org.apache.stratos.validate.domain.ui/src/main/resources/ValidateDomainAdminService.wsdl
new file mode 100644
index 0000000..0e16976
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/ValidateDomainAdminService.wsdl
@@ -0,0 +1,238 @@
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://services.domain.validate.carbon.wso2.org" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://services.domain.validate.carbon.wso2.org">
+    <wsdl:documentation>ValidateDomainAdminService</wsdl:documentation>
+    <wsdl:types>
+        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.domain.validate.carbon.wso2.org">
+            <xs:element name="validateByTextInRootException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="validateByTextInRootException" nillable="true" type="ns:Exception" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:complexType name="Exception">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string" />
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="validateByTextInRoot">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="domain" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="validateByTextInRootResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="validateByDNSEntryException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="validateByDNSEntryException" nillable="true" type="ns:Exception" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="validateByDNSEntry">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="domain" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="validateByDNSEntryResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getDomainValidationKeyException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="getDomainValidationKeyException" nillable="true" type="ns:Exception" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getDomainValidationKey">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="domain" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getDomainValidationKeyResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="validateByTextInRootRequest">
+        <wsdl:part name="parameters" element="ns:validateByTextInRoot" />
+    </wsdl:message>
+    <wsdl:message name="validateByTextInRootResponse">
+        <wsdl:part name="parameters" element="ns:validateByTextInRootResponse" />
+    </wsdl:message>
+    <wsdl:message name="validateByTextInRootException">
+        <wsdl:part name="parameters" element="ns:validateByTextInRootException" />
+    </wsdl:message>
+    <wsdl:message name="validateByDNSEntryRequest">
+        <wsdl:part name="parameters" element="ns:validateByDNSEntry" />
+    </wsdl:message>
+    <wsdl:message name="validateByDNSEntryResponse">
+        <wsdl:part name="parameters" element="ns:validateByDNSEntryResponse" />
+    </wsdl:message>
+    <wsdl:message name="validateByDNSEntryException">
+        <wsdl:part name="parameters" element="ns:validateByDNSEntryException" />
+    </wsdl:message>
+    <wsdl:message name="getDomainValidationKeyRequest">
+        <wsdl:part name="parameters" element="ns:getDomainValidationKey" />
+    </wsdl:message>
+    <wsdl:message name="getDomainValidationKeyResponse">
+        <wsdl:part name="parameters" element="ns:getDomainValidationKeyResponse" />
+    </wsdl:message>
+    <wsdl:message name="getDomainValidationKeyException">
+        <wsdl:part name="parameters" element="ns:getDomainValidationKeyException" />
+    </wsdl:message>
+    <wsdl:portType name="ValidateDomainAdminServicePortType">
+        <wsdl:operation name="validateByTextInRoot">
+            <wsdl:input message="ns:validateByTextInRootRequest" wsaw:Action="urn:validateByTextInRoot" />
+            <wsdl:output message="ns:validateByTextInRootResponse" wsaw:Action="urn:validateByTextInRootResponse" />
+            <wsdl:fault message="ns:validateByTextInRootException" name="validateByTextInRootException" wsaw:Action="urn:validateByTextInRootvalidateByTextInRootException" />
+        </wsdl:operation>
+        <wsdl:operation name="validateByDNSEntry">
+            <wsdl:input message="ns:validateByDNSEntryRequest" wsaw:Action="urn:validateByDNSEntry" />
+            <wsdl:output message="ns:validateByDNSEntryResponse" wsaw:Action="urn:validateByDNSEntryResponse" />
+            <wsdl:fault message="ns:validateByDNSEntryException" name="validateByDNSEntryException" wsaw:Action="urn:validateByDNSEntryvalidateByDNSEntryException" />
+        </wsdl:operation>
+        <wsdl:operation name="getDomainValidationKey">
+            <wsdl:input message="ns:getDomainValidationKeyRequest" wsaw:Action="urn:getDomainValidationKey" />
+            <wsdl:output message="ns:getDomainValidationKeyResponse" wsaw:Action="urn:getDomainValidationKeyResponse" />
+            <wsdl:fault message="ns:getDomainValidationKeyException" name="getDomainValidationKeyException" wsaw:Action="urn:getDomainValidationKeygetDomainValidationKeyException" />
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="ValidateDomainAdminServiceSoap11Binding" type="ns:ValidateDomainAdminServicePortType">
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="validateByTextInRoot">
+            <soap:operation soapAction="urn:validateByTextInRoot" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="validateByTextInRootException">
+                <soap:fault use="literal" name="validateByTextInRootException" />
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="validateByDNSEntry">
+            <soap:operation soapAction="urn:validateByDNSEntry" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="validateByDNSEntryException">
+                <soap:fault use="literal" name="validateByDNSEntryException" />
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getDomainValidationKey">
+            <soap:operation soapAction="urn:getDomainValidationKey" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="getDomainValidationKeyException">
+                <soap:fault use="literal" name="getDomainValidationKeyException" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="ValidateDomainAdminServiceSoap12Binding" type="ns:ValidateDomainAdminServicePortType">
+        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="validateByTextInRoot">
+            <soap12:operation soapAction="urn:validateByTextInRoot" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="validateByTextInRootException">
+                <soap12:fault use="literal" name="validateByTextInRootException" />
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="validateByDNSEntry">
+            <soap12:operation soapAction="urn:validateByDNSEntry" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="validateByDNSEntryException">
+                <soap12:fault use="literal" name="validateByDNSEntryException" />
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getDomainValidationKey">
+            <soap12:operation soapAction="urn:getDomainValidationKey" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="getDomainValidationKeyException">
+                <soap12:fault use="literal" name="getDomainValidationKeyException" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="ValidateDomainAdminServiceHttpBinding" type="ns:ValidateDomainAdminServicePortType">
+        <http:binding verb="POST" />
+        <wsdl:operation name="validateByTextInRoot">
+            <http:operation location="validateByTextInRoot" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="validateByDNSEntry">
+            <http:operation location="validateByDNSEntry" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getDomainValidationKey">
+            <http:operation location="getDomainValidationKey" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="ValidateDomainAdminService">
+        <wsdl:port name="ValidateDomainAdminServiceHttpsSoap11Endpoint" binding="ns:ValidateDomainAdminServiceSoap11Binding">
+            <soap:address location="https://192.168.1.100:9443/services/ValidateDomainAdminService.ValidateDomainAdminServiceHttpsSoap11Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="ValidateDomainAdminServiceHttpsSoap12Endpoint" binding="ns:ValidateDomainAdminServiceSoap12Binding">
+            <soap12:address location="https://192.168.1.100:9443/services/ValidateDomainAdminService.ValidateDomainAdminServiceHttpsSoap12Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="ValidateDomainAdminServiceHttpsEndpoint" binding="ns:ValidateDomainAdminServiceHttpBinding">
+            <http:address location="https://192.168.1.100:9443/services/ValidateDomainAdminService.ValidateDomainAdminServiceHttpsEndpoint/" />
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/ValidateDomainService.wsdl
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/ValidateDomainService.wsdl b/components/org.apache.stratos.validate.domain.ui/src/main/resources/ValidateDomainService.wsdl
new file mode 100644
index 0000000..c22a6ab
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/ValidateDomainService.wsdl
@@ -0,0 +1,238 @@
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://services.domain.validate.carbon.wso2.org" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://services.domain.validate.carbon.wso2.org">
+    <wsdl:documentation>ValidateDomainService</wsdl:documentation>
+    <wsdl:types>
+        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.domain.validate.carbon.wso2.org">
+            <xs:element name="validateByTextInRootException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="validateByTextInRootException" nillable="true" type="ns:Exception" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:complexType name="Exception">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="Message" nillable="true" type="xs:string" />
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="validateByTextInRoot">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="domain" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="validateByTextInRootResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="validateByDNSEntryException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="validateByDNSEntryException" nillable="true" type="ns:Exception" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="validateByDNSEntry">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="domain" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="validateByDNSEntryResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getDomainValidationKeyException">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="getDomainValidationKeyException" nillable="true" type="ns:Exception" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getDomainValidationKey">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="domain" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getDomainValidationKeyResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="validateByTextInRootRequest">
+        <wsdl:part name="parameters" element="ns:validateByTextInRoot" />
+    </wsdl:message>
+    <wsdl:message name="validateByTextInRootResponse">
+        <wsdl:part name="parameters" element="ns:validateByTextInRootResponse" />
+    </wsdl:message>
+    <wsdl:message name="validateByTextInRootException">
+        <wsdl:part name="parameters" element="ns:validateByTextInRootException" />
+    </wsdl:message>
+    <wsdl:message name="validateByDNSEntryRequest">
+        <wsdl:part name="parameters" element="ns:validateByDNSEntry" />
+    </wsdl:message>
+    <wsdl:message name="validateByDNSEntryResponse">
+        <wsdl:part name="parameters" element="ns:validateByDNSEntryResponse" />
+    </wsdl:message>
+    <wsdl:message name="validateByDNSEntryException">
+        <wsdl:part name="parameters" element="ns:validateByDNSEntryException" />
+    </wsdl:message>
+    <wsdl:message name="getDomainValidationKeyRequest">
+        <wsdl:part name="parameters" element="ns:getDomainValidationKey" />
+    </wsdl:message>
+    <wsdl:message name="getDomainValidationKeyResponse">
+        <wsdl:part name="parameters" element="ns:getDomainValidationKeyResponse" />
+    </wsdl:message>
+    <wsdl:message name="getDomainValidationKeyException">
+        <wsdl:part name="parameters" element="ns:getDomainValidationKeyException" />
+    </wsdl:message>
+    <wsdl:portType name="ValidateDomainServicePortType">
+        <wsdl:operation name="validateByTextInRoot">
+            <wsdl:input message="ns:validateByTextInRootRequest" wsaw:Action="urn:validateByTextInRoot" />
+            <wsdl:output message="ns:validateByTextInRootResponse" wsaw:Action="urn:validateByTextInRootResponse" />
+            <wsdl:fault message="ns:validateByTextInRootException" name="validateByTextInRootException" wsaw:Action="urn:validateByTextInRootvalidateByTextInRootException" />
+        </wsdl:operation>
+        <wsdl:operation name="validateByDNSEntry">
+            <wsdl:input message="ns:validateByDNSEntryRequest" wsaw:Action="urn:validateByDNSEntry" />
+            <wsdl:output message="ns:validateByDNSEntryResponse" wsaw:Action="urn:validateByDNSEntryResponse" />
+            <wsdl:fault message="ns:validateByDNSEntryException" name="validateByDNSEntryException" wsaw:Action="urn:validateByDNSEntryvalidateByDNSEntryException" />
+        </wsdl:operation>
+        <wsdl:operation name="getDomainValidationKey">
+            <wsdl:input message="ns:getDomainValidationKeyRequest" wsaw:Action="urn:getDomainValidationKey" />
+            <wsdl:output message="ns:getDomainValidationKeyResponse" wsaw:Action="urn:getDomainValidationKeyResponse" />
+            <wsdl:fault message="ns:getDomainValidationKeyException" name="getDomainValidationKeyException" wsaw:Action="urn:getDomainValidationKeygetDomainValidationKeyException" />
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="ValidateDomainServiceSoap11Binding" type="ns:ValidateDomainServicePortType">
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="validateByTextInRoot">
+            <soap:operation soapAction="urn:validateByTextInRoot" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="validateByTextInRootException">
+                <soap:fault use="literal" name="validateByTextInRootException" />
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="validateByDNSEntry">
+            <soap:operation soapAction="urn:validateByDNSEntry" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="validateByDNSEntryException">
+                <soap:fault use="literal" name="validateByDNSEntryException" />
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getDomainValidationKey">
+            <soap:operation soapAction="urn:getDomainValidationKey" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="getDomainValidationKeyException">
+                <soap:fault use="literal" name="getDomainValidationKeyException" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="ValidateDomainServiceSoap12Binding" type="ns:ValidateDomainServicePortType">
+        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="validateByTextInRoot">
+            <soap12:operation soapAction="urn:validateByTextInRoot" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="validateByTextInRootException">
+                <soap12:fault use="literal" name="validateByTextInRootException" />
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="validateByDNSEntry">
+            <soap12:operation soapAction="urn:validateByDNSEntry" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="validateByDNSEntryException">
+                <soap12:fault use="literal" name="validateByDNSEntryException" />
+            </wsdl:fault>
+        </wsdl:operation>
+        <wsdl:operation name="getDomainValidationKey">
+            <soap12:operation soapAction="urn:getDomainValidationKey" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="getDomainValidationKeyException">
+                <soap12:fault use="literal" name="getDomainValidationKeyException" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="ValidateDomainServiceHttpBinding" type="ns:ValidateDomainServicePortType">
+        <http:binding verb="POST" />
+        <wsdl:operation name="validateByTextInRoot">
+            <http:operation location="validateByTextInRoot" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="validateByDNSEntry">
+            <http:operation location="validateByDNSEntry" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="getDomainValidationKey">
+            <http:operation location="getDomainValidationKey" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="parameters" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="ValidateDomainService">
+        <wsdl:port name="ValidateDomainServiceHttpsSoap11Endpoint" binding="ns:ValidateDomainServiceSoap11Binding">
+            <soap:address location="https://192.168.1.100:9443/services/ValidateDomainService.ValidateDomainServiceHttpsSoap11Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="ValidateDomainServiceHttpsSoap12Endpoint" binding="ns:ValidateDomainServiceSoap12Binding">
+            <soap12:address location="https://192.168.1.100:9443/services/ValidateDomainService.ValidateDomainServiceHttpsSoap12Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="ValidateDomainServiceHttpsEndpoint" binding="ns:ValidateDomainServiceHttpBinding">
+            <http:address location="https://192.168.1.100:9443/services/ValidateDomainService.ValidateDomainServiceHttpsEndpoint/" />
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/org/apache/stratos/validate/domain/ui/i18n/JSResources.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/org/apache/stratos/validate/domain/ui/i18n/JSResources.properties b/components/org.apache.stratos.validate.domain.ui/src/main/resources/org/apache/stratos/validate/domain/ui/i18n/JSResources.properties
new file mode 100644
index 0000000..7052880
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/org/apache/stratos/validate/domain/ui/i18n/JSResources.properties
@@ -0,0 +1,7 @@
+validation.fail.with.text=Domain ownership validation failed. Make sure you have put the exact text content mentioned here in the web root. 
+validation.success.with.text=Domain ownership validation succeeded.
+validation.fail.with.dns=Domain ownership validation failed. Note it may take sometime to propagate the changes in DNS. Please retry after a little break.
+validation.success.with.dns=Domain ownership validation succeeded.
+domain.empty=The domain to validate ownership is empty.
+domain.unavailable=The domain is already registered. Please choose a different domain.
+session.timed.out=Your session timed out. Please login again.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/org/apache/stratos/validate/domain/ui/i18n/Resources.properties
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/org/apache/stratos/validate/domain/ui/i18n/Resources.properties b/components/org.apache.stratos.validate.domain.ui/src/main/resources/org/apache/stratos/validate/domain/ui/i18n/Resources.properties
new file mode 100644
index 0000000..fc77420
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/org/apache/stratos/validate/domain/ui/i18n/Resources.properties
@@ -0,0 +1,3 @@
+domain.ownership.validation=Domain Ownership Validation
+validate.domain.menu=Validate Domain
+validate=Validate

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/css/validate_domain.css
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/css/validate_domain.css b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/css/validate_domain.css
new file mode 100644
index 0000000..7b83d63
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/css/validate_domain.css
@@ -0,0 +1,31 @@
+div#validation-introduction {
+    margin: 5px;
+}
+
+div#with-text {
+    margin: 5px;
+}
+
+div#with-dns {
+    margin: 5px;
+}
+p {
+    padding:5px !important;
+}
+
+p.validate-button {
+    padding: 15px 5px 15px 5px !important;
+}
+
+li.catagory {
+    padding: 5px 0px 5px 25px  !important;
+}
+
+
+
+div.conf-info {
+    background: #cccccc !important;
+    border: 1px solid #111 !important;
+    margin: 5px !important;
+    padding: 2px !important;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/docs/images/domain-validation.png
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/docs/images/domain-validation.png b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/docs/images/domain-validation.png
new file mode 100644
index 0000000..382dfdb
Binary files /dev/null and b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/docs/images/domain-validation.png differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/docs/userguide.html
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/docs/userguide.html b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/docs/userguide.html
new file mode 100644
index 0000000..204c14a
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/docs/userguide.html
@@ -0,0 +1,47 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. 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>Validate Domain Ownership - User Guide</title>
+  <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+
+<body>
+<h1>Validate Domain Ownership</h1>
+
+<p>
+You can validate the ownership of your domain using two methods,
+    <ul>
+    <li>Creating a text file in the domain web ROOT </li>
+    <li>Setting up a CNAME entry in your DNS</li>
+    </ul>
+
+</p>
+
+
+<p>Instructions are shown in the following form.</p>
+
+<p>
+<img src="images/domain-validation.png" alt="Validation domain ownership"/>
+<div><strong>Figure1: Validate domain Ownership</strong></div>
+</p>
+
+</body>
+
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/ajax-loader.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/ajax-loader.gif b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/ajax-loader.gif
new file mode 100644
index 0000000..f2a1bc0
Binary files /dev/null and b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/ajax-loader.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/right.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/right.gif b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/right.gif
new file mode 100644
index 0000000..72a64c9
Binary files /dev/null and b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/right.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/wrong.gif
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/wrong.gif b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/wrong.gif
new file mode 100644
index 0000000..77e1f2c
Binary files /dev/null and b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/images/wrong.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/js/validate_domain.js
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/js/validate_domain.js b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/js/validate_domain.js
new file mode 100644
index 0000000..1585b42
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/js/validate_domain.js
@@ -0,0 +1,151 @@
+function validateWithText(domain, status) {
+	sessionAwareStatusAwareFunction(function() {
+    if(domain == "") {
+        CARBON.showWarningDialog(org_wso2_carbon_validate_domain_ui_jsi18n["domain.empty"]);
+        return false;
+    }
+
+    var reason = checkDomain(domain);
+    if (reason != "") {
+        CARBON.showWarningDialog(reason);
+        return false;
+    }
+
+    var continueDiv = document.getElementById("with-text-continue");
+    var msgDiv = document.getElementById("with-text-msg");
+    var keyInput = document.getElementById("with-text-success-key");
+
+    var busyTextPlaceHolder = document.getElementById("busyText");
+    busyTextPlaceHolder.innerHTML = "<img src=\"images/ajax-loader.gif\"/>";
+
+    new Ajax.Request('../validate-domain/validate_with_text_ajaxprocessor.jsp',
+    {
+        method:'post',
+        parameters: {domain: domain, status: status},
+
+        onSuccess: function(transport) {
+            busyTextPlaceHolder.innerHTML = "";
+            var returnValue = transport.responseText;
+            if (returnValue.search(/----false----/) >= 0) {
+                msgDiv.style.color = "#f00";
+                msgDiv.innerHTML = "<img src='images/wrong.gif'/> " + org_wso2_carbon_validate_domain_ui_jsi18n["validation.fail.with.text"];
+                continueDiv.style.visibility = "hidden";
+            } else if (returnValue.search(/----unavailable----/) >= 0) {
+                msgDiv.style.color = "#f00";
+                msgDiv.innerHTML = "<img src='images/wrong.gif'/> " + org_wso2_carbon_validate_domain_ui_jsi18n["domain.unavailable"];
+                continueDiv.style.visibility = "hidden";
+            } else if (returnValue != "") {
+                msgDiv.style.color = "#058000";
+                msgDiv.innerHTML = "<img src='images/right.gif'/> " + org_wso2_carbon_validate_domain_ui_jsi18n["validation.success.with.text"];
+                continueDiv.style.visibility = "visible";
+                keyInput.value = returnValue;
+            }
+        },
+
+        onFailure: function(transport){
+            busyTextPlaceHolder.innerHTML = "";
+        }
+    });
+	}, status, org_wso2_carbon_validate_domain_ui_jsi18n["session.timed.out"]);
+}
+
+function validateWithDNS(domain, status) {
+	sessionAwareStatusAwareFunction(function() {
+    if(domain == "") {
+        CARBON.showWarningDialog(org_wso2_carbon_validate_domain_ui_jsi18n["domain.empty"]);
+        return false;
+    }
+
+    var reason = checkDomain(domain);
+    if (reason != "") {
+        CARBON.showWarningDialog(reason);
+        return false;
+    }
+
+    var continueDiv = document.getElementById("with-dns-continue");
+    var msgDiv = document.getElementById("with-dns-msg");
+    var keyInput = document.getElementById("with-dns-success-key");
+
+    var busyDNSPlaceHolder = document.getElementById("busyDNS");
+    busyDNSPlaceHolder.innerHTML = "<img src=\"images/ajax-loader.gif\"/>";
+
+    new Ajax.Request('../validate-domain/validate_with_dns_ajaxprocessor.jsp',
+    {
+        method:'post',
+        parameters: {domain: domain, status: status},
+
+        onSuccess: function(transport) {
+            busyDNSPlaceHolder.innerHTML = "";
+            var returnValue = transport.responseText;
+            if (returnValue.search(/----false----/) >= 0) {
+                msgDiv.style.color = "#f00";
+                msgDiv.innerHTML = "<img src='images/wrong.gif'/> " + org_wso2_carbon_validate_domain_ui_jsi18n["validation.fail.with.dns"];
+                continueDiv.style.visibility = "hidden";
+            } else if (returnValue.search(/----unavailable----/) >= 0) {
+                msgDiv.style.color = "#f00";
+                msgDiv.innerHTML = "<img src='images/wrong.gif'/> " + org_wso2_carbon_validate_domain_ui_jsi18n["domain.unavailable"];
+                continueDiv.style.visibility = "hidden";
+            } else if (returnValue != "") {
+                msgDiv.style.color = "#058000";
+                msgDiv.innerHTML = "<img src='images/right.gif'/> " + org_wso2_carbon_validate_domain_ui_jsi18n["validation.success.with.dns"];
+                continueDiv.style.visibility = "visible";
+                keyInput.value = returnValue;
+            }
+        },
+
+        onFailure: function(transport){
+            busyDNSPlaceHolder.innerHTML = "";
+        }
+    });
+	}, status, org_wso2_carbon_validate_domain_ui_jsi18n["session.timed.out"]);
+}
+
+
+function gotoRegister() {
+    window.location.href = '../tenant-register/success_register.jsp';
+}
+
+function checkDomain(domain)
+{
+    var error = "";
+    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 (lastIndexOfDot <= 0) {
+        // since this is domain validation, this expects a valid domain with an extension.
+        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(domain)) {
+        error = "The domain only allows letters, numbers, '.', '-' and '_'. <br />";
+    }
+    return error;
+}
+
+function sessionAwareStatusAwareFunction(func, status, msg) {
+	if (status == "logged_in") {
+		sessionAwareFunction(func, msg);
+	} else {
+		func();
+	}
+}
+
+function submitValidateWithDNSForm(status) {
+	sessionAwareStatusAwareFunction(function() {
+		$('validateWithDNSForm').submit();
+	}, status, org_wso2_carbon_validate_domain_ui_jsi18n["session.timed.out"]);
+}
+
+function submitValidateWithTextForm(status) {
+	sessionAwareStatusAwareFunction(function() {
+		$('validateWithTextForm').submit();
+	}, status, org_wso2_carbon_validate_domain_ui_jsi18n["session.timed.out"]);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/submit_validate_domain_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/submit_validate_domain_ajaxprocessor.jsp b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/submit_validate_domain_ajaxprocessor.jsp
new file mode 100644
index 0000000..b5edff1
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/submit_validate_domain_ajaxprocessor.jsp
@@ -0,0 +1,36 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. 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.utils.multitenancy.MultitenantConstants" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+String successKey = request.getParameter("successKey");
+String domain = request.getParameter("domain");
+String status = request.getParameter("status");
+session.setAttribute("validate-domain-success-key", successKey);
+session.setAttribute("temp-domain-to-register", domain);
+
+// redirect to the add registry domain page
+if ("logged_in".equals(status)) {
+    // we have already logged in so redirect to the account management page
+    response.sendRedirect("../account-mgt/validation_success_ajaxprocessor.jsp");
+}
+else {
+    // if not logged in we will redirect to the register org page
+    response.sendRedirect("../tenant-register/success_register.jsp");
+}
+%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_logged_in.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_logged_in.jsp b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_logged_in.jsp
new file mode 100644
index 0000000..6ee6e47
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_logged_in.jsp
@@ -0,0 +1,22 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. 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 contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:include page="validate_domain_template.jsp">
+    <jsp:param name="status" 
+     value="logged_in" />
+</jsp:include>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_not_logged_in.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_not_logged_in.jsp b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_not_logged_in.jsp
new file mode 100644
index 0000000..92b4f61
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_not_logged_in.jsp
@@ -0,0 +1,22 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. 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 contentType="text/html;charset=UTF-8" language="java" %>
+<jsp:include page="validate_domain_template.jsp">
+    <jsp:param name="status" 
+     value="not_logged_in" />
+</jsp:include>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_template.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_template.jsp b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_template.jsp
new file mode 100644
index 0000000..0372c92
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_domain_template.jsp
@@ -0,0 +1,204 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. 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.validate.domain.ui.clients.ValidateDomainClient"%>
+<%@ page import="org.wso2.carbon.validate.domain.ui.utils.Util"%>
+<%@ page import="org.wso2.carbon.ui.CarbonUIUtil"%>
+<%@ page
+	import="org.wso2.carbon.utils.multitenancy.MultitenantConstants"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"
+	prefix="carbon"%>
+<link rel="stylesheet" type="text/css" href="../yui/assets/yui.css">
+<link rel="stylesheet" type="text/css"
+	href="../yui/build/menu/assets/skins/sam/menu.css" />
+<link rel="stylesheet" type="text/css"
+	href="../yui/build/button/assets/skins/sam/button.css" />
+<link rel="stylesheet" type="text/css"
+	href="../yui/build/container/assets/skins/sam/container.css" />
+<link rel="stylesheet" type="text/css"
+	href="../yui/build/autocomplete/assets/skins/sam/autocomplete.css" />
+<link rel="stylesheet" type="text/css"
+	href="../yui/build/editor/assets/skins/sam/editor.css" />
+<link rel="stylesheet" type="text/css"
+	href="../validate-domain/css/validate_domain.css" />
+<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>
+<carbon:jsi18n
+        resourceBundle="org.wso2.carbon.validate.domain.ui.i18n.JSResources"
+        request="<%=request%>" namespace="org.wso2.carbon.validate.domain.ui"/>
+
+<script type="text/javascript" src="../validate-domain/js/validate_domain.js"></script>
+
+<fmt:bundle
+	basename="org.wso2.carbon.validate.domain.ui.i18n.Resources">
+	<%
+	    String domain = request.getParameter("domain");
+		String status = request.getParameter("status");
+	        // get the validation key
+	        ValidateDomainClient client =
+	                Util.getValidateDomainClient(request, config, session);
+	        String domainValidationKey = client.getDomainValidationKey(domain);
+	        if ("unavailable".equals(domainValidationKey)) {
+           %>
+               <script type="text/javascript">
+                   jQuery(document).ready(function() {
+                       CARBON.showErrorDialog('The domain you are trying to validate ' +
+                               'is already taken. Please retry with another domain.');
+                   });
+               </script>
+
+           <%
+               }
+	        //String serverUrl = CarbonUIUtil.getServerURL(config.getServletContext(), session);
+	        String adminConsoleURL = CarbonUIUtil.getAdminConsoleURL("/");
+	        String serverUrl = adminConsoleURL.replace("carbon","services");
+	        // remove the services directory.
+	        String serverRoot =
+	                serverUrl.substring(0, serverUrl.length() - "/services/".length());
+	        // we have to remove the port as well.
+	        if (serverRoot == null) {
+	            serverRoot = "stratoslive.wso2.com";
+	        }
+	        // server root without https
+	        serverRoot = serverRoot.substring(8);
+	        int semiCol = serverRoot.indexOf(':');
+	        if (semiCol >= 0) {
+	            // need to remove the port
+	            serverRoot = serverRoot.substring(0, semiCol);
+	        }
+
+	        // we have additional statement
+	        String statementToIgnoreValidate = "";
+	        if (session.getAttribute(MultitenantConstants.TENANT_DOMAIN) == null) {
+	            statementToIgnoreValidate =
+	                    "or <input type='button' onclick='gotoRegister()' value='Skip the validation step'/>";
+	        }
+	%>
+	<div id="middle">
+
+    <carbon:breadcrumb label="validate"
+        resourceBundle="org.wso2.carbon.validate.domain.ui.i18n.Resources"
+        topPage="false" request="<%=request%>" />
+    
+	<div id="workArea">
+	<h2><fmt:message key="domain.ownership.validation" /></h2>
+
+	<div id="validation-introduction">
+	<p>You can validate your domain using the following method <%=statementToIgnoreValidate%></p>
+	<ul>
+		<li class="catagory">Creating a text file in the domain web
+		ROOT</li>
+<!-- 		<li class="catagory">2. Setting up a CNAME entry in your DNS</li> -->
+	</ul>
+	</div>
+
+	<div id="with-text">
+
+	<table class="styledLeft">
+		<thead>
+			<tr>
+				<th>Validate domain using a text file</th>
+			</tr>
+		</thead>
+		<tbody>
+			<tr>
+				<td>
+				<p>Add a text file inside the web root of your domain with the following configuration:</p>
+				<div class="conf-info">
+				<%
+				    // the filename is hard coded now, a change in this need to be reflected at validateDomainService.jsp
+				%>
+				<p>Filename: <strong>wso2multitenancy.txt</strong></p>
+				<p>Text content: <strong><%=domainValidationKey%></strong></p>
+				</div>
+				<p class="validate-button"><em> Click the 'Validate'
+				button, after you complete the above step </em> <input type="button"
+					value="Validate" onclick="validateWithText('<%=domain%>', '<%=status%>')" /> <span
+					id="busyText"></span></p>
+				<p>
+				<div id="with-text-msg"></div>
+				</p>
+				<p>
+				<div id="with-text-continue" style="visibility: hidden">
+				<form id="validateWithTextForm"
+					onsubmit="return submitValidateWithTextForm('<%=status%>');" 
+					action="submit_validate_domain_ajaxprocessor.jsp" method="post">
+				<input type="hidden" id="with-text-success-key" name="successKey"
+					value="" /> <input type="hidden" name="domain" value="<%=domain%>" />
+				<input type="hidden" id="with-text-status" name="status" value="<%=status%>"/>
+				<input type="submit" value="Continue" /></form>
+				</div>
+				</p>
+				</td>
+			</tr>
+		</tbody>
+	</table>
+	</div>
+
+
+<!-- 	<div id="with-dns"> -->
+
+<!-- 	<table class="styledLeft"> -->
+<!-- 		<thead> -->
+<!-- 			<tr> -->
+<!-- 				<th>Validate domain using a CName entry</th> -->
+<!-- 			</tr> -->
+<!-- 		</thead> -->
+<!-- 		<tbody> -->
+<!-- 			<tr> -->
+<!-- 				<td> -->
+<!-- 				<p>Put a CNAME entry in your DNS with following configuration: -->
+<!-- 				(Note that if you refresh this page, the parameters will be changed) -->
+<!-- 				</p> -->
+<!-- 				<div class="conf-info"> -->
+<%-- 				<p>Name: <strong><%=domainValidationKey%>.<%=domain%></strong></p> --%>
+<!-- 				<p>Type: <strong>CNAME</strong></p> -->
+<%-- 				<p>Value: <strong><%=serverRoot%></strong></p> --%>
+<!-- 				</div> -->
+<!-- 				<p class="validate-button"><em> Click the 'Validate' -->
+<!-- 				button, after you finish setting the CNAME entry </em> <input -->
+<!-- 					type="button" value="Validate" -->
+<%-- 					onclick="validateWithDNS('<%=domain%>', '<%=status%>')" /> <span id="busyDNS"></span> --%>
+<!-- 				</p> -->
+<!-- 				<p> -->
+<!-- 				<div id="with-dns-msg"></div> -->
+<!-- 				</p> -->
+<!-- 				<p> -->
+<!-- 				<div id="with-dns-continue" style="visibility: hidden"> -->
+<!-- 				<form id="validateWithDNSForm" -->
+<!-- 					action="submit_validate_domain_ajaxprocessor.jsp" -->
+<%-- 					onsubmit="return submitValidateWithDNSForm('<%=status%>');" method="post"> --%>
+<!-- 				<input type="hidden" id="with-dns-success-key" name="successKey" -->
+<%-- 					value="" /> <input type="hidden" name="domain" value="<%=domain%>" /> --%>
+<%-- 				<input type="hidden" id="with-dns-status" name="status" value="<%=status%>"/> --%>
+<!-- 				<input type="submit" value="Continue" /></form> -->
+<!-- 				</div> -->
+<!-- 				</p> -->
+<!-- 				</td> -->
+<!-- 			</tr> -->
+<!-- 		</tbody> -->
+<!-- 	</table> -->
+<!-- 	</div> -->
+	</div>
+</fmt:bundle>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_with_dns_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_with_dns_ajaxprocessor.jsp b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_with_dns_ajaxprocessor.jsp
new file mode 100644
index 0000000..a2bea9a
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_with_dns_ajaxprocessor.jsp
@@ -0,0 +1,22 @@
+<%@ page import="org.wso2.carbon.validate.domain.ui.clients.ValidateDomainClient" %>
+<%@ page import="org.wso2.carbon.validate.domain.ui.utils.Util" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+    String domain = request.getParameter("domain");
+    String validationSuccessKey;
+
+    try {
+        ValidateDomainClient client = Util.getValidateDomainClient(request, config, session);
+        validationSuccessKey = client.validateByDNSEntry(domain);
+    } catch (Exception e) {
+        validationSuccessKey = null;
+    }
+
+    if (validationSuccessKey == null || validationSuccessKey.equals("") ||
+            validationSuccessKey.equals("false") || validationSuccessKey.equals("null")) {
+        validationSuccessKey = "----false----";
+    }
+    else if (validationSuccessKey.equals("unavailable")) {
+        validationSuccessKey = "----unavailable----";
+    }
+%><%=validationSuccessKey%>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/a875aabb/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_with_text_ajaxprocessor.jsp
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_with_text_ajaxprocessor.jsp b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_with_text_ajaxprocessor.jsp
new file mode 100644
index 0000000..1105363
--- /dev/null
+++ b/components/org.apache.stratos.validate.domain.ui/src/main/resources/web/validate-domain/validate_with_text_ajaxprocessor.jsp
@@ -0,0 +1,22 @@
+<%@ page import="org.wso2.carbon.validate.domain.ui.clients.ValidateDomainClient" %>
+<%@ page import="org.wso2.carbon.validate.domain.ui.utils.Util" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+    String domain = request.getParameter("domain");
+    String validationSuccessKey;
+
+    try {
+        ValidateDomainClient client = Util.getValidateDomainClient(request, config, session);
+        validationSuccessKey = client.validateByTextInRoot(domain);
+    } catch (Exception e) {
+        validationSuccessKey = null;
+    }
+
+    if (validationSuccessKey == null || validationSuccessKey.equals("") ||
+            validationSuccessKey.equals("false") || validationSuccessKey.equals("null")) {
+        validationSuccessKey = "----false----";
+    }
+    else if (validationSuccessKey.equals("unavailable")) {
+        validationSuccessKey = "----unavailable----";
+    }
+%><%=validationSuccessKey%>
\ No newline at end of file