You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by pr...@apache.org on 2003/02/18 15:25:24 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap RedirectToURINode.java RedirectToNodeBuilder.java

proyal      2003/02/18 06:25:24

  Modified:    .        changes.xml
               src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        RedirectToURINode.java RedirectToNodeBuilder.java
  Log:
  Add ability to do global redirects from sitemap
  
  Revision  Changes    Path
  1.349     +4 -1      xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.348
  retrieving revision 1.349
  diff -u -r1.348 -r1.349
  --- changes.xml	17 Feb 2003 22:05:19 -0000	1.348
  +++ changes.xml	18 Feb 2003 14:25:24 -0000	1.349
  @@ -41,6 +41,9 @@
    </devs>
   
    <release version="@version@" date="@date@">
  +  <action dev="PAR" type="add">
  +    Optional 'global' parameter on map:redirect-to when giving a URI.
  +  </action>
     <action dev="PAR" type="update">
       Make getParentComponentManager in CocoonServlet protected so alternate methods to getting the
       parent CM can be used.
  
  
  
  1.9       +20 -3     xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToURINode.java
  
  Index: RedirectToURINode.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToURINode.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- RedirectToURINode.java	31 Jan 2003 22:51:37 -0000	1.8
  +++ RedirectToURINode.java	18 Feb 2003 14:25:24 -0000	1.9
  @@ -54,6 +54,7 @@
   import org.apache.cocoon.components.treeprocessor.InvokeContext;
   import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
   import org.apache.cocoon.environment.Environment;
  +import org.apache.cocoon.environment.Redirector;
   import org.apache.cocoon.sitemap.PatternException;
   
   /**
  @@ -69,7 +70,12 @@
   
       private boolean createSession;
   
  -    public RedirectToURINode(VariableResolver uri, boolean createSession) throws PatternException {
  +    private boolean global;
  +
  +    public RedirectToURINode(VariableResolver uri, boolean createSession, boolean global )
  +        throws PatternException
  +    {
  +        this.global = global;
           this.uri = uri;
           this.createSession = createSession;
       }
  @@ -81,7 +87,18 @@
           if (getLogger().isInfoEnabled()) {
               getLogger().info("Redirecting to '" + resolvedURI + "' at " + this.getLocation());
           }
  -        PipelinesNode.getRedirector(env).redirect(this.createSession, resolvedURI);
  +
  +        final Redirector redirector = PipelinesNode.getRedirector(env);
  +
  +        if( this.global )
  +        {
  +            redirector.globalRedirect(this.createSession, resolvedURI);
  +        }
  +        else
  +        {
  +            redirector.redirect(this.createSession, resolvedURI);
  +        }
  +
           return true;
       }
   }
  
  
  
  1.7       +3 -2      xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToNodeBuilder.java
  
  Index: RedirectToNodeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/sitemap/RedirectToNodeBuilder.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RedirectToNodeBuilder.java	31 Jan 2003 22:51:37 -0000	1.6
  +++ RedirectToNodeBuilder.java	18 Feb 2003 14:25:24 -0000	1.7
  @@ -102,7 +102,8 @@
           } else {
               ProcessingNode URINode = new RedirectToURINode(
                   VariableResolverFactory.getResolver(config.getAttribute("uri"), this.manager),
  -                config.getAttributeAsBoolean("session", false)
  +                config.getAttributeAsBoolean("session", false),
  +                config.getAttributeAsBoolean("global", false)
               );
               return this.treeBuilder.setupNode(URINode, config);
   
  
  
  

----------------------------------------------------------------------
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