Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-alpha-3
    • Component/s: cocoon-sax
    • Labels:
      None

      Description

      A LinkRewriterTransformer (like as the old one for Cocoon 2.1, see [1]) could be a very nice addendum to Cocoon 3.

      It could may even by an idea to have a LinkRewriterTransformer<T>, where T is the class performing the actual transformation on links.

      [1] http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/transformation/LinkRewriterTransformer.html
      1. ASF.LICENSE.NOT.GRANTED--cocoon3test.tar.gz
        9 kB
        Francesco Chicchiriccò
      2. ASF.LICENSE.NOT.GRANTED--LinkRewriterTransformer.patch
        34 kB
        Francesco Chicchiriccò

        Activity

        Simone Tripodi made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 3.0.0-alpha-3 [ 12314181 ]
        Resolution Fixed [ 1 ]
        Francesco Chicchiriccò made changes -
        Comment [ A possible implementation in the attached classes.

        Once provided a LinkRewriter implementation (i.e. TestRewriter), the transformer can be used in the following way:

                Map<String, Set<String>> toBeRewritten = new HashMap<String, Set<String>>();
                toBeRewritten.put("a", Collections.singleton("href"));
                toBeRewritten.put("img", Collections.singleton("src"));

                Pipeline<SAXPipelineComponent> pipeline = new NonCachingPipeline<SAXPipelineComponent>();
                pipeline.addComponent(new XMLGenerator(new File("/tmp/file.html")));
                pipeline.addComponent(new LinkRewriterTransformer(new TestRewriter(),
                        toBeRewritten));
                pipeline.addComponent(serializer);

                pipeline.setup(System.out);
                pipeline.execute();
        ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewriterTransformer.patch [ 12441411 ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewriterTransformer.patch [ 12441462 ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewriterTransformer.patch [ 12441411 ]
        Francesco Chicchiriccò made changes -
        Attachment cocoon3test.tar.gz [ 12441392 ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewritingException.java [ 12439367 ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewriterTransformer.java [ 12439366 ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewriter.java [ 12439365 ]
        Francesco Chicchiriccò made changes -
        Comment [ My idea about a possible implementation ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewriterTransformer.java [ 12439366 ]
        Attachment LinkRewriter.java [ 12439365 ]
        Attachment LinkRewritingException.java [ 12439367 ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewriterTransformer.java [ 12439362 ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewriter.java [ 12439363 ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewriringException.java [ 12439364 ]
        Francesco Chicchiriccò made changes -
        Attachment LinkRewriterTransformer.java [ 12439362 ]
        Attachment LinkRewriter.java [ 12439363 ]
        Attachment LinkRewriringException.java [ 12439364 ]
        Simone Tripodi made changes -
        Field Original Value New Value
        Assignee Cocoon Developers Team [ cocoon ] Simone Tripodi [ simone.tripodi ]
        Francesco Chicchiriccò created issue -

          People

          • Assignee:
            Simone Tripodi
            Reporter:
            Francesco Chicchiriccò
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development