diff --git a/core/feature-manager/org.wso2.carbon.feature.mgt.core/pom.xml b/core/feature-manager/org.wso2.carbon.feature.mgt.core/pom.xml index d4f85f62086..7c55205e513 100644 --- a/core/feature-manager/org.wso2.carbon.feature.mgt.core/pom.xml +++ b/core/feature-manager/org.wso2.carbon.feature.mgt.core/pom.xml @@ -40,7 +40,7 @@ org.wso2.carbon.utils - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.artifact.repository @@ -48,7 +48,7 @@ org.eclipse.osgi - org.wso2.eclipse.osgi + org.eclipse.platform org.eclipse.osgi.services @@ -68,7 +68,7 @@ org.eclipse.equinox.http.servlet - org.eclipse.osgi + org.eclipse.platform org.eclipse.equinox.jsp.jasper @@ -90,39 +90,39 @@ org.eclipse.osgi - org.wso2.eclipse.osgi + org.eclipse.platform org.eclipse.osgi.services - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.common - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.core - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.director - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.engine - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.metadata - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.metadata.repository - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.repository - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.simpleconfigurator @@ -162,6 +162,10 @@ org.wso2.carbon.feature.mgt.core.* + + + osgi.service;objectClass=org.eclipse.equinox.p2.core.IProvisioningAgentProvider + diff --git a/core/feature-manager/org.wso2.carbon.feature.mgt.services/pom.xml b/core/feature-manager/org.wso2.carbon.feature.mgt.services/pom.xml index 46a46eb77c6..1735f6ee0c9 100644 --- a/core/feature-manager/org.wso2.carbon.feature.mgt.services/pom.xml +++ b/core/feature-manager/org.wso2.carbon.feature.mgt.services/pom.xml @@ -54,23 +54,23 @@ org.wso2.carbon.feature.mgt.core - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.core - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.engine - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.metadata - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.repository - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.common diff --git a/core/feature-manager/org.wso2.carbon.p2.touchpoint/pom.xml b/core/feature-manager/org.wso2.carbon.p2.touchpoint/pom.xml index 092fc6a3513..1b77f11487a 100644 --- a/core/feature-manager/org.wso2.carbon.p2.touchpoint/pom.xml +++ b/core/feature-manager/org.wso2.carbon.p2.touchpoint/pom.xml @@ -16,11 +16,11 @@ - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.common - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.engine diff --git a/core/javax.cache/src/main/java/javax/cache/CacheManager.java b/core/javax.cache/src/main/java/javax/cache/CacheManager.java index ba48b75ecb3..9e8eddda562 100644 --- a/core/javax.cache/src/main/java/javax/cache/CacheManager.java +++ b/core/javax.cache/src/main/java/javax/cache/CacheManager.java @@ -7,8 +7,6 @@ package javax.cache; -import javax.transaction.UserTransaction; - /** * A CacheManager is used for looking up Caches and controls their lifecycle. It represents a collection of caches. *

@@ -127,13 +125,14 @@ public interface CacheManager { */ boolean removeCache(String cacheName); - /** - * This method will return a UserTransaction. - * - * @return the UserTransaction. - * @throws UnsupportedOperationException if JTA is not supported - */ - UserTransaction getUserTransaction(); + // TODO javax.transaction package is no longer available. Need to find a way to add this back +// /** +// * This method will return a UserTransaction. +// * +// * @return the UserTransaction. +// * @throws UnsupportedOperationException if JTA is not supported +// */ +// UserTransaction getUserTransaction(); /** * Indicates whether a optional feature is supported by this CacheManager. diff --git a/core/javax.cache/src/main/java/org/wso2/carbon/caching/impl/CarbonCacheManager.java b/core/javax.cache/src/main/java/org/wso2/carbon/caching/impl/CarbonCacheManager.java index 66329c8344e..14f27cf9ddc 100644 --- a/core/javax.cache/src/main/java/org/wso2/carbon/caching/impl/CarbonCacheManager.java +++ b/core/javax.cache/src/main/java/org/wso2/carbon/caching/impl/CarbonCacheManager.java @@ -17,16 +17,10 @@ */ package org.wso2.carbon.caching.impl; -import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.base.ServerConfiguration; +import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import javax.cache.Cache; -import javax.cache.CacheBuilder; -import javax.cache.CacheException; -import javax.cache.CacheManager; -import javax.cache.OptionalFeature; -import javax.cache.Status; import java.util.Collections; import java.util.HashSet; import java.util.Map; @@ -34,6 +28,13 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.cache.Cache; +import javax.cache.CacheBuilder; +import javax.cache.CacheException; +import javax.cache.CacheManager; +import javax.cache.OptionalFeature; +import javax.cache.Status; + import static org.wso2.carbon.caching.impl.CachingConstants.ILLEGAL_STATE_EXCEPTION_MESSAGE; /** @@ -202,13 +203,13 @@ boolean removeLocalCaches() { return this.caches.isEmpty(); } - @Override - public javax.transaction.UserTransaction getUserTransaction() { - Util.checkAccess(ownerTenantDomain, ownerTenantId); - checkStatusStarted(); - touch(); - return null; //To change body of implemented methods use File | Settings | File Templates. - } +// @Override +// public javax.transaction.UserTransaction getUserTransaction() { +// Util.checkAccess(ownerTenantDomain, ownerTenantId); +// checkStatusStarted(); +// touch(); +// return null; //To change body of implemented methods use File | Settings | File Templates. +// } @Override public boolean isSupported(OptionalFeature optionalFeature) { diff --git a/core/org.wso2.carbon.application.deployer/pom.xml b/core/org.wso2.carbon.application.deployer/pom.xml index 7dce129c359..aa0b8a7bea8 100644 --- a/core/org.wso2.carbon.application.deployer/pom.xml +++ b/core/org.wso2.carbon.application.deployer/pom.xml @@ -37,7 +37,7 @@ org.eclipse.osgi - org.wso2.eclipse.osgi + org.eclipse.platform org.eclipse.osgi.services diff --git a/core/org.wso2.carbon.base/pom.xml b/core/org.wso2.carbon.base/pom.xml index f328247c892..26e1401246c 100644 --- a/core/org.wso2.carbon.base/pom.xml +++ b/core/org.wso2.carbon.base/pom.xml @@ -36,7 +36,6 @@ org.apache.felix maven-bundle-plugin - true @@ -48,7 +47,7 @@ org.wso2.carbon.base.*; version="1.0.0" - javax.activation.*;version="[0.0.0, 1.0.0)", + javax.activation.*;version="[1.0.0, 2.0.0)", javax.servlet; version="${imp.pkg.version.javax.servlet}", javax.servlet.http; version="${imp.pkg.version.javax.servlet}", org.wso2.securevault.*, @@ -59,6 +58,9 @@ *;resolution:=optional + + osgi.service;objectClass=org.wso2.carbon.base.api.ServerConfigurationService + @@ -67,12 +69,19 @@ maven-surefire-plugin true + + --add-opens=java.base/java.lang=ALL-UNNAMED + --add-opens=java.base/java.util=ALL-UNNAMED + org.wso2.org.ops4j.pax.logging:pax-logging-api org.apache.logging.log4j.jul.LogManager + + src/test/resources/testng.xml + @@ -118,6 +127,7 @@ org.eclipse.equinox javax.servlet + org.wso2.orbit.xerces xercesImpl diff --git a/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/ServerConfiguration.java b/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/ServerConfiguration.java index 5066d157711..5048ee00799 100644 --- a/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/ServerConfiguration.java +++ b/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/ServerConfiguration.java @@ -21,6 +21,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.xerces.impl.Constants; import org.apache.xerces.util.SecurityManager; +import org.osgi.service.component.annotations.Component; import org.w3c.dom.Element; import org.wso2.carbon.base.api.ServerConfigurationService; import org.wso2.carbon.securevault.SecretManagerInitializer; @@ -55,6 +56,7 @@ * This class stores the configuration of the Carbon Server. */ @SuppressWarnings("unused") +//@Component(service = ServerConfigurationService.class) public class ServerConfiguration implements ServerConfigurationService { /** diff --git a/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/api/ServerConfigurationService.java b/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/api/ServerConfigurationService.java index 195c0a88faf..122c0351b96 100644 --- a/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/api/ServerConfigurationService.java +++ b/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/api/ServerConfigurationService.java @@ -1,5 +1,6 @@ package org.wso2.carbon.base.api; +import org.osgi.service.component.annotations.Component; import org.w3c.dom.Element; public interface ServerConfigurationService { diff --git a/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/internal/CarbonBaseActivator.java b/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/internal/CarbonBaseActivator.java index 6d1cec0bbb3..cd53af91503 100644 --- a/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/internal/CarbonBaseActivator.java +++ b/core/org.wso2.carbon.base/src/main/java/org/wso2/carbon/base/internal/CarbonBaseActivator.java @@ -22,16 +22,19 @@ import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; -import org.wso2.carbon.base.CarbonBaseConstants; import org.wso2.carbon.base.CarbonBaseUtils; import org.wso2.carbon.base.ServerConfiguration; import org.wso2.carbon.base.ServerConfigurationException; import org.wso2.carbon.base.api.ServerConfigurationService; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; + import javax.servlet.ServletException; -import java.io.*; /** * Activator of the {@link org.wso2.carbon.base} bundle @@ -52,7 +55,6 @@ public void start(BundleContext bundleContext) throws Exception { System.setProperty("portOffset", portOffset); //register carbon server confg as an OSGi service registration = bundleContext.registerService(ServerConfigurationService.class.getName(), carbonServerConfiguration, null); - } @Override diff --git a/core/org.wso2.carbon.base/src/test/java/org/wso2/carbon/base/CarbonBaseUtilsTest.java b/core/org.wso2.carbon.base/src/test/java/org/wso2/carbon/base/CarbonBaseUtilsTest.java index 2f0937898cb..2d2a5729106 100644 --- a/core/org.wso2.carbon.base/src/test/java/org/wso2/carbon/base/CarbonBaseUtilsTest.java +++ b/core/org.wso2.carbon.base/src/test/java/org/wso2/carbon/base/CarbonBaseUtilsTest.java @@ -50,7 +50,7 @@ public void setSecurityManager() { String resourcePath = resourceURL.getPath(); resourcePath = resourcePath + "policy-test.policy"; System.setProperty("java.security.policy", resourcePath); - System.setSecurityManager(new SecurityManager()); +// System.setSecurityManager(new SecurityManager()); } } diff --git a/core/org.wso2.carbon.base/src/test/java/org/wso2/carbon/base/ServerConfigurationTest.java b/core/org.wso2.carbon.base/src/test/java/org/wso2/carbon/base/ServerConfigurationTest.java index 9ee214c727e..f2abc748d79 100644 --- a/core/org.wso2.carbon.base/src/test/java/org/wso2/carbon/base/ServerConfigurationTest.java +++ b/core/org.wso2.carbon.base/src/test/java/org/wso2/carbon/base/ServerConfigurationTest.java @@ -54,6 +54,7 @@ public void createInstance() throws ServerConfigurationException, NoSuchFieldExc IllegalAccessException { assertFalse(getIsInitialized(ServerConfiguration.getInstance(), "isInitialized")); InputStream inputStream = readFile("carbon.xml"); + //TODO carbon.home is not set ServerConfiguration.getInstance().forceInit(inputStream); assertTrue(getIsInitialized(ServerConfiguration.getInstance(), "isInitialized")); } diff --git a/core/org.wso2.carbon.base/src/test/resources/testng.xml b/core/org.wso2.carbon.base/src/test/resources/testng.xml new file mode 100644 index 00000000000..10e44e3d88c --- /dev/null +++ b/core/org.wso2.carbon.base/src/test/resources/testng.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + diff --git a/core/org.wso2.carbon.bootstrap/src/main/java/org/wso2/carbon/bootstrap/CarbonSecurityManager.java b/core/org.wso2.carbon.bootstrap/src/main/java/org/wso2/carbon/bootstrap/CarbonSecurityManager.java index d1f2977fb74..6cbc8bf2a55 100644 --- a/core/org.wso2.carbon.bootstrap/src/main/java/org/wso2/carbon/bootstrap/CarbonSecurityManager.java +++ b/core/org.wso2.carbon.bootstrap/src/main/java/org/wso2/carbon/bootstrap/CarbonSecurityManager.java @@ -18,11 +18,6 @@ package org.wso2.carbon.bootstrap; -import sun.security.util.SecurityConstants; - -import java.security.AccessControlContext; -import java.security.AccessControlException; -import java.security.Policy; import java.util.ArrayList; import java.util.List; @@ -32,7 +27,11 @@ */ public class CarbonSecurityManager extends SecurityManager { - private List deniedProperties = new ArrayList(); + private List deniedProperties = new ArrayList<>(); + + //TODO check this later sun.security.util is not exported + public static final RuntimePermission MODIFY_THREADGROUP_PERMISSION = + new RuntimePermission("modifyThreadGroup"); public CarbonSecurityManager() { super(); @@ -86,7 +85,7 @@ public void checkAccess(ThreadGroup g) { throw new NullPointerException("thread group can't be null"); } - checkPermission(SecurityConstants.MODIFY_THREADGROUP_PERMISSION); + checkPermission(MODIFY_THREADGROUP_PERMISSION); } /** @@ -100,7 +99,7 @@ public void checkAccess(Thread t) { throw new NullPointerException("thread can't be null"); } - checkPermission(SecurityConstants.MODIFY_THREADGROUP_PERMISSION); + checkPermission(MODIFY_THREADGROUP_PERMISSION); } diff --git a/core/org.wso2.carbon.coordination.core/pom.xml b/core/org.wso2.carbon.coordination.core/pom.xml index 4b5e8d67aec..2cf851c594e 100644 --- a/core/org.wso2.carbon.coordination.core/pom.xml +++ b/core/org.wso2.carbon.coordination.core/pom.xml @@ -89,7 +89,6 @@ org.apache.felix maven-bundle-plugin - 1.4.0 true diff --git a/core/org.wso2.carbon.core.common/pom.xml b/core/org.wso2.carbon.core.common/pom.xml index 5d97a971f69..5ed7f20e712 100644 --- a/core/org.wso2.carbon.core.common/pom.xml +++ b/core/org.wso2.carbon.core.common/pom.xml @@ -57,7 +57,7 @@ !org.wso2.carbon.core.common.*, - javax.activation.*;version="[0.0.0, 1.0.0)" + javax.activation.*;version="[1.0.0, 2.0.0)" diff --git a/core/org.wso2.carbon.core.services/pom.xml b/core/org.wso2.carbon.core.services/pom.xml index f169c43d0dd..d50a1c2aa74 100644 --- a/core/org.wso2.carbon.core.services/pom.xml +++ b/core/org.wso2.carbon.core.services/pom.xml @@ -37,7 +37,11 @@ org.eclipse.osgi - org.wso2.eclipse.osgi + org.eclipse.equinox + javax.servlet + + + org.eclipse.platform org.eclipse.osgi.services diff --git a/core/org.wso2.carbon.core/pom.xml b/core/org.wso2.carbon.core/pom.xml index 28e5fb1a9a6..cae1c1bf6e9 100644 --- a/core/org.wso2.carbon.core/pom.xml +++ b/core/org.wso2.carbon.core/pom.xml @@ -37,13 +37,24 @@ org.eclipse.osgi - org.wso2.eclipse.osgi - org.eclipse.osgi.services + org.eclipse.equinox + javax.servlet + ${version.equinox.javax.servlet} - org.eclipse.equinox - org.eclipse.equinox.http.helper + org.eclipse.platform + org.eclipse.osgi.services + + + org.eclipse.jetty.toolchain + jetty-servlet + + + + + + junit junit @@ -243,6 +254,9 @@ naming-factory|naming-resources|commons-collections;scope=compile|runtime;inline=false + + osgi.service;objectClass=org.wso2.carbon.utils.ConfigurationContextService + true * @@ -269,6 +283,9 @@ org.apache.logging.log4j.jul.LogManager + + src/test/resources/testng.xml + diff --git a/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java b/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java index f9d5dc02b1d..acf0dcdcc81 100644 --- a/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java +++ b/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java @@ -36,19 +36,21 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.eclipse.core.runtime.adaptor.EclipseStarter; -import org.eclipse.equinox.http.helper.FilterServletAdaptor; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.ServiceEvent; import org.osgi.framework.ServiceReference; +import org.osgi.framework.ServiceRegistration; import org.osgi.service.http.HttpContext; import org.osgi.service.http.HttpService; -import org.osgi.service.http.NamespaceException; +import org.osgi.service.http.context.ServletContextHelper; +import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.base.CarbonBaseConstants; import org.wso2.carbon.base.CarbonContextHolderBase; import org.wso2.carbon.base.api.ServerConfigurationService; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.core.CarbonAxisConfigurator; import org.wso2.carbon.core.CarbonConfigurationContextFactory; import org.wso2.carbon.core.CarbonThreadCleanup; @@ -61,10 +63,9 @@ import org.wso2.carbon.core.deployment.RegistryBasedRepositoryUpdater; import org.wso2.carbon.core.internal.CarbonCoreDataHolder; import org.wso2.carbon.core.internal.CarbonCoreServiceComponent; -import org.wso2.carbon.core.multitenancy.GenericArtifactUnloader; import org.wso2.carbon.core.internal.HTTPGetProcessorListener; +import org.wso2.carbon.core.multitenancy.GenericArtifactUnloader; import org.wso2.carbon.core.multitenancy.MultitenantServerManager; -import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils; import org.wso2.carbon.core.security.CarbonJMXAuthenticator; import org.wso2.carbon.core.transports.CarbonServlet; @@ -92,8 +93,6 @@ import org.wso2.carbon.utils.deployment.GhostDeployerUtils; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import javax.servlet.Filter; -import javax.servlet.ServletException; import java.io.File; import java.io.IOException; import java.io.OutputStream; @@ -102,6 +101,7 @@ import java.util.Date; import java.util.Dictionary; import java.util.Enumeration; +import java.util.Hashtable; import java.util.Map; import java.util.Timer; import java.util.TimerTask; @@ -116,6 +116,10 @@ import java.util.logging.Logger; import java.util.logging.SimpleFormatter; +import javax.servlet.Filter; +import javax.servlet.Servlet; +import javax.servlet.ServletException; + import static org.apache.axis2.transport.TransportListener.HOST_ADDRESS; /** @@ -487,9 +491,10 @@ private void initializeCarbon() { } HttpService httpService = CarbonCoreDataHolder.getInstance().getHttpService(); + // TODO might want to do this differently HttpContext defaultHttpContext = httpService.createDefaultHttpContext(); - registerCarbonServlet(httpService, defaultHttpContext); + registerCarbonServlet(defaultHttpContext); RealmService realmService = CarbonCoreDataHolder.getInstance().getRealmService(); UserRealm teannt0Realm = realmService.getBootstrapRealm(); @@ -539,8 +544,8 @@ private void initializeCarbon() { } } - private void registerCarbonServlet(HttpService httpService, HttpContext defaultHttpContext) - throws ServletException, NamespaceException, InvalidSyntaxException { + private void registerCarbonServlet(HttpContext defaultHttpContext) throws InvalidSyntaxException { + if (!"false".equals(serverConfig.getFirstProperty("RequireCarbonServlet"))) { CarbonServlet carbonServlet = new CarbonServlet(serverConfigContext); String servicePath = "/services"; @@ -552,11 +557,30 @@ private void registerCarbonServlet(HttpService httpService, HttpContext defaultH servicePath = "/" + servicePath; } ServiceReference filterServiceReference = bundleContext.getServiceReference(Filter.class.getName()); + + Dictionary resourceProps = new Hashtable<>(); + resourceProps.put("osgi.http.whiteboard.context.name", "serviceContext"); + resourceProps.put("osgi.http.whiteboard.context.path", servicePath); + resourceProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN, servicePath + "/*"); + ServiceRegistration servletContextHelperServiceRegistration = + bundleContext.registerService(ServletContextHelper.class, (ServletContextHelper) defaultHttpContext, + resourceProps); + CarbonCoreDataHolder.getInstance().addServiceRegistration(servletContextHelperServiceRegistration); + + Dictionary carbonServletProperties = new Hashtable<>(); + carbonServletProperties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/*"); + carbonServletProperties.put("osgi.http.whiteboard.context.select", "(osgi.http.whiteboard.context.name=serviceContext)"); + ServiceRegistration servletServiceRegistration = + bundleContext.registerService(Servlet.class, carbonServlet, carbonServletProperties); + CarbonCoreDataHolder.getInstance().addServiceRegistration(servletServiceRegistration); + if (filterServiceReference != null) { Filter filter = (Filter) bundleContext.getService(filterServiceReference); - httpService.registerServlet(servicePath, new FilterServletAdaptor(filter, null, carbonServlet), null, defaultHttpContext); - } else { - httpService.registerServlet(servicePath, carbonServlet, null, defaultHttpContext); + Dictionary props = new Hashtable<>(); + props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN, servicePath); + ServiceRegistration filterServiceRegistration = + bundleContext.registerService(Filter.class, filter, props); + CarbonCoreDataHolder.getInstance().addServiceRegistration(filterServiceRegistration); } HTTPGetProcessorListener getProcessorListener = new HTTPGetProcessorListener(carbonServlet, bundleContext); @@ -941,17 +965,8 @@ public void stop() throws Exception { ((Map) property).clear(); } - // un-registering the carbonServlet - String servicePath = "/services"; // default path - String path = serverConfigContext.getServicePath(); - if (path != null) { - servicePath = path.trim(); - } - if (!servicePath.startsWith("/")) { - servicePath = "/" + servicePath; - } try { - CarbonCoreDataHolder.getInstance().getHttpService().unregister(servicePath); + CarbonCoreDataHolder.getInstance().unregisterServiceRegistrations(); } catch (Exception e) { log.error("Failed to Un-register Servlets ", e); } diff --git a/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java b/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java index b03544e24df..5fa6e49043e 100644 --- a/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java +++ b/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreActivator.java @@ -79,9 +79,9 @@ public void start(BundleContext context) throws Exception { provider = (Provider) (Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider")). getDeclaredConstructor().newInstance(); - } else if (providerName.equals(ServerConstants.JCE_PROVIDER_BCFIPS)) { - provider = (Provider) (Class.forName("org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider")). - getDeclaredConstructor().newInstance(); +// } else if (providerName.equals(ServerConstants.JCE_PROVIDER_BCFIPS)) { +// provider = (Provider) (Class.forName("org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider")). +// getDeclaredConstructor().newInstance(); } else { throw new NoSuchProviderException("Configured JCE provider is not supported."); diff --git a/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreDataHolder.java b/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreDataHolder.java index 00c1e8272b3..86cb2276f7c 100644 --- a/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreDataHolder.java +++ b/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreDataHolder.java @@ -20,7 +20,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; import org.osgi.service.http.HttpService; +import org.osgi.service.http.context.ServletContextHelper; import org.wso2.carbon.base.api.ServerConfigurationService; import org.wso2.carbon.crypto.api.CryptoService; import org.wso2.carbon.registry.core.service.RegistryService; @@ -47,6 +49,8 @@ public class CarbonCoreDataHolder { private ServerConfigurationService serverConfigurationService; private TenantRegistryLoader tenantRegistryLoader; + private List> serviceRegistrations = new ArrayList<>(); + private List coordinatedActivities = new ArrayList() ; private CryptoService cryptoService; @@ -166,4 +170,16 @@ public CryptoService getCryptoService() { return cryptoService; } + + public void addServiceRegistration(ServiceRegistration serviceRegistration) { + + serviceRegistrations.add(serviceRegistration); + } + + public void unregisterServiceRegistrations() { + + for (ServiceRegistration serviceRegistration : serviceRegistrations) { + serviceRegistration.unregister(); + } + } } diff --git a/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/transports/CarbonServlet.java b/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/transports/CarbonServlet.java index d322bb36a45..c9471794ffe 100644 --- a/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/transports/CarbonServlet.java +++ b/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/transports/CarbonServlet.java @@ -83,15 +83,21 @@ public void init(ServletConfig config) throws ServletException { configContext.setProperty("GETRequestProcessorMap", getRequestProcessors); initParams(); String isMeteringEnabledStr = ServerConfiguration.getInstance().getFirstProperty("EnableMetering"); - if(isMeteringEnabledStr!=null){ + if (isMeteringEnabledStr != null) { isMeteringEnabled = Boolean.parseBoolean(isMeteringEnabledStr); } - if(isMeteringEnabled){ + if (isMeteringEnabled) { requestDataPersister = new RequestDataPersisterTask(); new Thread(requestDataPersister).start(); requestDataPersisterScheduler.scheduleWithFixedDelay(requestDataPersister, 5, 5, TimeUnit.SECONDS); } + contextRoot = this.configContext.getContextRoot(); + } + + public ServletConfig getServletConfig() { + + return servletConfig; } private void populateGetRequestProcessors() throws ServletException { diff --git a/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/util/SignatureUtil.java b/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/util/SignatureUtil.java index 24c0e948346..5ca30f3962a 100644 --- a/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/util/SignatureUtil.java +++ b/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/util/SignatureUtil.java @@ -53,9 +53,10 @@ public static void init() throws Exception { provider = (Provider) (Class.forName("org.bouncycastle.jce.provider.BouncyCastleProvider")). getDeclaredConstructor().newInstance(); - } else if (providerName.equals(ServerConstants.JCE_PROVIDER_BCFIPS)) { - provider = (Provider) (Class.forName("org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider")). - getDeclaredConstructor().newInstance(); + //TODO check why this is not working +// } else if (providerName.equals(ServerConstants.JCE_PROVIDER_BCFIPS)) { +// provider = (Provider) (Class.forName("org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider")). +// getDeclaredConstructor().newInstance(); } else { throw new NoSuchProviderException("Configured JCE provider is not supported."); diff --git a/core/org.wso2.carbon.http.bridge/pom.xml b/core/org.wso2.carbon.http.bridge/pom.xml index 2ee399631e9..32872a15763 100644 --- a/core/org.wso2.carbon.http.bridge/pom.xml +++ b/core/org.wso2.carbon.http.bridge/pom.xml @@ -54,7 +54,7 @@ org.wso2.carbon.bridge - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.http.servlet diff --git a/core/org.wso2.carbon.ndatasource.common/pom.xml b/core/org.wso2.carbon.ndatasource.common/pom.xml index ad373b2b03f..2e39bc3621b 100644 --- a/core/org.wso2.carbon.ndatasource.common/pom.xml +++ b/core/org.wso2.carbon.ndatasource.common/pom.xml @@ -47,7 +47,10 @@ org.wso2.carbon.ndatasource.common.* - * + + + org.apache.commons.logging;version="[1.2,2)" + diff --git a/core/org.wso2.carbon.osgi.security/pom.xml b/core/org.wso2.carbon.osgi.security/pom.xml index 8d9a8b97867..c3571f5e079 100644 --- a/core/org.wso2.carbon.osgi.security/pom.xml +++ b/core/org.wso2.carbon.osgi.security/pom.xml @@ -39,13 +39,13 @@ org.eclipse.osgi - org.wso2.eclipse.osgi + org.eclipse.platform org.eclipse.osgi.services - - org.eclipse.equinox - org.eclipse.equinox.http.helper - + + + + junit junit diff --git a/core/org.wso2.carbon.pax-logging-log4j2-plugins/pom.xml b/core/org.wso2.carbon.pax-logging-log4j2-plugins/pom.xml index 7e68cacfcdd..ebcf375cf16 100644 --- a/core/org.wso2.carbon.pax-logging-log4j2-plugins/pom.xml +++ b/core/org.wso2.carbon.pax-logging-log4j2-plugins/pom.xml @@ -63,16 +63,6 @@ mockito-core test - - org.powermock - powermock-module-testng - test - - - org.powermock - powermock-api-mockito2 - test - org.apache.logging.log4j log4j-jul diff --git a/core/org.wso2.carbon.pax-logging-log4j2-plugins/src/test/java/org/wso2/carbon/log4j2/plugins/AppNameConverterTest.java b/core/org.wso2.carbon.pax-logging-log4j2-plugins/src/test/java/org/wso2/carbon/log4j2/plugins/AppNameConverterTest.java index dcb711f4345..a6ce6895308 100644 --- a/core/org.wso2.carbon.pax-logging-log4j2-plugins/src/test/java/org/wso2/carbon/log4j2/plugins/AppNameConverterTest.java +++ b/core/org.wso2.carbon.pax-logging-log4j2-plugins/src/test/java/org/wso2/carbon/log4j2/plugins/AppNameConverterTest.java @@ -21,19 +21,15 @@ import org.apache.logging.log4j.core.impl.Log4jLogEvent; import org.apache.logging.log4j.message.Message; import org.apache.logging.log4j.message.SimpleMessage; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.testng.PowerMockTestCase; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import org.wso2.carbon.utils.logging.handler.TenantDomainSetter; import static org.testng.Assert.assertEquals; /** * Tests AppNameConverter class. */ -@PrepareForTest(TenantDomainSetter.class) -public class AppNameConverterTest extends PowerMockTestCase { +public class AppNameConverterTest { private AppNameConverter appNameConverter; private LogEvent logEvent; diff --git a/core/org.wso2.carbon.registry.api/pom.xml b/core/org.wso2.carbon.registry.api/pom.xml index fbdb83b80a4..784e4641f3a 100644 --- a/core/org.wso2.carbon.registry.api/pom.xml +++ b/core/org.wso2.carbon.registry.api/pom.xml @@ -46,6 +46,9 @@ !javax.servlet.http, org.wso2.carbon.registry.api.*;version=1.0.1, + + !* + diff --git a/core/org.wso2.carbon.registry.core/pom.xml b/core/org.wso2.carbon.registry.core/pom.xml index 5ae65db2e7f..37a81f17421 100644 --- a/core/org.wso2.carbon.registry.core/pom.xml +++ b/core/org.wso2.carbon.registry.core/pom.xml @@ -54,7 +54,7 @@ org.wso2.carbon.user.*, org.wso2.carbon.utils.*, !javax.xml.namespace, - javax.activation.*;version="[0.0.0, 1.0.0)", + javax.activation.*;version="[1.0.0, 2.0.0)", org.apache.abdera.*; version="${imp.pkg.version.abdera}", javax.xml.namespace; version=0.0.0, javax.servlet; version="${imp.pkg.version.javax.servlet}", @@ -68,6 +68,11 @@ *;resolution:=optional * + + osgi.service;objectClass=org.wso2.carbon.registry.core.service.RegistryService, + osgi.service;objectClass=org.wso2.carbon.registry.api.RegistryService, + osgi.service;objectClass=org.wso2.carbon.registry.core.service.TenantRegistryLoader + acegi-security;scope=compile|runtime;inline=false @@ -102,7 +107,8 @@ false - pertest + 1 + false -enableassertions false ${project.build.directory}/surefire-reports-0 @@ -126,7 +132,8 @@ false - pertest + 1 + false -enableassertions false ${project.build.directory}/surefire-reports-1 @@ -150,7 +157,8 @@ false - pertest + 1 + false -enableassertions false ${project.build.directory}/surefire-reports-2 @@ -174,7 +182,8 @@ false - pertest + 1 + false -enableassertions false ${project.build.directory}/surefire-reports-3 @@ -198,7 +207,8 @@ false - pertest + 1 + false -enableassertions false ${project.build.directory}/surefire-reports-4 @@ -226,7 +236,8 @@ false - pertest + 1 + false -enableassertions false ${project.build.directory}/surefire-reports-5 @@ -254,7 +265,8 @@ false - pertest + 1 + false -enableassertions false ${project.build.directory}/surefire-reports-6 @@ -282,7 +294,8 @@ false - pertest + 1 + false -enableassertions false ${project.build.directory}/surefire-reports-7 @@ -310,7 +323,8 @@ false - pertest + 1 + false -enableassertions false ${project.build.directory}/surefire-reports-8 @@ -376,9 +390,14 @@ annotations - org.wso2.eclipse.osgi + org.eclipse.platform org.eclipse.osgi.services + + + + + junit junit diff --git a/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/app/RemoteRegistryService.java b/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/app/RemoteRegistryService.java index d4cc7baa286..40a620805a2 100644 --- a/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/app/RemoteRegistryService.java +++ b/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/app/RemoteRegistryService.java @@ -19,6 +19,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.osgi.service.component.annotations.Component; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.registry.core.Registry; import org.wso2.carbon.registry.core.RegistryConstants; @@ -42,6 +43,7 @@ * to create remote registry instances for user sessions. The class acts in a manner that is similar * to an {@link EmbeddedRegistryService}. */ +//@Component(service = RegistryService.class) public class RemoteRegistryService implements RegistryService { private static final Log log = LogFactory.getLog(RemoteRegistryService.class); diff --git a/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/jdbc/EmbeddedRegistryService.java b/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/jdbc/EmbeddedRegistryService.java index da4a63516e4..dc38fd42161 100644 --- a/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/jdbc/EmbeddedRegistryService.java +++ b/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/jdbc/EmbeddedRegistryService.java @@ -18,6 +18,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.osgi.service.component.annotations.Component; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.registry.core.RegistryConstants; import org.wso2.carbon.registry.core.clustering.NodeGroupLock; @@ -25,7 +26,6 @@ import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.dataaccess.DataAccessManager; import org.wso2.carbon.registry.core.exceptions.RegistryException; -import org.wso2.carbon.registry.core.internal.RegistryCoreServiceComponent; import org.wso2.carbon.registry.core.jdbc.dataaccess.JDBCDataAccessManager; import org.wso2.carbon.registry.core.jdbc.realm.RegistryRealm; import org.wso2.carbon.registry.core.jdbc.utils.Transaction; @@ -35,7 +35,6 @@ import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.UserRealm; import org.wso2.carbon.user.core.service.RealmService; -import org.wso2.carbon.user.core.util.UserCoreUtil; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; @@ -71,6 +70,7 @@ * @see EmbeddedRegistry * @see UserRegistry */ +//@Component(service = RegistryService.class) public class EmbeddedRegistryService implements RegistryService { private static final Log log = LogFactory.getLog(EmbeddedRegistryService.class); diff --git a/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/jdbc/InMemoryEmbeddedRegistryService.java b/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/jdbc/InMemoryEmbeddedRegistryService.java index 27552d76c1f..cb2c9de1a3f 100644 --- a/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/jdbc/InMemoryEmbeddedRegistryService.java +++ b/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/jdbc/InMemoryEmbeddedRegistryService.java @@ -16,9 +16,11 @@ package org.wso2.carbon.registry.core.jdbc; +import org.osgi.service.component.annotations.Component; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService; +import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.user.api.RealmConfiguration; import org.wso2.carbon.user.core.service.RealmService; @@ -28,6 +30,7 @@ * This is an extension to the {@link EmbeddedRegistryService} which is tailored to expose {@link * InMemoryEmbeddedRegistry} instances as OSGi services. */ +//@Component(service = RegistryService.class) public class InMemoryEmbeddedRegistryService extends EmbeddedRegistryService { private RealmService realmService; diff --git a/core/org.wso2.carbon.registry.core/src/test/resources/testng.xml b/core/org.wso2.carbon.registry.core/src/test/resources/testng.xml new file mode 100644 index 00000000000..9e60b4c8c4c --- /dev/null +++ b/core/org.wso2.carbon.registry.core/src/test/resources/testng.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/org.wso2.carbon.registry.xboot/pom.xml b/core/org.wso2.carbon.registry.xboot/pom.xml index 7f7237307c3..e69de29bb2d 100644 --- a/core/org.wso2.carbon.registry.xboot/pom.xml +++ b/core/org.wso2.carbon.registry.xboot/pom.xml @@ -1,37 +0,0 @@ - - - - - - - org.wso2.carbon - carbon-kernel - 4.10.16-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.registry.xboot - jar - WSO2 Carbon - Xbootclasspath library for Registry Kernel - Xboot library which handle the SQL Connection API differences in JDK 5 and JDK 6 - http://wso2.org - - - - - diff --git a/core/org.wso2.carbon.registry.xboot/src/main/java/java/sql/NClob.java b/core/org.wso2.carbon.registry.xboot/src/main/java/java/sql/NClob.java deleted file mode 100644 index 7571e44674a..00000000000 --- a/core/org.wso2.carbon.registry.xboot/src/main/java/java/sql/NClob.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2005-2009, 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 java.sql; - -/** - * Dummy implementation of NClob in JDK6 - */ -public interface NClob { -} diff --git a/core/org.wso2.carbon.registry.xboot/src/main/java/java/sql/RowId.java b/core/org.wso2.carbon.registry.xboot/src/main/java/java/sql/RowId.java deleted file mode 100644 index bd125b8bc40..00000000000 --- a/core/org.wso2.carbon.registry.xboot/src/main/java/java/sql/RowId.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2005-2009, 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 java.sql; - -/** - * Dummy implementation of RowId in JDK6 - */ -public interface RowId { -} diff --git a/core/org.wso2.carbon.registry.xboot/src/main/java/java/sql/SQLXML.java b/core/org.wso2.carbon.registry.xboot/src/main/java/java/sql/SQLXML.java deleted file mode 100644 index 0947067d332..00000000000 --- a/core/org.wso2.carbon.registry.xboot/src/main/java/java/sql/SQLXML.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2005-2009, 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 java.sql; - -/** - * Dummy implementation of SQLXML in JDK6 - */ -public interface SQLXML { -} diff --git a/core/org.wso2.carbon.securevault/pom.xml b/core/org.wso2.carbon.securevault/pom.xml index 6ba92beac08..f3fbc8fb820 100644 --- a/core/org.wso2.carbon.securevault/pom.xml +++ b/core/org.wso2.carbon.securevault/pom.xml @@ -36,7 +36,7 @@ org.eclipse.osgi - org.wso2.eclipse.osgi + org.eclipse.platform org.eclipse.osgi.services @@ -86,6 +86,9 @@ *;resolution:=optional * + + osgi.service;objectClass=org.wso2.carbon.securevault.SecretCallbackHandlerService + diff --git a/core/org.wso2.carbon.server.admin.common/pom.xml b/core/org.wso2.carbon.server.admin.common/pom.xml index 97d44a9ba94..ea5389bd049 100644 --- a/core/org.wso2.carbon.server.admin.common/pom.xml +++ b/core/org.wso2.carbon.server.admin.common/pom.xml @@ -55,6 +55,9 @@ org.wso2.carbon.server.admin.common.* + + !* + diff --git a/core/org.wso2.carbon.tomcat.ext/pom.xml b/core/org.wso2.carbon.tomcat.ext/pom.xml index 06f533caccd..abe300e130b 100644 --- a/core/org.wso2.carbon.tomcat.ext/pom.xml +++ b/core/org.wso2.carbon.tomcat.ext/pom.xml @@ -36,7 +36,7 @@ org.eclipse.osgi - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.common @@ -91,16 +91,6 @@ mockito-core test - - org.powermock - powermock-api-mockito2 - test - - - org.powermock - powermock-module-testng - test - org.osgi org.osgi.service.component.annotations diff --git a/core/org.wso2.carbon.tomcat/pom.xml b/core/org.wso2.carbon.tomcat/pom.xml index 56425c14214..735d0b3b5a7 100644 --- a/core/org.wso2.carbon.tomcat/pom.xml +++ b/core/org.wso2.carbon.tomcat/pom.xml @@ -36,11 +36,11 @@ org.eclipse.osgi - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.http.servlet - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.common @@ -119,6 +119,9 @@ *;resolution:=optional * + + osgi.service;objectClass=org.wso2.carbon.tomcat.api.CarbonTomcatService + diff --git a/core/org.wso2.carbon.ui/pom.xml b/core/org.wso2.carbon.ui/pom.xml index 690e17b431f..e123a3d4b0f 100644 --- a/core/org.wso2.carbon.ui/pom.xml +++ b/core/org.wso2.carbon.ui/pom.xml @@ -37,21 +37,32 @@ org.eclipse.osgi - org.wso2.eclipse.osgi + org.eclipse.equinox + javax.servlet + ${version.equinox.javax.servlet} + + + org.eclipse.platform org.eclipse.osgi.services + + + org.eclipse.jetty.toolchain + jetty-servlet + + org.apache.ws.commons.axiom.wso2 axiom - org.apache.tiles.wso2 + org.wso2.orbit.org.apache.tiles tiles-jsp - - org.apache.tiles - tiles-jsp - + + + + commons-digester commons-digester @@ -62,6 +73,17 @@ + + + + + + + + + + + org.wso2.carbon org.wso2.carbon.core @@ -111,7 +133,7 @@ axis2 - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.http.servlet @@ -146,10 +168,6 @@ - - org.eclipse.equinox - javax.servlet - commons-lang.wso2 commons-lang @@ -222,8 +240,7 @@ javax.servlet.http; version="${imp.pkg.version.javax.servlet}", javax.servlet.jsp; version="${imp.pkg.version.javax.servlet.jsp}" javax.servlet.jsp.tagext; version="${imp.pkg.version.javax.servlet.jsp}", - org.eclipse.equinox.http.helper, - org.apache.tiles.*;version="2.0.5", + org.apache.tiles.*;version="3.0.7", org.wso2.carbon.registry.core.service, org.owasp.csrfguard.tag.*; version="${orbit.version.csrfguard}", org.owasp.encoder.*;version="${owasp.encoder.wso2.imp.pkg.version}", diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/BundleEntryHttpContext.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/BundleEntryHttpContext.java new file mode 100644 index 00000000000..db6bb09e365 --- /dev/null +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/BundleEntryHttpContext.java @@ -0,0 +1,114 @@ +package org.wso2.carbon.ui; + +import java.io.IOException; +import java.net.URL; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Set; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.osgi.framework.Bundle; +import org.osgi.service.http.HttpContext; +import org.osgi.service.http.context.ServletContextHelper; + +public class BundleEntryHttpContext extends ServletContextHelper implements HttpContext { + private Bundle bundle; + private String bundlePath; + + public BundleEntryHttpContext(Bundle bundle) { + this.bundle = bundle; + } + + public BundleEntryHttpContext(Bundle b, String bundlePath) { + this(b); + if (bundlePath != null) { + if (bundlePath.endsWith("/")) { + bundlePath = bundlePath.substring(0, bundlePath.length() - 1); + } + + if (bundlePath.length() == 0) { + bundlePath = null; + } + } + + this.bundlePath = bundlePath; + } + + public String getMimeType(String arg0) { + return null; + } + + public boolean handleSecurity(HttpServletRequest arg0, HttpServletResponse arg1) throws IOException { + return true; + } + + public URL getResource(String resourceName) { + if (this.bundlePath != null) { + resourceName = this.bundlePath + resourceName; + } + + int lastSlash = resourceName.lastIndexOf(47); + if (lastSlash == -1) { + return null; + } else { + String path = resourceName.substring(0, lastSlash); + if (path.length() == 0) { + path = "/"; + } + + String file = this.sanitizeEntryName(resourceName.substring(lastSlash + 1)); + Enumeration entryPaths = this.bundle.findEntries(path, file, false); + return entryPaths != null && entryPaths.hasMoreElements() ? (URL)entryPaths.nextElement() : null; + } + } + + private String sanitizeEntryName(String name) { + StringBuffer buffer = null; + + for(int i = 0; i < name.length(); ++i) { + char c = name.charAt(i); + switch (c) { + case '*': + case '\\': + if (buffer == null) { + buffer = new StringBuffer(name.length() + 16); + buffer.append(name.substring(0, i)); + } + + buffer.append('\\').append(c); + break; + default: + if (buffer != null) { + buffer.append(c); + } + } + } + + return buffer == null ? name : buffer.toString(); + } + + public Set getResourcePaths(String path) { + if (this.bundlePath != null) { + path = this.bundlePath + path; + } + + Enumeration entryPaths = this.bundle.findEntries(path, (String)null, false); + if (entryPaths == null) { + return null; + } else { + Set result = new HashSet(); + + while(entryPaths.hasMoreElements()) { + URL entryURL = (URL)entryPaths.nextElement(); + String entryPath = entryURL.getFile(); + if (this.bundlePath == null) { + result.add(entryPath); + } else { + result.add(entryPath.substring(this.bundlePath.length())); + } + } + + return result; + } + } +} diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CarbonSecuredHttpContext.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CarbonSecuredHttpContext.java index d5996633341..b28032c82ff 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CarbonSecuredHttpContext.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CarbonSecuredHttpContext.java @@ -280,9 +280,9 @@ public boolean handleSecurity(HttpServletRequest request, HttpServletResponse re } if (request.getSession().isNew()) { if (skipLoginPage) { - response.sendRedirect(contextPath + "/carbon/admin/login_action.jsp"); + response.sendRedirect(contextPath + "/admin/login_action.jsp"); } else { - response.sendRedirect(contextPath + "/carbon/admin/login.jsp"); + response.sendRedirect(contextPath + "/admin/login.jsp"); } return false; diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CarbonUILoginUtil.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CarbonUILoginUtil.java index b1bc03a1620..f4063779ae6 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CarbonUILoginUtil.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CarbonUILoginUtil.java @@ -161,9 +161,9 @@ protected static boolean saveOriginalUrl(CarbonUIAuthenticator authenticator, } } else { if (skipLoginPage) { - response.sendRedirect(contextPath + "/carbon/admin/login_action.jsp"); + response.sendRedirect(contextPath + "/admin/login_action.jsp"); } else { - response.sendRedirect(contextPath + "/carbon/admin/login.jsp"); + response.sendRedirect(contextPath + "/admin/login.jsp"); } } @@ -460,7 +460,7 @@ protected static boolean handleLogin(CarbonUIAuthenticator authenticator, response.addCookie(rmeCookie); } } catch (Exception e) { - response.sendRedirect(contextPath + indexPageURL + response.sendRedirect(indexPageURL + (indexPageURL.indexOf('?') == -1 ? "?" : "&") + "loginStatus=false"); if (log.isDebugEnabled()) { log.debug("Security check failed for login request for " + userName); @@ -479,7 +479,7 @@ protected static boolean handleLogin(CarbonUIAuthenticator authenticator, indexPageURL = indexPageURL.substring(5); } - response.sendRedirect(contextPath + indexPageURL + response.sendRedirect(indexPageURL + (indexPageURL.indexOf('?') == -1 ? "?" : "&") + "loginStatus=true"); } @@ -497,14 +497,14 @@ protected static boolean handleLogin(CarbonUIAuthenticator authenticator, if (isLoginFailureReasonEnabled()) { if (e.getCause().getMessage().contains(ACCOUNT_LOCK_ERROR_CODE) || e.getCause().getMessage() .contains(ACCOUNT_LOCK_ERROR_MESSAGE)) { - response.sendRedirect(contextPath + "/carbon/admin/login.jsp?loginStatus=false&errorCode=error" + + response.sendRedirect(contextPath + "/admin/login.jsp?loginStatus=false&errorCode=error" + ".code.17003"); return false; } else if (e.getCause().getMessage().contains(USER_NOT_FOUND_ERROR_CODE)) { - response.sendRedirect(contextPath + "/carbon/admin/login.jsp?loginStatus=false&errorCode=error.code.17001"); + response.sendRedirect(contextPath + "/admin/login.jsp?loginStatus=false&errorCode=error.code.17001"); return false; } else if (e.getCause().getMessage().contains(INVALID_CREDENTIALS_ERROR_CODE)) { - response.sendRedirect(contextPath + "/carbon/admin/login.jsp?loginStatus=false&errorCode=error.code.17002"); + response.sendRedirect(contextPath + "/admin/login.jsp?loginStatus=false&errorCode=error.code.17002"); return false; } } @@ -512,7 +512,7 @@ protected static boolean handleLogin(CarbonUIAuthenticator authenticator, response.sendRedirect(httpLogin + "?loginStatus=false"); return false; } else { - response.sendRedirect(contextPath + "/carbon/admin/login.jsp?loginStatus=false"); + response.sendRedirect(contextPath + "/admin/login.jsp?loginStatus=false"); return false; } } catch (Exception e1) { @@ -644,7 +644,7 @@ protected static boolean escapeTenantWebAppRequests(boolean authenticated, // a tenant requesting login.jsp while not being authenticated // redirecting the tenant login page request to the root /carbon/admin/login.jsp // instead of tenant-aware login page - response.sendRedirect(context + "/carbon/admin/login.jsp"); + response.sendRedirect(context + "/admin/login.jsp"); log.debug("Redirecting to /carbon/admin/login.jsp"); return false; } diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/ContextPathServletAdaptor.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/ContextPathServletAdaptor.java new file mode 100644 index 00000000000..d2764e23b75 --- /dev/null +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/ContextPathServletAdaptor.java @@ -0,0 +1,382 @@ +package org.wso2.carbon.ui; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Method; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Enumeration; +import java.util.EventListener; +import java.util.Map; +import java.util.Set; +import javax.servlet.Filter; +import javax.servlet.FilterRegistration; +import javax.servlet.RequestDispatcher; +import javax.servlet.Servlet; +import javax.servlet.ServletConfig; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletRegistration; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.SessionCookieConfig; +import javax.servlet.SessionTrackingMode; +import javax.servlet.descriptor.JspConfigDescriptor; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; + +public class ContextPathServletAdaptor implements Servlet { + private Servlet delegate; + String contextPath; + + public ContextPathServletAdaptor(Servlet delegate, String contextPath) { + this.delegate = delegate; + this.contextPath = contextPath != null && !contextPath.equals("/") ? contextPath : ""; + } + + public void init(ServletConfig config) throws ServletException { + this.delegate.init(new ContextPathServletAdaptor.ServletConfigAdaptor(config)); + } + + public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException { + this.delegate.service(new ContextPathServletAdaptor.HttpServletRequestAdaptor((HttpServletRequest)request), response); + } + + public void destroy() { + this.delegate.destroy(); + } + + public ServletConfig getServletConfig() { + return this.delegate.getServletConfig(); + } + + public String getServletInfo() { + return this.delegate.getServletInfo(); + } + + private class RequestDispatcherAdaptor implements RequestDispatcher { + private RequestDispatcher requestDispatcher; + + public RequestDispatcherAdaptor(RequestDispatcher requestDispatcher) { + this.requestDispatcher = requestDispatcher; + } + + public void forward(ServletRequest req, ServletResponse resp) throws ServletException, IOException { + if (req instanceof ContextPathServletAdaptor.HttpServletRequestAdaptor) { + req = ((ContextPathServletAdaptor.HttpServletRequestAdaptor)req).getRequest(); + } + + this.requestDispatcher.forward(req, resp); + } + + public void include(ServletRequest req, ServletResponse resp) throws ServletException, IOException { + if (req instanceof ContextPathServletAdaptor.HttpServletRequestAdaptor) { + req = ((ContextPathServletAdaptor.HttpServletRequestAdaptor)req).getRequest(); + } + + this.requestDispatcher.include(req, resp); + } + } + + private class HttpServletRequestAdaptor extends HttpServletRequestWrapper { + static final String INCLUDE_REQUEST_URI_ATTRIBUTE = "javax.servlet.include.request_uri"; + static final String INCLUDE_CONTEXT_PATH_ATTRIBUTE = "javax.servlet.include.context_path"; + static final String INCLUDE_SERVLET_PATH_ATTRIBUTE = "javax.servlet.include.servlet_path"; + static final String INCLUDE_PATH_INFO_ATTRIBUTE = "javax.servlet.include.path_info"; + private boolean isRequestDispatcherInclude; + + public HttpServletRequestAdaptor(HttpServletRequest req) { + super(req); + this.isRequestDispatcherInclude = req.getAttribute(INCLUDE_REQUEST_URI_ATTRIBUTE) != null; + } + + public String getServletPath() { + if (this.isRequestDispatcherInclude) { + return super.getServletPath(); + } else { + String fullPath = super.getServletPath(); + return fullPath.substring( + ContextPathServletAdaptor.this.contextPath.length()); + } + } + + public String getContextPath() { + return this.isRequestDispatcherInclude ? super.getContextPath() : super.getContextPath() + ContextPathServletAdaptor.this.contextPath; + } + + public Object getAttribute(String attributeName) { + if (this.isRequestDispatcherInclude) { + String servletPath; + if (attributeName.equals(INCLUDE_CONTEXT_PATH_ATTRIBUTE)) { + servletPath = (String)super.getAttribute(INCLUDE_CONTEXT_PATH_ATTRIBUTE); + if (servletPath != null && !servletPath.equals("/")) { + return servletPath + ContextPathServletAdaptor.this.contextPath; + } + + return ContextPathServletAdaptor.this.contextPath; + } + + if (attributeName.equals(INCLUDE_SERVLET_PATH_ATTRIBUTE)) { + servletPath = (String)super.getAttribute(INCLUDE_SERVLET_PATH_ATTRIBUTE); + return servletPath.substring( + ContextPathServletAdaptor.this.contextPath.length()); + } + } + + return super.getAttribute(attributeName); + } + + public RequestDispatcher getRequestDispatcher(String arg0) { + return ContextPathServletAdaptor.this.new RequestDispatcherAdaptor(super.getRequestDispatcher( + ContextPathServletAdaptor.this.contextPath + arg0)); + } + } + + private class ServletContextAdaptor implements ServletContext { + private ServletContext delegate; + + public ServletContextAdaptor(ServletContext delegate) { + this.delegate = delegate; + } + + public RequestDispatcher getRequestDispatcher(String path) { + return ContextPathServletAdaptor.this.contextPath.equals("/") ? ContextPathServletAdaptor.this.new RequestDispatcherAdaptor(this.delegate.getRequestDispatcher(path)) : ContextPathServletAdaptor.this.new RequestDispatcherAdaptor(this.delegate.getRequestDispatcher( + ContextPathServletAdaptor.this.contextPath + path)); + } + + public URL getResource(String name) throws MalformedURLException { + return this.delegate.getResource(name); + } + + public InputStream getResourceAsStream(String name) { + return this.delegate.getResourceAsStream(name); + } + + public Set getResourcePaths(String name) { + return this.delegate.getResourcePaths(name); + } + + public Object getAttribute(String arg0) { + return this.delegate.getAttribute(arg0); + } + + public Enumeration getAttributeNames() { + return this.delegate.getAttributeNames(); + } + + public ServletContext getContext(String arg0) { + return this.delegate.getContext(arg0); + } + + public String getInitParameter(String arg0) { + return this.delegate.getInitParameter(arg0); + } + + public Enumeration getInitParameterNames() { + return this.delegate.getInitParameterNames(); + } + + public boolean setInitParameter(String s, String s1) { + return this.delegate.setInitParameter(s, s1); + } + + public int getMajorVersion() { + return this.delegate.getMajorVersion(); + } + + public String getMimeType(String arg0) { + return this.delegate.getMimeType(arg0); + } + + public int getMinorVersion() { + return this.delegate.getMinorVersion(); + } + + public int getEffectiveMajorVersion() { + return this.delegate.getEffectiveMajorVersion(); + } + + public int getEffectiveMinorVersion() { + return this.delegate.getEffectiveMinorVersion(); + } + + public RequestDispatcher getNamedDispatcher(String arg0) { + return ContextPathServletAdaptor.this.new RequestDispatcherAdaptor(this.delegate.getNamedDispatcher(arg0)); + } + + public String getRealPath(String arg0) { + return this.delegate.getRealPath(arg0); + } + + public String getServerInfo() { + return this.delegate.getServerInfo(); + } + + /** @deprecated */ + public Servlet getServlet(String arg0) throws ServletException { + return this.delegate.getServlet(arg0); + } + + public String getServletContextName() { + return this.delegate.getServletContextName(); + } + + public ServletRegistration.Dynamic addServlet(String s, String s1) { + return this.delegate.addServlet(s, s1); + } + + public ServletRegistration.Dynamic addServlet(String s, Servlet servlet) { + return this.delegate.addServlet(s, servlet); + } + + public ServletRegistration.Dynamic addServlet(String s, Class aClass) { + return this.delegate.addServlet(s, aClass); + } + + public T createServlet(Class tClass) throws ServletException { + return this.delegate.createServlet(tClass); + } + + public ServletRegistration getServletRegistration(String s) { + return this.delegate.getServletRegistration(s); + } + + public Map getServletRegistrations() { + return this.delegate.getServletRegistrations(); + } + + public FilterRegistration.Dynamic addFilter(String s, String s1) { + return this.delegate.addFilter(s, s1); + } + + public FilterRegistration.Dynamic addFilter(String s, Filter filter) { + return this.delegate.addFilter(s, filter); + } + + public FilterRegistration.Dynamic addFilter(String s, Class aClass) { + return this.delegate.addFilter(s, aClass); + } + + public T createFilter(Class tClass) throws ServletException { + return this.delegate.createFilter(tClass); + } + + public FilterRegistration getFilterRegistration(String s) { + return this.delegate.getFilterRegistration(s); + } + + public Map getFilterRegistrations() { + return this.delegate.getFilterRegistrations(); + } + + public SessionCookieConfig getSessionCookieConfig() { + return this.delegate.getSessionCookieConfig(); + } + + public void setSessionTrackingModes(Set sessionTrackingModes) throws IllegalStateException, IllegalArgumentException { + this.delegate.setSessionTrackingModes(sessionTrackingModes); + } + + public Set getDefaultSessionTrackingModes() { + return this.delegate.getDefaultSessionTrackingModes(); + } + + public Set getEffectiveSessionTrackingModes() { + return this.delegate.getEffectiveSessionTrackingModes(); + } + + public void addListener(Class aClass) { + this.delegate.addListener(aClass); + } + + public void addListener(String s) { + this.delegate.addListener(s); + } + + public void addListener(T t) { + this.delegate.addListener(t); + } + + public T createListener(Class tClass) throws ServletException { + return this.delegate.createListener(tClass); + } + + public void declareRoles(String... strings) { + this.delegate.declareRoles(strings); + } + + public ClassLoader getClassLoader() { + return this.delegate.getClassLoader(); + } + + public JspConfigDescriptor getJspConfigDescriptor() { + return this.delegate.getJspConfigDescriptor(); + } + + /** @deprecated */ + public Enumeration getServletNames() { + return this.delegate.getServletNames(); + } + + /** @deprecated */ + public Enumeration getServlets() { + return this.delegate.getServlets(); + } + + /** @deprecated */ + public void log(Exception arg0, String arg1) { + this.delegate.log(arg0, arg1); + } + + public void log(String arg0, Throwable arg1) { + this.delegate.log(arg0, arg1); + } + + public void log(String arg0) { + this.delegate.log(arg0); + } + + public void removeAttribute(String arg0) { + this.delegate.removeAttribute(arg0); + } + + public void setAttribute(String arg0, Object arg1) { + this.delegate.setAttribute(arg0, arg1); + } + + public String getContextPath() { + try { + Method getContextPathMethod = this.delegate.getClass().getMethod("getContextPath", (Class[])null); + return (String)getContextPathMethod.invoke(this.delegate, (Object[])null); + } catch (Exception var2) { + return null; + } + } + } + + private class ServletConfigAdaptor implements ServletConfig { + private ServletConfig config; + private ServletContext context; + + public ServletConfigAdaptor(ServletConfig config) { + this.config = config; + this.context = ContextPathServletAdaptor.this.new ServletContextAdaptor(config.getServletContext()); + } + + public String getInitParameter(String arg0) { + return this.config.getInitParameter(arg0); + } + + public Enumeration getInitParameterNames() { + return this.config.getInitParameterNames(); + } + + public ServletContext getServletContext() { + return this.context; + } + + public String getServletName() { + return this.config.getServletName(); + } + } +} diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CustomTilesInitializer.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CustomTilesInitializer.java new file mode 100644 index 00000000000..c6bc9a57895 --- /dev/null +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CustomTilesInitializer.java @@ -0,0 +1,26 @@ +package org.wso2.carbon.ui; + +import org.apache.tiles.factory.AbstractTilesContainerFactory; +import org.apache.tiles.factory.BasicTilesContainerFactory; +import org.apache.tiles.request.ApplicationContext; +import org.apache.tiles.request.servlet.ServletApplicationContext; +import org.apache.tiles.startup.AbstractTilesInitializer; +import org.apache.tiles.startup.TilesInitializer; +import org.apache.tiles.web.startup.AbstractTilesListener; + +import javax.servlet.ServletContext; + +public class CustomTilesInitializer extends AbstractTilesInitializer { + + @Override + protected AbstractTilesContainerFactory createContainerFactory(ApplicationContext applicationContext) { + + return new BasicTilesContainerFactory(); + } + + @Override + protected ApplicationContext createTilesApplicationContext(ApplicationContext context) { + + return new ServletApplicationContext((ServletContext) context.getContext()); + } +} diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CustomTilesInitializerListener.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CustomTilesInitializerListener.java new file mode 100644 index 00000000000..b68c4ac5887 --- /dev/null +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/CustomTilesInitializerListener.java @@ -0,0 +1,66 @@ +package org.wso2.carbon.ui; + +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import org.apache.tiles.factory.BasicTilesContainerFactory; +import org.apache.tiles.request.ApplicationContext; +import org.apache.tiles.request.servlet.ServletApplicationContext; +import org.apache.tiles.request.servlet.wildcard.WildcardServletApplicationContext; +import org.apache.tiles.startup.TilesInitializer; +import org.apache.tiles.startup.AbstractTilesInitializer; +import org.apache.tiles.TilesContainer; +import org.apache.tiles.request.servlet.ServletUtil; +import org.apache.tiles.web.startup.AbstractTilesListener; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; + +@Component( + service = ServletContextListener.class, + property = { + HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER + "=true", + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT + "=(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=tilesContext)" + } +) +public class CustomTilesInitializerListener extends AbstractTilesListener { + + @Override + protected TilesInitializer createTilesInitializer() { + + return new CustomTilesInitializer(); + } + +// @Override +// public void contextInitialized(ServletContextEvent sce) { +// ServletApplicationContext application = new ServletApplicationContext(sce.getServletContext()); +// TilesInitializer initializer = new AbstractTilesInitializer() { +// @Override +// protected ApplicationContext createTilesApplicationContext(ApplicationContext context) { +// return new ServletApplicationContext((ServletContext)context.getContext()); +// } +// +//// @Override +//// protected ApplicationContext createApplicationContext(Object context) { +//// return new ServletApplicationContext((javax.servlet.ServletContext) context); +//// } +// +// @Override +// protected BasicTilesContainerFactory createContainerFactory(ApplicationContext context) { +// return new BasicTilesContainerFactory(); +// } +// }; +//// TilesContainer container = initializer.createContainer(application); +//// ServletUtil.setContainer(sce.getServletContext(), container); +// +// initializer.initialize(application); +//// ServletUtil.setContainer(sce.getServletContext(), container); +// } +// +// @Override +// public void contextDestroyed(ServletContextEvent sce) { +// // Clean up resources if necessary +// } + + +} + diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/DefaultComponentEntryHttpContext.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/DefaultComponentEntryHttpContext.java index db7d1999876..b58c3dcfd58 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/DefaultComponentEntryHttpContext.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/DefaultComponentEntryHttpContext.java @@ -15,7 +15,6 @@ */ package org.wso2.carbon.ui; -import org.eclipse.equinox.http.helper.BundleEntryHttpContext; import org.osgi.framework.Bundle; import java.net.MalformedURLException; diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/FilterServletAdaptor.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/FilterServletAdaptor.java new file mode 100644 index 00000000000..c546293a100 --- /dev/null +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/FilterServletAdaptor.java @@ -0,0 +1,89 @@ +package org.wso2.carbon.ui; + +import java.io.IOException; +import java.util.Enumeration; +import java.util.Properties; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.Servlet; +import javax.servlet.ServletConfig; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +public class FilterServletAdaptor implements Servlet { + ServletConfig config; + Servlet delegate; + Filter filter; + Properties filterInitParameters; + private FilterChain filterChain; + + public FilterServletAdaptor(Filter filter, Properties filterInitParameters, Servlet delegate) { + this.delegate = delegate; + this.filter = filter; + this.filterInitParameters = filterInitParameters == null ? new Properties() : filterInitParameters; + this.filterChain = new FilterServletAdaptor.FilterChainImpl(); + } + + public void init(ServletConfig config) throws ServletException { + this.config = config; + this.filter.init(new FilterServletAdaptor.FilterConfigImpl()); + this.delegate.init(config); + } + + public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException { + this.filter.doFilter(request, response, this.filterChain); + } + + public void destroy() { + this.delegate.destroy(); + this.filter.destroy(); + this.config = null; + } + + public ServletConfig getServletConfig() { + return this.config; + } + + public String getServletInfo() { + return ""; + } + + class FilterConfigImpl implements FilterConfig { + FilterConfigImpl() { + } + + public String getFilterName() { + String filterName = FilterServletAdaptor.this.filterInitParameters.getProperty("filter-name"); + if (filterName == null) { + filterName = FilterServletAdaptor.this.filter.getClass().getName(); + } + + return filterName; + } + + public String getInitParameter(String name) { + return FilterServletAdaptor.this.filterInitParameters.getProperty(name); + } + + public Enumeration getInitParameterNames() { + return FilterServletAdaptor.this.filterInitParameters.propertyNames(); + } + + public ServletContext getServletContext() { + return FilterServletAdaptor.this.config.getServletContext(); + } + } + + public class FilterChainImpl implements FilterChain { + public FilterChainImpl() { + } + + public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException { + FilterServletAdaptor.this.delegate.service(request, response); + } + } +} + diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/JspServlet.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/JspServlet.java index f8376f97b28..bb3fd058571 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/JspServlet.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/JspServlet.java @@ -195,6 +195,7 @@ public void destroy() { public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String pathInfo = request.getPathInfo(); if (pathInfo != null && pathInfo.startsWith("/WEB-INF/")) { //$NON-NLS-1$ response.sendError(HttpServletResponse.SC_NOT_FOUND); diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/SecuredComponentEntryHttpContext.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/SecuredComponentEntryHttpContext.java index ca5b2af9f20..c441980904a 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/SecuredComponentEntryHttpContext.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/SecuredComponentEntryHttpContext.java @@ -20,7 +20,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.eclipse.equinox.http.helper.BundleEntryHttpContext; import org.osgi.framework.Bundle; import org.wso2.carbon.registry.core.Registry; diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/TilesJspServlet.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/TilesJspServlet.java index 0b6773e6576..0b1b4708c08 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/TilesJspServlet.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/TilesJspServlet.java @@ -19,6 +19,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.tiles.AttributeContext; +import org.apache.tiles.request.reflect.ClassUtil; +import org.apache.tiles.web.util.AttributeContextMutator; +import org.apache.tiles.web.util.TilesDispatchServlet; import org.osgi.framework.Bundle; import org.osgi.framework.ServiceReference; import org.wso2.carbon.ui.action.ActionHelper; @@ -35,16 +39,42 @@ public class TilesJspServlet extends JspServlet { private static final long serialVersionUID = 1L; private static Log log = LogFactory.getLog(TilesJspServlet.class); + public static final String CONTAINER_KEY_INIT_PARAMETER = + "org.apache.tiles.web.util.TilesDispatchServlet.CONTAINER_KEY"; + + private String containerKey; + private AttributeContextMutator mutator; + public TilesJspServlet(Bundle bundle, UIResourceRegistry uiResourceRegistry) { super(bundle, uiResourceRegistry); } + //TODO check if this is needed + @Override + public void init() throws ServletException { + super.init(); + + containerKey = getServletConfig().getInitParameter(CONTAINER_KEY_INIT_PARAMETER); + + String temp = getInitParameter("mutator"); + if (temp != null) { + try { + mutator = (AttributeContextMutator) ClassUtil.instantiate(temp); + } catch (Exception e) { + throw new ServletException("Unable to instantiate specified context mutator.", e); + } + } else { + mutator = new DefaultMutator(); + } + } + public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String actionUrl = request.getRequestURI(); //This is the layout page defined in - //"/org.wso2.carbon.component/src/main/resources/web/WEB-INF/tiles/main_defs.xml" + //"/org.wso2.carbon.component/src/main/resources/web/WEB-INF/tiles/tiles.xml" //Need to serve http requests other than to tiles body page, //using the normal OSGi way @@ -73,10 +103,10 @@ public void service(HttpServletRequest request, HttpServletResponse response) } } - if ((actionUrl.lastIndexOf("/admin/layout/template.jsp") > -1) || actionUrl.lastIndexOf("ajaxprocessor.jsp") > -1 - || actionUrl.indexOf("gadgets/js") > -1) { + || actionUrl.indexOf("gadgets/js") > -1 + || "INCLUDE".equals(request.getDispatcherType().toString())) { super.service(request, response); } else if (actionUrl.startsWith("/carbon/registry/web/resources/foo/bar")) { //TODO : consider the renamed ROOT war scenario @@ -104,4 +134,67 @@ public void service(HttpServletRequest request, HttpServletResponse response) } } } + + class DefaultMutator implements AttributeContextMutator { + + /** {@inheritDoc} */ + public void mutate(AttributeContext context, javax.servlet.ServletRequest request) { + // noop; + } + } + + protected static final String canonicalURI(String s) { + if (s == null) { + return null; + } else { + StringBuilder result = new StringBuilder(); + int len = s.length(); + int pos = 0; + + while(pos < len) { + char c = s.charAt(pos); + if (isPathSeparator(c)) { + while(pos + 1 < len && isPathSeparator(s.charAt(pos + 1))) { + ++pos; + } + + if (pos + 1 < len && s.charAt(pos + 1) == '.') { + if (pos + 2 >= len) { + break; + } + + switch (s.charAt(pos + 2)) { + case '.': + if (pos + 3 < len && isPathSeparator(s.charAt(pos + 3))) { + pos += 3; + + int separatorPos; + for(separatorPos = result.length() - 1; separatorPos >= 0 && !isPathSeparator(result.charAt(separatorPos)); --separatorPos) { + } + + if (separatorPos >= 0) { + result.setLength(separatorPos); + } + continue; + } + break; + case '/': + case '\\': + pos += 2; + continue; + } + } + } + + result.append(c); + ++pos; + } + + return result.toString(); + } + } + + protected static final boolean isPathSeparator(char c) { + return c == '/' || c == '\\'; + } } diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/UIResourceRegistry.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/UIResourceRegistry.java index 232b908e894..d8a24759522 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/UIResourceRegistry.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/UIResourceRegistry.java @@ -63,7 +63,7 @@ public void initialize(BundleContext bundleContext) { } public URL getUIResource(String path) { - URL url = defaultUIResourceProvider.getUIResource(path); + URL url = defaultUIResourceProvider.getUIResource(canonicalURI(path)); if (url == null) { for (UIResourceProvider resourceProvider : resourceProviderSet) { url = resourceProvider.getUIResource(path); @@ -104,4 +104,59 @@ public void serviceChanged(ServiceEvent serviceEvent) { resourceProviderSet.remove(uiResourceProvider); } } + + protected static final String canonicalURI(String s) { + if (s == null) { + return null; + } else { + StringBuilder result = new StringBuilder(); + int len = s.length(); + int pos = 0; + + while(pos < len) { + char c = s.charAt(pos); + if (isPathSeparator(c)) { + while(pos + 1 < len && isPathSeparator(s.charAt(pos + 1))) { + ++pos; + } + + if (pos + 1 < len && s.charAt(pos + 1) == '.') { + if (pos + 2 >= len) { + break; + } + + switch (s.charAt(pos + 2)) { + case '.': + if (pos + 3 < len && isPathSeparator(s.charAt(pos + 3))) { + pos += 3; + + int separatorPos; + for(separatorPos = result.length() - 1; separatorPos >= 0 && !isPathSeparator(result.charAt(separatorPos)); --separatorPos) { + } + + if (separatorPos >= 0) { + result.setLength(separatorPos); + } + continue; + } + break; + case '/': + case '\\': + pos += 2; + continue; + } + } + } + + result.append(c); + ++pos; + } + + return result.toString(); + } + } + + protected static final boolean isPathSeparator(char c) { + return c == '/' || c == '\\'; + } } diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/action/ActionHelper.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/action/ActionHelper.java index 99d3455b230..79f355a948d 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/action/ActionHelper.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/action/ActionHelper.java @@ -21,7 +21,12 @@ import org.apache.tiles.AttributeContext; import org.apache.tiles.TilesContainer; import org.apache.tiles.access.TilesAccess; +import org.apache.tiles.request.ApplicationContext; +import org.apache.tiles.request.Request; +import org.apache.tiles.request.servlet.ServletRequest; +import org.apache.tiles.request.servlet.ServletUtil; +import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -40,21 +45,25 @@ public class ActionHelper { */ public static void render(String actionUrl, HttpServletRequest request, HttpServletResponse response) throws Exception { - TilesContainer container = TilesAccess.getContainer( - request.getSession().getServletContext()); - if(log.isDebugEnabled()){ - log.debug("Rendering tiles main.layout with page : "+actionUrl+"("+request.getSession().getId()+")"); + + ServletContext servletContext = request.getSession().getServletContext(); + ApplicationContext applicationContext = ServletUtil.getApplicationContext(servletContext); + TilesContainer container = TilesAccess.getContainer(applicationContext); + if (log.isDebugEnabled()) { + log.debug( + "Rendering tiles main.layout with page : " + actionUrl + "(" + request.getSession().getId() + ")"); } - AttributeContext attributeContext = container.startContext(request, response); + Request requestContext = new ServletRequest(container.getApplicationContext(), request, response); + AttributeContext attributeContext = container.startContext(requestContext); Attribute attr = new Attribute(actionUrl); attributeContext.putAttribute("body", attr); try { - container.render("main.layout", request, response); - container.endContext(request, response); + container.render("main.layout", requestContext); + container.endContext(requestContext); } catch (Exception e) { if (log.isDebugEnabled()) { // Intentionally logged at debug level log.debug("Error occurred while rendering." + - " We generally see this 'harmless' exception on WebLogic. Hiding it.", e); + " We generally see this 'harmless' exception on WebLogic. Hiding it.", e); } } } diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/deployment/UIBundleDeployer.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/deployment/UIBundleDeployer.java index 0394aada225..4675d974825 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/deployment/UIBundleDeployer.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/deployment/UIBundleDeployer.java @@ -17,8 +17,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.eclipse.equinox.http.helper.ContextPathServletAdaptor; -import org.eclipse.equinox.http.helper.FilterServletAdaptor; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleEvent; @@ -30,11 +28,14 @@ import org.osgi.service.http.HttpContext; import org.osgi.service.http.HttpService; import org.osgi.service.http.NamespaceException; +import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; import org.osgi.util.tracker.ServiceTracker; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.CarbonException; import org.wso2.carbon.base.ServerConfiguration; import org.wso2.carbon.ui.BundleBasedUIResourceProvider; +import org.wso2.carbon.ui.ContextPathServletAdaptor; +import org.wso2.carbon.ui.FilterServletAdaptor; import org.wso2.carbon.ui.deployment.beans.CarbonUIDefinitions; import org.wso2.carbon.ui.deployment.beans.Component; import org.wso2.carbon.ui.deployment.beans.CustomUIDefenitions; @@ -44,9 +45,6 @@ import org.wso2.carbon.ui.transports.fileupload.FileUploadExecutorManager; import org.wso2.carbon.ui.util.UIResourceProvider; -import javax.servlet.Servlet; -import javax.servlet.ServletException; - import java.util.ArrayList; import java.util.Arrays; import java.util.Dictionary; @@ -55,6 +53,10 @@ import java.util.Iterator; import java.util.List; +import javax.servlet.Filter; +import javax.servlet.Servlet; +import javax.servlet.ServletException; + public class UIBundleDeployer implements SynchronousBundleListener { private static Log log = LogFactory.getLog(UIBundleDeployer.class); @@ -425,6 +427,18 @@ public void registerServlet(Servlet servlet, String urlPattern, Dictionary param httpService.registerServlet(urlPattern, new FilterServletAdaptor(associatedFilter, null, adaptedJspServlet), params, httpContext); } +// Dictionary properties = new Hashtable<>(); +// properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, urlPattern); +// for (Enumeration enm = params.keys(); enm.hasMoreElements();) { +// String key = (String) enm.nextElement(); +// properties.put("servlet.init." + key, params.get(key)); +// } +// CarbonUIServiceComponent.getBundleContext().registerService(Servlet.class, servlet, properties); +// if (associatedFilter != null) { +// Dictionary props = new Hashtable<>(); +// props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN, urlPattern); +// CarbonUIServiceComponent.getBundleContext().registerService(Filter.class, associatedFilter, props); +// } if (servletAttrs != null) { for (Enumeration enm = servletAttrs.keys(); enm.hasMoreElements();) { String key = (String) enm.nextElement(); diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/internal/CarbonUIServiceComponent.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/internal/CarbonUIServiceComponent.java index 1b657fc3d14..23d26441786 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/internal/CarbonUIServiceComponent.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/internal/CarbonUIServiceComponent.java @@ -25,7 +25,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.tomcat.InstanceManager; -import org.eclipse.equinox.http.helper.ContextPathServletAdaptor; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; @@ -38,6 +37,8 @@ import org.osgi.service.component.annotations.ReferencePolicy; import org.osgi.service.http.HttpContext; import org.osgi.service.http.HttpService; +import org.osgi.service.http.context.ServletContextHelper; +import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; import org.osgi.service.packageadmin.PackageAdmin; import org.osgi.service.url.URLConstants; import org.osgi.service.url.URLStreamHandlerService; @@ -52,6 +53,7 @@ import org.wso2.carbon.ui.CarbonSecuredHttpContext; import org.wso2.carbon.ui.CarbonUIAuthenticator; import org.wso2.carbon.ui.CarbonUIUtil; +import org.wso2.carbon.ui.ContextPathServletAdaptor; import org.wso2.carbon.ui.DefaultCarbonAuthenticator; import org.wso2.carbon.ui.TextJavascriptHandler; import org.wso2.carbon.ui.TilesJspServlet; @@ -68,13 +70,6 @@ import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.utils.ConfigurationContextService; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.xml.namespace.QName; -import javax.xml.stream.FactoryConfigurationError; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; import java.io.IOException; import java.io.InputStream; import java.net.ContentHandler; @@ -90,6 +85,14 @@ import java.util.Map; import java.util.StringTokenizer; +import javax.servlet.Servlet; +import javax.servlet.ServletContext; +import javax.xml.namespace.QName; +import javax.xml.stream.FactoryConfigurationError; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; + import static org.wso2.carbon.CarbonConstants.PRODUCT_XML; import static org.wso2.carbon.CarbonConstants.PRODUCT_XML_PROPERTIES; import static org.wso2.carbon.CarbonConstants.PRODUCT_XML_PROPERTY; @@ -108,8 +111,7 @@ public class CarbonUIServiceComponent { private static ServerConfigurationService serverConfiguration; private static RealmService realmService; private static CarbonTomcatService carbonTomcatService; - private static List authenticationExtenders = - new LinkedList(); + private static List authenticationExtenders = new LinkedList<>(); private BundleContext bundleContext; @@ -230,15 +232,6 @@ public void start(BundleContext context) throws Exception { final HttpService httpService = getHttpService(); - Dictionary initparams = new Hashtable(); - initparams.put("servlet-name", "TilesServlet"); - initparams.put("definitions-config", "/WEB-INF/tiles/main_defs.xml"); - initparams.put("org.apache.tiles.context.TilesContextFactory", - "org.apache.tiles.context.enhanced.EnhancedContextFactory"); - initparams.put("org.apache.tiles.factory.TilesContainerFactory.MUTABLE", "true"); - initparams.put("org.apache.tiles.definition.DefinitionsFactory", - "org.wso2.carbon.tiles.CarbonUrlDefinitionsFactory"); - String webContext = "carbon"; // The subcontext for the Carbon Mgt Console String serverURL = CarbonUIUtil.getServerURL(serverConfig); @@ -262,6 +255,9 @@ public void start(BundleContext context) throws Exception { //Registering filedownload servlet Servlet fileDownloadServlet = new ContextPathServletAdaptor(new FileDownloadServlet( context, getConfigurationContextService()), "/filedownload"); +// Dictionary fileDownloadServletProperties = new Hashtable<>(); +// fileDownloadServletProperties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/filedownload"); +// context.registerService(Servlet.class, fileDownloadServlet, fileDownloadServletProperties); httpService.registerServlet("/filedownload", fileDownloadServlet, null, commonContext); fileDownloadServlet.getServletConfig().getServletContext().setAttribute( CarbonConstants.SERVER_URL, serverURL); @@ -279,6 +275,9 @@ public void start(BundleContext context) throws Exception { } httpService.registerServlet("/fileupload", fileUploadServlet, null, commonContext); +// Dictionary fileUploadServletProperties = new Hashtable<>(); +// fileUploadServletProperties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/fileupload"); +// context.registerService(Servlet.class, fileUploadServlet, fileUploadServletProperties); fileUploadServlet.getServletConfig().getServletContext().setAttribute( CarbonConstants.SERVER_URL, serverURL); fileUploadServlet.getServletConfig().getServletContext().setAttribute( @@ -287,30 +286,44 @@ public void start(BundleContext context) throws Exception { uiBundleDeployer.deploy(bundleContext, commonContext); context.addBundleListener(uiBundleDeployer); - httpService.registerServlet("/", new org.apache.tiles.web.startup.TilesServlet(), - initparams, - commonContext); - httpService.registerResources("/" + webContext, "/", commonContext); - - adaptedJspServlet = new ContextPathServletAdaptor( - new TilesJspServlet(context.getBundle(), uiResourceRegistry), "/" + webContext); + Dictionary props = new Hashtable<>(); + props.put("osgi.http.whiteboard.context.name", "tilesContext"); + props.put("osgi.http.whiteboard.context.path", "/carbon"); - Dictionary carbonInitparams = new Hashtable(); - carbonInitparams.put("strictQuoteEscaping", "false"); - httpService.registerServlet("/" + webContext + "/*.jsp", adaptedJspServlet, carbonInitparams, commonContext); - - ServletContext jspServletContext = - adaptedJspServlet.getServletConfig().getServletContext(); - - jspServletContext.setAttribute( - InstanceManager.class.getName(), getTomcatInstanceManager()); + context.registerService(ServletContextHelper.class, (ServletContextHelper) commonContext, props); + HttpContext resourceContext = + new CarbonSecuredHttpContext(context.getBundle(), "/web", uiResourceRegistry, registry); + Dictionary resourceProps = new Hashtable<>(); + resourceProps.put("osgi.http.whiteboard.context.name", "resourceContext"); + resourceProps.put("osgi.http.whiteboard.context.path", "/carbon"); + resourceProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN, "/" + webContext + "/*"); + context.registerService(ServletContextHelper.class, (ServletContextHelper) resourceContext, resourceProps); + Dictionary properties = new Hashtable<>(); + properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN, "/*"); + properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PREFIX, "/"); + properties.put("osgi.http.whiteboard.context.select", "(osgi.http.whiteboard.context.name=resourceContext)"); + properties.put("osgi.http.whiteboard.context.httpservice", true); + + // Replacement for httpService.registerResources with whiteboard + bundleContext.registerService(String.class, "resource", properties); + + adaptedJspServlet = new TilesJspServlet(context.getBundle(), uiResourceRegistry); + + Dictionary carbonInitparams = new Hashtable<>(); + carbonInitparams.put("servlet.init.strictQuoteEscaping", "false"); + carbonInitparams.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, "/*.jsp"); + carbonInitparams.put("osgi.http.whiteboard.context.select", "(osgi.http.whiteboard.context.name=tilesContext)"); + context.registerService(Servlet.class, adaptedJspServlet, carbonInitparams); + + ServletContext jspServletContext = adaptedJspServlet.getServletConfig().getServletContext(); + + jspServletContext.setAttribute(InstanceManager.class.getName(), getTomcatInstanceManager()); jspServletContext.setAttribute("registry", registryService); - jspServletContext.setAttribute(CarbonConstants.SERVER_CONFIGURATION, serverConfig); jspServletContext.setAttribute(CarbonConstants.CLIENT_CONFIGURATION_CONTEXT, clientConfigContext); //If the UI is running on local transport mode, then we use the server-side config context. - if(isLocalTransportMode) { + if (isLocalTransportMode) { jspServletContext.setAttribute(CarbonConstants.CONFIGURATION_CONTEXT, serverConfigContext); } else { jspServletContext.setAttribute(CarbonConstants.CONFIGURATION_CONTEXT, clientConfigContext); @@ -328,6 +341,7 @@ public void start(BundleContext context) throws Exception { .setAttribute(CustomUIDefenitions.CUSTOM_UI_DEFENITIONS, customUIDefenitions); // Registering jspServletContext as a service so that UI components can use it + // TODO why do we need to register this again? bundleContext.registerService(ServletContext.class.getName(), jspServletContext, null); //saving bundle context for future reference within CarbonUI Generation diff --git a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIResourceProvider.java b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIResourceProvider.java index fafb0815672..55f1be6075b 100644 --- a/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIResourceProvider.java +++ b/core/org.wso2.carbon.ui/src/main/java/org/wso2/carbon/ui/util/UIResourceProvider.java @@ -45,11 +45,11 @@ public interface UIResourceProvider { * /WEB_INF * /WEB-INF/web.xml * /WEB-INF/tiles - * /WEB-INF/tiles/main_defs.xml + * /WEB-INF/tiles/tiles.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"}. + * getResourcePaths("/WEB-INF/tiles/") returns {"/WEB-INF/tiles/tiles.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 diff --git a/core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tiles/main_defs.xml b/core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tiles.xml similarity index 100% rename from core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tiles/main_defs.xml rename to core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tiles.xml diff --git a/core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tlds/tiles-jsp.tld b/core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tlds/tiles-jsp.tld index 5250bb20799..effdb62e203 100644 --- a/core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tlds/tiles-jsp.tld +++ b/core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/tlds/tiles-jsp.tld @@ -1,801 +1,921 @@ - - - - 2.0 - 1.2 - tiles - http://tiles.apache.org/tags-tiles + + + - This tag library provides Tiles tags.

+ + 1.2 + tiles + http://tiles.apache.org/tags-tiles - insertTemplate - org.apache.tiles.jsp.taglib.InsertTemplateTag - JSP - Insert a template.

-

Insert a template with the possibility to pass - parameters (called attributes). - A template can be seen as a procedure that can take parameters or attributes. - <tiles:insertTemplate> allows to define these attributes - and pass them to the inserted jsp page, called template. - Attributes are defined using nested tag <tiles:put> or - <tiles:putList>. + + Insert a template. +

+

+ Insert a template with the possibility to pass parameters (called + attributes). A template can be seen as a procedure that can take parameters + or attributes. <tiles:insertTemplate> allows to define + these attributes and pass them to the inserted jsp page, called template. + Attributes are defined using nested tag + <tiles:putAttribute> or + <tiles:putListAttribute>. +

+

+ You must specify template attribute, for inserting a template +

+ +

+ Example :

-

You must specify

  • template attribute, for inserting a template

    - -

    Example :

    +
    -        
    -          <tiles:insertTemplate template="/basic/myLayout.jsp" flush="true">
    -             <tiles:put name="title" value="My first page" />
    -             <tiles:put name="header" value="/common/header.jsp" />
    -             <tiles:put name="footer" value="/common/footer.jsp" />
    -             <tiles:put name="menu" value="/basic/menu.jsp" />
    -             <tiles:put name="body" value="/basic/helloBody.jsp" />
    -          </tiles:insert>
    -        
    +      <code>
    +                <tiles:insertTemplate template="/basic/myLayout.jsp" flush="true">
    +                   <tiles:putAttribute name="title" value="My first page" />
    +                   <tiles:putAttribute name="header" value="/common/header.jsp" />
    +                   <tiles:putAttribute name="footer" value="/common/footer.jsp" />
    +                   <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
    +                   <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
    +                </tiles:insertTemplate>
    +              </code>
           
    ]]> + insertTemplate + org.apache.tiles.jsp.taglib.InsertTemplateTag + scriptless + + + template true true + java.lang.String + + - A string representing the URI of a template (for example, a JSP - page). -

    +
    + templateType + false + true + java.lang.String
    - flush - false - false - boolean - True or false. If true, current page out stream is flushed - before insertion.

    +
    -
    - - ignore + templateExpression false true - boolean + java.lang.String + + - If this attribute is set to true, and the attribute specified by the - name does not exist, simply return without writing anything. The - default value is false, which will cause a runtime exception to be - thrown.

    +
    -
    - role false true + java.lang.String + + - If the user is in the specified role, the tag is taken into account; - otherwise, the tag is ignored (skipped).

    +
    + preparer + false + true + java.lang.String
    - - preparer + + true, the response will be flushed after the insert. + ]]> + + flush false true - - The fully qualified class name of the preparer. - + boolean - insertDefinition - org.apache.tiles.jsp.taglib.InsertDefinitionTag - JSP - Insert a definition.

    -

    Insert a definition with the possibility to override and specify - parameters (called attributes). - A definition can be seen as a (partially or totally) filled template that - can override or complete attribute values. - <tiles:insertDefinition> allows to define these attributes - and pass them to the inserted jsp page, called template. - Attributes are defined using nested tag <tiles:put> or - <tiles:putList>. + + Insert a definition. +

    +

    + Insert a definition with the possibility to override and specify parameters + (called attributes). A definition can be seen as a (partially or totally) + filled template that can override or complete attribute values. + <tiles:insertDefinition> allows to define these attributes + and pass them to the inserted jsp page, called template. Attributes are + defined using nested tag <tiles:putAttribute> or + <tiles:putListAttribute>. +

    +

    + You must specify name tag attribute, for inserting a definition + from definitions factory. +

    +

    + Example :

    -

    You must specify name tag attribute, for inserting a definition from - definitions factory.

    -

    Example :

    +
    -        
    -          <tiles:insertDefinition name=".my.tiles.defininition flush="true">
    -             <tiles:put name="title" value="My first page" />
    -             <tiles:put name="header" value="/common/header.jsp" />
    -             <tiles:put name="footer" value="/common/footer.jsp" />
    -             <tiles:put name="menu" value="/basic/menu.jsp" />
    -             <tiles:put name="body" value="/basic/helloBody.jsp" />
    -          </tiles:insertDefinition>
    -        
    +      <code>
    +                <tiles:insertDefinition name=".my.tiles.defininition flush="true">
    +                   <tiles:putAttribute name="title" value="My first page" />
    +                   <tiles:putAttribute name="header" value="/common/header.jsp" />
    +                   <tiles:putAttribute name="footer" value="/common/footer.jsp" />
    +                   <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
    +                   <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
    +                </tiles:insertDefinition>
    +              </code>
           
    ]]>
    + insertDefinition + org.apache.tiles.jsp.taglib.InsertDefinitionTag + scriptless + + + name true true + java.lang.String + + - Name of the definition to insert.

    +
    + template + false + true + java.lang.String
    - flush - false - false - boolean - True or false. If true, current page out stream is flushed - before insertion.

    +
    -
    - - ignore + templateType false true - boolean + java.lang.String + + - If this attribute is set to true, and the attribute specified by the - name does not exist, simply return without writing anything. The - default value is false, which will cause a runtime exception to be - thrown.

    +
    + templateExpression + false + true + java.lang.String
    + + + role false true + java.lang.String + + - If the user is in the specified role, the tag is taken into account; - otherwise, the tag is ignored (skipped).

    +
    + preparer + false + true + java.lang.String
    - - preparer + + true, the response will be flushed after the insert. + ]]> + + flush false true - - The fully qualified class name of preparer. - + boolean
    - insertAttribute - org.apache.tiles.jsp.taglib.InsertAttributeTag - JSP - Inserts the value of an attribute into the page.

    -

    This tag can be flexibly used to insert the value of an attribute into a page. - As in other usages in Tiles, every attribute can be determined to have a "type", - either set explicitly when it was defined, or "computed". If the type is not explicit, then - if the attribute value is a valid definition, it will be inserted as such. Otherwise, - if it begins with a "/" character, it will be treated as a "template". Finally, if it - has not otherwise been assigned a type, it will be treated as a String and included without - any special handling.

    - -

    Example :

    -
    -        
    -          
    -        
    -      
    + + Declare a list that will be pass as an attribute. +

    +

    + Declare a list that will be pass as an attribute . List elements are added + using the tag 'addAttribute' or 'addListAttribute'. This tag can only be used + inside 'insertTemplate', 'insertDefinition' or 'definition' tag. +

    ]]>
    + addListAttribute + org.apache.tiles.jsp.taglib.AddListAttributeTag + scriptless - name - false - true - Name of the attribute to insert. This attribute will be ignored if - the value attribute is specified.

    +
    + role + false + true + java.lang.String
    +
    + + + + Import attribute(s) in specified context. +

    +

    + Import attribute(s) to requested scope. Attribute name and scope are + optional. If not specified, all attributes are imported in page scope. Once + imported, an attribute can be used as any other beans from jsp contexts. +

    + ]]> +
    + importAttribute + org.apache.tiles.jsp.taglib.ImportAttributeTag + empty - value + + null, all the attributes will be imported. + ]]> + + name false true - java.lang.Object + java.lang.String + + - Attribute object to render directly. If it specified, the name - attribute will be ignored.

    + null, the import will go in page scope. ]]>
    + scope + false + true + java.lang.String
    - flush - false - false - boolean - True or false. If true, current page out stream is flushed - before insertion.

    + name. If + null, the value of name will be used. ]]>
    + toName + false + true + java.lang.String
    + + true, if the attribute is not present, the + problem will be ignored. + ]]> + ignore false true boolean - + +
    + + If this attribute is set to true, and the attribute specified by the - name does not exist, simply return without writing anything. The - default value is false, which will cause a runtime exception to be - thrown.

    +

    + Declare a list that will be pass as attribute to tile. +

    +

    + Declare a list that will be pass as attribute to tile. List elements are + added using the tags 'addAttribute' or 'addListAttribute'. This tag can only + be used inside 'insertTemplate', 'insertDefinition', 'definition' tags. +

    + ]]> +
    + putListAttribute + org.apache.tiles.jsp.taglib.PutListAttributeTag + scriptless + + + + name + true + true + java.lang.String + + + role false true + java.lang.String + + - If the user is in the specified role, the tag is taken into account; - otherwise, the tag is ignored (skipped).

    + true, the list attribute will use, as first elements, the + list contained in the list attribute, put with the same name, of the containing definition. ]]>
    + inherit + false + true + boolean
    - preparer + + true the attribute will be cascaded to all nested attributes. + ]]> + + cascade false true - - The fully qualified name of the preparer. - + boolean
    - definition - org.apache.tiles.jsp.taglib.definition.DefinitionTag - JSP Create a definition at runtime. -

    -

    Create a new definition at runtime. - Newly created definition will be available across the entire request. -

    ]]> -
    +

    + Create a definition at runtime. +

    +

    + Create a new definition at runtime. Newly created definition will be + available across the entire request. +

    + ]]> + + definition + org.apache.tiles.jsp.taglib.DefinitionTag + scriptless - name - true - true - Specifies the name under which the newly created definition bean - will be saved.

    +
    + name + false + true + java.lang.String
    + + + template false true + java.lang.String + + - A string representing the URI of a template - (a JSP page).

    +
    -
    - role false true + java.lang.String + + - Role to check before inserting this definition. If role is not - defined for current user, definition is not inserted. Checking is - done at insert time, not during definition process.

    +
    -
    - extends false true + java.lang.String + + - Name of a parent definition that is used to initialize this new - definition. Parent definition is searched in definitions factory.

    +
    -
    - preparer false true - - Specifies the preparer name to use. The specified preparer will - be executed before rendering this newly created definition.

    - ]]> -
    + java.lang.String
    - putAttribute - org.apache.tiles.jsp.taglib.PutAttributeTag - JSP - Put an attribute in enclosing attribute container tag.

    -

    - Enclosing attribute container tag can be : -

      -
    • <initContainer>
    • -
    • <definition>
    • -
    • <insertAttribute>
    • -
    • <insertDefinition>
    • -
    • <putListAttribute>
    • -
    - (or any other tag which implements the {@link PutAttributeTagParent} interface. - Exception is thrown if no appropriate tag can be found.

    -

    Put tag can have following atributes : -

      -
    • name : Name of the attribute
    • -
    • value : value to put as attribute
    • -
    • type : value type. Only valid if value is a String and is set by - value="something" or by a bean. - Possible type are : string (value is used as direct string), - template (value is used as a page url to insert), - definition (value is used as a definition name to insert)
    • -
    • direct : Specify if value is to be used as a direct string or as a - page url to insert. This is another way to specify the type. It only apply - if value is set as a string, and type is not present.
    • -
    • beanName : Name of a bean used for setting value. Only valid if value is not set. - If property is specified, value come from bean's property. Otherwise, bean - itself is used for value.
    • -
    • beanProperty : Name of the property used for retrieving value.
    • -
    • beanScope : Scope containing bean.
    • -
    • role : Role to check when 'insert' will be called. If enclosing tag is - <insert>, role is checked immediately. If enclosing tag is - <definition>, role will be checked when this definition will be - inserted.
    • -

    -

    Value can also come from tag body. Tag body is taken into account only if - value is not set by one of the tag attributes. In this case Attribute type is - "string", unless tag body define another type.

    +
    + setCurrentContainer + org.apache.tiles.jsp.taglib.SetCurrentContainerTag + empty - name - true - true - Name of the attribute.

    + null, the default one will be used. ]]>
    -
    - - value + containerKey false true - java.lang.Object - + java.lang.String + +
    + + Attribute value. Could be a String or an Object. - Value can come from a direct assignment (value="aValue") or from a bean. - One of 'value' 'content' or 'beanName' must be present.

    +

    + Inserts the value of an attribute into the page. +

    +

    + This tag can be flexibly used to insert the value of an attribute into a + page. As in other usages in Tiles, every attribute can be determined to have + a "type", either set explicitly when it was defined, or "computed". If the + type is not explicit, then if the attribute value is a valid definition, it + will be inserted as such. Otherwise, if it begins with a "/" character, it + will be treated as a "template". Finally, if it has not otherwise been + assigned a type, it will be treated as a String and included without any + special handling. +

    + +

    + Example : +

    + +
    +      <code>
    +                <tiles:insertAttribute name="body" />
    +              </code>
    +      
    + ]]> +
    + insertAttribute + org.apache.tiles.jsp.taglib.InsertAttributeTag + scriptless + + + true, if an exception happens during + rendering, of if the attribute is null, the problem will be ignored. ]]> + ignore + false + true + boolean - type - false - false - Specify content type: string, template or definition.

    -
      -
    • String : Content is printed directly.
    • -
    • template : Content is included from specified URL. Value is used as an URL.
    • -
    • definition : Value is the name of a definition defined in factory (xml file). Definition will be searched - in the inserted tile, in a <tiles:insert attribute="attributeName"> tag, where 'attributeName' - is the name used for this tag.
    • -
    +
    + preparer + false + true + java.lang.String
    + + + role false true + java.lang.String + + - - If the user is in the specified role, the tag is taken into account; - otherwise, the tag is ignored (skipped). -

    +
    + defaultValue + false + true + java.lang.Object
    -
    - - putListAttribute - org.apache.tiles.jsp.taglib.PutListAttributeTag - JSP - - Declare a list that will be pass as attribute to tile. -

    -

    Declare a list that will be pass as attribute to tile. - List elements are added using the tag 'add'. - This tag can only be used inside 'insert' or 'definition' tag.

    - ]]> -
    - name - true - true - Name of the list.

    +
    -
    -
    - - addAttribute - - org.apache.tiles.jsp.taglib.AddAttributeTag - JSP - - Add an element to the surrounding list. - Equivalent to 'put', but for list element.

    - -

    Add an element to the surrounding list. - This tag can only be used inside putList tag. - Value can come from a direct assignment (value="aValue") or from a bean. - One of 'value' or 'beanName' must be present.

    - ]]> -
    - - value + defaultValueRole false true - java.lang.Object + java.lang.String + + - Attribute value. Can be a String or Object.

    + -
    + + defaultValueType + false + true + java.lang.String
    - type - false - false - Specify content type: string, template or definition.

    -
      -
    • String : Content is printed directly.
    • -
    • template : Content is included from specified URL. Value is used as an URL.
    • -
    • definition : Value denote a definition defined in factory (xml file). Definition will be searched - in the inserted tile, in a <insert attribute="attributeName"> tag, where 'attributeName' - is the name used for this tag.
    • -
    +
    + name + false + true + java.lang.String
    - role + + + + value false true + org.apache.tiles.Attribute + + - If the user is in the specified role, the tag is taken into account; - otherwise, the tag is ignored (skipped).

    -

    The role isn't taken into account if <add> - tag is used in a definition.

    + true, the response will be flushed after the insert. ]]>
    + flush + false + true + boolean
    - addListAttribute - org.apache.tiles.jsp.taglib.AddListAttributeTag - JSP - - Declare a list that will be pass as attribute to tile. -

    -

    Declare a list that will be pass as attribute to tile. - List elements are added using the tag 'add'. - This tag can only be used inside 'insert' or 'definition' tag.

    - ]]> -
    -
    - - getAsString - org.apache.tiles.jsp.taglib.GetAsStringTag - empty - - Render the value of the specified template attribute to the current JspWriter -

    - -

    Retrieve the value of the specified template attribute - property, and render it to the current JspWriter as a String. - The usual toString() conversions is applied on found value.

    -

    Throw a JSPException if named value is not found.

    + + Add an element to the surrounding list. Equivalent to 'putAttribute', + but for list element. +

    + +

    + Add an element to the surrounding list. This tag can only be used inside + 'putListAttribute' or 'addListAttribute' tags. Value can come from a direct + assignment (value="aValue") +

    ]]>
    + addAttribute + org.apache.tiles.jsp.taglib.AddAttributeTag + scriptless - name - true - true - Attribute name.

    +
    -
    - - ignore + value false true - boolean + java.lang.Object + + - - If this attribute is set to true, and the attribute specified by the name - does not exist, simply return without writing anything. The default value is false, which will - cause a runtime exception to be thrown. -

    +
    + expression + false + true + java.lang.String
    + + + role false true + java.lang.String + + - - If the user is in the specified role, the tag is taken into account; - otherwise, the tag is ignored (skipped). -

    +
    + type + false + true + java.lang.String
    - useAttribute - org.apache.tiles.jsp.taglib.UseAttributeTag - org.apache.tiles.jsp.taglib.UseAttributeTag$Tei - empty - Use attribute value inside page.

    -

    Declare a Java variable, and an attribute in the specified scope, - using tile attribute value.

    -

    Java variable and attribute will have the name specified by 'id', - or the original name if not specified.

    + + Put an attribute in enclosing attribute container tag. +

    +

    + Enclosing attribute container tag can be : +

      +
    • <initContainer>
    • +
    • <definition>
    • +
    • <insertAttribute>
    • +
    • <insertDefinition>
    • +
    • <putListAttribute>
    • +
    + (or any other tag which implements the PutAttributeTagParent + interface. Exception is thrown if no appropriate tag can be found. +

    +

    + Put tag can have following atributes : +

      +
    • name : Name of the attribute
    • +
    • value : value to put as attribute
    • +
    • type : value type. Possible type are : string (value is used as direct + string), template (value is used as a page url to insert), definition (value + is used as a definition name to insert), object (value is used as it is)
    • +
    • role : Role to check when 'insertAttribute' will be called.
    • +
    +

    +

    + Value can also come from tag body. Tag body is taken into account only if + value is not set by one of the tag attributes. In this case Attribute type is + "string", unless tag body define another type. +

    ]]>
    + putAttribute + org.apache.tiles.jsp.taglib.PutAttributeTag + scriptless - id - false - true - Declared attribute and variable name.

    +
    + name + true + true + java.lang.String
    - classname - false - true - Class of the declared variable.

    +
    + value + false + true + java.lang.Object
    - scope - false - false - Scope of the declared attribute. Default to 'page'.

    +
    + expression + false + true + java.lang.String
    - name - true - true - Tile's attribute name.

    +
    + role + false + true + java.lang.String
    - ignore + + + + type false true - boolean + java.lang.String + + - - If this attribute is set to true, and the attribute specified by the name - does not exist, simply return without error. The default value is false, which will - cause a runtime exception to be thrown. -

    + true the attribute will be cascaded to all nested attributes. ]]>
    + cascade + false + true + boolean
    - importAttribute - org.apache.tiles.jsp.taglib.ImportAttributeTag - empty - Import Tile's attribute in specified context.

    -

    Import attribute from tile to requested scope. - Attribute name and scope are optional. If not specified, all tile - attributes are imported in page scope. - Once imported, an attribute can be used as any other beans from jsp - contexts.

    + + Render the value of the specified template attribute to the current + Writer +

    + +

    + Retrieve the value of the specified template attribute property, and render + it to the current Writer as a String. The usual toString() conversions is + applied on found value. +

    ]]>
    + getAsString + org.apache.tiles.jsp.taglib.GetAsStringTag + scriptless - name + + true, if an exception happens during + rendering, of if the attribute is null, the problem will be ignored. + ]]> + + ignore false true + boolean + + - Tile's attribute name. If not specified, all attributes are - imported.

    +
    + preparer + false + true + java.lang.String
    - toName + + + + role false true + java.lang.String + + - Name of the destination attribute. If not specified, the name will - be the same as specified in name attribute

    +
    + defaultValue + false + true + java.lang.Object
    - scope - false - false - Scope into which attribute is imported. Default to page.

    +
    + defaultValueRole + false + true + java.lang.String
    - ignore + + + + defaultValueType false true - boolean + java.lang.String + + - If this attribute is set to true, and the attribute specified by - the name does not exist, simply return without error. The default - value is false, which will cause a runtime exception to be thrown.

    +
    + name + true + true + java.lang.String
    -
    - - initContainer - org.apache.tiles.jsp.taglib.definition.InitContainerTag - JSP - - Initialize the TilesContainer.

    -

    - In order to use the Tiles system, a TilesContainer must be instantiated. - This initialization is generally done by the TilesListener (or perhaps the - TilesServlet or TilesFilter). -

    -

    - If the intialization needs to be dynamic, you can initialize the container using - this tag. Realize however, that this tag MUST be executed prior to invoking - any other definitions. Additionally, the initilization may only be done once, - and any subsequent invocations will be ignored. -

    - ]]> -
    - containerFactory + + + + value false true - Container Factory implementation used to instantiate the container.

    ]]>
    + org.apache.tiles.Attribute
    - - - destroyContainer - org.apache.tiles.jsp.taglib.definition.DestroyContainerTag - empty - - Destroy the TilesContainer.

    - ]]> -
    -
    - diff --git a/core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/web.xml b/core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/web.xml index c493f5e277c..b93f76fa73b 100644 --- a/core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/web.xml +++ b/core/org.wso2.carbon.ui/src/main/resources/web/WEB-INF/web.xml @@ -20,15 +20,15 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> - - TilesServlet - org.apache.tiles.web.startup.TilesServlet - - 0 - + + + + + + + + + org.apache.tiles.context.TilesContextFactory diff --git a/core/org.wso2.carbon.user.core/pom.xml b/core/org.wso2.carbon.user.core/pom.xml index 49b6921356d..66f269b6765 100644 --- a/core/org.wso2.carbon.user.core/pom.xml +++ b/core/org.wso2.carbon.user.core/pom.xml @@ -147,6 +147,7 @@ + org.apache.maven.plugins maven-resources-plugin @@ -201,6 +202,10 @@ *;resolution:=optional * + + osgi.service;objectClass=org.wso2.carbon.user.core.service.RealmService, + osgi.service;objectClass=org.wso2.carbon.user.api.UserRealmService + diff --git a/core/org.wso2.carbon.utils/pom.xml b/core/org.wso2.carbon.utils/pom.xml index 105c4f86851..a9b425c6fb5 100644 --- a/core/org.wso2.carbon.utils/pom.xml +++ b/core/org.wso2.carbon.utils/pom.xml @@ -277,6 +277,9 @@ *;resolution:=optional * + + osgi.service;objectClass=org.wso2.carbon.context.CarbonCoreInitializedEvent + diff --git a/core/pom.xml b/core/pom.xml index 6bb05edaff8..69091320fc8 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -113,7 +113,7 @@ org.wso2.carbon.registry.api org.wso2.carbon.user.api org.wso2.carbon.osgi.security - org.wso2.carbon.registry.xboot + org.wso2.carbon.queuing org.wso2.carbon.utils org.wso2.carbon.securevault @@ -147,7 +147,7 @@ org.wso2.carbon.ndatasource.common org.wso2.carbon.ndatasource.core org.wso2.carbon.ndatasource.rdbms - org.wso2.carbon.framework.exporter + org.wso2.carbon.pax-logging-log4j2-plugins org.wso2.carbon.hazelcast admin-advisory-mgt diff --git a/core/server-role-manager/org.wso2.carbon.roles.mgt/pom.xml b/core/server-role-manager/org.wso2.carbon.roles.mgt/pom.xml index f8f3b9cffe8..80977322788 100644 --- a/core/server-role-manager/org.wso2.carbon.roles.mgt/pom.xml +++ b/core/server-role-manager/org.wso2.carbon.roles.mgt/pom.xml @@ -53,7 +53,7 @@ org.eclipse.osgi - org.wso2.eclipse.osgi + org.eclipse.platform org.eclipse.osgi.services diff --git a/core/server-role-manager/pom.xml b/core/server-role-manager/pom.xml index d0713c6c944..93b50b7a8b5 100644 --- a/core/server-role-manager/pom.xml +++ b/core/server-role-manager/pom.xml @@ -21,6 +21,7 @@ org.wso2.carbon carbon-kernel 4.10.16-SNAPSHOT + ../pom.xml 4.0.0 diff --git a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature-licensed/1.0.0/pom.xml b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature-licensed/1.0.0/pom.xml index 0b6f33897d9..e6a838d4413 100644 --- a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature-licensed/1.0.0/pom.xml +++ b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature-licensed/1.0.0/pom.xml @@ -27,6 +27,7 @@ org.wso2.maven carbon-p2-plugin + true p2-feature-generation @@ -53,4 +54,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature-unlicensed/pom.xml b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature-unlicensed/pom.xml index c9cf236862e..8388b4c960d 100644 --- a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature-unlicensed/pom.xml +++ b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature-unlicensed/pom.xml @@ -27,6 +27,7 @@ org.wso2.maven carbon-p2-plugin + true p2-feature-generation @@ -58,4 +59,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature1/1.0.0/pom.xml b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature1/1.0.0/pom.xml index 7f8187a9b7b..655aeb45d60 100644 --- a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature1/1.0.0/pom.xml +++ b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature1/1.0.0/pom.xml @@ -27,6 +27,7 @@ org.wso2.maven carbon-p2-plugin + true p2-feature-generation @@ -53,4 +54,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature1/1.0.1/pom.xml b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature1/1.0.1/pom.xml index 25b166f0d72..07684207b5b 100644 --- a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature1/1.0.1/pom.xml +++ b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature1/1.0.1/pom.xml @@ -27,6 +27,7 @@ org.wso2.maven carbon-p2-plugin + true p2-feature-generation @@ -53,4 +54,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature2/1.0.0/pom.xml b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature2/1.0.0/pom.xml index d6e712a36ff..4f40094132f 100644 --- a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature2/1.0.0/pom.xml +++ b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature2/1.0.0/pom.xml @@ -39,6 +39,7 @@ org.wso2.maven carbon-p2-plugin + true p2-feature-generation @@ -68,4 +69,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature2/1.0.1/pom.xml b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature2/1.0.1/pom.xml index d8e43cb522f..d921f2f54b9 100644 --- a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature2/1.0.1/pom.xml +++ b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature2/1.0.1/pom.xml @@ -39,6 +39,7 @@ org.wso2.maven carbon-p2-plugin + true p2-feature-generation @@ -68,4 +69,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature3/1.0.0/pom.xml b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature3/1.0.0/pom.xml index 9fcdcd519c9..795f85abcc1 100644 --- a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature3/1.0.0/pom.xml +++ b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature3/1.0.0/pom.xml @@ -39,6 +39,7 @@ org.wso2.maven carbon-p2-plugin + true p2-feature-generation @@ -70,4 +71,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature3/1.0.1/pom.xml b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature3/1.0.1/pom.xml index 97b2d3d55b1..179530c0d2e 100644 --- a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature3/1.0.1/pom.xml +++ b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/feature3/1.0.1/pom.xml @@ -39,6 +39,7 @@ org.wso2.maven carbon-p2-plugin + true p2-feature-generation @@ -70,4 +71,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/licensed-unlicensed-features/pom.xml b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/licensed-unlicensed-features/pom.xml index 982c6bbe3d1..5836bd93643 100644 --- a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/licensed-unlicensed-features/pom.xml +++ b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/features/licensed-unlicensed-features/pom.xml @@ -33,6 +33,7 @@ org.wso2.maven carbon-p2-plugin + true p2-feature-generation @@ -59,4 +60,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/repository/pom.xml b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/repository/pom.xml index b8b501f7abe..7410b3d5fdc 100644 --- a/distribution/integration/test-common/common-artifacts/sample-feature-repo1/repository/pom.xml +++ b/distribution/integration/test-common/common-artifacts/sample-feature-repo1/repository/pom.xml @@ -19,6 +19,7 @@ org.wso2.maven carbon-p2-plugin + true 2-p2-repo-generation @@ -67,4 +68,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/tests-integration/tests/pom.xml b/distribution/integration/tests-integration/tests/pom.xml index dd54bb8ce2b..5949405f246 100644 --- a/distribution/integration/tests-integration/tests/pom.xml +++ b/distribution/integration/tests-integration/tests/pom.xml @@ -24,7 +24,7 @@ maven-surefire-plugin false - -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m + -Xmx1024m org.wso2.carbon org.wso2.carbon.server.admin.ui @@ -389,6 +406,12 @@ org.wso2.carbon.automationutils org.wso2.carbon.integration.common.utils 4.4.1 + + + org.slf4j + log4j-over-slf4j + + org.apache.logging.log4j @@ -410,4 +433,4 @@ - \ No newline at end of file + diff --git a/distribution/integration/tests-integration/tests/src/test/java/org/wso2/carbon/integration/tests/carbontools/CarbonServerBasicOperationTestCase.java b/distribution/integration/tests-integration/tests/src/test/java/org/wso2/carbon/integration/tests/carbontools/CarbonServerBasicOperationTestCase.java index 1cb445b49d5..af8c7b7a2e2 100755 --- a/distribution/integration/tests-integration/tests/src/test/java/org/wso2/carbon/integration/tests/carbontools/CarbonServerBasicOperationTestCase.java +++ b/distribution/integration/tests-integration/tests/src/test/java/org/wso2/carbon/integration/tests/carbontools/CarbonServerBasicOperationTestCase.java @@ -35,7 +35,6 @@ import org.wso2.carbon.integration.tests.common.utils.CarbonIntegrationBaseTest; import org.wso2.carbon.integration.tests.common.utils.CarbonIntegrationConstants; import org.wso2.carbon.utils.ServerConstants; -import sun.management.VMManagement; import javax.xml.xpath.XPathExpressionException; import java.io.BufferedReader; @@ -208,17 +207,11 @@ public void testCarbonDumpCommandOnWindows() throws Exception { if (CarbonCommandToolsUtil.getCurrentOperatingSystem(). contains(OperatingSystems.WINDOWS.name().toLowerCase())) { - RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean(); - Field jvmField = runtimeMXBean.getClass().getDeclaredField("jvm"); - jvmField.setAccessible(true); - VMManagement vmManagement = (VMManagement) jvmField.get(runtimeMXBean); - Method getProcessIdMethod = vmManagement.getClass().getDeclaredMethod("getProcessId"); - getProcessIdMethod.setAccessible(true); - Integer processId = (Integer) getProcessIdMethod.invoke(vmManagement); + long pid = ProcessHandle.current().pid(); String[] cmdArray = new String[] {"cmd.exe", "/c", "carbondump.bat", "-carbonHome" - , carbonHome, "-pid", Integer.toString(processId)}; + , carbonHome, "-pid", Long.toString(pid)}; processDump = CarbonCommandToolsUtil.runScript(carbonHome + "/bin", cmdArray); assertTrue(isDumpFileFound(carbonHome), "Couldn't find the dump file"); } else { diff --git a/distribution/kernel/carbon-home/bin/wso2server.sh b/distribution/kernel/carbon-home/bin/wso2server.sh index b92f2d6a1d5..6e7b85dbf48 100755 --- a/distribution/kernel/carbon-home/bin/wso2server.sh +++ b/distribution/kernel/carbon-home/bin/wso2server.sh @@ -288,7 +288,7 @@ echo "Using Java memory options: $JVM_MEM_OPTS" #To monitor a Carbon server in remote JMX mode on linux host machines, set the below system property. # -Djava.rmi.server.hostname="your.IP.goes.here" -JAVA_VER_BASED_OPTS="--add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-opens=java.base/sun.security.x509=ALL-UNNAMED" +JAVA_VER_BASED_OPTS="--add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-opens=java.base/sun.security.x509=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED" if [ $java_version_formatted -ge 1700 ]; then JAVA_VER_BASED_OPTS=$JAVA_VER_BASED_OPTS" --add-opens=java.naming/com.sun.jndi.ldap=ALL-UNNAMED" diff --git a/distribution/kernel/pom.xml b/distribution/kernel/pom.xml index aeeaec720fa..67ac1d22d4a 100644 --- a/distribution/kernel/pom.xml +++ b/distribution/kernel/pom.xml @@ -165,38 +165,14 @@ org.jvnet.staxex stax-ex + - - org.apache.maven.plugins - maven-dependency-plugin - false - - - unpack-equinox-executable - test - - unpack - - - - - org.eclipse.equinox - org.eclipse.equinox.executable - 3.5.0.v20110530-7P7NFUFFLWUl76mart - zip - true - target - - - - - - org.wso2.maven carbon-p2-plugin + true p2-repo-generation @@ -217,6 +193,7 @@ org.wso2.carbon:org.wso2.carbon.core.runtime.feature:${carbon.kernel.version} + true @@ -228,9 +205,6 @@ ${basedir}/carbon.product - - ${basedir}/target/org.eclipse.equinox.executable_3.5.0.v20110530-7P7NFUFFLWUl76mart - file:${basedir}/target/p2-repo file:${basedir}/target/p2-repo diff --git a/distribution/product/modules/features/org.wso2.carbon.styles.feature/pom.xml b/distribution/product/modules/features/org.wso2.carbon.styles.feature/pom.xml index cefc2bed31a..a8867c95f68 100644 --- a/distribution/product/modules/features/org.wso2.carbon.styles.feature/pom.xml +++ b/distribution/product/modules/features/org.wso2.carbon.styles.feature/pom.xml @@ -42,6 +42,7 @@ org.wso2.maven carbon-p2-plugin + true p2-feature-generation diff --git a/distribution/product/modules/p2-profile-gen/pom.xml b/distribution/product/modules/p2-profile-gen/pom.xml index eb9de241eb2..db607617fa2 100644 --- a/distribution/product/modules/p2-profile-gen/pom.xml +++ b/distribution/product/modules/p2-profile-gen/pom.xml @@ -61,6 +61,7 @@ org.wso2.maven carbon-p2-plugin + true 2-p2-repo-generation @@ -80,6 +81,9 @@ org.wso2.ciphertool:org.wso2.ciphertool.feature:${version.ciphertool} + + + @@ -106,6 +110,10 @@ org.wso2.ciphertool.feature.group ${version.ciphertool} + + + + diff --git a/features/org.wso2.carbon.core.common.feature/pom.xml b/features/org.wso2.carbon.core.common.feature/pom.xml index 7800eaa204c..fd25411c8a7 100644 --- a/features/org.wso2.carbon.core.common.feature/pom.xml +++ b/features/org.wso2.carbon.core.common.feature/pom.xml @@ -36,6 +36,7 @@ org.wso2.maven carbon-p2-plugin + true 4-p2-feature-generation @@ -54,10 +55,7 @@ - org.eclipse.equinox:org.eclipse.equinox.http.servlet:${version.equinox.http.servlet} - - - org.eclipse.equinox:org.eclipse.equinox.http.helper:${version.equinox.http.helper} + org.eclipse.platform:org.eclipse.equinox.http.servlet:${version.equinox.http.servlet} org.wso2.orbit.org.apache.tomcat:tomcat-jsp-api:${orbit.version.tomcat.jsp.api} @@ -78,7 +76,7 @@ commons-pool.wso2:commons-pool:${orbit.version.commons.pool} org.apache.abdera.wso2:abdera:${orbit.version.abdera} org.apache.axis2.wso2:axis2:${orbit.version.axis2} - org.apache.tiles.wso2:tiles-jsp:${orbit.version.tiles} + org.wso2.orbit.org.apache.tiles:tiles-jsp:${orbit.version.tiles} org.wso2.orbit.org.apache.xmlbeans:xmlbeans:${version.xmlbeans} org.apache.ws.commons.axiom.wso2:axiom:${orbit.version.axiom} org.wso2.orbit.org.apache.neethi:neethi:${neethi.osgi.version} @@ -170,6 +168,11 @@ org.wso2.carbon.crypto:org.wso2.carbon.crypto.provider:${carbon.crypto.version} org.wso2.orbit.sun.xml.bind:jaxb:${version.org.wso2.orbit.javax.xml.bind.jaxb} + + org.wso2.orbit.javax.activation:activation:1.1.1.wso2v4 + + + javax.xml.soap:javax.xml.soap-api:1.4.0 diff --git a/features/org.wso2.carbon.core.feature/pom.xml b/features/org.wso2.carbon.core.feature/pom.xml index 6e98f82386e..17cf4169b8d 100644 --- a/features/org.wso2.carbon.core.feature/pom.xml +++ b/features/org.wso2.carbon.core.feature/pom.xml @@ -49,6 +49,7 @@ org.wso2.maven carbon-p2-plugin + true 4-p2-feature-generation diff --git a/features/org.wso2.carbon.core.runtime.feature/pom.xml b/features/org.wso2.carbon.core.runtime.feature/pom.xml index 5e5d5c0226f..fcb871d0130 100644 --- a/features/org.wso2.carbon.core.runtime.feature/pom.xml +++ b/features/org.wso2.carbon.core.runtime.feature/pom.xml @@ -38,19 +38,24 @@ org.eclipse.osgi - org.wso2.eclipse.osgi + org.eclipse.platform org.eclipse.osgi.services + + + + + - org.wso2.eclipse.equinox - org.eclipse.equinox.launcher.gtk.linux.x86 + org.eclipse.platform + org.eclipse.equinox.launcher.gtk.linux.x86_64 - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.common - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.simpleconfigurator @@ -58,31 +63,39 @@ org.wso2.carbon.osgi.security - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.util - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.ds - org.wso2.eclipse.equinox + org.eclipse.platform + org.eclipse.osgi.util + + + org.apache.felix + org.apache.felix.scr + + + org.eclipse.platform org.eclipse.equinox.launcher - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.app - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.concurrent - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.frameworkadmin - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.frameworkadmin.equinox @@ -102,119 +115,132 @@ org.apache.felix.gogo.runtime - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.artifact.repository - org.wso2.eclipse.equinox + org.tukaani + xz + + + org.eclipse.platform org.eclipse.equinox.p2.console - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.core - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.director - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.director.app - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.directorywatcher - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.engine - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.extensionlocation - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.garbagecollector - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.jarprocessor - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.metadata - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.metadata.repository - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.reconciler.dropins - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.repository.tools - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.repository - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.touchpoint.eclipse - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.touchpoint.natives - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.updatechecker - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.updatesite - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.publisher.eclipse - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.preferences - org.wso2.eclipse.equinox + org.osgi + org.osgi.service.prefs + + + + org.bouncycastle + bcpg-jdk18on + + + org.eclipse.platform org.eclipse.equinox.registry - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.security - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.simpleconfigurator.manipulator - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.publisher - org.eclipse.core + org.eclipse.platform org.eclipse.core.contenttype - org.eclipse.core + org.eclipse.platform org.eclipse.core.expressions - org.eclipse.core + org.eclipse.platform org.eclipse.core.jobs - org.eclipse.core + org.eclipse.platform org.eclipse.core.runtime @@ -242,7 +268,7 @@ org.sat4j.pb - org.eclipse.osgi + org.eclipse.platform org.eclipse.equinox.p2.transport.ecf @@ -253,6 +279,63 @@ org.wso2.eclipse.osgi org.eclipse.osgi.compatibility.state + + org.osgi + org.osgi.service.component + + + org.osgi + org.osgi.util.promise + + + org.osgi + org.osgi.util.function + + + org.osgi + org.osgi.service.cm + + + org.osgi + org.osgi.service.upnp + + + org.osgi + org.osgi.service.device + + + org.osgi + org.osgi.service.event + + + org.osgi + org.osgi.service.wireadmin + + + org.osgi + org.osgi.service.provisioning + + + org.osgi + org.osgi.service.useradmin + + + org.osgi + org.osgi.service.metatype + + + org.osgi + org.osgi.service.permissionadmin + + + org.osgi + org.osgi.service.http.whiteboard + + + org.eclipse.platform + org.eclipse.equinox.http.service.api + + @@ -260,6 +343,7 @@ org.wso2.maven carbon-p2-plugin + true 4-p2-feature-generation @@ -276,62 +360,79 @@ - org.wso2.eclipse.equinox:org.eclipse.equinox.common - org.wso2.eclipse.equinox:org.eclipse.equinox.simpleconfigurator + org.eclipse.platform:org.eclipse.equinox.common + org.eclipse.platform:org.eclipse.equinox.simpleconfigurator org.wso2.carbon:org.wso2.carbon.osgi.security - org.wso2.eclipse.equinox:org.eclipse.equinox.ds - org.wso2.eclipse.equinox:org.eclipse.equinox.launcher - org.wso2.eclipse.equinox:org.eclipse.equinox.util - org.wso2.eclipse.osgi:org.eclipse.osgi.services + org.eclipse.platform:org.eclipse.equinox.ds + + org.eclipse.platform:org.eclipse.equinox.launcher + org.eclipse.platform:org.eclipse.equinox.util + org.eclipse.platform:org.eclipse.osgi.services org.eclipse.platform:org.eclipse.osgi - org.eclipse.equinox:org.eclipse.equinox.app - org.wso2.eclipse.equinox:org.eclipse.equinox.concurrent - org.wso2.eclipse.equinox:org.eclipse.equinox.frameworkadmin - org.wso2.eclipse.equinox:org.eclipse.equinox.frameworkadmin.equinox - org.wso2.eclipse.equinox:org.eclipse.equinox.preferences - org.wso2.eclipse.equinox:org.eclipse.equinox.registry - org.wso2.eclipse.equinox:org.eclipse.equinox.security - org.wso2.eclipse.equinox:org.eclipse.equinox.simpleconfigurator.manipulator + org.eclipse.platform:org.eclipse.equinox.app + org.eclipse.platform:org.eclipse.equinox.concurrent + org.eclipse.platform:org.eclipse.equinox.frameworkadmin + org.eclipse.platform:org.eclipse.equinox.frameworkadmin.equinox + org.eclipse.platform:org.eclipse.equinox.preferences + org.osgi:org.osgi.service.prefs + org.bouncycastle:bcpg-jdk18on + org.eclipse.platform:org.eclipse.equinox.registry + org.eclipse.platform:org.eclipse.equinox.security + org.eclipse.platform:org.eclipse.equinox.simpleconfigurator.manipulator - + org.apache.felix:org.apache.felix.scr org.eclipse.platform:org.eclipse.equinox.console org.apache.felix:org.apache.felix.gogo.command org.apache.felix:org.apache.felix.gogo.runtime org.apache.felix:org.apache.felix.gogo.shell - org.eclipse.core:org.eclipse.core.contenttype - org.eclipse.core:org.eclipse.core.expressions - org.eclipse.core:org.eclipse.core.jobs - org.eclipse.core:org.eclipse.core.runtime + org.eclipse.platform:org.eclipse.core.contenttype + org.eclipse.platform:org.eclipse.core.expressions + org.eclipse.platform:org.eclipse.core.jobs + org.eclipse.platform:org.eclipse.core.runtime org.eclipse.ecf:org.eclipse.ecf org.eclipse.ecf:org.eclipse.ecf.filetransfer org.eclipse.ecf:org.eclipse.ecf.identity org.eclipse.ecf:org.eclipse.ecf.provider.filetransfer org.eclipse:org.sat4j.core org.eclipse:org.sat4j.pb - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.artifact.repository - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.console - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.core - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.director - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.engine - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.garbagecollector - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.jarprocessor - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.metadata - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.metadata.repository - org.eclipse.equinox:org.eclipse.equinox.p2.publisher - org.eclipse.equinox:org.eclipse.equinox.p2.touchpoint.eclipse - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.touchpoint.natives - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.updatechecker - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.director.app - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.directorywatcher - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.extensionlocation - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.repository.tools - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.repository - org.wso2.eclipse.equinox:org.eclipse.equinox.p2.updatesite - org.eclipse.equinox:org.eclipse.equinox.p2.publisher.eclipse - org.wso2.eclipse.equinox:org.eclipse.equinox.launcher.gtk.linux.x86 - org.eclipse.osgi:org.eclipse.equinox.p2.transport.ecf + org.eclipse.platform:org.eclipse.equinox.p2.artifact.repository + org.tukaani:xz + org.eclipse.platform:org.eclipse.equinox.p2.console + org.eclipse.platform:org.eclipse.equinox.p2.core + org.eclipse.platform:org.eclipse.equinox.p2.director + org.eclipse.platform:org.eclipse.equinox.p2.engine + org.eclipse.platform:org.eclipse.equinox.p2.garbagecollector + org.eclipse.platform:org.eclipse.equinox.p2.jarprocessor + org.eclipse.platform:org.eclipse.equinox.p2.metadata + org.eclipse.platform:org.eclipse.equinox.p2.metadata.repository + org.eclipse.platform:org.eclipse.equinox.p2.publisher + org.eclipse.platform:org.eclipse.equinox.p2.touchpoint.eclipse + org.eclipse.platform:org.eclipse.equinox.p2.touchpoint.natives + org.eclipse.platform:org.eclipse.equinox.p2.updatechecker + org.eclipse.platform:org.eclipse.equinox.p2.director.app + org.eclipse.platform:org.eclipse.equinox.p2.directorywatcher + org.eclipse.platform:org.eclipse.equinox.p2.extensionlocation + org.eclipse.platform:org.eclipse.equinox.p2.repository.tools + org.eclipse.platform:org.eclipse.equinox.p2.repository + org.eclipse.platform:org.eclipse.equinox.p2.updatesite + org.eclipse.platform:org.eclipse.equinox.p2.publisher.eclipse + org.eclipse.platform:org.eclipse.equinox.p2.transport.ecf + org.eclipse.platform:org.eclipse.equinox.http.service.api org.eclipse.ecf.provider.filetransfer:httpclient org.wso2.eclipse.osgi:org.eclipse.osgi.compatibility.state + org.osgi:org.osgi.service.component + org.osgi:org.osgi.util.promise + org.osgi:org.osgi.util.function + org.osgi:org.osgi.service.cm + org.osgi:org.osgi.service.upnp + org.osgi:org.osgi.service.device + org.osgi:org.osgi.service.event + org.osgi:org.osgi.service.wireadmin + org.osgi:org.osgi.service.provisioning + org.osgi:org.osgi.service.useradmin + org.osgi:org.osgi.service.metatype + org.osgi:org.osgi.service.permissionadmin + org.osgi:org.osgi.service.http.whiteboard diff --git a/features/org.wso2.carbon.core.server.feature/pom.xml b/features/org.wso2.carbon.core.server.feature/pom.xml index 09fe53142bc..0dd64348414 100644 --- a/features/org.wso2.carbon.core.server.feature/pom.xml +++ b/features/org.wso2.carbon.core.server.feature/pom.xml @@ -36,6 +36,7 @@ org.wso2.maven carbon-p2-plugin + true 4-p2-feature-generation diff --git a/features/org.wso2.carbon.core.ui.feature/pom.xml b/features/org.wso2.carbon.core.ui.feature/pom.xml index b7f69be7ae7..05bd5375a08 100644 --- a/features/org.wso2.carbon.core.ui.feature/pom.xml +++ b/features/org.wso2.carbon.core.ui.feature/pom.xml @@ -36,6 +36,7 @@ org.wso2.maven carbon-p2-plugin + true 4-p2-feature-generation @@ -54,6 +55,7 @@ org.eclipse.platform:org.eclipse.equinox.jsp.jasper:${version.equinox.jsp.jasper} + org.glassfish:jakarta.el:3.0.4 org.wso2.carbon:org.wso2.carbon.ui:${carbon.kernel.version} org.wso2.carbon:org.wso2.carbon.core.commons.stub:${carbon.kernel.version} org.wso2.carbon:org.wso2.carbon.ui.menu.general:${carbon.kernel.version} diff --git a/features/org.wso2.carbon.hazelcast.feature/pom.xml b/features/org.wso2.carbon.hazelcast.feature/pom.xml index 16c9d05df85..fc6d1289099 100644 --- a/features/org.wso2.carbon.hazelcast.feature/pom.xml +++ b/features/org.wso2.carbon.hazelcast.feature/pom.xml @@ -35,6 +35,7 @@ org.wso2.maven carbon-p2-plugin + true 4-p2-feature-generation diff --git a/parent/pom.xml b/parent/pom.xml index 19e820589a4..7710bf5b10b 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 1.8 + 17 @@ -80,7 +80,6 @@ org.apache.maven.plugins maven-compiler-plugin - ${maven.compiler.plugin.version} org.apache.maven.plugins @@ -108,10 +107,11 @@ org.apache.maven.plugins maven-compiler-plugin + 3.12.1 UTF-8 - 1.8 - 1.8 + 17 + 17 @@ -293,6 +293,11 @@ + + org.apache.maven.plugins + maven-resources-plugin + ${maven.resources.plugin.version} + @@ -306,75 +311,73 @@ [${carbon.kernel.version}, 5.0.0) - 1.1.200.v20160504-1450 - 3.8.0.v20160509-1230 - 1.4.400.v20160226-2036 - 1.3.200.v20160318-1642 - 1.0.500.v20130404-1337 - 1.3.100.v20130327-1442 - 1.1.0.v20130327-1442 - 2.0.300.v20160504-1450 - 1.0.700.v20160102-2223 - 3.6.0.v20160120-1756 - 3.6.0.v20150318-1503 - 1.2.100.v20150423-1356 - 2.0.200.v20160504-1450 - 1.1.400.v20160518-1444 - 3.9.0.v20130326-1255 - 3.5.100.v20160504-1419 - 3.14.0 - 3.4.200.v20130326-1255 - 3.4.500.v20130515-1343 - 3.5.300.v20130429-1813 - 1.3.300 + 1.5.200 + 3.19.0 + 1.6.200 + 1.6.700 + 1.1.300 + 1.7.0 + 1.3.0 + 2.3.100 + 1.3.100 + 3.11.0 + 3.12.0 + 1.4.200 + 2.3.100 + 1.1.800 + 3.31.0 + 3.12.0 + 3.19.0 + 3.9.300 + 3.9.300 + 3.15.200 + 1.4.700 1.0.200.v20160504-1419 - 3.2.0.v20130604-1622 - 5.0.0.v20130604-1622 - 3.2.0.v20130604-1622 - 3.2.0.v20130604-1622 + 3.11.0 + 5.1.103 + 3.10.0 + 3.3.0 2.3.5.v201308161310 2.3.5.v201308161310 2.3.0.v20110329 [1.9,2.0) [1.2.0,2.0) - 1.1.400.v20130418-1354 - 1.1.0.wso2v1 - 1.1.200 + 1.8.100 + + 1.2.0 3.0.0.v201112011016 2.2.0.v201108011116 2.2.0.v201112011158 - 2.2.2.v201205150955 - - 1.1.300.v20131211-1531 - 2.3.0.v20131211-1531 - 2.3.100.v20140224-1921 - 1.0.300.v20150129-0838 - 1.1.0.v20131211-1531 - 2.3.0.v20140506-1720 - 1.0.300.v20131113-1212 + + 1.5.300 + 2.11.0 + 2.6.300 + 1.3.300 + 1.4.300 + 2.10.0 + 1.3.300 - 1.2.100.v20131119-0908 - 1.0.200.v20131115-1210 - 1.0.300.v20131211-1531 - 2.2.0.v20131211-1531 - 1.2.100.v20131209-2144 - 1.1.200.v20131119-0908 - 2.1.0.v20131211-1531 - 2.3.0.v20131211-1531 - 2.1.0.v20110511-wso2v1 - - 1.1.100.v20140523-0116 - 1.1.200.v20131119-0908 - 1.0.400.v20131211-1531 - 0.10.0.v201212101605 - 0.10.0.v201209301036 - 0.10.0.v201209301215 - 1.0.0.v20110511 - 1.2.0.v20110511 - 1.0.100.v20110902-0807 + 1.5.300 + 1.3.200 + 1.3.300 + 2.9.0 + 1.5.300 + 1.5.300 + 2.4.300 + 2.8.100 + 2.4.200 + 1.5.200 + 1.4.200 + 1.3.200 + 1.1.4 + 1.1.6 + 1.1.2 + 1.6.0 + 1.9.100 + 1.4.200 4.0.200.v20120319-0616 - 5.1.2 + 5.2.50-SNAPSHOT 1.1.14 @@ -397,9 +400,9 @@ [1.2.1, 1.3.0) - 2.0.5.wso2v2 - 2.0.5 - [2.0.5, 2.2.0) + 3.0.7.wso2v2 + 3.0.7 + 2.2.wso2v1 @@ -455,7 +458,7 @@ 3.1.0.RELEASE - 1.6.1-wso2v76 + 1.6.1-wso2v98-SNAPSHOT [1.6.1, 1.7.0) ${version.axis2} ${version.axis2} @@ -489,10 +492,10 @@ 2.1.0-wso2v5 2.3.2 - 9.0.82 - ${version.tomcat}.wso2v1 - ${version.tomcat}.wso2v1 - ${version.tomcat}.wso2v1 + 9.0.85 + ${version.tomcat}.wso2v2 + ${version.tomcat}.wso2v2 + ${version.tomcat}.wso2v2 ${version.tomcat}.wso2v1 ${version.tomcat}.wso2v1 @@ -517,10 +520,6 @@ 10.3.2.1wso2v1 - - 1.5.10 - - 1.3.2 1.2 @@ -542,7 +541,7 @@ 1.16.0.wso2v1 0.1.0.wso2v1 3.1.0.wso2v1 - 1.5.0.wso2v2 + 1.5.0.wso2v3 1.5.0.wso2v2 1.8.wso2v1 @@ -551,7 +550,7 @@ 3.1.0.wso2v6 1.5.6.wso2v1 - 1.2.0.wso2v1 + 1.2.0.wso2v3 5.1.1.wso2v1 @@ -575,7 +574,6 @@ 1.0 1.2 1.0 - 2.2.0.v201108011116 0.3.3.wso2v1 3.3.5.wso2v1 2.1 @@ -591,7 +589,7 @@ 1.3 1.7.4 - 3.2.0 + 5.1.9 2.1.2 2.4 1.7 @@ -608,24 +606,24 @@ 9.0.65.wso2v1 - 1.5.10 + 2.0.13 1.0M9 2.4.1 2.9.0 - 4.4.3 - 6.10 + 4.4.11-SNAPSHOT + 7.10.1 1.5.5 - 0.8.2 - 2.22.0 - 2.22.0 - 2.23.4 - 2.0.2 + 0.8.12 + 3.3.0 + 3.3.0 + 5.3.1 + 3.3.1 - 3.1.0.wso2v4 + 3.1.0.wso2v5 [1.2.0,1.3.0) @@ -658,6 +656,7 @@ 4.5.13.wso2v1 [4.3.1.wso2v2,5.0.0) + @@ -673,193 +672,228 @@ ${version.equinox.osgi} - org.wso2.eclipse.osgi + org.eclipse.platform org.eclipse.osgi.services ${version.equinox.osgi.services} - org.wso2.eclipse.equinox + org.eclipse.platform + org.eclipse.osgi.util + 3.7.300 + + + org.apache.felix + org.apache.felix.scr + 2.2.10 + + + + org.eclipse.platform org.eclipse.equinox.common ${version.equinox.common} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.simpleconfigurator ${version.equinox.simpleconfigurator} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.util ${version.equinox.util} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.ds ${version.equinox.ds} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.launcher ${version.equinox.launcher} + + + + + + - org.wso2.eclipse.equinox - org.eclipse.equinox.launcher.gtk.linux.x86 - ${version.equinox.launcher.gtk.linux.x86} + org.eclipse.platform + org.eclipse.equinox.launcher.gtk.linux.x86_64 + 1.2.900 + - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.app ${version.equinox.app} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.concurrent ${version.equinox.concurrent} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.frameworkadmin ${version.equinox.frameworkadmin} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.frameworkadmin.equinox ${version.equinox.frameworkadmin.equinox} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.artifact.repository ${version.equinox.p2.artifact.repository} + + + org.tukaani + xz + 1.9 + - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.console ${version.equinox.p2.console} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.core ${version.equinox.p2.core} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.director ${version.equinox.p2.director} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.director.app ${version.equinox.p2.director.app} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.directorywatcher ${version.equinox.p2.directorywatcher} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.engine ${version.equinox.p2.engine} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.extensionlocation ${version.equinox.p2.extensionlocation} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.garbagecollector ${version.equinox.p2.garbagecollector} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.jarprocessor ${version.equinox.p2.jarprocessor} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.metadata ${version.equinox.p2.metadata} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.metadata.repository ${version.equinox.p2.metadata.repository} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.reconciler.dropins ${version.equinox.p2.reconciler.dropins} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.repository.tools ${version.equinox.p2.repository.tools} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.repository ${version.equinox.p2.repository} - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.touchpoint.eclipse ${version.equinox.p2.touchpoint.eclipse} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.touchpoint.natives ${version.equinox.p2.touchpoint.natives} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.updatechecker ${version.equinox.p2.updatechecker} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.updatesite ${version.equinox.p2.updatesite} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.preferences ${version.equinox.preferences} - org.wso2.eclipse.equinox + org.osgi + org.osgi.service.prefs + 1.1.2 + + + + org.bouncycastle + bcpg-jdk18on + 1.77 + + + org.eclipse.platform org.eclipse.equinox.registry ${version.equinox.registry} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.security ${version.equinox.security} - org.wso2.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.simpleconfigurator.manipulator ${version.equinox.simpleconfigurator.manipulator} - org.eclipse.core + org.eclipse.platform org.eclipse.core.contenttype ${version.equinox.core.contenttype} - org.eclipse.core + org.eclipse.platform org.eclipse.core.expressions ${version.equinox.core.expressions} - org.eclipse.core + org.eclipse.platform org.eclipse.core.jobs ${version.equinox.core.jobs} - org.eclipse.core + org.eclipse.platform org.eclipse.core.runtime ${version.equinox.core.runtime} @@ -905,14 +939,19 @@ ${version.eclipse.ecj} - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.http.servlet ${version.equinox.http.servlet} + + + + + - org.eclipse.equinox - org.eclipse.equinox.http.helper - ${version.equinox.http.helper} + org.eclipse.platform + org.eclipse.equinox.http.service.api + 1.2.2 org.eclipse.platform @@ -920,27 +959,23 @@ ${version.equinox.jsp.jasper} - org.eclipse.equinox - javax.servlet.jsp - ${version.equinox.javax.servlet.jsp} - - - org.eclipse.equinox - org.apache.jasper.glassfish - ${version.equinox.jasper} + org.glassfish + jakarta.el + 3.0.4 + org.eclipse.equinox - javax.el - ${version.javax.el} + javax.servlet.jsp + ${version.equinox.javax.servlet.jsp} - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.publisher ${version.equinox.p2.publisher} - org.eclipse.equinox + org.eclipse.platform org.eclipse.equinox.p2.publisher.eclipse ${version.equinox.p2.publisher.eclipse} @@ -960,7 +995,7 @@ ${version.apache.felix.gogo.runtime} - org.eclipse.osgi + org.eclipse.platform org.eclipse.equinox.p2.transport.ecf ${version.equinox.p2.transport.ecf} @@ -979,6 +1014,7 @@ javax.servlet ${version.equinox.javax.servlet} + org.wso2.eclipse.osgi org.eclipse.osgi.compatibility.state @@ -1045,7 +1081,7 @@ ${version.geronimo.stax.api.spec} - org.apache.tiles.wso2 + org.wso2.orbit.org.apache.tiles tiles-jsp ${orbit.version.tiles} @@ -1733,16 +1769,6 @@ org.wso2.carbon.automation.test.utils ${test.framework.version} - org.wso2.carbon org.wso2.carbon.integration.test.common.integration.test.utils @@ -1780,16 +1806,6 @@ mockito-core ${mockito.version} - - org.powermock - powermock-api-mockito2 - ${powermock.version} - - - org.powermock - powermock-module-testng - ${powermock.version} - javax.xml.bind jaxb-api @@ -1875,6 +1891,72 @@ org.osgi.service.component.annotations ${version.org.osgi.service.component.annotations} + + org.osgi + org.osgi.service.component + 1.5.1 + + + org.osgi + org.osgi.util.promise + 1.3.0 + + + org.osgi + org.osgi.util.function + 1.2.0 + + + org.osgi + org.osgi.service.cm + 1.6.1 + + + org.osgi + org.osgi.service.upnp + 1.2.1 + + + org.osgi + org.osgi.service.device + 1.1.1 + + + org.osgi + org.osgi.service.event + 1.4.1 + + + org.osgi + org.osgi.service.wireadmin + 1.0.2 + + + org.osgi + org.osgi.service.provisioning + 1.2.0 + + + org.osgi + org.osgi.service.useradmin + 1.1.1 + + + org.osgi + org.osgi.service.metatype + 1.4.1 + + + org.osgi + org.osgi.service.permissionadmin + 1.2.1 + + + org.osgi + org.osgi.service.http.whiteboard + 1.1.1 + + org.osgi org.osgi.annotation @@ -1936,6 +2018,16 @@ httpclient ${httpcomponents-httpclient.wso2.version} + + org.wso2.orbit.javax.activation + activation + 1.1.1.wso2v4 + + + javax.xml.soap + javax.xml.soap-api + 1.4.0 + diff --git a/samples/pom.xml b/samples/pom.xml index 4eadbc958f2..4d78b04f682 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -26,7 +26,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 1.8 + 17 diff --git a/samples/student-manager/components/org.wso2.carbon.student.mgt.ui/pom.xml b/samples/student-manager/components/org.wso2.carbon.student.mgt.ui/pom.xml index 6c68a59d4bf..a34b49be690 100644 --- a/samples/student-manager/components/org.wso2.carbon.student.mgt.ui/pom.xml +++ b/samples/student-manager/components/org.wso2.carbon.student.mgt.ui/pom.xml @@ -82,7 +82,6 @@ org.apache.felix maven-bundle-plugin - ${maven.bundle.plugin.version} true s diff --git a/samples/student-manager/features/org.wso2.carbon.student.mgt.feature/pom.xml b/samples/student-manager/features/org.wso2.carbon.student.mgt.feature/pom.xml index 14c63e9620f..b5577d542a7 100644 --- a/samples/student-manager/features/org.wso2.carbon.student.mgt.feature/pom.xml +++ b/samples/student-manager/features/org.wso2.carbon.student.mgt.feature/pom.xml @@ -36,6 +36,7 @@ org.wso2.maven carbon-p2-plugin + true ${carbon.p2.plugin.version} @@ -53,10 +54,8 @@ - org.wso2.carbon:org.wso2.carbon.student.mgt.server.feature - - org.wso2.carbon:org.wso2.carbon.student.mgt.ui.feature - + org.wso2.carbon:org.wso2.carbon.student.mgt.server.feature:${student.manager.version} + org.wso2.carbon:org.wso2.carbon.student.mgt.ui.feature:${student.manager.version} diff --git a/samples/student-manager/features/org.wso2.carbon.student.mgt.server.feature/pom.xml b/samples/student-manager/features/org.wso2.carbon.student.mgt.server.feature/pom.xml index 03121291a2e..f141b62b777 100644 --- a/samples/student-manager/features/org.wso2.carbon.student.mgt.server.feature/pom.xml +++ b/samples/student-manager/features/org.wso2.carbon.student.mgt.server.feature/pom.xml @@ -27,6 +27,7 @@ org.wso2.maven carbon-p2-plugin + true ${carbon.p2.plugin.version} @@ -45,7 +46,7 @@ - org.wso2.carbon:org.wso2.carbon.student.mgt + org.wso2.carbon:org.wso2.carbon.student.mgt:${student.manager.version} diff --git a/samples/student-manager/features/org.wso2.carbon.student.mgt.ui.feature/pom.xml b/samples/student-manager/features/org.wso2.carbon.student.mgt.ui.feature/pom.xml index 117e80010ed..df4ea119f69 100644 --- a/samples/student-manager/features/org.wso2.carbon.student.mgt.ui.feature/pom.xml +++ b/samples/student-manager/features/org.wso2.carbon.student.mgt.ui.feature/pom.xml @@ -25,6 +25,7 @@ org.wso2.maven carbon-p2-plugin + true ${carbon.p2.plugin.version} @@ -43,7 +44,7 @@ - org.wso2.carbon:org.wso2.carbon.student.mgt.ui + org.wso2.carbon:org.wso2.carbon.student.mgt.ui:${student.manager.version} diff --git a/samples/student-manager/features/pom.xml b/samples/student-manager/features/pom.xml index 2739ee2952e..c70af8dcbd3 100644 --- a/samples/student-manager/features/pom.xml +++ b/samples/student-manager/features/pom.xml @@ -18,8 +18,4 @@ org.wso2.carbon.student.mgt.ui.feature org.wso2.carbon.student.mgt.feature - - - - diff --git a/samples/student-manager/pom.xml b/samples/student-manager/pom.xml index c5f93d45dd9..dda333ef9ac 100644 --- a/samples/student-manager/pom.xml +++ b/samples/student-manager/pom.xml @@ -16,7 +16,7 @@ 4.10.16-SNAPSHOT - 5.1.2 + 5.2.50-SNAPSHOT 2.3.5 1.6.1-wso2v29 diff --git a/samples/student-manager/repository/pom.xml b/samples/student-manager/repository/pom.xml index 2889488369e..a8d869cbedc 100644 --- a/samples/student-manager/repository/pom.xml +++ b/samples/student-manager/repository/pom.xml @@ -20,6 +20,7 @@ org.wso2.maven carbon-p2-plugin ${carbon.p2.plugin.version} + true 2-p2-repo-generation diff --git a/tests/caching/pom.xml b/tests/caching/pom.xml index 5300f882ccc..e15ae108a12 100644 --- a/tests/caching/pom.xml +++ b/tests/caching/pom.xml @@ -23,8 +23,8 @@ org.apache.maven.plugins maven-compiler-plugin - 8 - 8 + 17 + 17