portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddew...@apache.org
Subject svn commit: r517514 - in /portals/pluto/branches/pluto-1.1.x: ./ pluto-container/src/main/java/org/apache/pluto/core/ pluto-portal-driver/ pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/ pluto-taglib/ pluto-taglib/src/main/java/org/apac...
Date Tue, 13 Mar 2007 03:48:02 GMT
Author: ddewolf
Date: Mon Mar 12 20:48:01 2007
New Revision: 517514

URL: http://svn.apache.org/viewvc?view=rev&rev=517514
Log:
JSP1.2 Compatibility enhancements: Testsuite runs in WebLogic8.1

Modified:
    portals/pluto/branches/pluto-1.1.x/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java
    portals/pluto/branches/pluto-1.1.x/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
    portals/pluto/branches/pluto-1.1.x/pluto-portal-driver/pom.xml
    portals/pluto/branches/pluto-1.1.x/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java
    portals/pluto/branches/pluto-1.1.x/pluto-taglib/pom.xml
    portals/pluto/branches/pluto-1.1.x/pluto-taglib/src/main/java/org/apache/pluto/tags/el/JSP20ExpressionEvaluatorProxy.java
    portals/pluto/branches/pluto-1.1.x/pom.xml

Modified: portals/pluto/branches/pluto-1.1.x/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java?view=diff&rev=517514&r1=517513&r2=517514
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java
(original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java
Mon Mar 12 20:48:01 2007
@@ -18,6 +18,14 @@
 
 import javax.servlet.ServletContext;
 
+/**
+ <pre>
+      <context-param>
+      <param-name>org.apache.pluto.CONTEXT_PATH</param-name>
+      <param-value>/path</param-value>
+    </context-param>
+ </pre>
+ */
 public class InitParameterApplicationIdResolver implements ApplicationIdResolver {
 
     public static final String CONTEXT_PATH_PARAM = "org.apache.pluto.CONTEXT_PATH";

Modified: portals/pluto/branches/pluto-1.1.x/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java?view=diff&rev=517514&r1=517513&r2=517514
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
(original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
Mon Mar 12 20:48:01 2007
@@ -122,6 +122,8 @@
             portletContext.getPortletApplicationDefinition();
         PortletDD portletDD = null;
 
+        LOG.info("Registering "+portletAppDD.getPortlets().size()+" portlets for context
"+portletContext.getApplicationId());
+
         for (Iterator it = portletAppDD.getPortlets().iterator(); it.hasNext();) {
             portletDD = (PortletDD) it.next();
             portletConfigs.put(
@@ -142,7 +144,7 @@
     public InternalPortletContext register(ServletContext servletContext)
         throws PortletContainerException {
         String applicationId = getContextPath(servletContext);
-        if (!portletContexts.containsKey(servletContext)) {
+        if (!portletContexts.containsKey(applicationId)) {
 
             PortletAppDD portletAppDD = PortletDescriptorRegistry.getRegistry()
                 .getPortletAppDD(servletContext);
@@ -156,17 +158,22 @@
             portletContexts.put(applicationId, portletContext);
 
             fireRegistered(portletContext);
-        }
 
-        if (LOG.isInfoEnabled()) {
-            LOG.info("Registered portlet application with application id '" + applicationId
+ "'");
+            if (LOG.isInfoEnabled()) {
+                LOG.info("Registered portlet application with application id '" + applicationId
+ "'");
+            }
+        } else {
+             if (LOG.isInfoEnabled()) {
+                LOG.info("Portlet application with application id '" + applicationId + "'
already registered.");
+            }
         }
 
+
         return (InternalPortletContext) portletContexts.get(applicationId);
     }
 
     public void remove(InternalPortletContext context) {
-        portletContexts.remove(context);
+        portletContexts.remove(context.getApplicationId());
         Iterator configs = portletConfigs.keySet().iterator();
         while (configs.hasNext()) {
             String key = (String) configs.next();
@@ -198,7 +205,11 @@
     }
 
     public PortletConfig getPortletConfig(String applicationId, String portletName) {
-        return (InternalPortletConfig) portletConfigs.get(applicationId + "/" + portletName);
+        String lookup = applicationId + "/" + portletName;
+        if(!portletConfigs.containsKey(lookup)) {
+            LOG.info("Unable to locate portlet config [applicationId="+applicationId+"]/["+portletName+"].");
+        }
+        return (InternalPortletConfig) portletConfigs.get(lookup);
     }
 
     public PortletDD getPortletDescriptor(String applicationId, String portletName) {
@@ -315,7 +326,7 @@
                 }
             }
             if (LOG.isInfoEnabled()) {
-                LOG.info("Found " +APP_ID_RESOLVERS.size()+" application id resolvers.");
+                LOG.info("Found " + APP_ID_RESOLVERS.size() + " application id resolvers.");
             }
         }
 
@@ -328,13 +339,13 @@
             if (resolver.getAuthority() < authority || path == null) {
                 authority = resolver.getAuthority();
                 String temp = resolver.resolveApplicationId(context);
-                if(temp != null) {
+                if (temp != null) {
                     path = temp;
                 }
             }
         }
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Resolved application id '"+path+"' with authority "+authority);
+            LOG.debug("Resolved application id '" + path + "' with authority " + authority);
         }
         return path;
     }

Modified: portals/pluto/branches/pluto-1.1.x/pluto-portal-driver/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-portal-driver/pom.xml?view=diff&rev=517514&r1=517513&r2=517514
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-portal-driver/pom.xml (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-portal-driver/pom.xml Mon Mar 12 20:48:01 2007
@@ -1,4 +1,5 @@
-<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">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
   <parent>
     <groupId>org.apache.pluto</groupId>
@@ -15,6 +16,12 @@
     <dependency>
       <groupId>org.apache.pluto</groupId>
       <artifactId>pluto-container</artifactId>
+      <version>${pom.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.pluto</groupId>
+      <artifactId>pluto-taglib</artifactId>
       <version>${pom.version}</version>
       <scope>provided</scope>
     </dependency>

Modified: portals/pluto/branches/pluto-1.1.x/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java?view=diff&rev=517514&r1=517513&r2=517514
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java
(original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-portal-driver/src/main/java/org/apache/pluto/driver/tags/PortletTag.java
Mon Mar 12 20:48:01 2007
@@ -30,6 +30,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.pluto.PortletContainer;
 import org.apache.pluto.PortletWindow;
+import org.apache.pluto.tags.el.ExpressionEvaluatorProxy;
 import org.apache.pluto.driver.AttributeKeys;
 import org.apache.pluto.driver.services.portal.PortletWindowConfig;
 import org.apache.pluto.driver.url.PortalURL;
@@ -206,8 +207,8 @@
      * @throws JspException  if an error occurs.
      */
     private void evaluatePortletId() throws JspException {
-        Object obj = ExpressionEvaluatorManager.evaluate(
-        		"portletId", portletId, String.class, this, pageContext);
+        ExpressionEvaluatorProxy proxy = ExpressionEvaluatorProxy.getProxy();
+        Object obj = proxy.evaluate(portletId, pageContext);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Evaluated portletId to: " + obj);
         }

Modified: portals/pluto/branches/pluto-1.1.x/pluto-taglib/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-taglib/pom.xml?view=diff&rev=517514&r1=517513&r2=517514
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-taglib/pom.xml (original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-taglib/pom.xml Mon Mar 12 20:48:01 2007
@@ -25,12 +25,14 @@
             <version>${servlet-api.version}</version>
             <scope>provided</scope>
         </dependency>
+      <!--
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>jsp-api</artifactId>
             <version>${jsp-api.version}</version>
             <scope>provided</scope>
         </dependency>
+        -->
 
       <dependency>
         <groupId>commons-logging</groupId>

Modified: portals/pluto/branches/pluto-1.1.x/pluto-taglib/src/main/java/org/apache/pluto/tags/el/JSP20ExpressionEvaluatorProxy.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-taglib/src/main/java/org/apache/pluto/tags/el/JSP20ExpressionEvaluatorProxy.java?view=diff&rev=517514&r1=517513&r2=517514
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pluto-taglib/src/main/java/org/apache/pluto/tags/el/JSP20ExpressionEvaluatorProxy.java
(original)
+++ portals/pluto/branches/pluto-1.1.x/pluto-taglib/src/main/java/org/apache/pluto/tags/el/JSP20ExpressionEvaluatorProxy.java
Mon Mar 12 20:48:01 2007
@@ -16,15 +16,52 @@
  */
 package org.apache.pluto.tags.el;
 
-import javax.servlet.jsp.PageContext;
 import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.el.ExpressionEvaluator;
-import javax.servlet.jsp.el.ELException;
+import javax.servlet.jsp.PageContext;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 
 class JSP20ExpressionEvaluatorProxy extends ExpressionEvaluatorProxy {
 
+    public static Method expressionEvaluatorGetter;
+
+    public static Method variableResolverGetter;
+
+    public static Method evalMethod;
+
+    static {
+        try {
+            expressionEvaluatorGetter = PageContext.class.getMethod("getExpressionEvaluator",
new Class[0]);
+
+            variableResolverGetter = PageContext.class.getMethod("getVariableResolver", new
Class[0]);
+
+            evalMethod = expressionEvaluatorGetter.getReturnType().getMethod("evaluate",
+                new Class[]{String.class, Class.class, variableResolverGetter.getReturnType(),
Class.forName("javax.servlet.jsp.el.FunctionMapper")});
+
+        } catch (Exception e) {
+            throw new RuntimeException("Unable to located JSP20 Methods.", e);
+        }
+    }
 
     public String evaluate(String value, PageContext pageContext) throws JspException {
+        try {
+            Object evaluator = expressionEvaluatorGetter.invoke(pageContext, new Object[0]);
+            Object resolver = variableResolverGetter.invoke(pageContext, new Object[0]);
+
+            Object evaluated = evalMethod.invoke(evaluator, new Object[]{value, Object.class,
resolver, null});
+
+            if (evaluated != null) {
+                value = evaluated.toString();
+            }
+        } catch (IllegalAccessException e) {
+            throw new JspException(e);
+        } catch (InvocationTargetException e) {
+            throw new JspException(e);
+        }
+        return value;
+    }
+    
+    /*
         ExpressionEvaluator eval = pageContext.getExpressionEvaluator();
 
         try {
@@ -46,4 +83,5 @@
 
         return value;
     }
+    */
 }

Modified: portals/pluto/branches/pluto-1.1.x/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pom.xml?view=diff&rev=517514&r1=517513&r2=517514
==============================================================================
--- portals/pluto/branches/pluto-1.1.x/pom.xml (original)
+++ portals/pluto/branches/pluto-1.1.x/pom.xml Mon Mar 12 20:48:01 2007
@@ -227,9 +227,9 @@
         <javax.portlet.version.minor>0</javax.portlet.version.minor>
         <portlet-api.version>1.0</portlet-api.version>
         <servlet-api.version>2.3</servlet-api.version>
-        <jsp-api.version>2.0</jsp-api.version>
-        <jstl.version>1.1.2</jstl.version>
-        <taglibs.standard.version>1.0.4</taglibs.standard.version>
+        <jsp-api.version>1.2</jsp-api.version>
+        <jstl.version>1.0.6</jstl.version>
+        <taglibs.standard.version>1.0.6</taglibs.standard.version>
         <xerces.version>2.6.2</xerces.version>
         <castor.version>1.0</castor.version>
         <commons-digester.version>1.8</commons-digester.version>



Mime
View raw message