Author: ivol37 at gmail.com
Date: Wed Nov  3 10:56:26 2010
New Revision: 240

Log:
[AMDATU-128] Replaced dependency on Pax Web for JSP support with Jasper bundle. 
The API is not effected, with the exception that the standard jstl and taglibs 
should no longer be embedded in bundles that contain JSPs.


Added:
   trunk/amdatu-web/
   trunk/amdatu-web/jsp-support-bundle/
   trunk/amdatu-web/jsp-support-bundle/pom.xml
   trunk/amdatu-web/jsp-support-bundle/src/
   trunk/amdatu-web/jsp-support-bundle/src/main/
   trunk/amdatu-web/jsp-support-bundle/src/main/java/
   trunk/amdatu-web/jsp-support-bundle/src/main/java/org/
   trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/
   trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/
   trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/
   trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/osgi/
   
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/osgi/Activator.java
   trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/service/
   
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/service/JasperClassLoader.java
   
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/service/ResourceProviderJspServlet.java
   
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/service/ResourceProviderListener.java
   trunk/amdatu-web/pom.xml
   trunk/src/main/resources/licenses/
   trunk/src/main/resources/licenses/apache-license-2.0.txt
Modified:
   trunk/amdatu-release/pom.xml
   trunk/application-bundles/dashboard-bundle/pom.xml
   
trunk/application-bundles/dashboard-bundle/src/main/java/org/amdatu/application/dashboard/service/DashboardService.java
   trunk/application-bundles/gadget-management/pom.xml
   
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
   
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/UserAdminStoreTest.java
   
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.loghandler.cfg
   trunk/platform-bundles/httpcontext/pom.xml
   
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextFactoryServiceImpl.java
   
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextImpl.java
   
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/osgi/Activator.java
   trunk/pom.xml
   trunk/src/main/resources/conf/felix-config.properties

Modified: trunk/amdatu-release/pom.xml
==============================================================================
--- trunk/amdatu-release/pom.xml        (original)
+++ trunk/amdatu-release/pom.xml        Wed Nov  3 10:56:26 2010
@@ -24,7 +24,16 @@
       <version>${platform.version}</version>
       <scope>compile</scope>
       <type>bundle</type>
-    </dependency> 
+    </dependency>
+    
+    <!-- Web bundles -->
+    <dependency>
+      <groupId>org.amdatu.web</groupId>
+      <artifactId>jsp-support</artifactId>
+      <version>${platform.version}</version>
+      <scope>compile</scope>
+      <type>bundle</type>
+    </dependency>
     
     <!-- Example bundles -->
     <dependency>
@@ -227,11 +236,17 @@
       <scope>compile</scope>
     </dependency> 
     <dependency>
-      <groupId>org.ops4j.pax.web</groupId>
-      <artifactId>pax-web-jsp</artifactId>
-      <version>${pax-web.version}</version>
+      <groupId>org.ops4j.pax.swissbox</groupId>
+      <artifactId>pax-swissbox-core</artifactId>
+      <version>${pax.swissbox.version}</version>
       <scope>compile</scope>
-    </dependency> 
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.base</groupId>
+      <artifactId>ops4j-base-lang</artifactId>
+      <version>1.2.2</version>
+      <scope>compile</scope>
+    </dependency>    
     <dependency>
       <groupId>org.apache.sling</groupId>
       <artifactId>org.apache.sling.commons.mime</artifactId>

Added: trunk/amdatu-web/jsp-support-bundle/pom.xml
==============================================================================
--- (empty file)
+++ trunk/amdatu-web/jsp-support-bundle/pom.xml Wed Nov  3 10:56:26 2010
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.amdatu</groupId>
+    <artifactId>org.amdatu.amdatu-web</artifactId>
+    <version>0.0.6-SNAPSHOT</version>
+  </parent>
+  <groupId>org.amdatu.web</groupId>
+  <artifactId>jsp-support</artifactId>
+  <packaging>bundle</packaging>
+  <name>Amdatu Web - JSP Support</name>
+  <description>Bundle providing JSP support</description>
+  
+  <dependencies>
+    <dependency>
+      <groupId>org.amdatu.platform</groupId>
+      <artifactId>httpcontext</artifactId>
+      <scope>provided</scope>
+      <type>bundle</type>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.tomcat</groupId>
+      <artifactId>jasper</artifactId>
+      <version>6.0.29</version>
+      <scope>compile</scope>
+      <type>jar</type>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.tomcat</groupId>
+          <artifactId>servlet-api</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+     <groupId>javax.servlet</groupId>
+      <artifactId>jstl</artifactId>
+      <version>${jstl.version}</version>
+      <scope>compile</scope>
+    </dependency> 
+    <dependency>
+      <groupId>taglibs</groupId>
+      <artifactId>standard</artifactId>
+      <version>${taglibs.version}</version>
+      <scope>compile</scope>
+    </dependency>       
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            
<Bundle-Activator>org.amdatu.web.jsp.osgi.Activator</Bundle-Activator>
+            <Bundle-SymbolicName> org.amdatu.web.jsp</Bundle-SymbolicName>     
   
+            <Embed-Dependency>*;scope=compile</Embed-Dependency>
+            <Embed-Transitive>true</Embed-Transitive>
+            <Import-Package>*;resolution:=optional</Import-Package>            
+          </instructions>
+        </configuration>
+      </plugin>   
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+      </plugin> 
+    </plugins>        
+  </build> 
+</project>

Added: 
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/osgi/Activator.java
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/osgi/Activator.java
    Wed Nov  3 10:56:26 2010
@@ -0,0 +1,52 @@
+/*
+    Copyright (C) 2010 Amdatu.org
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.amdatu.web.jsp.osgi;
+
+import org.amdatu.platform.httpcontext.HttpContextServiceFactory;
+import org.amdatu.platform.httpcontext.ResourceProvider;
+import org.amdatu.web.jsp.service.ResourceProviderListener;
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.http.HttpService;
+import org.osgi.service.log.LogService;
+
+/**
+ * This is the activator for the jsp support bundle.
+ * @author ivol
+ */
+public class Activator extends DependencyActivatorBase {
+    // The resource identifier for this bundle. Resources are only considered 
to be 'ours' when
+    // it is prefixed with this id
+    public final static String RESOURCE_ID = "jspservlet";
+
+    @Override
+    public void init(BundleContext context, DependencyManager manager) throws 
Exception {
+     // Create and register the dashboard service.
+        manager.add(
+                createComponent()
+                .setImplementation(ResourceProviderListener.class)
+                
.add(createServiceDependency().setService(LogService.class).setRequired(true))
+                
.add(createServiceDependency().setService(HttpContextServiceFactory.class).setRequired(true))
+                
.add(createServiceDependency().setService(HttpService.class).setRequired(true))
+                
.add(createServiceDependency().setService(ResourceProvider.class).setCallbacks("onAdded",
 "onRemoved")));
+    }
+
+        @Override
+    public void destroy(BundleContext context, DependencyManager manager) 
throws Exception {
+    }
+}

Added: 
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/service/JasperClassLoader.java
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/service/JasperClassLoader.java
 Wed Nov  3 10:56:26 2010
@@ -0,0 +1,133 @@
+/*
+    Copyright (C) 2010 Amdatu.org
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+    
+    This file was originally published under the Apache 2.0 license as
+    org.ops4j.pax.web.jsp.internal.JasperClassLoader. It was copied, 
+    modified and redistributed with Amdatu.
+ */
+package org.amdatu.web.jsp.service;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import org.ops4j.pax.swissbox.core.BundleClassLoader;
+import org.osgi.framework.Bundle;
+
+/**
+ * The Jasper classloader is used for the compiled Java classes generated from 
the JSPs.
+ * The classloader creates a BundleClassLoader for the bundle that holds the 
JSP and sets the
+ * parent classloader to the classloader of the Jasper classes itself (which 
is the classloader of this bundle).
+ * @see org.ops4j.pax.web.jsp.internal.JasperClassLoader
+ * @author ivol
+ */
+public class JasperClassLoader extends URLClassLoader {
+
+    /**
+     * Internal bundle class loader.
+     */
+    private final BundleClassLoader m_bundleClassLoader;
+
+    public JasperClassLoader(final Bundle bundle, final ClassLoader parent) {
+        super(getClassPathJars(bundle));
+        m_bundleClassLoader = new BundleClassLoader(bundle, parent);
+    }
+
+    /**
+     * Delegate to bundle class loader.
+     * 
+     * @see BundleClassLoader#getResource(String)
+     */
+    public URL getResource(String name) {
+        return m_bundleClassLoader.getResource(name);
+    }
+
+    /**
+     * Delegate to bundle class loader.
+     * 
+     * @see BundleClassLoader#getResources(String)
+     */
+    public Enumeration<URL> getResources(String name)
+        throws IOException {
+        return m_bundleClassLoader.getResources(name);
+    }
+
+    /**
+     * Delegate to bundle class loader.
+     * 
+     * @see BundleClassLoader#loadClass(String)
+     */
+    @SuppressWarnings("unchecked")
+     public Class loadClass(final String name)
+        throws ClassNotFoundException {
+        return m_bundleClassLoader.loadClass(name);
+    }
+
+    @Override
+    public String toString() {
+        return new StringBuffer()
+            .append(this.getClass().getSimpleName())
+            .append("{")
+            .append("bundleClassLoader=").append(m_bundleClassLoader)
+            .append("}")
+            .toString();
+    }
+
+    /**
+     * Returns a list of urls to jars that composes the Bundle-ClassPath.
+     * 
+     * @param bundle the bundle from which the class path should be taken
+     * 
+     * @return list or urls to jars that composes the Bundle-ClassPath.
+     */
+    private static URL[] getClassPathJars(final Bundle bundle) {
+        final List<URL> urls = new ArrayList<URL>();
+        final String bundleClasspath = (String) 
bundle.getHeaders().get("Bundle-ClassPath");
+        if (bundleClasspath != null) {
+            String[] segments = bundleClasspath.split(",");
+            for (String segment : segments) {
+                final URL url = bundle.getEntry(segment);
+                if (url != null) {
+                    if (url.toExternalForm().endsWith("jar")) {
+                        try {
+                            URL jarUrl = new URL("jar:" + url.toExternalForm() 
+ "!/");
+                            urls.add(jarUrl);
+                        }
+                        catch (MalformedURLException ignore) {}
+                    }
+                }
+            }
+        }
+        
+        return urls.toArray(new URL[urls.size()]);
+    }
+    
+    /**
+     * Adds the jars on classpath of the specified bundle to this classloader. 
This used to add
+     * any TLDs contained by this bundle but not by the bundle that contains 
the JSP
+     * @param bundle Bundle to add classpath jars for
+     */
+    public void addClassPathJars(Bundle bundle) {
+        URL[] urls = getClassPathJars(bundle);
+        for (URL url : urls) {
+            addURL(url);
+        }
+    }
+}

Added: 
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/service/ResourceProviderJspServlet.java
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/service/ResourceProviderJspServlet.java
        Wed Nov  3 10:56:26 2010
@@ -0,0 +1,201 @@
+/*
+    Copyright (C) 2010 Amdatu.org
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+    This file was originally published under the Apache 2.0 license as
+    org.ops4j.pax.web.jsp.JspServletWrapper. It was copied, modified 
+    and redistributed with Amdatu.
+ */
+package org.amdatu.web.jsp.service;
+
+import java.io.IOException;
+import java.util.concurrent.Callable;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+
+import org.amdatu.platform.httpcontext.ResourceProvider;
+import org.apache.jasper.Constants;
+import org.apache.jasper.servlet.JspServlet;
+import org.ops4j.pax.swissbox.core.ContextClassLoaderUtils;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+
+/**
+ * This class implements a servlet that facilitates rendering and compiling 
JSPs for a particular resource provider.
+ * It extends the Jasper implementation of the JSPServlet but uses OPS4J 
Swissbox to fix some classloading issues with
+ * this servlet.
+ * This class was copied and modified from 
org.ops4j.pax.web.jsp.JspServletWrapper.
+ * 
+ * @author ivol
+ */
+public class ResourceProviderJspServlet implements Servlet {
+    // The serial version UID of this servlet.
+    private static final long serialVersionUID = 7506277600212824000L;
+
+    // Injected by the OSGi container
+    private volatile LogService m_logService;
+
+    // The Jasper Servlet
+    private JspServlet m_jasperServlet;
+
+    // / Jasper specific class loader.
+    private JasperClassLoader m_jasperClassLoader;
+
+    // The resource provider that provides the JSPs tro be rendered by this 
servlet
+    private ResourceProvider m_resourceProvider;
+
+    private BundleContext m_bundleContext;
+
+    // Constructor
+    public ResourceProviderJspServlet(ResourceProvider provider) {
+        m_resourceProvider = provider;
+    }
+
+    public void init() {
+        ClassLoader jcl = JasperClassLoader.class.getClassLoader();
+
+        // Look up the bundle that hosts the provider.
+        // The OSGi 4.1 spec does not yet support retrieving the bundle from 
the bundle classloader
+        // (in 4.2 one could use org.osgi.framework.BundleReference for it). 
Therefore we loop over
+        // all ResourceProvider service references and compare the resourceId 
with the resourceId of
+        // our provider.
+        boolean found = false;
+        try {
+            ServiceReference[] allRefs =
+                
m_bundleContext.getAllServiceReferences(ResourceProvider.class.getName(), null);
+            for (ServiceReference serviceRef : allRefs) {
+                if (!found) {
+                    ResourceProvider provider = (ResourceProvider) 
m_bundleContext.getService(serviceRef);
+                    if 
(provider.getResourceId().equals(m_resourceProvider.getResourceId())) {
+                        m_jasperClassLoader = new 
JasperClassLoader(serviceRef.getBundle(), jcl);
+                        
m_jasperClassLoader.addClassPathJars(m_bundleContext.getBundle());
+                        m_jasperServlet = new JspServlet();
+                        found = true;
+                    }
+                }
+            }
+        }
+        catch (InvalidSyntaxException e) {
+            m_logService.log(LogService.LOG_ERROR, "Could not retrieve service 
references", e);
+        }
+
+        if (!found) {
+            throw new RuntimeException(
+                "BundleClassLoader does not implement BundleReference, could 
not register JSP servlet");
+        }
+    }
+
+    /**
+     * Delegates to jasper servlet with a controlled context class loader.
+     * 
+     * @see ResourceProviderJspServlet#init(ServletConfig)
+     */
+    public void init(final ServletConfig config) throws ServletException {
+        try {
+            ContextClassLoaderUtils.doWithClassLoader(
+                m_jasperClassLoader,
+                new Callable<Void>() {
+                public Void call() throws Exception {
+                    m_jasperServlet.init(config);
+                    return null;
+                }
+            }
+                );
+        }
+        catch (Exception e) {
+            m_logService.log(LogService.LOG_ERROR, "Could not initialize Jsp 
Servlet", e);
+            throw new ServletException(e);
+        }
+    }
+
+    /**
+     * Delegates to jasper servlet.
+     * 
+     * @see ResourceProviderJspServlet#getServletConfig()
+     */
+    public ServletConfig getServletConfig() {
+        return m_jasperServlet.getServletConfig();
+    }
+
+    /**
+     * Delegates to Jasper servlet with a controlled context class loader.
+     * 
+     * @see ResourceProviderJspServlet#service(ServletRequest, ServletResponse)
+     */
+    public void service(final ServletRequest req, final ServletResponse res) 
throws ServletException, IOException {
+        HttpServletRequest request = (HttpServletRequest) req;
+        String resourcePath = request.getRequestURI().substring(1);
+        resourcePath = resourcePath.substring(resourcePath.indexOf("/"));
+        req.setAttribute(Constants.JSP_FILE, request.getRequestURI());
+
+        try {
+            ContextClassLoaderUtils.doWithClassLoader(
+                m_jasperClassLoader,
+                new Callable<Void>() {
+                public Void call() throws Exception {
+                    m_jasperServlet.service(req, res);
+                    return null;
+                }
+            }
+                );
+        }
+        catch (Exception e) {
+            m_logService.log(LogService.LOG_ERROR, "An error occurred while 
handling JSP request", e);
+            throw new ServletException(e);
+        }
+    }
+
+    /**
+     * Delegates to jasper servlet.
+     * 
+     * @see ResourceProviderJspServlet#getServletInfo()
+     */
+    public String getServletInfo() {
+        return m_jasperServlet.getServletInfo();
+    }
+
+    /**
+     * Delegates to jasper servlet with a controlled context class loader.
+     * 
+     * @see ResourceProviderJspServlet#destroy()
+     */
+    public void destroy() {
+        try {
+            ContextClassLoaderUtils.doWithClassLoader(
+                m_jasperClassLoader,
+                new Callable<Void>() {
+                public Void call() throws Exception {
+                    m_jasperServlet.destroy();
+                    return null;
+                }
+            }
+                );
+        }
+        catch (Exception e) {
+            m_logService.log(LogService.LOG_ERROR, "Could not destroy 
JspServletServiceImpl", e);
+        }
+    }
+
+    public ResourceProvider getResourceProvider() {
+        return m_resourceProvider;
+    }
+}

Added: 
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/service/ResourceProviderListener.java
==============================================================================
--- (empty file)
+++ 
trunk/amdatu-web/jsp-support-bundle/src/main/java/org/amdatu/web/jsp/service/ResourceProviderListener.java
  Wed Nov  3 10:56:26 2010
@@ -0,0 +1,173 @@
+/*
+    Copyright (C) 2010 Amdatu.org
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.amdatu.web.jsp.service;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+
+import org.amdatu.platform.httpcontext.HttpContextServiceFactory;
+import org.amdatu.platform.httpcontext.ResourceProvider;
+import org.amdatu.web.jsp.osgi.Activator;
+import org.apache.felix.dm.Component;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.http.HttpContext;
+import org.osgi.service.http.HttpService;
+import org.osgi.service.http.NamespaceException;
+import org.osgi.service.log.LogService;
+
+/**
+ * This class is responsible for registration of JSP Servlets for each 
ResourceProvider that
+ * comes available.
+ * 
+ * @author ivol
+ */
+public class ResourceProviderListener implements ResourceProvider {
+    //The serial version UID of this servlet.
+    private static final long serialVersionUID = 7506277600212824000L;
+    
+    // The file name extensions that are assumed to be JSPs
+    private final static List<String> JSP_EXTENSIONS = new ArrayList<String>();
+    static {
+        JSP_EXTENSIONS.add(".jsp");
+        JSP_EXTENSIONS.add(".jspf");
+    }
+    
+    // This path is appended to the ResourceProvider's resourceId defines the 
servlet alias
+    // used to register the JSP servlet.
+    private final static String JSP_SERVLET_PATH = "jsp";
+
+    // Injected by the OSGi container
+    private volatile BundleContext m_bundleContext;
+    private volatile LogService m_logService;
+    private volatile HttpContextServiceFactory m_httpContextFactoryService;
+    private volatile HttpService m_httpService;
+    private volatile DependencyManager m_dependencyManager;
+
+    // Http context variables
+    private Component m_httpContextComponent;
+    private HttpContext m_httpContext;
+
+    List<ResourceProvider> m_resourceProviders = new 
ArrayList<ResourceProvider>();
+    Map<String, Component> m_components = new HashMap<String, Component>();
+
+    public void init() {
+        // Create our own http context and register resources
+        m_httpContextComponent = 
m_httpContextFactoryService.create(m_bundleContext, this);
+        m_httpContext = (HttpContext) m_httpContextComponent.getService();
+    }
+
+    public void destroy() {
+        m_httpContextComponent.stop();
+    }
+
+    // This callback is invoked for each ResourceProvider that comes available
+    public void onAdded(ResourceProvider provider) {
+        Dictionary<String, String> initParams = new Hashtable<String, 
String>();
+        String servletAlias = getServletAlias(provider);
+
+        // Instantiate new ResourceProviderJspServlet service
+        ResourceProviderJspServlet jspServlet = new 
ResourceProviderJspServlet(provider);
+        Component component = m_dependencyManager.createComponent();
+        component.setImplementation(jspServlet);
+
+        // Add service dependencies
+        
component.add(m_dependencyManager.createServiceDependency().setService(LogService.class).setRequired(true));
+
+        // Add the component to the dependency manager
+        m_components.put(provider.getResourceId(), component);
+        m_dependencyManager.add(component);
+
+        try {
+            m_httpService.registerServlet(servletAlias, jspServlet, 
initParams, m_httpContext);
+        }
+        catch (ServletException e) {
+            m_logService.log(LogService.LOG_ERROR, "Could not register JSP 
servlet for resource provider " + provider,
+                e);
+            return;
+        }
+        catch (NamespaceException e) {
+            m_logService.log(LogService.LOG_ERROR, "Could not register JSP 
servlet for resource provider " + provider,
+                e);
+            return;
+        }
+        m_resourceProviders.add(provider);
+    }
+
+    // This callback is invoked for each ResourceProvider that becomes 
unavailable
+    public void omRemoved(ResourceProvider provider) {
+        try {
+            
m_dependencyManager.remove(m_components.get(provider.getResourceId()));
+            m_httpService.unregister(getServletAlias(provider));
+        }
+        finally {
+            m_resourceProviders.remove(provider);
+        }
+    }
+
+    private String getServletAlias(ResourceProvider provider) {
+        return "/" + provider.getResourceId() + "/" + JSP_SERVLET_PATH;
+    }
+
+    public URL getResource(String name) {
+        if ("/".equals(name) || name == null || "".equals(name.trim())) {
+            return null;
+        }
+        else if (isJsp(name)) {
+            // Get the resource prefix
+            String prefix = getJspServletPath(name);
+            if (m_components.containsKey(prefix)) {
+                ResourceProvider provider =
+                    ((ResourceProviderJspServlet) 
m_components.get(prefix).getService()).getResourceProvider();
+                String resource = name.substring(("/" + prefix + 
"/").length());
+                URL url = provider.getResource(resource);
+                if (url == null) {
+                    url = 
provider.getClass().getClassLoader().getResource(resource);
+                }
+                return url;
+            }
+        }
+        return null;
+    }
+
+    public String getResourceId() {
+        return Activator.RESOURCE_ID;
+    }
+    
+    private boolean isJsp(String name) {
+        for (String extension : JSP_EXTENSIONS) {
+            if (name.endsWith(extension)) {
+                return true;
+            }
+        }
+        return false;
+    }
+    
+    private String getJspServletPath(String name) {
+        // Retrieves the Jsp servlet path from a full URL
+        int endIndex = name.indexOf("/" + JSP_SERVLET_PATH + "/");
+        int startIndex = name.startsWith("/") ? 1 : 0;
+        return name.substring(startIndex, endIndex);
+    }
+}

Added: trunk/amdatu-web/pom.xml
==============================================================================
--- (empty file)
+++ trunk/amdatu-web/pom.xml    Wed Nov  3 10:56:26 2010
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.amdatu</groupId>
+    <artifactId>amdatu-parent</artifactId>
+    <version>0.0.6-SNAPSHOT</version>
+    <relativePath>../pom/pom.xml</relativePath>
+  </parent>
+  <artifactId>org.amdatu.web</artifactId>
+  <name>Amdatu Web</name>
+  <description>This module consists of all Web related bundles</description>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>jsp-support-bundle</module>
+  </modules>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <!-- This plugin ensures that the resulting jar is also copied to the 
proper target directory, bound to the package 
+          phase -->
+        <plugin>
+          <artifactId>maven-antrun-plugin</artifactId>
+          <executions>
+            <execution>
+              <phase>package</phase>
+              <goals>
+                <goal>run</goal>
+              </goals>
+              <configuration>
+                <tasks>
+                  <copy 
file="${project.build.directory}/${project.build.finalName}.jar" 
todir="${root.directory}/application-bundles"
+                    overwrite="true" />
+                </tasks>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>
\ No newline at end of file

Modified: trunk/application-bundles/dashboard-bundle/pom.xml
==============================================================================
--- trunk/application-bundles/dashboard-bundle/pom.xml  (original)
+++ trunk/application-bundles/dashboard-bundle/pom.xml  Wed Nov  3 10:56:26 2010
@@ -13,76 +13,19 @@
   <name>Amdatu Application - Dashboard</name>
   <description>Dashboard application (gadget container UI)</description>
   
-  <dependencies>  
-    <dependency>
-     <groupId>javax.servlet</groupId>
-      <artifactId>jstl</artifactId>
-      <scope>provided</scope>
-    </dependency> 
-    <dependency>
-      <groupId>taglibs</groupId>
-      <artifactId>standard</artifactId>
-      <scope>provided</scope>
-    </dependency>   
+  <dependencies>    
     <dependency>
       <groupId>org.amdatu.platform</groupId>
       <artifactId>authorization</artifactId>
       <scope>provided</scope>
       <type>bundle</type>
-    </dependency>
-    
-    <!--
+    </dependency>  
     <dependency>
-      <groupId>tomcat</groupId>
-      <artifactId>jasper-compiler</artifactId>
-      <version>5.5.23</version>
-      <scope>compile</scope>
-      <type>bundle</type>
-    </dependency>
-    <dependency>
-      <groupId>tomcat</groupId>
-      <artifactId>jasper-runtime</artifactId>
-      <version>5.5.23</version>
-      <scope>compile</scope>
+      <groupId>org.amdatu.platform</groupId>
+      <artifactId>shindig-application</artifactId>
+      <scope>provided</scope>
       <type>bundle</type>
-    </dependency>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <version>1.2.16</version>
-      <scope>compile</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.jms</groupId>
-          <artifactId>jms</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>com.sun.jmx</groupId>
-          <artifactId>jmxri</artifactId>
-        </exclusion>
-        
-      </exclusions>
     </dependency>     
-    -->
-    <!--
-    <dependency>
-      <groupId>org.eclipse.equinox.jsp</groupId>
-      <artifactId>jasper</artifactId>
-      <version>1.0.0-v20070607</version>
-            <scope>compile</scope>
-      <type>bundle</type>
-    </dependency>
-    
-    <dependency>
-        <groupId>org.eclipse.equinox.jsp.jasper</groupId>
-        <artifactId>registry</artifactId>
-        <version>1.0.0-v20070607</version>
-        <scope>compile</scope>
-      <type>bundle</type>
-    </dependency>
-    -->
-
-    
   </dependencies>
   
   <build>
@@ -96,7 +39,15 @@
             <Bundle-SymbolicName> 
org.amdatu.application.dashboard</Bundle-SymbolicName>        
             <Embed-Dependency>*;scope=compile</Embed-Dependency>
             <Embed-Transitive>true</Embed-Transitive>
-            
+            <Import-Package>
+              *,
+              org.apache.shindig.common.crypto,
+              org.apache.shindig.auth,
+              org.apache.shindig.common.util,
+              org.osgi.service.useradmin,
+              net.oauth,
+              org.apache.shindig.social.opensocial.oauth
+              </Import-Package>
           </instructions>
         </configuration>
       </plugin>   

Modified: 
trunk/application-bundles/dashboard-bundle/src/main/java/org/amdatu/application/dashboard/service/DashboardService.java
==============================================================================
--- 
trunk/application-bundles/dashboard-bundle/src/main/java/org/amdatu/application/dashboard/service/DashboardService.java
     (original)
+++ 
trunk/application-bundles/dashboard-bundle/src/main/java/org/amdatu/application/dashboard/service/DashboardService.java
     Wed Nov  3 10:56:26 2010
@@ -19,60 +19,39 @@
 import static org.amdatu.application.dashboard.osgi.Activator.RESOURCE_ID;
 
 import java.net.URL;
-import java.util.Dictionary;
-import java.util.Hashtable;
 
 import org.amdatu.platform.httpcontext.HttpContextServiceFactory;
 import org.amdatu.platform.httpcontext.ResourceProvider;
 import org.apache.felix.dm.Component;
 import org.osgi.framework.BundleContext;
-import org.osgi.service.http.HttpContext;
-import org.osgi.service.http.HttpService;
 import org.osgi.service.log.LogService;
 
 /**
- * The dashboard service registers the login and logout page using the 
authorization 
+ * The dashboard service registers the login and logout page using the 
authorization
  * service (which is using JSecurity, a light security framework). Furthermore 
it
  * is a web resource provider of dashboard JSPs and statics.
+ * 
  * @author ivol
  */
-public class DashboardService implements ResourceProvider {   
+public class DashboardService implements ResourceProvider {
     // Services injected by the Felix dependency manager
     private volatile BundleContext m_bundleContext;
     private volatile LogService m_logService;
     private volatile HttpContextServiceFactory m_httpContextFactoryService;
 
-    private volatile HttpService m_httpService;
-    
     private Component m_httpContextComponent;
-    private HttpContext m_httpContext;
-        
+
     /**
      * The init() method is invoked by the Felix dependency manager.
      */
     public void init() {
         // Create our own http context and register resources
         m_httpContextComponent = 
m_httpContextFactoryService.create(m_bundleContext, this);
-        m_httpContext = (HttpContext) m_httpContextComponent.getService();
-        Dictionary<String, String> initParams = new Hashtable<String, 
String>();
-       
-        /*JspServletWrapper servlet = new JspServletWrapper(m_bundleContext);
-        try {
-                       m_httpService.registerServlet("/jsp", servlet, 
initParams, m_httpContext);
-               } catch (ServletException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               } catch (NamespaceException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               }*/
         m_logService.log(LogService.LOG_INFO, getClass().getName() + " service 
initialized");
     }
-    
-   
 
     /**
-     * The idestroynit() method is invoked by the Felix dependency manager.
+     * The destroy() method is invoked by the Felix dependency manager.
      */
     public void destroy() {
         m_httpContextComponent.stop();

Modified: trunk/application-bundles/gadget-management/pom.xml
==============================================================================
--- trunk/application-bundles/gadget-management/pom.xml (original)
+++ trunk/application-bundles/gadget-management/pom.xml Wed Nov  3 10:56:26 2010
@@ -14,16 +14,8 @@
   <description>Provides a service to manage gadgets stored in the gadget 
store</description>
   
   <dependencies>  
-    <dependency>
-     <groupId>javax.servlet</groupId>
-      <artifactId>jstl</artifactId>
-      <scope>provided</scope>
-    </dependency> 
-    <dependency>
-      <groupId>taglibs</groupId>
-      <artifactId>standard</artifactId>
-      <scope>provided</scope>
-    </dependency>   
+   
+       
     <dependency>
       <groupId>org.amdatu.platform</groupId>
       <artifactId>authorization</artifactId>

Modified: 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
==============================================================================
--- 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
     (original)
+++ 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/base/IntegrationTestBase.java
     Wed Nov  3 10:56:26 2010
@@ -80,7 +80,6 @@
                     configAdmin(),
                     felixLog(),
                     paxWebJetty(),
-                    PaxWebJsp(),
                     paxUserAdmin(),
                     slingMime(),
                     slingCommons(),
@@ -300,10 +299,6 @@
         return 
mavenBundle().groupId("org.ops4j.pax.useradmin").artifactId("pax-useradmin-service").versionAsInProject();
     }
 
-    protected static MavenArtifactProvisionOption PaxWebJsp() {
-        return 
mavenBundle().groupId("org.ops4j.pax.web").artifactId("pax-web-jsp").versionAsInProject();
-    }
-
     protected static MavenArtifactProvisionOption paxWebJetty() {
         return 
mavenBundle().groupId("org.ops4j.pax.web").artifactId("pax-web-jetty-bundle").versionAsInProject();
     }

Modified: 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/UserAdminStoreTest.java
==============================================================================
--- 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/UserAdminStoreTest.java
     (original)
+++ 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/UserAdminStoreTest.java
     Wed Nov  3 10:56:26 2010
@@ -41,7 +41,7 @@
 public class UserAdminStoreTest extends IntegrationTestBase {
     // Amount of milliseconds to wait between WRITE and READ operations 
concerning the same row and same column.
     // See AMDATU-137.
-    private static int WAIT = 10;
+    private static int WAIT = 20;
 
     @Inject
     protected BundleContext m_bundleContext;

Modified: 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.loghandler.cfg
==============================================================================
--- 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.loghandler.cfg
   (original)
+++ 
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.loghandler.cfg
   Wed Nov  3 10:56:26 2010
@@ -2,4 +2,4 @@
 # to the console. Can be DEBUG, INFO, WARNING or ERROR. For example if "INFO"
 # is defined, only log messages will be printed in the console which have a 
 # loglevel of INFO or higher (WARNING or ERROR).
-console.mininum.loglevel=INFO
\ No newline at end of file
+console.mininum.loglevel=WARNING
\ No newline at end of file

Modified: trunk/platform-bundles/httpcontext/pom.xml
==============================================================================
--- trunk/platform-bundles/httpcontext/pom.xml  (original)
+++ trunk/platform-bundles/httpcontext/pom.xml  Wed Nov  3 10:56:26 2010
@@ -14,19 +14,7 @@
   <description>Provides a HTTPContext implementation</description>
   
   <dependencies>  
-    <!-- Include JSTL taglibrary in this bundle so that it is embedded in this 
shared http context -->
-    <dependency>
-     <groupId>javax.servlet</groupId>
-      <artifactId>jstl</artifactId>
-      <version>1.1.2</version>
-      <scope>compile</scope>
-    </dependency> 
-    <dependency>
-      <groupId>taglibs</groupId>
-      <artifactId>standard</artifactId>
-      <version>1.1.2</version>
-      <scope>compile</scope>
-    </dependency>   
+  
     <dependency>  
       <groupId>commons-beanutils</groupId>  
       <artifactId>commons-beanutils</artifactId>  

Modified: 
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextFactoryServiceImpl.java
==============================================================================
--- 
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextFactoryServiceImpl.java
 (original)
+++ 
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextFactoryServiceImpl.java
 Wed Nov  3 10:56:26 2010
@@ -16,8 +16,8 @@
  */
 package org.amdatu.platform.httpcontext.service;
 
-import java.net.URL;
-import java.util.*;
+import java.util.Dictionary;
+import java.util.Hashtable;
 
 import org.amdatu.platform.httpcontext.HttpContextServiceFactory;
 import org.amdatu.platform.httpcontext.ResourceProvider;
@@ -25,7 +25,6 @@
 import org.apache.felix.dm.DependencyManager;
 import org.apache.sling.commons.mime.MimeTypeService;
 import org.ops4j.pax.web.service.WebContainer;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.service.http.HttpContext;
@@ -51,7 +50,7 @@
      * @param resourceId The resource id
      * @return The newly created http context
      */
-    private Component internalCreate(BundleContext bundleContext, 
ResourceProvider resourceProvider, List<String> jsps) {
+    private Component internalCreate(BundleContext bundleContext, 
ResourceProvider resourceProvider) {
         Dictionary<String, Object> properties = new Hashtable<String, 
Object>();
         properties.put(HttpContextImpl.BUNDLECONTEXT_PROP, bundleContext);
         properties.put(HttpContextImpl.BUNDLEID_PROP, 
bundleContext.getBundle().getBundleId());
@@ -60,9 +59,6 @@
             if (resourceProvider.getResourceId() != null) {
                 properties.put(HttpContextImpl.RESOURCEID_PROP, 
resourceProvider.getResourceId());
             }
-            if (jsps != null) {
-                properties.put(HttpContextImpl.JSPS_PROP, jsps);
-            }
         }
         Component component = m_manager.createComponent();
         m_manager.add(
@@ -77,12 +73,11 @@
     }
 
     public Component create(BundleContext bundleContext) {
-        return internalCreate(bundleContext, null, null);
+        return internalCreate(bundleContext, null);
     }
 
     public Component create(BundleContext bundleContext, ResourceProvider 
resourceProvider) {
         // Create context and bind all resources to it
-        Bundle bundle = bundleContext.getBundle();
         String resourceId = resourceProvider.getResourceId();
         Component component = null;
         try {
@@ -96,25 +91,9 @@
                 resId  = resId.substring(0, resId.length()-1);
             }
 
-            // Because of the restricted functionality in 
org.mortbay.jetty.servlet.PathMap it is very hard to 
-            // register jsps and statics onto urls prefixed by the resource 
id. For example, registration of
-            // /dashboard/dashboard.jsp to be rendered by the JstlServlet and 
/dashboard/index.html to be rendered
-            // by the ResourceServlet is not possible using generic URL 
mappings like *.jsp or /dashboard/*
-            // The only way to fix this is by registering all JSPs by its full 
path and all other resources
-            // to /dashboard/*. For that reason, we loop over all resources in 
the bundle, locate the .jsp and .jspf
-            // files ourselves and register them all buy its full path name.
-            List<String> jsps = getJSPs(bundle, resId);
-          
             // Create the http context
-            component = internalCreate(bundleContext, resourceProvider, jsps);
+            component = internalCreate(bundleContext, resourceProvider);
             HttpContext context = (HttpContext) component.getService();
-            
-            // Register the JSPs by its full path name
-            if (jsps.size() > 0) {
-                m_logService.log(LogService.LOG_DEBUG, "JSPs registered in 
HTTP context for bundle '" + 
-                        bundleContext.getBundle().getSymbolicName() + "' 
(resource id '" + resourceId + "'): " + jsps);
-                m_webContainer.registerJsps(jsps.toArray(new 
String[jsps.size()]), context);
-            }
 
             // And register all resources on /[resourceId]/*
             m_webContainer.registerResources(resId + "/*", "", context);
@@ -125,17 +104,4 @@
         }
         return component;
     }
-    
-    @SuppressWarnings("unchecked")
-    private List<String> getJSPs(Bundle bundle, String resourceId) {
-        List<String> jsps = new ArrayList<String>();
-        for (String extension : HttpContextImpl.JSP_EXTENSIONS) {
-            Enumeration<URL> entries = bundle.findEntries("", extension, true);
-            while (entries != null && entries.hasMoreElements()) {
-                URL entry = entries.nextElement();
-                jsps.add(resourceId + entry.getPath());
-            }
-        }
-        return jsps;
-    }
 }

Modified: 
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextImpl.java
==============================================================================
--- 
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextImpl.java
       (original)
+++ 
trunk/platform-bundles/httpcontext/src/main/java/org/amdatu/platform/httpcontext/service/HttpContextImpl.java
       Wed Nov  3 10:56:26 2010
@@ -46,19 +46,11 @@
  * @author ivol
  */
 public class HttpContextImpl implements ExtHttpContext {
-    // The file name extensions that are assumed to be JSPs
-    final static List<String> JSP_EXTENSIONS = new ArrayList<String>();
-    static {
-        JSP_EXTENSIONS.add("*.jsp");
-        JSP_EXTENSIONS.add("*.jspf");
-    }
-
     // Internal property names for service properties
     final static String BUNDLECONTEXT_PROP = "bundlecontext";
     final static String BUNDLEID_PROP = "bundleid";
     final static String RESOURCEPROVIDER_PROP = "resourceprovider";
     final static String RESOURCEID_PROP = "resourceid";
-    final static String JSPS_PROP = "jsps";
 
     // Service depedencies, injected by the Felix dependency manager
     private volatile MimeTypeService m_mimeTypeService;
@@ -90,17 +82,10 @@
     /**
      * The destroy() method is invoked by the Felix dependency manager.
      */
-    @SuppressWarnings("unchecked")
     public void destroy() {
-        // Unregister JSPs and statics
-        List<String> jsps = (List<String>) 
m_component.getServiceProperties().get(JSPS_PROP);
-        if (jsps != null && jsps.size() > 0) {
-            m_webContainer.unregisterJsps(this);
-        }
         if (m_resourceId != null) {
             m_webContainer.unregister("/" + m_resourceId + "/*");
         }
-
         m_logService.log(LogService.LOG_INFO, "HTTP Context destroyed for 
bundle " + m_bundleId + " ('" + m_resourceId
                 + "')");
     }
@@ -127,16 +112,11 @@
         URL resourceUrl = bundle.getResource(name);
         if (resourceUrl != null) {
             return resourceUrl;
-        } else {
-            if (name.lastIndexOf(".") != -1 && JSP_EXTENSIONS.contains("*" + 
name.substring(name.lastIndexOf(".")))) {
-                // Remove resource id from the name, i.e. name is 
'/examples/gadget/course/jsp/CourseGadget.jsp'
-                // and resource id is 'examples/gadget/course'
-                String resName = name.substring(name.indexOf(m_resourceId) + 
m_resourceId.length());
-                return bundle.getResource(resName);
-            }
-        }
+        } 
 
-        m_logService.log(LogService.LOG_WARNING, "No resource provider offers 
a resource named '" + name + "'.");
+        // Log that this resource could not be found on DEBUG level, since 
there are many cases in which
+        // this is the intention (i.e. Jasper servlet retrieves web.xml to 
read registered TLDs)
+        m_logService.log(LogService.LOG_DEBUG, "No resource provider offers a 
resource named '" + name + "'.");
         return null;
     }
 

Modified: 
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/osgi/Activator.java
==============================================================================
--- 
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/osgi/Activator.java
        (original)
+++ 
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/osgi/Activator.java
        Wed Nov  3 10:56:26 2010
@@ -70,15 +70,17 @@
                 
.add(createServiceDependency().setService(UserAdmin.class).setRequired(true)));
         
         // Create and register the Gadget store
+        String gadgetKeyspaceFilter = "(" + 
CassandraPersistenceManager.KEYSPACE_AWARE_KEY + "=" + 
CassandraPersistenceManager.DEFAULT_KEYSPACE + ")"; 
+        String gadgetCFAvailableFilter = "(" + 
ColumnFamilyAvailable.FILTER_NAME + "=" + GadgetStore.CF_GADGET + ")";
         manager.add( 
                 createComponent()
                 .setImplementation(GadgetStoreImpl.class)
                 .setInterface(GadgetStore.class.getName(), null)
                 
.add(createServiceDependency().setService(LogService.class).setRequired(true))
-                
.add(createServiceDependency().setService(CassandraPersistenceManager.class).setRequired(true)));
+                
.add(createServiceDependency().setService(CassandraPersistenceManager.class, 
gadgetKeyspaceFilter).setRequired(true))
+                
.add(createServiceDependency().setService(ColumnFamilyAvailable.class, 
gadgetCFAvailableFilter).setRequired(true)));
         
         // Create and register the oAuth store
-        String gadgetCFAvailableFilter = "(" + 
ColumnFamilyAvailable.FILTER_NAME + "=" + GadgetStore.CF_GADGET + ")";
         manager.add( 
                 createComponent()
                 .setImplementation(CassandraOAuthStore.class)

Modified: trunk/pom.xml
==============================================================================
--- trunk/pom.xml       (original)
+++ trunk/pom.xml       Wed Nov  3 10:56:26 2010
@@ -48,6 +48,9 @@
     
<org.apache.felix.file.install.version>3.0.0</org.apache.felix.file.install.version>
     <org.apache.felix.scr.version>1.6.0</org.apache.felix.scr.version>
     <pax-web.version>0.7.1</pax-web.version>
+    <pax.swissbox.version>1.3.0</pax.swissbox.version>
+    <pax.useradmin.version>0.0.1-SNAPSHOT</pax.useradmin.version>
+    <pax.exam.version>1.2.2</pax.exam.version>
     
<org.apache.sling.commons.mime.version>2.1.4</org.apache.sling.commons.mime.version>
     
<org.apache.sling.commons.osgi.version>2.0.6</org.apache.sling.commons.osgi.version>
     
<org.apache.felix.dependencymanager.version>3.0.0-SNAPSHOT</org.apache.felix.dependencymanager.version>
@@ -64,10 +67,8 @@
     <jstl.version>1.1.2</jstl.version>
     <taglibs.version>1.1.2</taglibs.version>
     
<net.kornr.osgi.commons-logging-osgi.version>20081215</net.kornr.osgi.commons-logging-osgi.version>
-    <pax.useradmin.version>0.0.1-SNAPSHOT</pax.useradmin.version>
     <junit.version>4.8.1</junit.version>
     <jmock.version>2.5.1</jmock.version>
-    <pax.exam.version>1.2.2</pax.exam.version>
 
     <!--
       Version numbers of platform bundles
@@ -249,19 +250,6 @@
   -->
   <dependencyManagement>
     <dependencies>
-      <dependency>
-        <groupId>javax.servlet</groupId>
-        <artifactId>jstl</artifactId>
-        <version>${jstl.version}</version>
-        <scope>provided</scope>
-      </dependency>
-      <dependency>
-        <groupId>taglibs</groupId>
-        <artifactId>standard</artifactId>
-        <version>${taglibs.version}</version>
-        <scope>provided</scope>
-      </dependency>
-
       <!--
         Platform bundles (start level 5)
       -->
@@ -492,10 +480,18 @@
       <version>${pax-web.version}</version>
       <scope>provided</scope>
     </dependency>
+    
+    <!-- Swissbox is used to resolve classloading issues in Jasper -->
     <dependency>
-      <groupId>org.ops4j.pax.web</groupId>
-      <artifactId>pax-web-jsp</artifactId>
-      <version>${pax-web.version}</version>
+      <groupId>org.ops4j.pax.swissbox</groupId>
+      <artifactId>pax-swissbox-core</artifactId>
+      <version>${pax.swissbox.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.ops4j.base</groupId>
+      <artifactId>ops4j-base-lang</artifactId>
+      <version>1.2.2</version>
       <scope>provided</scope>
     </dependency>
 
@@ -584,6 +580,7 @@
   -->
   <modules>
     <module>amdatu-release</module>
+    <module>amdatu-web</module>
     <module>platform-bundles</module>
     <module>application-bundles</module>
     <module>gadget-bundles</module>
@@ -795,7 +792,7 @@
               
<outputDirectory>${root.directory}/system-bundles</outputDirectory>
               <excludeTransitive>true</excludeTransitive>
               <includeScope>runtime</includeScope>
-              
<includeGroupIds>org.apache.felix,org.ops4j.pax.web,org.ops4j.pax.useradmin,org.apache.sling</includeGroupIds>
+              
<includeGroupIds>org.apache.felix,org.ops4j.pax.web,org.ops4j.pax.useradmin,org.ops4j.pax.swissbox,org.ops4j.base,org.apache.sling</includeGroupIds>
             </configuration>
           </execution>
           <execution>
@@ -808,7 +805,7 @@
               
<outputDirectory>${root.directory}/system-bundles</outputDirectory>
               <excludeTransitive>true</excludeTransitive>
               <includeScope>provided</includeScope>
-              
<includeGroupIds>org.apache.felix,org.ops4j.pax.web,org.apache.sling</includeGroupIds>
+              
<includeGroupIds>org.apache.felix,org.ops4j.pax.web,org.ops4j.pax.swissbox,org.ops4j.base,org.apache.sling</includeGroupIds>
             </configuration>
           </execution>
 

Modified: trunk/src/main/resources/conf/felix-config.properties
==============================================================================
--- trunk/src/main/resources/conf/felix-config.properties       (original)
+++ trunk/src/main/resources/conf/felix-config.properties       Wed Nov  3 
10:56:26 2010
@@ -70,18 +70,18 @@
 # to install when the framework starts. The ending numerical component
 # is the target start level. Any number of these properties may be
 # specified for different start levels.
-#felix.auto.install.5=file:platform-bundles/org.amdatu.shindig-app-bundle-0.0.6-SNAPSHOT.jar
+#felix.auto.install.5=file:platform-bundles/org.amdatu.shindig-app-bundle-${platform.version}.jar
 
 # The following property is a space-delimited list of bundle URLs
 # to install and start when the framework starts. The ending numerical
 # component is the target start level. Any number of these properties
 # may be specified for different start levels.
-felix.auto.start.1=reference:file:system-bundles/org.apache.felix.configadmin-1.2.4.jar
 
reference:file:system-bundles/org.apache.felix.dependencymanager-3.0.0-SNAPSHOT.jar
 reference:file:system-bundles/org.apache.felix.eventadmin-1.2.2.jar 
reference:file:system-bundles/org.apache.felix.fileinstall-3.0.0.jar 
reference:file:system-bundles/org.apache.felix.log-1.0.0.jar 
reference:file:system-bundles/org.apache.felix.main-2.0.5.jar 
reference:file:system-bundles/org.apache.felix.metatype-1.0.4.jar 
reference:file:system-bundles/org.apache.felix.shell.tui-1.4.1.jar 
reference:file:system-bundles/org.apache.felix.shell-1.4.2.jar 
reference:file:system-bundles/org.apache.felix.webconsole-3.1.2.jar 
reference:file:system-bundles/org.apache.sling.commons.mime-2.1.4.jar 
reference:file:system-bundles/org.apache.sling.commons.osgi-2.0.6.jar 
reference:file:system-bundles/org.osgi.compendium-1.0.0.jar 
reference:file:system-bundles/org.osgi.core-1.0.0.jar 
reference:file:system-bundles/pax-useradmin-service-0.0.1-SNAPSHOT.jar 
reference:file:system-bundles/pax-web-jetty-bundle-0.7.1.jar 
reference:file:system-bundles/pax-web-jsp-0.7.1.jar 
reference:file:system-bundles/org.apache.felix.scr-1.6.0.jar
-felix.auto.start.2=reference:file:platform-bundles/org.amdatu.platform.filebased-configuration-0.0.6-SNAPSHOT.jar
-felix.auto.start.5=reference:file:platform-bundles/org.amdatu.platform.shindig-application-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.cassandra-application-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.cassandra-listener-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.cassandra-persistencemanager-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.loghandler-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.profile-service-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.tenant-service-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.authorization-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.httpcontext-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.wink-application-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.sesame-application-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.config-template-manager-0.0.6-SNAPSHOT.jar
 
reference:file:platform-bundles/org.amdatu.platform.useradmin-cassandra-store-0.0.6-SNAPSHOT.jar
-felix.auto.start.10=reference:file:application-bundles/org.amdatu.application.dashboard-0.0.6-SNAPSHOT.jar
 
reference:file:application-bundles/org.amdatu.application.gadgetmanagement-0.0.6-SNAPSHOT.jar
-felix.auto.start.20=reference:file:gadget-bundles/org.amdatu.gadget.sparqlendpoint-0.0.6-SNAPSHOT.jar
 reference:file:gadget-bundles/org.amdatu.gadget.login-0.0.6-SNAPSHOT.jar
-felix.auto.start.30=reference:file:example-bundles/org.amdatu.example.friends-gadget-0.0.6-SNAPSHOT.jar
 
reference:file:example-bundles/org.amdatu.example.course-gadget-0.0.6-SNAPSHOT.jar
 
reference:file:example-bundles/org.amdatu.example.course-service-0.0.6-SNAPSHOT.jar
+felix.auto.start.1=reference:file:system-bundles/org.apache.felix.configadmin-1.2.4.jar
 
reference:file:system-bundles/org.apache.felix.dependencymanager-3.0.0-SNAPSHOT.jar
 reference:file:system-bundles/org.apache.felix.eventadmin-1.2.2.jar 
reference:file:system-bundles/org.apache.felix.fileinstall-3.0.0.jar 
reference:file:system-bundles/org.apache.felix.log-1.0.0.jar 
reference:file:system-bundles/org.apache.felix.main-2.0.5.jar 
reference:file:system-bundles/org.apache.felix.metatype-1.0.4.jar 
reference:file:system-bundles/org.apache.felix.shell.tui-1.4.1.jar 
reference:file:system-bundles/org.apache.felix.shell-1.4.2.jar 
reference:file:system-bundles/org.apache.felix.webconsole-3.1.2.jar 
reference:file:system-bundles/org.apache.sling.commons.mime-2.1.4.jar 
reference:file:system-bundles/org.apache.sling.commons.osgi-2.0.6.jar 
reference:file:system-bundles/org.osgi.compendium-1.0.0.jar 
reference:file:system-bundles/org.osgi.core-1.0.0.jar 
reference:file:system-bundles/pax-useradmin-service-0.0.1-SNAPSHOT.jar 
reference:file:system-bundles/pax-web-jetty-bundle-0.7.1.jar 
reference:file:system-bundles/pax-swissbox-core-${pax.swissbox.version}.jar 
reference:file:system-bundles/ops4j-base-lang-1.2.2.jar 
reference:file:system-bundles/org.apache.felix.scr-1.6.0.jar
+felix.auto.start.2=reference:file:platform-bundles/org.amdatu.platform.filebased-configuration-${platform.version}.jar
+felix.auto.start.5=reference:file:platform-bundles/org.amdatu.platform.shindig-application-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.cassandra-application-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.cassandra-listener-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.cassandra-persistencemanager-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.loghandler-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.profile-service-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.tenant-service-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.authorization-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.httpcontext-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.wink-application-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.sesame-application-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.config-template-manager-${platform.version}.jar
 
reference:file:platform-bundles/org.amdatu.platform.useradmin-cassandra-store-${platform.version}.jar
+felix.auto.start.10=reference:file:application-bundles/org.amdatu.application.dashboard-${platform.version}.jar
 
reference:file:application-bundles/org.amdatu.application.gadgetmanagement-${platform.version}.jar
 
reference:file:application-bundles/org.amdatu.web.jsp-support-${platform.version}.jar
+felix.auto.start.20=reference:file:gadget-bundles/org.amdatu.gadget.sparqlendpoint-${platform.version}.jar
 reference:file:gadget-bundles/org.amdatu.gadget.login-${platform.version}.jar
+felix.auto.start.30=reference:file:example-bundles/org.amdatu.example.friends-gadget-${platform.version}.jar
 
reference:file:example-bundles/org.amdatu.example.course-gadget-${platform.version}.jar
 
reference:file:example-bundles/org.amdatu.example.course-service-${platform.version}.jar
 
 # Sets the initial start level of the framework upon startup.
 org.osgi.framework.startlevel.beginning=40

Added: trunk/src/main/resources/licenses/apache-license-2.0.txt
==============================================================================
--- (empty file)
+++ trunk/src/main/resources/licenses/apache-license-2.0.txt    Wed Nov  3 
10:56:26 2010
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Reply via email to