portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container/namespace NamespaceMapper.java
Date Tue, 17 May 2005 14:47:39 GMT
ate         2005/05/17 07:47:39

  Modified:    portal/src/webapp/WEB-INF/assembly Tag: M3_preparation
                        pluto-factories.xml
               portal/src/java/org/apache/jetspeed/services/information
                        Tag: M3_preparation
                        DynamicInformationProviderImpl.java
               portal/src/java/org/apache/jetspeed/engine/servlet Tag:
                        M3_preparation NamespaceEncodedSession.java
                        ServletRequestImpl.java
               portal/src/java/org/apache/jetspeed/aggregator/impl Tag:
                        M3_preparation PortletRendererImpl.java
  Added:       portal/src/java/org/apache/jetspeed/container/namespace Tag:
                        M3_preparation JetspeedNamespaceMapper.java
                        JetspeedNamespaceMapperFactoryImpl.java
                        JetspeedNamespaceMapperFactory.java
                        JetspeedNamespaceMapperImpl.java
  Removed:     commons/src/java/org/apache/jetspeed/container/namespace
                        Tag: M3_preparation NamespaceMapper.java
  Log:
  See: http://issues.apache.org/jira/browse/JS2-260
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.5.2.1   +12 -1     jakarta-jetspeed-2/portal/src/webapp/WEB-INF/assembly/pluto-factories.xml
  
  Index: pluto-factories.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/webapp/WEB-INF/assembly/pluto-factories.xml,v
  retrieving revision 1.5
  retrieving revision 1.5.2.1
  diff -u -r1.5 -r1.5.2.1
  --- pluto-factories.xml	12 May 2005 21:03:22 -0000	1.5
  +++ pluto-factories.xml	17 May 2005 14:47:39 -0000	1.5.2.1
  @@ -3,6 +3,10 @@
   
   <beans> 
     
  +  <bean id="JetspeedNamespaceMapper" class="org.apache.jetspeed.container.namespace.JetspeedNamespaceMapperImpl">
  +       <constructor-arg index="0"><value>js_</value></constructor-arg>
  +  </bean>
  +  
     <bean id="LocalPortletInvokerTarget"
           class="org.apache.jetspeed.container.invoker.LocalPortletInvoker" singleton="false"
     />   
  @@ -156,8 +160,15 @@
     <bean id="org.apache.pluto.util.NamespaceMapper"
           class="org.apache.jetspeed.components.factorybeans.PlutoFactoryFactoryBean"
     >             
  -       <property name="className"><value>org.apache.pluto.util.impl.NamespaceMapperFactoryImpl</value></property>
  +       <property name="className"><value>org.apache.jetspeed.container.namespace.JetspeedNamespaceMapperFactoryImpl</value></property>
          <property name="servletConfig"><ref bean="javax.servlet.ServletConfig"/></property>
  +       <property name="props">
  +        <map>
  +         <entry key="JetspeedNamespaceMapper">
  +             <ref bean="JetspeedNamespaceMapper" />
  +         </entry>
  +        </map>          
  +       </property>
     </bean>
     
    
  
  
  
  No                   revision
  No                   revision
  1.7.4.1   +6 -3      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/information/DynamicInformationProviderImpl.java
  
  Index: DynamicInformationProviderImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/information/DynamicInformationProviderImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.7.4.1
  diff -u -r1.7 -r1.7.4.1
  --- DynamicInformationProviderImpl.java	15 Oct 2004 21:44:32 -0000	1.7
  +++ DynamicInformationProviderImpl.java	17 May 2005 14:47:39 -0000	1.7.4.1
  @@ -29,8 +29,9 @@
   import org.apache.pluto.services.information.DynamicInformationProvider;
   import org.apache.pluto.services.information.PortletActionProvider;
   import org.apache.pluto.services.information.ResourceURLProvider;
  +import org.apache.pluto.factory.NamespaceMapperFactory;
   import org.apache.pluto.om.window.PortletWindow;
  -import org.apache.pluto.util.NamespaceMapperAccess;
  +import org.apache.pluto.util.NamespaceMapper;
   import org.apache.pluto.services.information.PortletURLProvider;
   import org.apache.jetspeed.container.state.MutableNavigationalState;
   import org.apache.jetspeed.container.state.NavigationalState;
  @@ -188,11 +189,13 @@
   
           Map portletParameters = new HashMap();
   
  +        NamespaceMapper namespaceMapper = ((NamespaceMapperFactory) Jetspeed.getComponentManager().getComponent(
  +                org.apache.pluto.util.NamespaceMapper.class)).getNamespaceMapper();
           while (parameters.hasMoreElements())
           {
               String name = (String)parameters.nextElement();
   
  -            String portletParameter = NamespaceMapperAccess.getNamespaceMapper().decode(portletWindow.getId(),name);
  +            String portletParameter = namespaceMapper.decode(portletWindow.getId(),name);
   
               if (portletParameter!=null) // it is in the portlet's namespace
               {
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +31 -0     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/namespace/Attic/JetspeedNamespaceMapper.java
  
  
  
  
  1.1.2.1   +48 -0     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/namespace/Attic/JetspeedNamespaceMapperFactoryImpl.java
  
  
  
  
  1.1.2.1   +29 -0     jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/namespace/Attic/JetspeedNamespaceMapperFactory.java
  
  
  
  
  1.1.2.1   +113 -0    jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/namespace/Attic/JetspeedNamespaceMapperImpl.java
  
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +8 -6      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/servlet/NamespaceEncodedSession.java
  
  Index: NamespaceEncodedSession.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/servlet/NamespaceEncodedSession.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- NamespaceEncodedSession.java	8 Mar 2005 21:59:15 -0000	1.1
  +++ NamespaceEncodedSession.java	17 May 2005 14:47:39 -0000	1.1.2.1
  @@ -21,9 +21,10 @@
   
   import javax.servlet.http.HttpSession;
   
  +import org.apache.jetspeed.Jetspeed;
  +import org.apache.jetspeed.container.namespace.JetspeedNamespaceMapper;
  +import org.apache.jetspeed.container.namespace.JetspeedNamespaceMapperFactory;
   import org.apache.pluto.om.common.ObjectID;
  -import org.apache.pluto.util.NamespaceMapper;
  -import org.apache.pluto.util.NamespaceMapperAccess;
   
   /**
    * @author Scott T Weaver
  @@ -32,7 +33,7 @@
   public class NamespaceEncodedSession extends HttpSessionWrapper
   {
   
  -    private NamespaceMapper nameSpaceMapper;
  +    private JetspeedNamespaceMapper nameSpaceMapper;
   
       private ObjectID webAppId;
   
  @@ -44,7 +45,8 @@
       public NamespaceEncodedSession(HttpSession session, ObjectID webAppId)
       {
           super(session);
  -        this.nameSpaceMapper = NamespaceMapperAccess.getNamespaceMapper();
  +        this.nameSpaceMapper = ((JetspeedNamespaceMapperFactory) Jetspeed.getComponentManager().getComponent(
  +                org.apache.pluto.util.NamespaceMapper.class)).getJetspeedNamespaceMapper();
           this.webAppId = webAppId;
       }
   
  @@ -90,13 +92,13 @@
           }
           else
           {
  -            return super.getAttribute(NamespaceMapperAccess.getNamespaceMapper().encode(webAppId,
name));
  +            return super.getAttribute(nameSpaceMapper.encode(webAppId, name));
           }
       }
   
       private boolean skipEncode(String name)
       {
  -        return name.startsWith("Pluto_") || name.startsWith("javax.portlet") || name.startsWith("javax.servlet")
|| name.startsWith("org.apache.jetspeed");
  +        return name.startsWith(nameSpaceMapper.getPrefix()) || name.startsWith("javax.portlet")
|| name.startsWith("javax.servlet") || name.startsWith("org.apache.jetspeed");
       }
   
       /*
  
  
  
  1.38.2.1  +8 -6      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java
  
  Index: ServletRequestImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/servlet/ServletRequestImpl.java,v
  retrieving revision 1.38
  retrieving revision 1.38.2.1
  diff -u -r1.38 -r1.38.2.1
  --- ServletRequestImpl.java	11 Apr 2005 13:42:49 -0000	1.38
  +++ ServletRequestImpl.java	17 May 2005 14:47:39 -0000	1.38.2.1
  @@ -31,7 +31,10 @@
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.apache.jetspeed.Jetspeed;
   import org.apache.jetspeed.PortalReservedParameters;
  +import org.apache.jetspeed.container.namespace.JetspeedNamespaceMapper;
  +import org.apache.jetspeed.container.namespace.JetspeedNamespaceMapperFactory;
   import org.apache.jetspeed.container.url.PortalURL;
   import org.apache.jetspeed.request.JetspeedRequestContext;
   import org.apache.jetspeed.request.RequestContext;
  @@ -42,8 +45,6 @@
   import org.apache.pluto.om.portlet.PortletDefinition;
   import org.apache.pluto.om.window.PortletWindow;
   import org.apache.pluto.util.Enumerator;
  -import org.apache.pluto.util.NamespaceMapper;
  -import org.apache.pluto.util.NamespaceMapperAccess;
   
   /**
    * This request wrappers the servlet request and is used within the container to
  @@ -59,7 +60,7 @@
       private static final Log log = LogFactory.getLog(ServletRequestImpl.class);
   
       PortletWindow portletWindow = null;
  -    private NamespaceMapper nameSpaceMapper = null;
  +    private JetspeedNamespaceMapper nameSpaceMapper = null;
       private ServletRequest currentRequest = null;
   
       private Map portletParameters;
  @@ -68,7 +69,8 @@
       public ServletRequestImpl( HttpServletRequest servletRequest, PortletWindow window
)
       {
           super(servletRequest);
  -        nameSpaceMapper = NamespaceMapperAccess.getNamespaceMapper();
  +        nameSpaceMapper = ((JetspeedNamespaceMapperFactory) Jetspeed.getComponentManager().getComponent(
  +                org.apache.pluto.util.NamespaceMapper.class)).getJetspeedNamespaceMapper();
           this.portletWindow = window;        
           PortletDefinition portletDef = portletWindow.getPortletEntity().getPortletDefinition();
           if(portletDef != null)
  @@ -227,7 +229,7 @@
                   PortletRequest pr = (PortletRequest) super.getAttribute("javax.portlet.request");
                   if (pr != null)
                   {
  -                    value = super.getAttribute(NamespaceMapperAccess.getNamespaceMapper().encode(portletWindow.getId(),
  +                    value = super.getAttribute(nameSpaceMapper.encode(portletWindow.getId(),
                               name));
                   }
               }
  
  
  
  No                   revision
  No                   revision
  1.28.2.1  +1 -9      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
  
  Index: PortletRendererImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java,v
  retrieving revision 1.28
  retrieving revision 1.28.2.1
  diff -u -r1.28 -r1.28.2.1
  --- PortletRendererImpl.java	29 Apr 2005 14:01:38 -0000	1.28
  +++ PortletRendererImpl.java	17 May 2005 14:47:39 -0000	1.28.2.1
  @@ -33,7 +33,6 @@
   import org.apache.jetspeed.request.RequestContext;
   import org.apache.jetspeed.util.JetspeedObjectID;
   import org.apache.pluto.PortletContainer;
  -import org.apache.pluto.PortletContainerServices;
   import org.apache.pluto.om.common.ObjectID;
   import org.apache.pluto.om.entity.PortletEntity;
   import org.apache.pluto.om.window.PortletWindow;
  @@ -93,7 +92,6 @@
           try
           {
               portletWindow = getPortletWindow(fragment);
  -            PortletContainerServices.prepare("jetspeed");           
               ContentDispatcherCtrl dispatcherCtrl = getDispatcherCtrl(requestContext, true);
               dispatcher = getDispatcher(requestContext, true);
               servletRequest = requestContext.getRequestForWindow(portletWindow);
  @@ -128,7 +126,6 @@
           try
           {
               portletWindow = getPortletWindow(fragment);
  -            PortletContainerServices.prepare("jetspeed");
               ContentDispatcherCtrl dispatcherCtrl = getDispatcherCtrl(requestContext, true);
               
               HttpServletRequest servletRequest = requestContext.getRequestForWindow(portletWindow);
  @@ -155,9 +152,6 @@
        */
       public void render( ContentFragment fragment, RequestContext requestContext )
       {
  -
  -        PortletContainerServices.prepare("jetspeed");
  -
           PortletWindow portletWindow;
           
           ContentDispatcherCtrl dispatcherCtrl = getDispatcherCtrl(requestContext, true);
  @@ -231,8 +225,6 @@
           ContentDispatcher dispatcher = null;
           RenderingJob rJob;
   
  -        PortletContainerServices.prepare("jetspeed");
  -
           PortletWindow portletWindow = getPortletWindow(fragment);
           ContentDispatcherCtrl dispatcherCtrl = getDispatcherCtrl(requestContext, true);
           dispatcher = getDispatcher(requestContext, true);        
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message