jefft       2003/03/07 06:50:18

  Modified:    src/blocks/linkrewriter/java/org/apache/cocoon/transformation
                        LinkRewriterTransformer.java
  Log:
  - By default, don't rewrite 'http' and 'https' links
  - Move recycle() somewhere a bit more visible
  
  Revision  Changes    Path
  1.4       +15 -14    
xml-cocoon2/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/LinkRewriterTransformer.java
  
  Index: LinkRewriterTransformer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/LinkRewriterTransformer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LinkRewriterTransformer.java      31 Jan 2003 22:49:21 -0000      1.3
  +++ LinkRewriterTransformer.java      7 Mar 2003 14:50:18 -0000       1.4
  @@ -159,7 +159,7 @@
    *  <dt>schemes</dt>
    *  <dd>Space-separated list of URI schemes to explicitly include.  If specified, 
all URIs with unlisted schemes will not be converted.</dd>
    *  <dt>exclude-schemes</dt>
  - *  <dd>Space-separated list of URI schemes to explicitly exclude.</dd>
  + *  <dd>Space-separated list of URI schemes to explicitly exclude. Defaults to 
'http https'.</dd>
    *  <dt>bad-link-str</dt>
    *  <dd>String to use for links with a correct InputModule prefix, but no value
    *  therein.  Defaults to the original URI.</dd>
  @@ -228,7 +228,7 @@
           this.badLinkStr = parameters.getParameter("bad-link-str", null);
           this.linkAttrs = split(parameters.getParameter("link-attrs", "href"), " ");
           this.inSchemes = split(parameters.getParameter("schemes", ""), " ");
  -        this.outSchemes = split(parameters.getParameter("exclude-schemes", ""), " 
");
  +        this.outSchemes = split(parameters.getParameter("exclude-schemes", ""), 
"http https");
   
           // Generate conf
           VariableConfiguration varConf = new VariableConfiguration(this.origConf);
  @@ -241,6 +241,19 @@
           }
       }
   
  +    /** Recycle this component for use in another map:transform. */
  +    public void recycle() {
  +        super.recycle();
  +        this.resolver = null;
  +        this.links = null;
  +        this.linkAttrs = null;
  +        this.inSchemes = null;
  +        this.outSchemes = null;
  +        this.conf = null;
  +        // Note: configure() and initialize() are not called after every
  +        //recycle, so don't null origConf
  +    }
  +
       /** Split a string into a Set of strings.
        * @param str String to split
        * @param delim Delimiter character
  @@ -349,16 +362,4 @@
           return null;
       }
   
  -    /** Recycle this component for use in another map:transform. */
  -    public void recycle() {
  -        super.recycle();
  -        this.resolver = null;
  -        this.links = null;
  -        this.linkAttrs = null;
  -        this.inSchemes = null;
  -        this.outSchemes = null;
  -        this.conf = null;
  -        // Note: configure() and initialize() are not called after every
  -        //recycle, so don't null origConf
  -    }
   }
  
  
  

Reply via email to