Forrest
  1. Forrest
  2. FOR-1000

Use locationmap to resolve XSL imports in skins

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8, 0.9
    • Fix Version/s: 0.9
    • Component/s: Skins (general issues)
    • Labels:
      None

      Description

      To create a custom skin that imports stylesheets from common, for example by copying pelt and modifying it for a project, it is also necessary to copy the common skin because the xsl:import calls use relative paths. The imports can be done with the help of the locationmap.

        Activity

        Brian M Dube created issue -
        Show
        Brian M Dube added a comment - Some discussion: http://www.mail-archive.com/user@forrest.apache.org/msg02741.html
        Hide
        Brian M Dube added a comment -
        As David indicates in the surrounding thread, the custom skin documentation will need to reflect this change.
        Show
        Brian M Dube added a comment - As David indicates in the surrounding thread, the custom skin documentation will need to reflect this change.
        Hide
        Brian M Dube added a comment -
        Example:
        <xsl:import href="lm://transform.common.html.site.xhtml"/>

        Cocoon generates an error for unknown protocol "lm" when I test this.
        Show
        Brian M Dube added a comment - Example: <xsl:import href=" lm://transform.common.html.site.xhtml "/> Cocoon generates an error for unknown protocol "lm" when I test this.
        Hide
        Tim Williams added a comment -
        So with the new LocationmapSourceFactory is this not resolved?

        Show
        Tim Williams added a comment - So with the new LocationmapSourceFactory is this not resolved?
        Hide
        Brian M Dube added a comment - - edited
        I just made a quick test and it worked.

        Next:
        1) Devise a naming scheme for main/webapp/locationmap-transforms.xml
        2) Replace all the relative skin imports with the locationmap pattern from step 1
        3) Update documentation regarding custom skins

        If I don't get to it by tomorrow evening, it'll be a few weeks before I can.
        Show
        Brian M Dube added a comment - - edited I just made a quick test and it worked. Next: 1) Devise a naming scheme for main/webapp/locationmap-transforms.xml 2) Replace all the relative skin imports with the locationmap pattern from step 1 3) Update documentation regarding custom skins If I don't get to it by tomorrow evening, it'll be a few weeks before I can.
        Brian M Dube made changes -
        Field Original Value New Value
        Assignee Brian M Dube [ brian ]
        Hide
        Brian M Dube added a comment -
        The rewrites are done in r887050. I have not yet updated the documentation.

        I used something like this:
        $ grep -r --exclude-dir=\.svn xsl:import main/webapp/skins \
        | awk -F : '{ print $1 }' \
        | xargs sed -i 's_../../../common/xslt/.*/\(.*\)-to-\(.*\)\.xsl_lm://transform.skin.common.\2.\1-to-\2_'

        and a slightly different version for the css. Changes to the naming scheme I used are fine by me.

        There are a few files that may need to be handled separately:
        $ grep -r --exclude-dir=\.svn xsl:import . | grep -v lm
        ./common/images/rc.svg.xslt: <xsl:import href="corner-imports.svg.xslt" />
        ./common/images/dc.svg.xslt: <xsl:import href="corner-imports.svg.xslt" />
        ./leather-dev/xslt/xml/contract.xsl: <xsl:import href="fct-bits/fct-bits.xsl"/>
        ./leather-dev/xslt/xml/ft-to-xhtml.xsl: <xsl:import href="fct-bits/fct-bits.xsl"/>
        Show
        Brian M Dube added a comment - The rewrites are done in r887050. I have not yet updated the documentation. I used something like this: $ grep -r --exclude-dir=\.svn xsl:import main/webapp/skins \ | awk -F : '{ print $1 }' \ | xargs sed -i 's_../../../common/xslt/.*/\(.*\)-to-\(.*\)\.xsl_ lm://transform.skin.common .\2.\1-to-\2_' and a slightly different version for the css. Changes to the naming scheme I used are fine by me. There are a few files that may need to be handled separately: $ grep -r --exclude-dir=\.svn xsl:import . | grep -v lm ./common/images/rc.svg.xslt: <xsl:import href="corner-imports.svg.xslt" /> ./common/images/dc.svg.xslt: <xsl:import href="corner-imports.svg.xslt" /> ./leather-dev/xslt/xml/contract.xsl: <xsl:import href="fct-bits/fct-bits.xsl"/> ./leather-dev/xslt/xml/ft-to-xhtml.xsl: <xsl:import href="fct-bits/fct-bits.xsl"/>
        Brian M Dube made changes -
        Affects Version/s 0.9-dev [ 12310041 ]
        Hide
        Brian M Dube added a comment -
        Please review the locationmap naming scheme and documentation changes.
        Show
        Brian M Dube added a comment - Please review the locationmap naming scheme and documentation changes.
        Brian M Dube made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Brian M Dube [ brian ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Brian M Dube
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development