You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by pr...@apache.org on 2014/04/17 04:43:24 UTC
[44/52] [partial] forking carbon ui bundle in to stratos code base
and removing license incompatible JS and packing the new module to carbon
runtime, through dropins
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/FileUploadExecutorManager.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/FileUploadExecutorManager.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/FileUploadExecutorManager.java
new file mode 100644
index 0000000..5fb272c
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/FileUploadExecutorManager.java
@@ -0,0 +1,401 @@
+/*
+ * Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
+ *
+ * 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.wso2.carbon.ui.transports.fileupload;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.util.XMLUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.CarbonException;
+import org.wso2.carbon.base.ServerConfiguration;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.xml.namespace.QName;
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * <p>
+ * This class is responsible for delegating the file upload requests to the different
+ * FileUploadExecutors.
+ * </p>
+ * <p>
+ * The FileUploadExecutors may be registered in the following manner:
+ *
+ * <ol>
+ * <li>1. Using FileUploadConfig configuration section in the carbon.xml</li>
+ * <li>2. Instances of {@link AbstractFileUploadExecutor } registered as OSGi services</li>
+ * <li>3. Using component.xml file in UI components</li>
+ * </ol>
+ * </p>
+ * <p>
+ * If a FileUploadExecutor cannot be found in the above 3 collections, as a final resort,
+ * we will finally try to upload the file using an {@link AnyFileUploadExecutor}, if it has been
+ * registered in the carbon.xml file. Searching for an FileUploadExecutor in the above 3 types of
+ * items is done using the chain of execution pattern. As soon as a FileUploadExecutor which can
+ * handle the uploaded file type is found, execution of the chain is terminated.
+ * </p>
+ */
+public class FileUploadExecutorManager {
+
+ private static Log log = LogFactory.getLog(FileUploadExecutorManager.class);
+
+ private Map<String, AbstractFileUploadExecutor> executorMap =
+ new HashMap<String, AbstractFileUploadExecutor>();
+
+ private BundleContext bundleContext;
+
+ private ConfigurationContext configContext;
+
+ private String webContext;
+
+ public FileUploadExecutorManager(BundleContext bundleContext,
+ ConfigurationContext configCtx,
+ String webContext) throws CarbonException {
+ this.bundleContext = bundleContext;
+ this.configContext = configCtx;
+ this.webContext = webContext;
+ this.loadExecutorMap();
+ }
+
+ /**
+ * When a FileUpload request is received, this method will be called.
+ *
+ * @param request The HTTP Request
+ * @param response The HTTP Response
+ * @return true - if the file uploading was successful, false - otherwise
+ * @throws IOException If an unrecoverable error occurs during file upload
+ */
+ public boolean execute(HttpServletRequest request,
+ HttpServletResponse response) throws IOException {
+
+ HttpSession session = request.getSession();
+ String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
+ request.setAttribute(CarbonConstants.ADMIN_SERVICE_COOKIE, cookie);
+ request.setAttribute(CarbonConstants.WEB_CONTEXT, webContext);
+ request.setAttribute(CarbonConstants.SERVER_URL,
+ CarbonUIUtil.getServerURL(request.getSession().getServletContext(),
+ request.getSession()));
+
+
+ String requestURI = request.getRequestURI();
+
+ //TODO - fileupload is hardcoded
+ int indexToSplit = requestURI.indexOf("fileupload/") + "fileupload/".length();
+ String actionString = requestURI.substring(indexToSplit);
+
+ // Register execution handlers
+ FileUploadExecutionHandlerManager execHandlerManager =
+ new FileUploadExecutionHandlerManager();
+ CarbonXmlFileUploadExecHandler carbonXmlExecHandler =
+ new CarbonXmlFileUploadExecHandler(request, response, actionString);
+ execHandlerManager.addExecHandler(carbonXmlExecHandler);
+ OSGiFileUploadExecHandler osgiExecHandler =
+ new OSGiFileUploadExecHandler(request, response);
+ execHandlerManager.addExecHandler(osgiExecHandler);
+ AnyFileUploadExecHandler anyFileExecHandler =
+ new AnyFileUploadExecHandler(request, response);
+ execHandlerManager.addExecHandler(anyFileExecHandler);
+ execHandlerManager.startExec();
+ return true;
+ }
+
+ private void loadExecutorMap() throws CarbonException {
+ ServerConfiguration serverConfiguration = ServerConfiguration.getInstance();
+ OMElement documentElement;
+ try {
+ documentElement = XMLUtils.toOM(serverConfiguration.getDocumentElement());
+ } catch (Exception e) {
+ String msg = "Unable to read Server Configuration.";
+ log.error(msg);
+ throw new CarbonException(msg, e);
+ }
+ OMElement fileUploadConfigElement =
+ documentElement.getFirstChildWithName(
+ new QName(ServerConstants.CARBON_SERVER_XML_NAMESPACE, "FileUploadConfig"));
+ for (Iterator iterator = fileUploadConfigElement.getChildElements(); iterator.hasNext();) {
+ OMElement mapppingElement = (OMElement) iterator.next();
+ if (mapppingElement.getLocalName().equalsIgnoreCase("Mapping")) {
+ OMElement actionsElement =
+ mapppingElement.getFirstChildWithName(
+ new QName(ServerConstants.CARBON_SERVER_XML_NAMESPACE, "Actions"));
+
+ if (actionsElement == null) {
+ String msg = "The mandatory FileUploadConfig/Actions entry " +
+ "does not exist or is empty in the CARBON_HOME/conf/carbon.xml " +
+ "file. Please fix this error in the carbon.xml file and restart.";
+ log.error(msg);
+ throw new CarbonException(msg);
+ }
+ Iterator actionElementIterator =
+ actionsElement.getChildrenWithName(
+ new QName(ServerConstants.CARBON_SERVER_XML_NAMESPACE, "Action"));
+
+ if (!actionElementIterator.hasNext()) {
+ String msg = "A FileUploadConfig/Mapping entry in the " +
+ "CARBON_HOME/conf/carbon.xml should have at least on Action " +
+ "defined. Please fix this error in the carbon.xml file and " +
+ "restart.";
+ log.error(msg);
+ throw new CarbonException(msg);
+ }
+
+ OMElement classElement = mapppingElement.getFirstChildWithName(
+ new QName(ServerConstants.CARBON_SERVER_XML_NAMESPACE, "Class"));
+
+ if (classElement == null || classElement.getText() == null) {
+ String msg = "The mandatory FileUploadConfig/Mapping/Class entry " +
+ "does not exist or is empty in the CARBON_HOME/conf/carbon.xml " +
+ "file. Please fix this error in the carbon.xml file and restart.";
+ log.error(msg);
+ throw new CarbonException(msg);
+ }
+
+
+ AbstractFileUploadExecutor object;
+ String className = classElement.getText().trim();
+
+ try {
+ Class clazz = bundleContext.getBundle().loadClass(className);
+ Constructor constructor =
+ clazz.getConstructor();
+ object = (AbstractFileUploadExecutor) constructor
+ .newInstance();
+
+ } catch (Exception e) {
+ String msg = "Error occurred while trying to instantiate the " + className +
+ " class specified as a FileUploadConfig/Mapping/class element in " +
+ "the CARBON_HOME/conf/carbon.xml file. Please fix this error in " +
+ "the carbon.xml file and restart.";
+ log.error(msg, e);
+ throw new CarbonException(msg, e);
+ }
+
+ while (actionElementIterator.hasNext()) {
+ OMElement actionElement = (OMElement) actionElementIterator.next();
+ if (actionElement.getText() == null) {
+ String msg = "A FileUploadConfig/Mapping/Actions/Action element in the " +
+ "CARBON_HOME/conf/carbon.xml file is empty. Please include " +
+ "the correct value in this file and restart.";
+ log.error(msg);
+ throw new CarbonException(msg);
+ }
+ executorMap.put(actionElement.getText().trim(), object);
+ }
+ }
+ }
+ }
+
+ public void addExecutor(String action, String executorClass) throws CarbonException {
+ if (action == null) {
+ String msg = "A FileUploadConfig/Mapping/Actions/Action element is null ";
+ log.error(msg);
+ }
+
+ if (executorClass == null || executorClass.equals("")) {
+ String msg = "Provided FileUploadExecutor object is invalid ";
+ log.error(msg);
+ }
+
+ AbstractFileUploadExecutor object;
+
+ try {
+ Class clazz = bundleContext.getBundle().loadClass(executorClass);
+ Constructor constructor = clazz.getConstructor();
+ object = (AbstractFileUploadExecutor) constructor.newInstance();
+ executorMap.put(action, object);
+ } catch (Exception e) {
+ String msg = "Error occurred while trying to instantiate the " + executorClass +
+ " class specified as a FileUploadConfig/Mapping/class element";
+ log.error(msg, e);
+ throw new CarbonException(msg, e);
+ }
+ }
+
+ public void removeExecutor(String action) {
+ if (action == null) {
+ String msg = "A FileUploadConfig/Mapping/Actions/Action element is null ";
+ log.error(msg);
+ }
+
+ executorMap.remove(action);
+ }
+
+ /**
+ * This class manages registration of a chain of {@link FileUploadExecutionHandler}s. Uses
+ * chain of execution pattern.
+ */
+ private static class FileUploadExecutionHandlerManager {
+
+ /**
+ * First handler in the chain
+ */
+ private FileUploadExecutionHandler firstHandler;
+
+ /**
+ * Previous handler
+ */
+ private FileUploadExecutionHandler prevHandler;
+
+ public void addExecHandler(FileUploadExecutionHandler handler) {
+ if (prevHandler != null) {
+ prevHandler.setNext(handler);
+ } else {
+ firstHandler = handler;
+ }
+ prevHandler = handler;
+ }
+
+ public void startExec() throws IOException {
+ firstHandler.execute();
+ }
+ }
+
+ /**
+ * The base class of all FileUploadExecutionHandler. For each type of file upload execution
+ * chain, we will implement a subclass of this. Uses chain of execution pattern.
+ */
+ private abstract class FileUploadExecutionHandler {
+ private FileUploadExecutionHandler next;
+
+ public abstract void execute() throws IOException;
+
+ public final void next() throws IOException {
+ next.execute();
+ }
+
+ public final void setNext(FileUploadExecutionHandler next) {
+ this.next = next;
+ }
+ }
+
+ /**
+ * Represents upload execution chain of {@link AnyFileUploadExecutor}
+ */
+ private class AnyFileUploadExecHandler extends FileUploadExecutionHandler {
+ private HttpServletRequest request;
+ private HttpServletResponse response;
+
+ private AnyFileUploadExecHandler(HttpServletRequest request, HttpServletResponse response) {
+ this.request = request;
+ this.response = response;
+ }
+
+ @Override
+ public void execute() throws IOException {
+ Object obj = executorMap.get("*");
+ if (obj == null) {
+ log.warn("Reached 'All' section but Could not find the Implementation Class");
+ return;
+ }
+ AnyFileUploadExecutor executor = (AnyFileUploadExecutor) obj;
+ executor.executeGeneric(request, response, configContext);
+ }
+ }
+
+ /**
+ * Represents upload execution chain of UploadExecutors registered as OSGi services
+ */
+ private class OSGiFileUploadExecHandler extends FileUploadExecutionHandler {
+
+ private HttpServletRequest request;
+ private HttpServletResponse response;
+
+ private OSGiFileUploadExecHandler(HttpServletRequest request,
+ HttpServletResponse response) {
+ this.request = request;
+ this.response = response;
+ }
+
+ public void execute() throws IOException {
+
+ ServiceReference[] serviceReferences;
+ try {
+ serviceReferences =
+ bundleContext.
+ getServiceReferences(AbstractFileUploadExecutor.class.getName(),
+ null);
+ } catch (InvalidSyntaxException e) {
+ throw new IllegalArgumentException("Service reference cannot be obtained", e);
+ }
+ boolean foundExecutor = false;
+ if (serviceReferences != null) {
+ String requestURI = request.getRequestURI();
+ for (ServiceReference reference : serviceReferences) {
+ String action = (String) reference.getProperty("action");
+ if (action != null && requestURI.indexOf(action) > -1) {
+ foundExecutor = true;
+ AbstractFileUploadExecutor uploadExecutor =
+ (AbstractFileUploadExecutor) bundleContext.getService(reference);
+ uploadExecutor.executeGeneric(request, response, configContext);
+ break;
+ }
+ }
+ if (!foundExecutor) {
+ next();
+ }
+ }
+
+ }
+ }
+
+ /**
+ * Represents upload execution chain of UploadExecutors registered in carbon.xml, except for
+ * {@link AnyFileUploadExecutor}
+ */
+ private class CarbonXmlFileUploadExecHandler extends FileUploadExecutionHandler {
+
+ private HttpServletRequest request;
+ private HttpServletResponse response;
+ private String actionString;
+
+ private CarbonXmlFileUploadExecHandler(HttpServletRequest request,
+ HttpServletResponse response,
+ String actionString) {
+ this.request = request;
+ this.response = response;
+ this.actionString = actionString;
+ }
+
+ public void execute() throws IOException {
+ boolean foundExecutor = false;
+ for (String key : executorMap.keySet()) {
+ if (key.equals(actionString)) {
+ AbstractFileUploadExecutor obj = executorMap.get(key);
+ foundExecutor = true;
+ obj.executeGeneric(request, response, configContext);
+ break;
+ }
+ }
+ if (!foundExecutor) {
+ next();
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/FileUploadFailedException.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/FileUploadFailedException.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/FileUploadFailedException.java
new file mode 100644
index 0000000..dc932d3
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/FileUploadFailedException.java
@@ -0,0 +1,22 @@
+package org.wso2.carbon.ui.transports.fileupload;
+
+/**
+ * This exception is thrown when file uploading fails
+ */
+public class FileUploadFailedException extends Exception {
+ public FileUploadFailedException() {
+
+ }
+
+ public FileUploadFailedException(String s) {
+ super(s);
+ }
+
+ public FileUploadFailedException(String s, Throwable throwable) {
+ super(s, throwable);
+ }
+
+ public FileUploadFailedException(Throwable throwable) {
+ super(throwable);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/JarZipUploadExecutor.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/JarZipUploadExecutor.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/JarZipUploadExecutor.java
new file mode 100644
index 0000000..e3b25c2
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/JarZipUploadExecutor.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2005,2006 WSO2, Inc. http://www.wso2.org
+ *
+ * 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.wso2.carbon.ui.transports.fileupload;
+
+import org.apache.commons.collections.bidimap.TreeBidiMap;
+import org.apache.commons.fileupload.disk.DiskFileItem;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.apache.commons.fileupload.servlet.ServletRequestContext;
+import org.wso2.carbon.CarbonException;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Handles Jar, Zip file upload and creating a service archive out of it
+ * This class is totally comply with add_new_jar_zip.xsl. Thus, should not use in general purpose
+ * activities.
+ */
+public class JarZipUploadExecutor extends org.wso2.carbon.ui.transports.fileupload.AbstractFileUploadExecutor {
+
+ public boolean execute(HttpServletRequest request, HttpServletResponse response)
+ throws CarbonException, IOException {
+ ServletRequestContext servletRequestContext = new ServletRequestContext(request);
+ boolean isMultipart =
+ ServletFileUpload.isMultipartContent(servletRequestContext);
+ PrintWriter out = response.getWriter();
+ response.setContentType("text/html; charset=utf-8");
+ try {
+ if (isMultipart) {
+ List items = parseRequest(servletRequestContext);
+ Map fileResourceMap =
+ (Map) configurationContext
+ .getProperty(ServerConstants.FILE_RESOURCE_MAP);
+ if (fileResourceMap == null) {
+ fileResourceMap = new TreeBidiMap();
+ configurationContext.setProperty(ServerConstants.FILE_RESOURCE_MAP,
+ fileResourceMap);
+ }
+ List resourceUUID = new ArrayList();
+ String main = null;
+ for (Iterator iterator = items.iterator(); iterator.hasNext();) {
+ DiskFileItem item = (DiskFileItem) iterator.next();
+ if (!item.isFormField()) {
+ String uuid = String.valueOf(System.currentTimeMillis() + Math.random());
+ String extraFileLocation =
+ configurationContext.getProperty(ServerConstants.WORK_DIR) +
+ File.separator + "extra" +
+ File.separator + uuid + File.separator;
+ String fieldName = item.getFieldName();
+ if (fieldName != null && fieldName.equals("jarZipFilename")) {
+ File dirs = new File(extraFileLocation);
+ dirs.mkdirs();
+ String fileName = item.getName();
+ String fileExtension = fileName;
+ checkServiceFileExtensionValidity(fileExtension,
+ new String[]{".jar", ".zip"});
+ File uploadedFile = new File(extraFileLocation,
+ getFileName(fileName));
+ item.write(uploadedFile);
+ main = uuid;
+ resourceUUID.add(uuid);
+ fileResourceMap.put(uuid, uploadedFile.getAbsolutePath());
+ }
+
+ if (fieldName != null && fieldName.equals("jarResource")) {
+ String fileName = item.getName();
+ if (fileName.toLowerCase().endsWith(".jar")) {
+ File dirs = new File(extraFileLocation);
+ dirs.mkdirs();
+ File uploadedFile = new File(extraFileLocation,
+ getFileName(fileName));
+ item.write(uploadedFile);
+ resourceUUID.add(uuid);
+ fileResourceMap.put(uuid, uploadedFile.getAbsolutePath());
+ }
+ }
+ }
+ }
+ if (main == null) {
+ out.write("<script type=\"text/javascript\">" +
+ "top.wso2.wsf.Util.alertWarning('Please upload a jar or a zip file.');" +
+ "</script>");
+ }
+
+ String s = "var uObj = new Object();";
+ for (int i = 0; i < resourceUUID.size(); i++) {
+ s += "uObj[" + i + "]=\"" + resourceUUID.get(i) + "\";\n";
+ }
+ out.write("<script type=\"text/javascript\">" +
+ s +
+ "top." + "jarZipFileUploadExecutor" + "(\"" + main + "\",uObj);" +
+ "</script>");
+ out.flush();
+ }
+ } catch (Exception e) {
+ log.error("File upload FAILED", e);
+ out.write("<script type=\"text/javascript\">" +
+ "top.wso2.wsf.Util.alertWarning('File upload FAILED. File may be non-existent or invalid.');" +
+ "</script>");
+ } finally {
+ out.close();
+ }
+ return true;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/KeyStoreFileUploadExecutor.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/KeyStoreFileUploadExecutor.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/KeyStoreFileUploadExecutor.java
new file mode 100644
index 0000000..da475b6
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/KeyStoreFileUploadExecutor.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
+ *
+ * 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.wso2.carbon.ui.transports.fileupload;
+
+import org.apache.commons.collections.bidimap.TreeBidiMap;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.apache.commons.fileupload.servlet.ServletRequestContext;
+import org.wso2.carbon.CarbonException;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+/*
+ *
+ */
+
+public class KeyStoreFileUploadExecutor extends org.wso2.carbon.ui.transports.fileupload.AbstractFileUploadExecutor {
+
+ public boolean execute(HttpServletRequest request, HttpServletResponse response)
+ throws CarbonException, IOException {
+ ServletRequestContext servletRequestContext = new ServletRequestContext(request);
+ boolean isMultipart =
+ ServletFileUpload.isMultipartContent(servletRequestContext);
+ PrintWriter out = response.getWriter();
+ response.setContentType("text/html; charset=utf-8");
+ try {
+ if (isMultipart) {
+ List items = parseRequest(servletRequestContext);
+ // Process the uploaded items
+ for (Iterator iter = items.iterator(); iter.hasNext();) {
+ FileItem item = (FileItem) iter.next();
+ if (!item.isFormField()) {
+ String uuid = String.valueOf(System.currentTimeMillis() + Math.random());
+ String ksUploadDir =
+ configurationContext.getProperty(ServerConstants.WORK_DIR) +
+ File.separator + "keystores" +
+ File.separator + uuid + File.separator;
+
+ File dirs = new File(ksUploadDir);
+ if (!dirs.exists()) {
+ dirs.mkdirs();
+ }
+ File uploadedFile = new File(ksUploadDir,
+ getFileName(item.getName()));
+ item.write(uploadedFile);
+ Map fileResourceMap =
+ (Map) configurationContext.getProperty(ServerConstants.FILE_RESOURCE_MAP);
+ if (fileResourceMap == null) {
+ fileResourceMap = new TreeBidiMap();
+ configurationContext.setProperty(ServerConstants.FILE_RESOURCE_MAP,
+ fileResourceMap);
+ }
+ fileResourceMap.put(uuid, uploadedFile.getAbsolutePath());
+ item.write(uploadedFile);
+
+ // call the javascript which will in turn call the relevant web service
+ out.write("<script type=\"text/javascript\">" +
+ "top.getKeystoreUUID('" + uuid + "');" +
+ "</script>");
+ }
+ }
+ out.flush();
+ }
+ } catch (Exception e) {
+ log.error("KeyStore file upload failed", e);
+ out.write("<script type=\"text/javascript\">" +
+ "top.wso2.wsf.Util.alertWarning('KeyStore file upload FAILED. Reason : " + e + "');" +
+ "</script>");
+ } finally {
+ out.close();
+ }
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/ToolsAnyFileUploadExecutor.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/ToolsAnyFileUploadExecutor.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/ToolsAnyFileUploadExecutor.java
new file mode 100644
index 0000000..89b6b26
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/ToolsAnyFileUploadExecutor.java
@@ -0,0 +1,90 @@
+/*
+* 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.wso2.carbon.ui.transports.fileupload;
+
+import org.apache.commons.collections.bidimap.TreeBidiMap;
+import org.wso2.carbon.CarbonException;
+import org.wso2.carbon.utils.FileItemData;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.Map;
+
+public class ToolsAnyFileUploadExecutor extends AbstractFileUploadExecutor {
+
+ @Override
+ public boolean execute(HttpServletRequest request,
+ HttpServletResponse response) throws CarbonException, IOException {
+ PrintWriter out = response.getWriter();
+ try {
+ Map fileResourceMap =
+ (Map) configurationContext
+ .getProperty(ServerConstants.FILE_RESOURCE_MAP);
+ if (fileResourceMap == null) {
+ fileResourceMap = new TreeBidiMap();
+ configurationContext.setProperty(ServerConstants.FILE_RESOURCE_MAP,
+ fileResourceMap);
+ }
+ List<FileItemData> fileItems = getAllFileItems();
+ //String filePaths = "";
+
+ for (FileItemData fileItem : fileItems) {
+ String uuid = String.valueOf(
+ System.currentTimeMillis() + Math.random());
+ String serviceUploadDir =
+ configurationContext
+ .getProperty(ServerConstants.WORK_DIR) +
+ File.separator +
+ "extra" + File
+ .separator +
+ uuid + File.separator;
+ File dir = new File(serviceUploadDir);
+ if (!dir.exists()) {
+ dir.mkdirs();
+ }
+ File uploadedFile = new File(dir, fileItem.getFileItem().getFieldName());
+ FileOutputStream fileOutStream = new FileOutputStream(uploadedFile);
+ fileItem.getDataHandler().writeTo(fileOutStream);
+ fileOutStream.flush();
+ fileOutStream.close();
+ response.setContentType("text/plain; charset=utf-8");
+ //filePaths = filePaths + uploadedFile.getAbsolutePath() + ",";
+ fileResourceMap.put(uuid, uploadedFile.getAbsolutePath());
+ out.write(uuid);
+ }
+ //filePaths = filePaths.substring(0, filePaths.length() - 1);
+ //out.write(filePaths);
+ out.flush();
+ } catch (Exception e) {
+ log.error("File upload FAILED", e);
+ out.write("<script type=\"text/javascript\">" +
+ "top.wso2.wsf.Util.alertWarning('File upload FAILED. File may be non-existent or invalid.');" +
+ "</script>");
+ } finally {
+ out.close();
+ }
+ return true;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/ToolsFileUploadExecutor.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/ToolsFileUploadExecutor.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/ToolsFileUploadExecutor.java
new file mode 100644
index 0000000..2c2e40c
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/transports/fileupload/ToolsFileUploadExecutor.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
+ *
+ * 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.wso2.carbon.ui.transports.fileupload;
+
+import org.wso2.carbon.CarbonException;
+import org.wso2.carbon.utils.FileItemData;
+import org.wso2.carbon.utils.ServerConstants;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+
+public class ToolsFileUploadExecutor extends AbstractFileUploadExecutor {
+ public boolean execute(HttpServletRequest request, HttpServletResponse response)
+ throws CarbonException, IOException {
+ PrintWriter out = response.getWriter();
+ try {
+ List<FileItemData> fileItems = getAllFileItems();
+
+ StringBuffer filePathsStrBuffer = new StringBuffer();
+
+ for (FileItemData fileItem : fileItems) {
+ String uuid = String.valueOf(
+ System.currentTimeMillis() + Math.random());
+ String serviceUploadDir =
+ configurationContext
+ .getProperty(ServerConstants.WORK_DIR) +
+ File.separator +
+ "extra" + File
+ .separator +
+ uuid + File.separator;
+ File dir = new File(serviceUploadDir);
+ if (!dir.exists()) {
+ boolean dirCreated = dir.mkdirs();
+ if (!dirCreated) {
+ log.error("Error creating dir " + dir.getPath());
+ return false;
+ }
+ }
+ File uploadedFile = new File(dir, uuid);
+ FileOutputStream fileOutStream = new FileOutputStream(uploadedFile);
+ fileItem.getDataHandler().writeTo(fileOutStream);
+ fileOutStream.flush();
+ fileOutStream.close();
+ response.setContentType("text/plain; charset=utf-8");
+ filePathsStrBuffer.append(uploadedFile.getAbsolutePath());
+ filePathsStrBuffer.append(',');
+ }
+
+ out.write(filePathsStrBuffer.substring(0, filePathsStrBuffer.length() - 1));
+ out.flush();
+ } catch (Exception e) {
+ log.error("File upload FAILED", e);
+ out.write("<script type=\"text/javascript\">" +
+ "top.wso2.wsf.Util.alertWarning('File upload FAILED. File may be non-existent or invalid.');" +
+ "</script>");
+ } finally {
+ out.close();
+ }
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/CarbonUIAuthenticationUtil.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/CarbonUIAuthenticationUtil.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/CarbonUIAuthenticationUtil.java
new file mode 100644
index 0000000..6e97055
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/CarbonUIAuthenticationUtil.java
@@ -0,0 +1,48 @@
+/*
+* 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.wso2.carbon.ui.util;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.Cookie;
+
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.commons.httpclient.Header;
+
+public class CarbonUIAuthenticationUtil {
+
+ /**
+ * Sets the cookie information, i.e. whether remember me cookie is enabled of disabled. If enabled
+ * we will send that information in a HTTP header.
+ * @param cookie The remember me cookie.
+ * @param serviceClient The service client used in communication.
+ */
+ public static void setCookieHeaders(Cookie cookie, ServiceClient serviceClient) {
+
+ List<Header> headers = new ArrayList<Header>();
+ Header rememberMeHeader = new Header("RememberMeCookieData", cookie.getValue());
+ headers.add(rememberMeHeader);
+
+ serviceClient.getOptions().setProperty(HTTPConstants.HTTP_HEADERS, headers);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/CharacterEncoder.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/CharacterEncoder.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/CharacterEncoder.java
new file mode 100644
index 0000000..c2f15e0
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/CharacterEncoder.java
@@ -0,0 +1,38 @@
+/*
+* 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.wso2.carbon.ui.util;
+
+/*
+ * This class validates special characters to avoid any XSS vulnerabilities.
+ */
+public class CharacterEncoder {
+
+ public static String getSafeText(String text) {
+ if (text == null) {
+ return text;
+ }
+ text = text.trim();
+ if (text.indexOf('<') > -1) {
+ text = text.replace("<", "<");
+ }
+ if (text.indexOf('>') > -1) {
+ text = text.replace(">", ">");
+ }
+ return text;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/FileDownloadUtil.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/FileDownloadUtil.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/FileDownloadUtil.java
new file mode 100644
index 0000000..589547f
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/FileDownloadUtil.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
+ *
+ * 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.wso2.carbon.ui.util;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.BundleContext;
+import org.wso2.carbon.CarbonException;
+import org.wso2.carbon.core.util.MIMEType2FileExtensionMap;
+import org.wso2.carbon.core.commons.stub.filedownload.FileDownloadServiceStub;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.utils.ConfigurationContextService;
+import org.wso2.carbon.utils.ServerConstants;
+import org.wso2.carbon.utils.CarbonUtils;
+
+
+import javax.activation.DataHandler;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.util.Map;
+
+/**
+ *
+ */
+public class FileDownloadUtil {
+ private static Log log = LogFactory.getLog(FileDownloadUtil.class);
+
+ private MIMEType2FileExtensionMap mimeMap;
+
+ public FileDownloadUtil(BundleContext context) {
+ mimeMap = new MIMEType2FileExtensionMap();
+ mimeMap.init(context);
+ }
+
+ public synchronized boolean acquireResource(ConfigurationContextService configCtxService,
+ HttpServletRequest request,
+ HttpServletResponse response)
+ throws CarbonException {
+
+ OutputStream out;
+ try {
+ out = response.getOutputStream();
+ } catch (IOException e) {
+ String msg = "Unable to retrieve file ";
+ log.error(msg, e);
+ throw new CarbonException(msg, e);
+ }
+ String fileID = request.getParameter("id");
+ String fileName = getFileName(configCtxService, request, fileID);
+
+ if (fileName == null) {
+ String serverURL = CarbonUIUtil.getServerURL(request.getSession().
+ getServletContext(), request.getSession());
+
+ String serviceEPR = serverURL + "FileDownloadService";
+ try {
+
+ FileDownloadServiceStub stub;
+ if(CarbonUtils.isRunningOnLocalTransportMode()) {
+ stub = new FileDownloadServiceStub(configCtxService.getServerConfigContext(), serviceEPR);
+ } else {
+ stub = new FileDownloadServiceStub(configCtxService.getClientConfigContext(), serviceEPR);
+ }
+ DataHandler dataHandler = stub.downloadFile(fileID);
+ if (dataHandler != null) {
+ response.setHeader("Content-Disposition", "filename=" + fileID);
+ response.setContentType(dataHandler.getContentType());
+ InputStream in = dataHandler.getDataSource().getInputStream();
+ int nextChar;
+ while ((nextChar = in.read()) != -1) {
+ out.write((char) nextChar);
+ }
+ out.flush();
+ out.close();
+ in.close();
+ return true;
+ }
+ out.write("The requested file was not found on the server".getBytes());
+ out.flush();
+ out.close();
+ } catch (IOException e) {
+ String msg = "Unable to write output to HttpServletResponse OutputStream ";
+ log.error(msg, e);
+ throw new CarbonException(msg, e);
+ }
+ return false;
+ }
+
+
+ try {
+ File file = new File(fileName);
+ FileInputStream in = new FileInputStream(file);
+ byte[] b = new byte[(int) file.length()];
+ response.setContentType(mimeMap.getMIMEType(file));
+ response.setContentLength((int) file.length());
+ response.setHeader("Content-Disposition", "filename=" + file.getName());
+ int lengthRead = in.read(b);
+ if (lengthRead != -1) {
+ out.write(b);
+ }
+ out.flush();
+ out.close();
+ in.close();
+ return true;
+ } catch (IOException e) {
+ String msg = "Unable to retrieve file ";
+ log.error(msg, e);
+ throw new CarbonException(msg, e);
+ }
+ }
+
+ private String getFileName(ConfigurationContextService configCtxService,
+ HttpServletRequest request,
+ String fileID) {
+ //Trying to get the fileName from the client-configuration context
+ Map fileResourcesMap =
+ (Map) configCtxService.getClientConfigContext().
+ getProperty(ServerConstants.FILE_RESOURCE_MAP);
+ String fileName = (String) fileResourcesMap.get(fileID);
+
+ if (fileName == null) {
+ String requestURI = request.getRequestURI();
+ ConfigurationContext configContext = configCtxService.getServerConfigContext();
+ fileResourcesMap = (Map) configContext.getProperty(ServerConstants.FILE_RESOURCE_MAP);
+ fileName = (String) fileResourcesMap.get(fileID);
+ }
+ return fileName;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIAnnouncementDeployer.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIAnnouncementDeployer.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIAnnouncementDeployer.java
new file mode 100644
index 0000000..f8d4324
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIAnnouncementDeployer.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2005-2008, 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.wso2.carbon.ui.util;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+import org.wso2.carbon.ui.CarbonUIUtil;
+import org.wso2.carbon.ui.UIAnnouncement;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.http.HttpSession;
+
+public class UIAnnouncementDeployer {
+
+ private static Log log = LogFactory.getLog(UIAnnouncementDeployer.class);
+ private static ServiceTracker uiAnnouncementTracker = null;
+
+ public static String getAnnouncementHtml(HttpSession session, ServletConfig config) {
+ UIAnnouncement uiAnnouncement = (UIAnnouncement) uiAnnouncementTracker.getService();
+ if (uiAnnouncement == null) {
+ return ""; // empty htmls
+ }
+ return uiAnnouncement.getAnnouncementHtml(session, config);
+ }
+
+ public static void deployNotificationSources() {
+ BundleContext bundleContext = CarbonUIUtil.getBundleContext();
+ uiAnnouncementTracker = new ServiceTracker(bundleContext,
+ UIAnnouncement.class.getName(), null);
+ uiAnnouncementTracker.open();
+ }
+
+ public static void undeployNotificationSources() {
+ uiAnnouncementTracker.close();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIResourceProvider.java
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIResourceProvider.java b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIResourceProvider.java
new file mode 100644
index 0000000..fafb081
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIResourceProvider.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2009-2010 WSO2, Inc. (http://wso2.com)
+ *
+ * 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.wso2.carbon.ui.util;
+
+import java.net.URL;
+import java.util.Set;
+
+/**
+ * Defines a set of methos to load UI resources and resource paths from resource providers such as OSGi Bundles,
+ * registry, file system, etc.
+ */
+public interface UIResourceProvider {
+
+ /**
+ * Returns a URL to the resource that is mapped to a specified path. The path must begin with a "/" and is
+ * interpreted as relative to the current context root.
+ *
+ * This method returns null if no resource is mapped to the pathname.
+ *
+ * @param path a String specifying the path to the resource
+ * @return the resource located at the named path, or null if there is no resource at that path
+ */
+ URL getUIResource(String path);
+
+ /**
+ * Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path
+ * matches the supplied path argument. Paths indicating subdirectory paths end with a '/'. The returned paths are
+ * all relative to the root of resource provider and have a leading '/'. For example, for a resource provider
+ * containing
+ *
+ * /welcome.html
+ * /WEB_INF
+ * /WEB-INF/web.xml
+ * /WEB-INF/tiles
+ * /WEB-INF/tiles/main_defs.xml
+ *
+ * getResourcePaths("/") returns {"/welcome.html", "/WEB_INF"}.
+ * getResourcePaths("/WEB_INF/") returns {"/WEB-INF/web.xml", "/WEB-INF/tiles/"}.
+ * getResourcePaths("/WEB-INF/tiles/") returns {"/WEB-INF/tiles/main_defs.xml"}.
+ *
+ * @param path partial path used to match the resources, which must start with a /
+ * @return a Set containing the directory listing, or null if there are no resources whose path begins with the
+ * supplied path.
+ */
+ Set<String> getUIResourcePaths(String path);
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/resources/FileDownloadService.wsdl
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/resources/FileDownloadService.wsdl b/dependencies/org.wso2.carbon.ui/src/main/resources/FileDownloadService.wsdl
new file mode 100644
index 0000000..cedfdb4
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/resources/FileDownloadService.wsdl
@@ -0,0 +1,138 @@
+<!--
+ ~ 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.
+ -->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:ns1="http://org.apache.axis2/xsd"
+ xmlns:ns="http://filedownload.services.core.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://filedownload.services.core.carbon.wso2.org">
+ <wsdl:documentation>FileDownloadService</wsdl:documentation>
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified"
+ targetNamespace="http://filedownload.services.core.carbon.wso2.org">
+ <xs:element name="downloadFile">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
+ </xs:sequence>
+
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="downloadFileResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true"
+ type="xs:base64Binary"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ </xs:schema>
+ </wsdl:types>
+ <wsdl:message name="downloadFileRequest">
+ <wsdl:part name="parameters" element="ns:downloadFile"/>
+ </wsdl:message>
+ <wsdl:message name="downloadFileResponse">
+ <wsdl:part name="parameters" element="ns:downloadFileResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="FileDownloadServicePortType">
+
+ <wsdl:operation name="downloadFile">
+ <wsdl:input message="ns:downloadFileRequest" wsaw:Action="urn:downloadFile"/>
+ <wsdl:output message="ns:downloadFileResponse" wsaw:Action="urn:downloadFileResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="FileDownloadServiceSoap11Binding" type="ns:FileDownloadServicePortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="downloadFile">
+ <soap:operation soapAction="urn:downloadFile" style="document"/>
+
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="FileDownloadServiceSoap12Binding" type="ns:FileDownloadServicePortType">
+
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="downloadFile">
+ <soap12:operation soapAction="urn:downloadFile" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="FileDownloadServiceHttpBinding" type="ns:FileDownloadServicePortType">
+ <http:binding verb="POST"/>
+ <wsdl:operation name="downloadFile">
+ <http:operation location="downloadFile"/>
+ <wsdl:input>
+ <mime:content type="text/xml" part="downloadFile"/>
+ </wsdl:input>
+
+ <wsdl:output>
+ <mime:content type="text/xml" part="downloadFile"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="FileDownloadService">
+ <wsdl:port name="FileDownloadServiceHttpSoap11Endpoint"
+ binding="ns:FileDownloadServiceSoap11Binding">
+ <soap:address
+ location="http://10.182.8.115:9763/services/FileDownloadService.FileDownloadServiceHttpSoap11Endpoint/"/>
+ </wsdl:port>
+
+ <wsdl:port name="FileDownloadServiceHttpsSoap11Endpoint"
+ binding="ns:FileDownloadServiceSoap11Binding">
+ <soap:address
+ location="https://10.182.8.115:9443/services/FileDownloadService.FileDownloadServiceHttpsSoap11Endpoint/"/>
+ </wsdl:port>
+ <wsdl:port name="FileDownloadServiceHttpSoap12Endpoint"
+ binding="ns:FileDownloadServiceSoap12Binding">
+ <soap12:address
+ location="http://10.182.8.115:9763/services/FileDownloadService.FileDownloadServiceHttpSoap12Endpoint/"/>
+ </wsdl:port>
+ <wsdl:port name="FileDownloadServiceHttpsSoap12Endpoint"
+ binding="ns:FileDownloadServiceSoap12Binding">
+ <soap12:address
+ location="https://10.182.8.115:9443/services/FileDownloadService.FileDownloadServiceHttpsSoap12Endpoint/"/>
+ </wsdl:port>
+
+ <wsdl:port name="FileDownloadServiceHttpEndpoint"
+ binding="ns:FileDownloadServiceHttpBinding">
+ <http:address
+ location="http://10.182.8.115:9763/services/FileDownloadService.FileDownloadServiceHttpEndpoint/"/>
+ </wsdl:port>
+ <wsdl:port name="FileDownloadServiceHttpsEndpoint"
+ binding="ns:FileDownloadServiceHttpBinding">
+ <http:address
+ location="https://10.182.8.115:9443/services/FileDownloadService.FileDownloadServiceHttpsEndpoint/"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/resources/FileUploadService.wsdl
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/resources/FileUploadService.wsdl b/dependencies/org.wso2.carbon.ui/src/main/resources/FileUploadService.wsdl
new file mode 100644
index 0000000..9dcaf94
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/resources/FileUploadService.wsdl
@@ -0,0 +1,141 @@
+<!--
+ ~ 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.
+ -->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://fileupload.services.core.carbon.wso2.org" xmlns:ax28="http://common.core.carbon.wso2.org/xsd" 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://fileupload.services.core.carbon.wso2.org">
+ <wsdl:documentation>FileUploadService</wsdl:documentation>
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://common.core.carbon.wso2.org/xsd">
+ <xs:complexType name="UploadedFileItem">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="dataHandler" nillable="true" type="xs:base64Binary" />
+ <xs:element minOccurs="0" name="fileName" nillable="true" type="xs:string" />
+ <xs:element minOccurs="0" name="fileType" nillable="true" type="xs:string" />
+
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ <xs:schema xmlns:ax29="http://common.core.carbon.wso2.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://fileupload.services.core.carbon.wso2.org">
+ <xs:import namespace="http://common.core.carbon.wso2.org/xsd" />
+ <xs:complexType name="Exception">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="Exception" nillable="true" type="xs:anyType" />
+ </xs:sequence>
+
+ </xs:complexType>
+ <xs:element name="Exception">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="Exception" nillable="true" type="ns:Exception" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="uploadFiles">
+
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="uploadedFileItems" nillable="true" type="ax28:UploadedFileItem" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="uploadFilesResponse">
+ <xs:complexType>
+ <xs:sequence>
+
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="return" nillable="true" type="xs:string" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+ <wsdl:message name="uploadFilesRequest">
+ <wsdl:part name="parameters" element="ns:uploadFiles" />
+ </wsdl:message>
+
+ <wsdl:message name="uploadFilesResponse">
+ <wsdl:part name="parameters" element="ns:uploadFilesResponse" />
+ </wsdl:message>
+ <wsdl:message name="Exception">
+ <wsdl:part name="parameters" element="ns:Exception" />
+ </wsdl:message>
+ <wsdl:portType name="FileUploadServicePortType">
+ <wsdl:operation name="uploadFiles">
+ <wsdl:input message="ns:uploadFilesRequest" wsaw:Action="urn:uploadFiles" />
+
+ <wsdl:output message="ns:uploadFilesResponse" wsaw:Action="urn:uploadFilesResponse" />
+ <wsdl:fault message="ns:Exception" name="Exception" wsaw:Action="urn:uploadFilesException" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="FileUploadServiceSoap11Binding" type="ns:FileUploadServicePortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <wsdl:operation name="uploadFiles">
+ <soap:operation soapAction="urn:uploadFiles" style="document" />
+ <wsdl:input>
+
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="Exception">
+ <soap:fault use="literal" name="Exception" />
+ </wsdl:fault>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:binding name="FileUploadServiceSoap12Binding" type="ns:FileUploadServicePortType">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <wsdl:operation name="uploadFiles">
+ <soap12:operation soapAction="urn:uploadFiles" style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+
+ <soap12:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="Exception">
+ <soap12:fault use="literal" name="Exception" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="FileUploadServiceHttpBinding" type="ns:FileUploadServicePortType">
+ <http:binding verb="POST" />
+
+ <wsdl:operation name="uploadFiles">
+ <http:operation location="uploadFiles" />
+ <wsdl:input>
+ <mime:content type="text/xml" part="uploadFiles" />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="uploadFiles" />
+ </wsdl:output>
+ </wsdl:operation>
+
+ </wsdl:binding>
+ <wsdl:service name="FileUploadService">
+ <wsdl:port name="FileUploadServiceHttpsSoap11Endpoint" binding="ns:FileUploadServiceSoap11Binding">
+ <soap:address location="https://10.182.8.115:9443/services/FileUploadService.FileUploadServiceHttpsSoap11Endpoint/" />
+ </wsdl:port>
+ <wsdl:port name="FileUploadServiceHttpsSoap12Endpoint" binding="ns:FileUploadServiceSoap12Binding">
+ <soap12:address location="https://10.182.8.115:9443/services/FileUploadService.FileUploadServiceHttpsSoap12Endpoint/" />
+ </wsdl:port>
+ <wsdl:port name="FileUploadServiceHttpsEndpoint" binding="ns:FileUploadServiceHttpBinding">
+
+ <http:address location="https://10.182.8.115:9443/services/FileUploadService.FileUploadServiceHttpsEndpoint/" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/resources/LoggedUserInfoAdmin.wsdl
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/resources/LoggedUserInfoAdmin.wsdl b/dependencies/org.wso2.carbon.ui/src/main/resources/LoggedUserInfoAdmin.wsdl
new file mode 100644
index 0000000..9436c39
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/resources/LoggedUserInfoAdmin.wsdl
@@ -0,0 +1,120 @@
+<!--
+ ~ 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.
+ -->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ax215="http://common.core.carbon.wso2.org/xsd" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://loggeduserinfo.services.core.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://loggeduserinfo.services.core.carbon.wso2.org">
+ <wsdl:documentation>LoggedUserInfoAdmin</wsdl:documentation>
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://common.core.carbon.wso2.org/xsd">
+ <xs:complexType name="LoggedUserInfo">
+ <xs:all>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="UIPermissionOfUser" nillable="true" type="xs:string" />
+ <xs:element minOccurs="0" name="passwordExpiration" nillable="true" type="xs:string" />
+ <xs:element minOccurs="0" name="userName" nillable="true" type="xs:string" />
+ </xs:all>
+ </xs:complexType>
+ </xs:schema>
+ <xs:schema xmlns:ax216="http://common.core.carbon.wso2.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://loggeduserinfo.services.core.carbon.wso2.org">
+ <xs:import namespace="http://common.core.carbon.wso2.org/xsd" />
+ <xs:complexType name="Exception">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="Exception" nillable="true" type="xs:anyType" />
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="Exception">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="Exception" nillable="true" type="ns:Exception" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getUserInfoResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="ax216:LoggedUserInfo" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+ <wsdl:message name="getUserInfoRequest" />
+ <wsdl:message name="getUserInfoResponse">
+ <wsdl:part name="parameters" element="ns:getUserInfoResponse" />
+ </wsdl:message>
+ <wsdl:message name="Exception">
+ <wsdl:part name="parameters" element="ns:Exception" />
+ </wsdl:message>
+ <wsdl:portType name="LoggedUserInfoAdminPortType">
+ <wsdl:operation name="getUserInfo">
+ <wsdl:input message="ns:getUserInfoRequest" wsaw:Action="urn:getUserInfo" />
+ <wsdl:output message="ns:getUserInfoResponse" wsaw:Action="urn:getUserInfoResponse" />
+ <wsdl:fault message="ns:Exception" name="Exception" wsaw:Action="urn:getUserInfoException" />
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="LoggedUserInfoAdminSoap11Binding" type="ns:LoggedUserInfoAdminPortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <wsdl:operation name="getUserInfo">
+ <soap:operation soapAction="urn:getUserInfo" style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="Exception">
+ <soap:fault use="literal" name="Exception" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="LoggedUserInfoAdminSoap12Binding" type="ns:LoggedUserInfoAdminPortType">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+ <wsdl:operation name="getUserInfo">
+ <soap12:operation soapAction="urn:getUserInfo" style="document" />
+ <wsdl:input>
+ <soap12:body use="literal" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal" />
+ </wsdl:output>
+ <wsdl:fault name="Exception">
+ <soap12:fault use="literal" name="Exception" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="LoggedUserInfoAdminHttpBinding" type="ns:LoggedUserInfoAdminPortType">
+ <http:binding verb="POST" />
+ <wsdl:operation name="getUserInfo">
+ <http:operation location="getUserInfo" />
+ <wsdl:input>
+ <mime:content type="text/xml" part="getUserInfo" />
+ </wsdl:input>
+ <wsdl:output>
+ <mime:content type="text/xml" part="getUserInfo" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="LoggedUserInfoAdmin">
+ <wsdl:port name="LoggedUserInfoAdminHttpsSoap11Endpoint" binding="ns:LoggedUserInfoAdminSoap11Binding">
+ <soap:address location="https://10.100.1.226:9443/services/LoggedUserInfoAdmin.LoggedUserInfoAdminHttpsSoap11Endpoint/" />
+ </wsdl:port>
+ <wsdl:port name="LoggedUserInfoAdminHttpsSoap12Endpoint" binding="ns:LoggedUserInfoAdminSoap12Binding">
+ <soap12:address location="https://10.100.1.226:9443/services/LoggedUserInfoAdmin.LoggedUserInfoAdminHttpsSoap12Endpoint/" />
+ </wsdl:port>
+ <wsdl:port name="LoggedUserInfoAdminHttpsEndpoint" binding="ns:LoggedUserInfoAdminHttpBinding">
+ <http:address location="https://10.100.1.226:9443/services/LoggedUserInfoAdmin.LoggedUserInfoAdminHttpsEndpoint/" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/resources/RegistryAdminService/RegistryAdminService.wsdl
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/resources/RegistryAdminService/RegistryAdminService.wsdl b/dependencies/org.wso2.carbon.ui/src/main/resources/RegistryAdminService/RegistryAdminService.wsdl
new file mode 100644
index 0000000..f9a3932
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/resources/RegistryAdminService/RegistryAdminService.wsdl
@@ -0,0 +1,173 @@
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://service.server.registry.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://service.server.registry.carbon.wso2.org">
+ <wsdl:documentation>RegistryAdminService</wsdl:documentation>
+ <wsdl:types>
+ <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.server.registry.carbon.wso2.org">
+ <xs:element name="isRegistryReadOnlyResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" type="xs:boolean"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getHTTPSPermalink">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="path" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getHTTPSPermalinkResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getHTTPPermalink">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" name="path" nillable="true" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getHTTPPermalinkResponse">
+ <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="getHTTPPermalinkRequest">
+ <wsdl:part name="parameters" element="ns:getHTTPPermalink"/>
+ </wsdl:message>
+ <wsdl:message name="getHTTPPermalinkResponse">
+ <wsdl:part name="parameters" element="ns:getHTTPPermalinkResponse"/>
+ </wsdl:message>
+ <wsdl:message name="isRegistryReadOnlyRequest"/>
+ <wsdl:message name="isRegistryReadOnlyResponse">
+ <wsdl:part name="parameters" element="ns:isRegistryReadOnlyResponse"/>
+ </wsdl:message>
+ <wsdl:message name="getHTTPSPermalinkRequest">
+ <wsdl:part name="parameters" element="ns:getHTTPSPermalink"/>
+ </wsdl:message>
+ <wsdl:message name="getHTTPSPermalinkResponse">
+ <wsdl:part name="parameters" element="ns:getHTTPSPermalinkResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="RegistryAdminServicePortType">
+ <wsdl:operation name="getHTTPPermalink">
+ <wsdl:input message="ns:getHTTPPermalinkRequest" wsaw:Action="urn:getHTTPPermalink"/>
+ <wsdl:output message="ns:getHTTPPermalinkResponse" wsaw:Action="urn:getHTTPPermalinkResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="isRegistryReadOnly">
+ <wsdl:input message="ns:isRegistryReadOnlyRequest" wsaw:Action="urn:isRegistryReadOnly"/>
+ <wsdl:output message="ns:isRegistryReadOnlyResponse" wsaw:Action="urn:isRegistryReadOnlyResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="getHTTPSPermalink">
+ <wsdl:input message="ns:getHTTPSPermalinkRequest" wsaw:Action="urn:getHTTPSPermalink"/>
+ <wsdl:output message="ns:getHTTPSPermalinkResponse" wsaw:Action="urn:getHTTPSPermalinkResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="RegistryAdminServiceSoap11Binding" type="ns:RegistryAdminServicePortType">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="getHTTPPermalink">
+ <soap:operation soapAction="urn:getHTTPPermalink" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="isRegistryReadOnly">
+ <soap:operation soapAction="urn:isRegistryReadOnly" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getHTTPSPermalink">
+ <soap:operation soapAction="urn:getHTTPSPermalink" style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="RegistryAdminServiceSoap12Binding" type="ns:RegistryAdminServicePortType">
+ <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="getHTTPPermalink">
+ <soap12:operation soapAction="urn:getHTTPPermalink" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="isRegistryReadOnly">
+ <soap12:operation soapAction="urn:isRegistryReadOnly" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getHTTPSPermalink">
+ <soap12:operation soapAction="urn:getHTTPSPermalink" style="document"/>
+ <wsdl:input>
+ <soap12:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap12:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="RegistryAdminServiceHttpBinding" type="ns:RegistryAdminServicePortType">
+ <http:binding verb="POST"/>
+ <wsdl:operation name="getHTTPPermalink">
+ <http:operation location="getHTTPPermalink"/>
+ <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="isRegistryReadOnly">
+ <http:operation location="isRegistryReadOnly"/>
+ <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="getHTTPSPermalink">
+ <http:operation location="getHTTPSPermalink"/>
+ <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="RegistryAdminService">
+ <wsdl:port name="RegistryAdminServiceHttpsSoap11Endpoint" binding="ns:RegistryAdminServiceSoap11Binding">
+ <soap:address location="https://10.0.0.11:9443/services/RegistryAdminService.RegistryAdminServiceHttpsSoap11Endpoint/"/>
+ </wsdl:port>
+ <wsdl:port name="RegistryAdminServiceHttpsSoap12Endpoint" binding="ns:RegistryAdminServiceSoap12Binding">
+ <soap12:address location="https://10.0.0.11:9443/services/RegistryAdminService.RegistryAdminServiceHttpsSoap12Endpoint/"/>
+ </wsdl:port>
+ <wsdl:port name="RegistryAdminServiceHttpsEndpoint" binding="ns:RegistryAdminServiceHttpBinding">
+ <http:address location="https://10.0.0.11:9443/services/RegistryAdminService.RegistryAdminServiceHttpsEndpoint/"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/6b1dba58/dependencies/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tiles/main_defs.xml
----------------------------------------------------------------------
diff --git a/dependencies/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tiles/main_defs.xml b/dependencies/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tiles/main_defs.xml
new file mode 100644
index 0000000..a71f8a4
--- /dev/null
+++ b/dependencies/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tiles/main_defs.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <definition name="main.layout" template="/admin/layout/template.jsp">
+ <put-attribute name="title" value="WSO2 Management Console"/>
+ <put-attribute name="header" value="/admin/layout/header.jsp"/>
+ <put-attribute name="region1" value="/admin/layout/region1.jsp"/>
+ <put-attribute name="region2" value="/admin/layout/region2.jsp"/>
+ <put-attribute name="region3" value="/admin/layout/region3.jsp"/>
+ <put-attribute name="region4" value="/admin/layout/region4.jsp"/>
+ <put-attribute name="region5" value="/admin/layout/region5.jsp"/>
+ <put-attribute name="body" value="/admin/layout/defaultBody.jsp"/>
+ <put-attribute name="breadcrumb" value="/admin/layout/breadcrumb.jsp"/>
+ <put-attribute name="footer" value="/admin/layout/footer.jsp"/>
+ </definition>
+
+
+
+ <!--
+ <definition name="main.welcome" extends="main.layout">
+ <put-attribute name="body" value="/admin/jsp/test.jsp"/>
+ </definition>
+ -->
+</tiles-definitions>
\ No newline at end of file