You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2005/05/10 15:26:50 UTC

cvs commit: jakarta-tapestry/framework/src/descriptor/META-INF tapestry.persist.xml

hlship      2005/05/10 06:26:50

  Modified:    .        status.xml
               framework/src/java/org/apache/tapestry/record
                        ClientPropertyPersistenceStrategy.java
                        PropertyPersistenceStrategySourceImpl.java
               portlet/src/java/org/apache/tapestry/portlet
                        PortletMessages.java
               framework/src/test/org/apache/tapestry/record
                        TestClientPropertyPersistenceStrategy.java
               framework/src/descriptor/META-INF tapestry.persist.xml
  Log:
  TAPESTRY-320: Properly seperate client-side persisted property data from multiple users.
  
  Revision  Changes    Path
  1.100     +1 -0      jakarta-tapestry/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/status.xml,v
  retrieving revision 1.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- status.xml	9 May 2005 20:43:02 -0000	1.99
  +++ status.xml	10 May 2005 13:26:49 -0000	1.100
  @@ -56,6 +56,7 @@
         <action type="add" dev="HLS">Add initial support for the validator: binding prefix.</action>
         <action type="add" dev="PF" fixes-bug="TAPESTRY-317">Fixed workbench build script so that generated war file will include the required ognl jar.</action>
         <action type="fix" dev="HLS" fixes-bug="TAPESTRY-166">Allow Submits to defer invoking their listener.</action>
  +      <action type="fix" dev="HLS" fixes-bug="TAPESTRY-320"> Property seperate data from different users stored using the tapestry.persist.ClientPropertyPersistenceStrategy service.</action>
       </release>
       <release version="4.0-alpha-2" date="May 5 2005">
         <action type="update" dev="HLS"> Coordinate Locale changes with the hivemind.ThreadLocale service. </action>
  
  
  
  1.3       +11 -2     jakarta-tapestry/framework/src/java/org/apache/tapestry/record/ClientPropertyPersistenceStrategy.java
  
  Index: ClientPropertyPersistenceStrategy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/record/ClientPropertyPersistenceStrategy.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClientPropertyPersistenceStrategy.java	18 Apr 2005 17:06:35 -0000	1.2
  +++ ClientPropertyPersistenceStrategy.java	10 May 2005 13:26:49 -0000	1.3
  @@ -27,7 +27,8 @@
   import org.apache.tapestry.web.WebRequest;
   
   /**
  - * Encodes persistent page properties on the client as query parameters.
  + * Service tapestry.persist.ClientPropertyPersistenceStrategy. Encodes persistent page properties on
  + * the client as query parameters.
    * <p>
    * Uses the threaded model.
    * 
  @@ -64,7 +65,15 @@
           _encoder = encoder;
       }
   
  -    public void initializeForService()
  +    /**
  +     * Initializer for this service, invoked every time a service instance is created. This
  +     * initializer pulls out of the request and query parameters whose prefix is "client:" and
  +     * expects them to be encoded {@link PersistentPropertyData}, which are stored internally.
  +     * Because the service model is threaded, this information is specific to a single request, and
  +     * will be discarded at the end of the request.
  +     */
  +
  +    public void initializeService()
       {
           List names = _request.getParameterNames();
           Iterator i = names.iterator();
  
  
  
  1.3       +5 -0      jakarta-tapestry/framework/src/java/org/apache/tapestry/record/PropertyPersistenceStrategySourceImpl.java
  
  Index: PropertyPersistenceStrategySourceImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/record/PropertyPersistenceStrategySourceImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PropertyPersistenceStrategySourceImpl.java	11 Apr 2005 16:08:21 -0000	1.2
  +++ PropertyPersistenceStrategySourceImpl.java	10 May 2005 13:26:49 -0000	1.3
  @@ -26,7 +26,12 @@
   import org.apache.tapestry.engine.ServiceEncoding;
   
   /**
  + * Implementation of the <code>tapestry.persist.PropertyPersistenceStrategySource</code> service.
  + * Allows access to other services, that implement the
  + * {@link org.apache.tapestry.record.PropertyPersistenceStrategy} interface.
  + * 
    * @author Howard M. Lewis Ship
  + * @since 4.0
    */
   public class PropertyPersistenceStrategySourceImpl implements PropertyPersistenceStrategySource
   {
  
  
  
  1.7       +1 -3      jakarta-tapestry/portlet/src/java/org/apache/tapestry/portlet/PortletMessages.java
  
  Index: PortletMessages.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/portlet/src/java/org/apache/tapestry/portlet/PortletMessages.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PortletMessages.java	9 May 2005 20:43:02 -0000	1.6
  +++ PortletMessages.java	10 May 2005 13:26:49 -0000	1.7
  @@ -14,8 +14,6 @@
   
   package org.apache.tapestry.portlet;
   
  -import java.net.MalformedURLException;
  -
   import org.apache.hivemind.impl.MessageFormatter;
   
   /**
  @@ -54,6 +52,6 @@
   
       static String staleSession()
       {
  -        return _formatter.getMessage("sale-session");
  +        return _formatter.getMessage("stale-session");
       }
   }
  \ No newline at end of file
  
  
  
  1.3       +2 -2      jakarta-tapestry/framework/src/test/org/apache/tapestry/record/TestClientPropertyPersistenceStrategy.java
  
  Index: TestClientPropertyPersistenceStrategy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/record/TestClientPropertyPersistenceStrategy.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestClientPropertyPersistenceStrategy.java	18 Apr 2005 17:07:52 -0000	1.2
  +++ TestClientPropertyPersistenceStrategy.java	10 May 2005 13:26:50 -0000	1.3
  @@ -58,7 +58,7 @@
           ClientPropertyPersistenceStrategy strategy = new ClientPropertyPersistenceStrategy(encoder);
           strategy.setRequest(request);
   
  -        strategy.initializeForService();
  +        strategy.initializeService();
   
           assertSame(changes, strategy.getStoredChanges("MyPage", null));
   
  @@ -109,7 +109,7 @@
           ClientPropertyPersistenceStrategy strategy = new ClientPropertyPersistenceStrategy();
           strategy.setRequest(request);
   
  -        strategy.initializeForService();
  +        strategy.initializeService();
   
           strategy.addParametersForPersistentProperties(encoding, cycle);
   
  
  
  
  1.8       +2 -1      jakarta-tapestry/framework/src/descriptor/META-INF/tapestry.persist.xml
  
  Index: tapestry.persist.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/descriptor/META-INF/tapestry.persist.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- tapestry.persist.xml	18 Apr 2005 17:07:50 -0000	1.7
  +++ tapestry.persist.xml	10 May 2005 13:26:50 -0000	1.8
  @@ -59,8 +59,9 @@
       
       Stores persistent properties on the client, as either hidden form fields, or as
       query parameters. Persistent data for each page is stored in a seperate query parameter.
  +    The service stores client-specific state internally, and so it must use the threaded service model.
       
  -    <invoke-factory model="primitive">
  +    <invoke-factory model="threaded">
         <construct class="ClientPropertyPersistenceStrategy">
           <set-object property="request" value="infrastructure:request"/>
         </construct>
  
  
  

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