Re: svn commit: r398882 -/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/transf ormation/EncodeURLTransformer.java

2006-05-03 Thread Ralph Goers
Do you mean in general or this specific one?  I try to in general. This 
one is there under 2.1.9 as fixes-bug=COCOON-1742.  Speaking of which, 
now that this is also on trunk I can close it.


Ralph

Carsten Ziegeler wrote:

Ralph Goers wrote
  

Thanks for doing this.  Did you also delete ElementAttributeMatching from
the util directory?



Done now, thanks for the hint.

Btw, could you please add an entry to status.xml in 2.1.x for your changes?

Thanks
Carsten
  


Re: svn commit: r398882 -/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/transf ormation/EncodeURLTransformer.java

2006-05-03 Thread Carsten Ziegeler
Ralph Goers schrieb:
 Do you mean in general or this specific one?  I try to in general. This 
 one is there under 2.1.9 as fixes-bug=COCOON-1742.  Speaking of which, 
 now that this is also on trunk I can close it.
 
I meant this specific one. As far as I followed this, there was a bug in the
2.1.9 release and you fixed this recently. So it might be worth adding this,
so people upgrading to 2.1.10 will now that this one is fixed.

Carsten
-- 
Carsten Ziegeler - Open Source Group, SN AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/


Re: svn commit: r398882 -/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/transf ormation/EncodeURLTransformer.java

2006-05-03 Thread Ralph Goers

Right. Thanks for reminding me as I had forgotten about it.

Ralph

Carsten Ziegeler wrote:


Ralph Goers schrieb:
 

Do you mean in general or this specific one?  I try to in general. This 
one is there under 2.1.9 as fixes-bug=COCOON-1742.  Speaking of which, 
now that this is also on trunk I can close it.


   


I meant this specific one. As far as I followed this, there was a bug in the
2.1.9 release and you fixed this recently. So it might be worth adding this,
so people upgrading to 2.1.10 will now that this one is fixed.

Carsten
 





Re: svn commit: r398882 -/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/transf ormation/EncodeURLTransformer.java

2006-05-02 Thread Ralph Goers
Thanks for doing this.  Did you also delete ElementAttributeMatching from
the util directory?


[EMAIL PROTECTED] said:
 Author: cziegeler
 Date: Tue May  2 02:41:56 2006
 New Revision: 398882

 URL: http://svn.apache.org/viewcvs?rev=398882view=rev
 Log:
 Merge changes from 2.1.x

 Modified:
 
 cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/transformation/EncodeURLTransformer.java

 Modified:
 cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/transformation/EncodeURLTransformer.java
 URL:
 http://svn.apache.org/viewcvs/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/transformation/EncodeURLTransformer.java?rev=398882r1=398881r2=398882view=diff
 ==
 ---
 cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/transformation/EncodeURLTransformer.java
 (original)
 +++
 cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/transformation/EncodeURLTransformer.java
 Tue May  2 02:41:56 2006
 @@ -17,12 +17,14 @@

  import java.io.IOException;
  import java.util.Map;
 +import java.util.regex.Pattern;
 +import java.util.regex.PatternSyntaxException;
 +
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.parameters.Parameters;
  import org.apache.cocoon.ProcessingException;
 -import org.apache.cocoon.util.ElementAttributeMatching;
  import org.apache.cocoon.caching.CacheableProcessingComponent;
  import org.apache.cocoon.environment.ObjectModelHelper;
  import org.apache.cocoon.environment.Request;
 @@ -31,7 +33,6 @@
  import org.apache.cocoon.environment.SourceResolver;
  import org.apache.excalibur.source.SourceValidity;
  import org.apache.excalibur.source.impl.validity.NOPValidity;
 -import org.apache.regexp.RESyntaxException;
  import org.xml.sax.Attributes;
  import org.xml.sax.SAXException;
  import org.xml.sax.helpers.AttributesImpl;
 @@ -105,13 +106,13 @@
   * Configuration default exclude pattern,
   * ie img/@src
   */
 -public final static String EXCLUDE_NAME_DEFAULT = img/@src;
 +public final static String EXCLUDE_NAME_DEFAULT = img/@src=;

  /**
   * Configuration default exclude pattern,
   * ie .*\/@href|.*\/@action|frame/@src
   */
 -public final static String INCLUDE_NAME_DEFAULT =
 .*/@href|.*/@action|frame/@src;
 +public final static String INCLUDE_NAME_DEFAULT =
 .*/@href=|.*/@action=|frame/@src=;

  private String includeNameConfigure = INCLUDE_NAME_DEFAULT;
  private String excludeNameConfigure = EXCLUDE_NAME_DEFAULT;
 @@ -168,7 +169,7 @@
 
 this.excludeNameConfigure);
  try {
  this.elementAttributeMatching = new
 ElementAttributeMatching(includeName, excludeName);
 -} catch (RESyntaxException reex) {
 +} catch (PatternSyntaxException reex) {
  final String message = Cannot parse include-name:  +
 includeName +   +
  or exclude-name:  + excludeName + !;
  throw new ProcessingException(message, reex);
 @@ -307,6 +308,108 @@
  encoded_url = url;
  }
  return encoded_url;
 +}
 +
 +/**
 + * A helper class for matching element names, and attribute names.
 + *
 + * p
 + *  For given include-name, exclude-name decide if element-attribute
 pair
 + *  matches. This class defines the precedence and matching
 algorithm.
 + * /p
 + *
 + * @author a href=mailto:[EMAIL PROTECTED]Bernhard Huber/a
 + * @versionCVS $Id$
 + */
 +public static class ElementAttributeMatching {
 +/**
 + * Regular expression of including patterns
 + *
 + */
 +protected Pattern includeNameRE;
 +/**
 + * Regular expression of excluding patterns
 + *
 + */
 +protected Pattern excludeNameRE;
 +
 +
 +/**
 + *Constructor for the ElementAttributeMatching object
 + *
 + * @param  includeNameDescription of Parameter
 + * @param  excludeNameDescription of Parameter
 + * @exception  PatternSyntaxException  Description of Exception
 + */
 +public ElementAttributeMatching(String includeName, String
 excludeName) throws PatternSyntaxException {
 +includeNameRE = Pattern.compile(includeName,
 Pattern.CASE_INSENSITIVE);
 +excludeNameRE = Pattern.compile(excludeName,
 Pattern.CASE_INSENSITIVE);
 +}
 +
 +
 +/**
 + * Return true iff element_name attr_name pair is not matched by
 exclude-name,
 + * but is matched by include-name
 + * @param  element_name
 + * @param  attr_name
 + * 

Re: svn commit: r398882 -/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/transf ormation/EncodeURLTransformer.java

2006-05-02 Thread Carsten Ziegeler
Ralph Goers wrote
 Thanks for doing this.  Did you also delete ElementAttributeMatching from
 the util directory?
 
Done now, thanks for the hint.

Btw, could you please add an entry to status.xml in 2.1.x for your changes?

Thanks
Carsten
-- 
Carsten Ziegeler - Open Source Group, SN AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/