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--LinkRewriterTransformer.patch
        34 kB
        Francesco Chicchiriccò
      2. ASF.LICENSE.NOT.GRANTED--cocoon3test.tar.gz
        9 kB
        Francesco Chicchiriccò

        Activity

        Hide
        Simone Tripodi added a comment -
        Thanks Francesco, your patch has been successfully applied, since it was very very easy I took advantage to add attributes namespace support.
        The new component you kindly provided now needs to be integrated in the sitemap, follow the issues if you're interested.
        Thanks a lot once again.
        Show
        Simone Tripodi added a comment - Thanks Francesco, your patch has been successfully applied, since it was very very easy I took advantage to add attributes namespace support. The new component you kindly provided now needs to be integrated in the sitemap, follow the issues if you're interested. Thanks a lot once again.
        Hide
        Francesco Chicchiriccò added a comment -
        A new version, with no more dependency on commons-collections (even though this meant that I had to provide a custom and private implementation of Map.Entry).
        Show
        Francesco Chicchiriccò added a comment - A new version, with no more dependency on commons-collections (even though this meant that I had to provide a custom and private implementation of Map.Entry).
        Hide
        Simone Tripodi added a comment -
        Thanks for your effort Francesco :)
        While applying the patch, I noticed that the org.apache.cocoon.sax.component.ToRewrite contains a missing org.apache.commons.collections.keyvalue.DefaultMapEntry dependency, that comes from commons-collections: unfortunately that violates the principle of the SAX module to dependencies-less (only the logging module admitted).

        Moreover IMHO
         * checking elements QName could be a risk, since their pattern are <namespace_prefix>:<element_name>
         * namespaces that should be checked are attributes namepsaces and not elements ones... any thought?

        Thanks for working on it!!!
        Show
        Simone Tripodi added a comment - Thanks for your effort Francesco :) While applying the patch, I noticed that the org.apache.cocoon.sax.component.ToRewrite contains a missing org.apache.commons.collections.keyvalue.DefaultMapEntry dependency, that comes from commons-collections: unfortunately that violates the principle of the SAX module to dependencies-less (only the logging module admitted). Moreover IMHO  * checking elements QName could be a risk, since their pattern are <namespace_prefix>:<element_name>  * namespaces that should be checked are attributes namepsaces and not elements ones... any thought? Thanks for working on it!!!
        Hide
        Francesco Chicchiriccò added a comment -
        As suggested by Simone, sorry for not understanding the way before :-)
        Show
        Francesco Chicchiriccò added a comment - As suggested by Simone, sorry for not understanding the way before :-)
        Hide
        Simone Tripodi added a comment -
        Very appreciated Francesco, thanks a lot, btw I'd ask you a little step more :P

        Apache has a policy about submitting patches (previously I also suggested you reading http://commons.apache.org/patches.html to have a reference): briefly, you should make a .patch file with a semful name, for example, in the cocoon root

        svn diff . > LinkRewriterTransformer.patch

        and then attach it to the issue.
        Thanks in advance!!!
        Show
        Simone Tripodi added a comment - Very appreciated Francesco, thanks a lot, btw I'd ask you a little step more :P Apache has a policy about submitting patches (previously I also suggested you reading http://commons.apache.org/patches.html to have a reference): briefly, you should make a .patch file with a semful name, for example, in the cocoon root svn diff . > LinkRewriterTransformer.patch and then attach it to the issue. Thanks in advance!!!
        Hide
        Francesco Chicchiriccò added a comment -
        A simple maven2 project including an updated implementation of LinkRewriterTransformer with:

        * no @author
        * Apache license header in every file
        * JUnit test case
        * consideration for namespace features

        Moreover, it seems to work ;-)
        Show
        Francesco Chicchiriccò added a comment - A simple maven2 project including an updated implementation of LinkRewriterTransformer with: * no @author * Apache license header in every file * JUnit test case * consideration for namespace features Moreover, it seems to work ;-)
        Hide
        Sylvain Wallez added a comment -
        The configuration of the rewriter needs to take into account element namespaces, so that you can deal with mixed namespace documents, e.g. xhtml and xlink or xinclude
        Show
        Sylvain Wallez added a comment - The configuration of the rewriter needs to take into account element namespaces, so that you can deal with mixed namespace documents, e.g. xhtml and xlink or xinclude
        Hide
        Francesco Chicchiriccò added a comment -
        Simone,
        sorry for the (right) remarks you made on my code: it was not actually meant as a patch, it was more like a sort of POC ;-)

        By the way I'll do my best to follow your advice for the future.

        I'll provide JUnit4 test cases as soon as my baby will give me the time, maybe this time first taking a look at existing sources... ;-)
        Show
        Francesco Chicchiriccò added a comment - Simone, sorry for the (right) remarks you made on my code: it was not actually meant as a patch, it was more like a sort of POC ;-) By the way I'll do my best to follow your advice for the future. I'll provide JUnit4 test cases as soon as my baby will give me the time, maybe this time first taking a look at existing sources... ;-)
        Hide
        Simone Tripodi added a comment -
        Francesco,
        can you provide also a junit4 TestCase class please? Thanks in advance!!! :)
        Show
        Simone Tripodi added a comment - Francesco, can you provide also a junit4 TestCase class please? Thanks in advance!!! :)
        Hide
        Simone Tripodi added a comment -
        Hi Francesco, thanks a lot, very appreciated,
        please take a look at below suggestions:
        - for future patches you'll submit, follow http://commons.apache.org/patches.html that describes the Apache way to submit patches, otherwise merging code for more complicated stuff will become hard;
        - add always the apache license header you can find on existing code;
        - no more @author tags: committers and contributors are mentioned in the Team page.
        Thanks in advance,
        Simo
        Show
        Simone Tripodi added a comment - Hi Francesco, thanks a lot, very appreciated, please take a look at below suggestions: - for future patches you'll submit, follow http://commons.apache.org/patches.html that describes the Apache way to submit patches, otherwise merging code for more complicated stuff will become hard; - add always the apache license header you can find on existing code; - no more @author tags: committers and contributors are mentioned in the Team page. Thanks in advance, Simo
        Hide
        Simone Tripodi added a comment -
        Thanks a lot Francesco for your suggestion, I'm starting working on it this evening
        Show
        Simone Tripodi added a comment - Thanks a lot Francesco for your suggestion, I'm starting working on it this evening

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development