[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action ...

Christian Bauer christian at hibernate.org
Wed Mar 21 16:08:03 EDT 2007


  User: cbauer  
  Date: 07/03/21 16:08:03

  Modified:    examples/wiki/src/main/org/jboss/seam/wiki/core/action  
                        NodeBrowser.java Menu.java
  Log:
  Starting to understand PAGE scope...
  
  Revision  Changes    Path
  1.7       +6 -8      jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action/NodeBrowser.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NodeBrowser.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action/NodeBrowser.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- NodeBrowser.java	21 Mar 2007 01:24:48 -0000	1.6
  +++ NodeBrowser.java	21 Mar 2007 20:08:03 -0000	1.7
  @@ -11,6 +11,7 @@
   import org.jboss.seam.wiki.core.ui.WikiUtil;
   
   import java.util.*;
  +import java.io.Serializable;
   
   /**
    * Resolves <tt>currentDocument</tt> and <tt>currentDirectory</tt> objects for given request parameters.
  @@ -34,9 +35,9 @@
    * @author Christian Bauer
    */
   @Name("browser")
  - at Scope(ScopeType.EVENT)
  + at Scope(ScopeType.PAGE)
   @AutoCreate
  -public class NodeBrowser {
  +public class NodeBrowser implements Serializable {
   
       @RequestParameter
       protected String areaName;
  @@ -49,9 +50,6 @@
       public void setNodeId(Long nodeId) { this.nodeId = nodeId; }
   
       @In
  -    private Directory wikiRoot;
  -
  -    @In
       private GlobalPreferences globalPrefs;
   
       @In
  @@ -62,10 +60,10 @@
   
       // These are only EVENT scoped, we don't want them to jump from DocumentBrowser to
       // DirectoryBrowser over redirects
  -    @Out(scope = ScopeType.EVENT, required = false)
  +    @Out(scope = ScopeType.PAGE, required = false)
       protected Document currentDocument;
   
  -    @Out(scope = ScopeType.EVENT, required = false)
  +    @Out(scope = ScopeType.PAGE, required = false)
       protected Directory currentDirectory;
   
       @Out(scope = ScopeType.EVENT)
  @@ -136,7 +134,7 @@
       // Just a convenience method for recursive calling
       protected void addDirectoryToPath(List<Node> path, Node directory) {
           if (Identity.instance().hasPermission("Node", "read", directory) ||
  -            directory.getId().equals(wikiRoot.getId())
  +            directory.getId().equals( ((Directory)Component.getInstance("wikiRoot")).getId() )
              )
               path.add(directory);
           if (directory.getParent() != null )
  
  
  
  1.4       +2 -2      jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Menu.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Menu.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Menu.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- Menu.java	20 Mar 2007 02:38:15 -0000	1.3
  +++ Menu.java	21 Mar 2007 20:08:03 -0000	1.4
  @@ -13,7 +13,7 @@
   import java.io.Serializable;
   
   @Name("menu")
  - at Scope(ScopeType.CONVERSATION)
  + at Scope(ScopeType.PAGE)
   public class Menu implements Serializable {
   
       private List<MenuItem> items;
  @@ -56,7 +56,7 @@
           }
       }
   
  -    public class MenuItem{
  +    public class MenuItem implements Serializable {
           private Node node;
           private int level;
           private List<MenuItem> subItems = new ArrayList<MenuItem>();
  
  
  



More information about the jboss-cvs-commits mailing list