cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/treeprocessor/sitemap SitemapLanguage.java
Date Fri, 08 Feb 2002 07:48:33 GMT
cziegeler    02/02/07 23:48:33

  Modified:    src/scratchpad/src/org/apache/cocoon/transformation
                        EncodeURLTransformer.java
               src/scratchpad/src/org/apache/cocoon/treeprocessor/sitemap
                        SitemapLanguage.java
  Log:
  - TreeProcessor now uses CocoonComponentManager
  - EncodeURLTransformer is Cacheable if: a) no session is available or b) the session is
  tracked by cookies
  
  Revision  Changes    Path
  1.4       +20 -15    xml-cocoon2/src/scratchpad/src/org/apache/cocoon/transformation/EncodeURLTransformer.java
  
  Index: EncodeURLTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/transformation/EncodeURLTransformer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EncodeURLTransformer.java	7 Feb 2002 14:40:17 -0000	1.3
  +++ EncodeURLTransformer.java	8 Feb 2002 07:48:32 -0000	1.4
  @@ -114,7 +114,7 @@
    * </pre></tt>
    *
    * @author     <a href="mailto:bh22351@i-one.at">Bernhard Huber</a>
  - * @version    CVS $Id: EncodeURLTransformer.java,v 1.3 2002/02/07 14:40:17 cziegeler Exp
$
  + * @version    CVS $Id: EncodeURLTransformer.java,v 1.4 2002/02/08 07:48:32 cziegeler Exp
$
    *
    * @cocoon:name encodeURL
    * @cocoon:status scratchpad
  @@ -183,20 +183,25 @@
       public void setup(SourceResolver resolver, Map objectModel, String source, Parameters
parameters)
       throws ProcessingException, SAXException, IOException {
   
  -
  -        this.session = ObjectModelHelper.getRequest(objectModel).getSession( false );
  +        final Request request = ObjectModelHelper.getRequest(objectModel);
  +        this.session = request.getSession( false );
           if ( null != this.session ) {
  -            this.response = ObjectModelHelper.getResponse(objectModel);
  -            final String includeName = parameters.getParameter(EncodeURLTransformer.INCLUDE_NAME,
  -                                                               this.includeNameConfigure);
  -            final String excludeName = parameters.getParameter(EncodeURLTransformer.EXCLUDE_NAME,
  -                                                               this.excludeNameConfigure);
  -            try {
  -                this.elementAttributeMatching = new ElementAttributeMatching(includeName,
excludeName);
  -            } catch (RESyntaxException reex) {
  -                final String message = "Cannot parse include-name: " + includeName + "
" +
  -                    "or exclude-name: " + excludeName + "!";
  -                throw new ProcessingException(message, reex);
  +            if ( request.isRequestedSessionIdFromURL() ) {
  +                this.response = ObjectModelHelper.getResponse(objectModel);
  +                final String includeName = parameters.getParameter(EncodeURLTransformer.INCLUDE_NAME,
  +                                                                   this.includeNameConfigure);
  +                final String excludeName = parameters.getParameter(EncodeURLTransformer.EXCLUDE_NAME,
  +                                                                   this.excludeNameConfigure);
  +                try {
  +                    this.elementAttributeMatching = new ElementAttributeMatching(includeName,
excludeName);
  +                } catch (RESyntaxException reex) {
  +                    final String message = "Cannot parse include-name: " + includeName
+ " " +
  +                        "or exclude-name: " + excludeName + "!";
  +                    throw new ProcessingException(message, reex);
  +                }
  +            } else {
  +                // we don't need to encode
  +                this.session = null;
               }
           }
       }
  @@ -318,7 +323,7 @@
        * </p>
        *
        * @author     <a href="mailto:bh22351@i-one.at">Bernhard Huber</a>
  -     * @version    CVS $Id: EncodeURLTransformer.java,v 1.3 2002/02/07 14:40:17 cziegeler
Exp $
  +     * @version    CVS $Id: EncodeURLTransformer.java,v 1.4 2002/02/08 07:48:32 cziegeler
Exp $
        */
       public class ElementAttributeMatching {
           /**
  
  
  
  1.6       +4 -4      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/treeprocessor/sitemap/SitemapLanguage.java
  
  Index: SitemapLanguage.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/treeprocessor/sitemap/SitemapLanguage.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SitemapLanguage.java	7 Feb 2002 10:48:57 -0000	1.5
  +++ SitemapLanguage.java	8 Feb 2002 07:48:33 -0000	1.6
  @@ -63,10 +63,10 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
   
  -import org.apache.avalon.excalibur.component.ExcaliburComponentManager;
   import org.apache.avalon.excalibur.component.ExcaliburComponentSelector;
   import org.apache.avalon.excalibur.component.RoleManager;
   
  +import org.apache.cocoon.components.CocoonComponentManager;
   import org.apache.cocoon.components.ExtendedComponentSelector;
   import org.apache.cocoon.components.LifecycleHelper;
   
  @@ -87,7 +87,7 @@
    * The tree builder for the sitemap language.
    *
    * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
  - * @version CVS $Id: SitemapLanguage.java,v 1.5 2002/02/07 10:48:57 sylvain Exp $
  + * @version CVS $Id: SitemapLanguage.java,v 1.6 2002/02/08 07:48:33 cziegeler Exp $
    */
   
   public class SitemapLanguage extends TreeBuilder {
  @@ -109,7 +109,7 @@
               config = new DefaultConfiguration("", "");
           }
   
  -        ComponentManager manager = new ExcaliburComponentManager(this.parentManager);
  +        ComponentManager manager = new CocoonComponentManager(this.parentManager);
   
           LifecycleHelper.setupComponent(manager,
               getLogger(),
  @@ -255,7 +255,7 @@
               // Ignore (no selector for this role)
               getLogger().debug("No selector for role " + role);
           }
  -        
  +
           // 2 - labels defined on this statement
           if (statementLabels != null) {
               labels.addAll(splitLabels(statementLabels));
  
  
  

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