Forrest
  1. Forrest
  2. FOR-146

Issues with //skinconfig and document2html.xsl

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 0.6
    • Component/s: Skins (general issues)
    • Labels:
      None
    • Environment:
      copyless branch, SuSE 9.0, java 1.4.2

      Description

      There's a bit of an issue with the change to //skinconf (other than the PDF one).

      Using aggregation is a great idea for the skin configuration. Unfortunately, where it's being done means that some of the configuration bits are not available when desired.

      In particular, any requests for configuration information done by document2html.xsl will not result in any information being returned. This includes, by default, the configuration information for

            * disable-print-link
            * disable-pdf-link
            * disable-xml-link
            * toc/@location
            * disable-external-link-image
            * obfuscate-mail-links

      This is because the aggregation of the skinconf happens at the pipeline matching "*.html". This pipeline aggregates skinconf.xml, tab-*, menu-* and body-*.

      The items above (disable-*-link, etc) are handled in the pipeline for body-* by the document2html.xsl transformation sheet. That pipeline does NOT have access to the skinconf at this point. It would if the aggregation was done in the "body-*" pipeline.

      There are a couple of ways of solving this:

           1. Move the aggregation to the body-* pipeline. The "*.html"
      will
              then also have access to the skinconf. However, if this is
              done, it should probably be done for the tab-* and menu-*
              pipelines as well. Currently, it doesn't look like these last
              two pipelines make use of anything in the skinconf, but that may
              not always be the case. Not too fond of this one.
           2. Move the skinning bits out of document2html and handle it all
              within the "skinit" resource. This may require putting place
              holder tags in the html generated by document2html that "skinit"
              can then replace with proper skinconf values. I like this
              option better than #1.
           3. Go back to using document(). Don't like this option either.

      Thoughts? Any other options? More explanation required? BTW, I'm
      seeing this on the copyless branch.

        Activity

        Hide
        Rick Tessner added a comment -
        [Just attaching the patch and created the bug so that it doesn't get lost in the mailing list archives]

        I've made the necessary changes to the various skins so that the
        skinning takes place primarily in the site2xhtml.xsl sheets. By
        primarily, I mean any skinning that required referencing the
        skinconf.xsl sheet.

        Attached is the patch and below is a short summary of the changes that
        were made.

        It should be noted that other skins that folk have out there may be
        incompatible with these changes. In particular, if those skins were
        referencing "$config" or "//skinconfig" in the document2html.xsl, they
        won't work as expected.

        If, like the "avalon-tigris" skin, the document2html.xsl does NOT make
        any references to anything in the skinconf.xsl, then everything should
        be fine.

        Change Log
        ----------

              * Moved all references to //skinconfig out of the
                document2html.xsl to the site2xhtml.xsl
              * Rationalized the Table of Contents stuff by creating a "toc"
                mode in the common/xslt/html/document2html.xsl. That is then
                used to generate the per-page ToC and the ToC attached to the
                menu. The DTD for the intermediate form of the Table of
                Contents is:
                
                  <!ELEMENT tocitems (tocitem)*>
                  <!ELEMENT tocitem (tocitem)*>
                  <!ATTLIST tocitem
                            title CDATA REQUIRED
                            href CDATA REQUIRED
                            level CDATA REQUIRED >


              * Removed extraneous default xsl matchers on the non-common
                document2html and site2xhtml XSLs. This allows matches
                defined in the imported transformation sheets to match
                (imported sheets have lower precedence).
              * Defined a couple of <div id="..."> place holder tags used by
                the document2html. Those are then skinned by the site2xhtml
                sheets. The following table is how the place holder <div>'s
                correspond to the skinconf.xml (referenced as //skinconfig)

        <!-- Place Holder --> <!-- skinconf.xml element -->
        <div id="skinconf-heading-1"> <!-- //skinconfig/heading -->
        <div id="skinconf-heading-2"> <!-- //skinconfig/heading -->
        <div id="skinconf-pdflink"> <!-- //skinconfig/disable-pdf-link -->
        <div id="skinconf-printlink"> <!-- //skinconfig/disable-print-link -->
        <div id="skinconf-xmllink"> <!-- //skinconfig/disable-xml-link -->
        <div id="skinconf-toc-page"> <!-- //skinconfig/toc/[@location='page']
        -->

        NOTE:

        The "skinconf-toc-page" corresponds to
        //skinconfig/toc/[@location='page'] and has nothing to do with the
        //skinconfig/toc/[@location='menu']. The menu ToC is handled directly
        by the site2xhtml.xsl for a particular skin.

        Show
        Rick Tessner added a comment - [Just attaching the patch and created the bug so that it doesn't get lost in the mailing list archives] I've made the necessary changes to the various skins so that the skinning takes place primarily in the site2xhtml.xsl sheets. By primarily, I mean any skinning that required referencing the skinconf.xsl sheet. Attached is the patch and below is a short summary of the changes that were made. It should be noted that other skins that folk have out there may be incompatible with these changes. In particular, if those skins were referencing "$config" or "//skinconfig" in the document2html.xsl, they won't work as expected. If, like the "avalon-tigris" skin, the document2html.xsl does NOT make any references to anything in the skinconf.xsl, then everything should be fine. Change Log ----------       * Moved all references to //skinconfig out of the         document2html.xsl to the site2xhtml.xsl       * Rationalized the Table of Contents stuff by creating a "toc"         mode in the common/xslt/html/document2html.xsl. That is then         used to generate the per-page ToC and the ToC attached to the         menu. The DTD for the intermediate form of the Table of         Contents is:                    <!ELEMENT tocitems (tocitem)*>           <!ELEMENT tocitem (tocitem)*>           <!ATTLIST tocitem                     title CDATA REQUIRED                     href CDATA REQUIRED                     level CDATA REQUIRED >       * Removed extraneous default xsl matchers on the non-common         document2html and site2xhtml XSLs. This allows matches         defined in the imported transformation sheets to match         (imported sheets have lower precedence).       * Defined a couple of <div id="..."> place holder tags used by         the document2html. Those are then skinned by the site2xhtml         sheets. The following table is how the place holder <div>'s         correspond to the skinconf.xml (referenced as //skinconfig) <!-- Place Holder --> <!-- skinconf.xml element --> <div id="skinconf-heading-1"> <!-- //skinconfig/heading --> <div id="skinconf-heading-2"> <!-- //skinconfig/heading --> <div id="skinconf-pdflink"> <!-- //skinconfig/disable-pdf-link --> <div id="skinconf-printlink"> <!-- //skinconfig/disable-print-link --> <div id="skinconf-xmllink"> <!-- //skinconfig/disable-xml-link --> <div id="skinconf-toc-page"> <!-- //skinconfig/toc/[@location='page'] --> NOTE: The "skinconf-toc-page" corresponds to //skinconfig/toc/[@location='page'] and has nothing to do with the //skinconfig/toc/[@location='menu']. The menu ToC is handled directly by the site2xhtml.xsl for a particular skin.
        Hide
        Juan Jose Pablos added a comment -
        Seems important enough to be fixed before the release.
        Show
        Juan Jose Pablos added a comment - Seems important enough to be fixed before the release.
        Hide
        David Crossley added a comment -
        Patch checked and applied. Wow, thanks Rick - it was a pleasure to work with your patch and issue report.
        Show
        David Crossley added a comment - Patch checked and applied. Wow, thanks Rick - it was a pleasure to work with your patch and issue report.

          People

          • Assignee:
            David Crossley
            Reporter:
            Rick Tessner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development