cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/acting SessionStateAction.java
Date Tue, 22 Oct 2002 02:10:31 GMT
vgritsenko    2002/10/21 19:10:31

  Modified:    .        changes.xml
               src/java/org/apache/cocoon/acting SessionStateAction.java
  Log:
  Sync and fix:
      Local parameters in SessionStateAction still do override global parameters,
      but do NOT change global parameters.
  
  Revision  Changes    Path
  1.269     +5 -1      xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.268
  retrieving revision 1.269
  diff -u -r1.268 -r1.269
  --- changes.xml	22 Oct 2002 01:52:59 -0000	1.268
  +++ changes.xml	22 Oct 2002 02:10:30 -0000	1.269
  @@ -41,6 +41,10 @@
   
    <release version="@version@" date="@date@">
     <action dev="VG" type="update">
  +    Local parameters in SessionStateAction still do override global parameters,
  +    but do NOT change global parameters.
  +  </action>
  +  <action dev="VG" type="update">
       Src attribute can be used now with ResourceExistsAction. Old parameter
       syntax preserved.
     </action>
  
  
  
  1.9       +26 -35    xml-cocoon2/src/java/org/apache/cocoon/acting/SessionStateAction.java
  
  Index: SessionStateAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/SessionStateAction.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SessionStateAction.java	11 Sep 2002 08:26:44 -0000	1.8
  +++ SessionStateAction.java	22 Oct 2002 02:10:31 -0000	1.9
  @@ -81,7 +81,7 @@
    * several times with different attribute names rather than sub
    * levels. </p>
    *
  - * <p><b>Global and local paramters:</b></p>
  + * <p><b>Global and local parameters:</b></p>
    *
    * <table border="1">
    *   <tr>
  @@ -130,31 +130,33 @@
       public void configure(Configuration conf) throws ConfigurationException {
           super.configure(conf);
   
  -        if (settings.containsKey("state-key-prefix"))
  +        if (settings.containsKey("state-key-prefix")) {
               statekey = (String) settings.get("state-key-prefix");
  -        if (settings.containsKey("new-state"))
  +        }
  +        if (settings.containsKey("new-state")) {
               newstate = (String) settings.get("new-state");
  -        if (settings.containsKey("sub-levels"))
  +        }
  +        if (settings.containsKey("sub-levels")) {
               sublevels = Integer.parseInt((String) settings.get("sub-levels"));
  -        if (settings.containsKey("state-level"))
  +        }
  +        if (settings.containsKey("state-level")) {
               mylevel = Integer.parseInt((String) settings.get("state-level"));
  +        }
       }
   
  -    public Map act(
  -        Redirector redirector,
  -        SourceResolver resolver,
  -        Map objectModel,
  -        String src,
  -        Parameters par)
  -        throws Exception {
  -            
  +    public Map act(Redirector redirector,
  +                   SourceResolver resolver,
  +                   Map objectModel,
  +                   String src,
  +                   Parameters par) throws Exception {
  +
           Request request = ObjectModelHelper.getRequest(objectModel);
   
           // read local settings
  -        newstate = par.getParameter("new-state", newstate);
  -        statekey = par.getParameter("state-key", statekey);
  -        sublevels = par.getParameterAsInteger("sublevels", sublevels);
  -        mylevel = par.getParameterAsInteger("state-level", mylevel);
  +        String newstate = par.getParameter("new-state", this.newstate);
  +        String statekey = par.getParameter("state-key", this.statekey);
  +        int sublevels = par.getParameterAsInteger("sublevels", this.sublevels);
  +        int mylevel = par.getParameterAsInteger("state-level", this.mylevel);
   
           if (newstate == null) {
               if (this.getLogger().isDebugEnabled()) {
  @@ -176,32 +178,25 @@
                       }
   
                   } else { // sublevels != 0
  -                    oldstate =
  -                        (String) session.getAttribute(
  -                            statekey + Integer.toString(mylevel));
  +                    oldstate = (String)session.getAttribute(statekey + mylevel);
                       for (int i = mylevel + 1; i <= sublevels; i++) {
  -                        session.removeAttribute(statekey + Integer.toString(i));
  +                        session.removeAttribute(statekey + i);
                           if (this.getLogger().isDebugEnabled()) {
  -                            getLogger().debug(
  -                                "remove " + statekey + Integer.toString(i));
  +                            getLogger().debug("Remove " + statekey + i);
                           }
                       }
  -                    session.setAttribute(
  -                        statekey + Integer.toString(mylevel),
  -                        newstate);
  +                    session.setAttribute(statekey + mylevel, newstate);
                       if (this.getLogger().isDebugEnabled()) {
  -                        getLogger().debug(
  -                            statekey + Integer.toString(mylevel) + "=" + newstate);
  +                        getLogger().debug(statekey + mylevel + "=" + newstate);
                       }
                   }
                   if (this.getLogger().isDebugEnabled()) {
  -                    getLogger().debug("transition " + oldstate + " -> " + newstate);
  +                    getLogger().debug("Transition " + oldstate + " -> " + newstate);
                   }
   
                   HashMap map = new HashMap(1);
                   map.put("newstate", newstate);
                   return map;
  -
               } else {
                   getLogger().warn(
                       "A session object was not present or no longer valid");
  @@ -211,9 +206,5 @@
               getLogger().warn("No request object");
               return null;
           }
  -
       }
   }
  -
  -
  -
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message