Forrest
  1. Forrest
  2. FOR-211

whole-site html and pdf: broken ext links

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.6
    • Fix Version/s: 0.10-dev
    • Component/s: Core operations
    • Labels:
      None
    • Other Info:
      Patch available

      Description

      In the the generated site.html all of the external links are broken (i.e. the href attributes are like ... error:#ext:forrest).
      1. wholesite_pdftab_patch4.txt
        15 kB
        Andreas Lehmkühler
      2. links-patched.txt
        12 kB
        Johannes Schaefer
      3. links-HEAD.txt
        12 kB
        Johannes Schaefer

        Issue Links

          Activity

          Hide
          Johannes Schaefer added a comment -
          It's not just the external links :-(
          All inline <link>s give the (error:#site:target) links in both: site.html and site.pdf
          I have lots of these cross-links in my project and they work fine for the single pages, only the "Full HTML" and "Full PDF" pages are broken.
          So far I have no clue why this happens.
          Show
          Johannes Schaefer added a comment - It's not just the external links :-( All inline <link>s give the (error:#site:target) links in both: site.html and site.pdf I have lots of these cross-links in my project and they work fine for the single pages, only the "Full HTML" and "Full PDF" pages are broken. So far I have no clue why this happens.
          Hide
          Johannes Schaefer added a comment -
          Don't know if this helps but ...
          direct links to anchors like <link href="#anchor">
          produce a link like this: <a href="##anchor">
          Show
          Johannes Schaefer added a comment - Don't know if this helps but ... direct links to anchors like <link href="#anchor"> produce a link like this: <a href="##anchor">
          Hide
          Johannes Schaefer added a comment -
          duplicate?! see FOR-147
          Show
          Johannes Schaefer added a comment - duplicate?! see FOR-147
          Hide
          Nicola Ken Barozzi added a comment -
          This is set to be resolved by 0.7, but if a working patch is submitted it may be put in 0.6.
          Show
          Nicola Ken Barozzi added a comment - This is set to be resolved by 0.7, but if a working patch is submitted it may be put in 0.6.
          Hide
          Gavin added a comment -
          Ok, I wonder if I can take a look at this, where should I start looking at ?
          Show
          Gavin added a comment - Ok, I wonder if I can take a look at this, where should I start looking at ?
          Hide
          Andreas Lehmkühler added a comment - - edited
          It is possible to demonstrate this behaviour by one of the forrrest "seed sample sites".

          1.) forrest seed
          2.) add the pdf-tab support as described in http://forrest.apache.org/docs_0_80/howto/howto-pdf-tab.html
          3.) some additional stylesheets are needed (after the seed only hello2document.xsl is present). Therefore I copied all stylesheets from %FORREST%\main\webapp\resources\stylesheets to the seeded project
          4.) to produce one page for the whole sample1-tab add the wholesite-tag to the site.xml like this

            <samples1 label="First set of Samples" description="First Set of Samples" wholesite="true">
          5.) forrest run ;-)
          6.) open the url http://localhost:8888/pdf-tab.html

          For example the links the list "Documentation contained in Samples 1" in the section "Samples 1 Documentation" are broken as described.
          Show
          Andreas Lehmkühler added a comment - - edited It is possible to demonstrate this behaviour by one of the forrrest "seed sample sites". 1.) forrest seed 2.) add the pdf-tab support as described in http://forrest.apache.org/docs_0_80/howto/howto-pdf-tab.html 3.) some additional stylesheets are needed (after the seed only hello2document.xsl is present). Therefore I copied all stylesheets from %FORREST%\main\webapp\resources\stylesheets to the seeded project 4.) to produce one page for the whole sample1-tab add the wholesite-tag to the site.xml like this   <samples1 label="First set of Samples" description="First Set of Samples" wholesite="true"> 5.) forrest run ;-) 6.) open the url http://localhost:8888/pdf-tab.html For example the links the list "Documentation contained in Samples 1" in the section "Samples 1 Documentation" are broken as described.
          Hide
          David Crossley added a comment - - edited
          Hmmm, it is complicating this issue by considering the "pdf-tab" stuff. It seems to have other problems, because we should not need to do step 3 described by Andreas. That will be unmaintainable. Pehaps the "howto-pdf-tab" instructions need to be modified now that we have locationmap. Anyway ...

          An easier way to demonstrate this issue ...

          *) forrest seed

          *) edit src/documentation/content/xdocs/site.xml to uncomment the "wholesite" section.

          *) forrest run

          *) open localhost:8888

          *) select the "All" and then "Whole Site HTML" from the left-hand navigation.

          *) observe the broken links on the face of the page.
          Show
          David Crossley added a comment - - edited Hmmm, it is complicating this issue by considering the "pdf-tab" stuff. It seems to have other problems, because we should not need to do step 3 described by Andreas. That will be unmaintainable. Pehaps the "howto-pdf-tab" instructions need to be modified now that we have locationmap. Anyway ... An easier way to demonstrate this issue ... *) forrest seed *) edit src/documentation/content/xdocs/site.xml to uncomment the "wholesite" section. *) forrest run *) open localhost:8888 *) select the "All" and then "Whole Site HTML" from the left-hand navigation. *) observe the broken links on the face of the page.
          Hide
          Andreas Lehmkühler added a comment -
          Oh yes, this is a quite easier way than mine.

          So, how do we proceed? Do you have the time to fix it, or do I've to try it on my own? I'm not very familiar with the cocoon/xsl-stuff, so that I've to read the one or other book/article about it...
          Show
          Andreas Lehmkühler added a comment - Oh yes, this is a quite easier way than mine. So, how do we proceed? Do you have the time to fix it, or do I've to try it on my own? I'm not very familiar with the cocoon/xsl-stuff, so that I've to read the one or other book/article about it...
          Hide
          Andreas Lehmkühler added a comment - - edited
          I think I've a solution for the wholesite issue. The "site:"-links weren't properly handled in doc-to-doc-uniqueids.xsl. The patched file is attached. The pdf-tab issue isn't solved yet, but it looks better and I'll work on it. As soon as I have a solution for that, I'll post it.

          Andreas
          Show
          Andreas Lehmkühler added a comment - - edited I think I've a solution for the wholesite issue. The "site:"-links weren't properly handled in doc-to-doc-uniqueids.xsl. The patched file is attached. The pdf-tab issue isn't solved yet, but it looks better and I'll work on it. As soon as I have a solution for that, I'll post it. Andreas
          Hide
          Andreas Lehmkühler added a comment - - edited
          The attached file "doc-to-doc-uniqueids.xsl" belongs to the directory %FORREST%\main\webapp\resources\stylesheets\aggregates

          Andreas
          Show
          Andreas Lehmkühler added a comment - - edited The attached file "doc-to-doc-uniqueids.xsl" belongs to the directory %FORREST%\main\webapp\resources\stylesheets\aggregates Andreas
          Hide
          Ross Gardler added a comment -
          Andreas - can you provide a patch so that we can see the changes you are proposing.

          See http://forrest.apache.org/contrib.html#patch

          It's true that we could generate a patch from the two files (yours and the opriginal) however, this adds to the work that we need to do and therefore reduces the chances of one of us finding the time to do it.

          If you need help creating a patch just ask us on the dev list and we'll walk you through it.
          Show
          Ross Gardler added a comment - Andreas - can you provide a patch so that we can see the changes you are proposing. See http://forrest.apache.org/contrib.html#patch It's true that we could generate a patch from the two files (yours and the opriginal) however, this adds to the work that we need to do and therefore reduces the chances of one of us finding the time to do it. If you need help creating a patch just ask us on the dev list and we'll walk you through it.
          Hide
          Andreas Lehmkühler added a comment -
          Hi Ross,

          I've followed your link and created a patch as described. I hope everthing's o.k.

          Andreas
          Show
          Andreas Lehmkühler added a comment - Hi Ross, I've followed your link and created a patch as described. I hope everthing's o.k. Andreas
          Hide
          Andreas Lehmkühler added a comment - - edited
          I think I've solved the pdf-tab issue too.

          I've integrated a matcher to the sitemap.xmap and generated a suitable submap by copying the aggregate.xmap to aggregate-pdf-tab.xmap with an additional transformer to filter the entries from the site.xml.
          I've also updated the pdf-tab-howto. I think someone has to have a look at it, because of my limited english.

          So, forrest will be able to generate a pdf-tab-document without any changes to the configuration. It is only necessary to mark the relevant content with the wholesite-tag and that's it.

          My first patch is included to this one.

          I forgot one little detail. The title of the pdf-tab has to be configured in the new submap aggregate-pdf-tab.xmap. In future this should be done with a config-value in the skin.conf. To do this the dtd has to be changed and I didn't want to do that on my own. Perhaps some other changesa re already planned , so that they could be combined with this one.
          Show
          Andreas Lehmkühler added a comment - - edited I think I've solved the pdf-tab issue too. I've integrated a matcher to the sitemap.xmap and generated a suitable submap by copying the aggregate.xmap to aggregate-pdf-tab.xmap with an additional transformer to filter the entries from the site.xml. I've also updated the pdf-tab-howto. I think someone has to have a look at it, because of my limited english. So, forrest will be able to generate a pdf-tab-document without any changes to the configuration. It is only necessary to mark the relevant content with the wholesite-tag and that's it. My first patch is included to this one. I forgot one little detail. The title of the pdf-tab has to be configured in the new submap aggregate-pdf-tab.xmap. In future this should be done with a config-value in the skin.conf. To do this the dtd has to be changed and I didn't want to do that on my own. Perhaps some other changesa re already planned , so that they could be combined with this one.
          Hide
          Johannes Schaefer added a comment -
          I've had a quick look at the wholesite.html from 'forrest seed':
          1. Most (internal) links seem to work properly
          2. External links [1] with "ext:" don't work.
            This may be fixed by adding another "or" clause to doc-to-doc-uniqueids.xsl

            <xsl:template match="section/document//link/@href[not(starts-with(., 'http:') or starts-with(., 'https:')
                or starts-with(., 'site:') or starts-with(., 'ext:'))]">

          This is great progress!

          3. There are still some links that won't work (properly), e.g.
            http://localhost:8888/wholesite.html#sample.xml
            http://localhost:8888/wholesite.html#../index.html
            http://localhost:8888/wholesite.html#pluginDocs/plugins_0_90/
            http://localhost:8888/wholesite.html##section
            http://localhost:8888/wholesite.html#../samples-c/subdir/index.html
            http://localhost:8888/wholesite.html#../samples-c/subdir/hello.zip
            http://localhost:8888/wholesite.html#../old_site/test1.html
            http://localhost:8888/wholesite.html#samples-b/
            ALTHOUGH http://localhost:8888/wholesite.html#samples-b/faq.html WORKS!
            http://localhost:8888/wholesite.html#ellipse.png
            http://localhost:8888/wholesite.html#introduction

          You could check a freshly seeded site and see if you get some insights and
          improve on your patch.

          I did not check the tabs-pdf, though (I never needed it so far)

          [1] http://forrest.apache.org/docs_0_90/linking.html#resolve-ext-uris
          Show
          Johannes Schaefer added a comment - I've had a quick look at the wholesite.html from 'forrest seed': 1. Most (internal) links seem to work properly 2. External links [1] with "ext:" don't work.   This may be fixed by adding another "or" clause to doc-to-doc-uniqueids.xsl   <xsl:template match="section/document//link/@href[not(starts-with(., 'http:') or starts-with(., 'https:')       or starts-with(., 'site:') or starts-with(., 'ext:'))]"> This is great progress! 3. There are still some links that won't work (properly), e.g.    http://localhost:8888/wholesite.html#sample.xml    http://localhost:8888/wholesite.html#../index.html    http://localhost:8888/wholesite.html#pluginDocs/plugins_0_90/    http://localhost:8888/wholesite.html##section    http://localhost:8888/wholesite.html#../samples-c/subdir/index.html    http://localhost:8888/wholesite.html#../samples-c/subdir/hello.zip    http://localhost:8888/wholesite.html#../old_site/test1.html    http://localhost:8888/wholesite.html#samples-b/   ALTHOUGH http://localhost:8888/wholesite.html#samples-b/faq.html WORKS!    http://localhost:8888/wholesite.html#ellipse.png    http://localhost:8888/wholesite.html#introduction You could check a freshly seeded site and see if you get some insights and improve on your patch. I did not check the tabs-pdf, though (I never needed it so far) [1] http://forrest.apache.org/docs_0_90/linking.html#resolve-ext-uris
          Hide
          Andreas Lehmkühler added a comment -
          I've improved the patch. Most of the work is done. There are only two kind of links which don't work:

          1.) locationmap-links: there is one at the end n samples-b\locationmap\index.html. For now I don't know yet where to look for a solution

          2.) special image-links like in samples-b\linking.html in the section "Images". There is an automatic redirection to the image drectory in the resources-path. For now I don't know yet where to look for a solution, too

          Any idea where I have to look for a solution for the remaining issues?

          The second patch includes all former changes.
          Show
          Andreas Lehmkühler added a comment - I've improved the patch. Most of the work is done. There are only two kind of links which don't work: 1.) locationmap-links: there is one at the end n samples-b\locationmap\index.html. For now I don't know yet where to look for a solution 2.) special image-links like in samples-b\linking.html in the section "Images". There is an automatic redirection to the image drectory in the resources-path. For now I don't know yet where to look for a solution, too Any idea where I have to look for a solution for the remaining issues? The second patch includes all former changes.
          Hide
          Andreas Lehmkühler added a comment -
          I guess I've done.

          I solved the issue with the special image-links by including a part of the patch of FOR-147

          The problem with the locationmap lies somewhere else. I have to confess that I didn't understand the whole locationmap-thing yet, but as the locationmap-link doesn't work in a fresh seeded site, I'm not suprised that it doesn't work in the wholesite.html. Perhaps someone else should have a look at this point of the issue.

          My improved patch is attached.
          Show
          Andreas Lehmkühler added a comment - I guess I've done. I solved the issue with the special image-links by including a part of the patch of FOR-147 The problem with the locationmap lies somewhere else. I have to confess that I didn't understand the whole locationmap-thing yet, but as the locationmap-link doesn't work in a fresh seeded site, I'm not suprised that it doesn't work in the wholesite.html. Perhaps someone else should have a look at this point of the issue. My improved patch is attached.
          Hide
          Johannes Schaefer added a comment -
          I'm hesitating to apply the patch ... it obviously improves a lot of links but for some I cannot trace back what happens. The attachments show a list of the links(*) from a freshly seeded site. One time in
          HEAD (revision: 689507) without patch, the other with the patch applied. Make a diff to see the what's up.

          Some of the "bad" links may be due to direct link coding (not using the site: protocol), others may be due to usage of the locationmap.

          What do others mean? It's definitely a progress and we should apply the patch but leave the bug open?!



          (*) Should be almost all, some duplicates, though.
          Show
          Johannes Schaefer added a comment - I'm hesitating to apply the patch ... it obviously improves a lot of links but for some I cannot trace back what happens. The attachments show a list of the links(*) from a freshly seeded site. One time in HEAD (revision: 689507) without patch, the other with the patch applied. Make a diff to see the what's up. Some of the "bad" links may be due to direct link coding (not using the site: protocol), others may be due to usage of the locationmap. What do others mean? It's definitely a progress and we should apply the patch but leave the bug open?! (*) Should be almost all, some duplicates, though.
          Hide
          Andreas Lehmkühler added a comment -
          The main problem was an issue in "doc-to-doc-uniqueids.xsl". For aggregated content it tries to make all links unique by adding a trailing "#". But some of them where added where it don't have to be.

          For example in samples-c/index.xml

          "site:docs-samples2/i18n" became "#site:docs-samples1/sample" which is obviously wrong.

          It has to be translated to "samples-b/sample.html" and with the trailing "#" it becomes "#samples-b/sample.html"

          I have to fix/complete the matching templates starting at line 27. There are 4 cases:

          1.) (sub)section-ids
          these have to be completed by the ancestor ids (works well without my patch)

          2.) #fragment-id references
          these have to be completed by the ancestor ids (works well without my patch)

          3.) all links using a special protocol as http:,https:,site:,ext: and lm:
          they have have to left unchanged because they are translated elsewhere. (without my patch it only works for http: and https:)

          4.) the remaining links. This have to be direct coded links which are relative to the document in which they are included
          these links have to be completed with the whole path, so that they are relative the the site and not to the document in which they are included (my patch added this behaviour, so that direct coded links will work within an aggregation)

          I hope this was the explanation you're looking for.

          As the main problem is solved, I suggest to close this issue. I guess the locationmap-issue lies perhaps somewhere else, because it already doesn't work in a fresh seeded site without aggregation.
          Show
          Andreas Lehmkühler added a comment - The main problem was an issue in "doc-to-doc-uniqueids.xsl". For aggregated content it tries to make all links unique by adding a trailing "#". But some of them where added where it don't have to be. For example in samples-c/index.xml "site:docs-samples2/i18n" became "#site:docs-samples1/sample" which is obviously wrong. It has to be translated to "samples-b/sample.html" and with the trailing "#" it becomes "#samples-b/sample.html" I have to fix/complete the matching templates starting at line 27. There are 4 cases: 1.) (sub)section-ids these have to be completed by the ancestor ids (works well without my patch) 2.) #fragment-id references these have to be completed by the ancestor ids (works well without my patch) 3.) all links using a special protocol as http:,https:,site:,ext: and lm: they have have to left unchanged because they are translated elsewhere. (without my patch it only works for http: and https:) 4.) the remaining links. This have to be direct coded links which are relative to the document in which they are included these links have to be completed with the whole path, so that they are relative the the site and not to the document in which they are included (my patch added this behaviour, so that direct coded links will work within an aggregation) I hope this was the explanation you're looking for. As the main problem is solved, I suggest to close this issue. I guess the locationmap-issue lies perhaps somewhere else, because it already doesn't work in a fresh seeded site without aggregation.
          Hide
          Johannes Schaefer added a comment -
          Sorry, I wont be able to commit the patch before leaving for vacation.
          If nobody else will do it, I'll pick it up again late in October ;-)
          Show
          Johannes Schaefer added a comment - Sorry, I wont be able to commit the patch before leaving for vacation. If nobody else will do it, I'll pick it up again late in October ;-)
          Hide
          Andreas Lehmkühler added a comment -
          Is there someone who is able to spare some time to overview/commit my patch, or do I have to wait until late october 2009? ;-)))

          I just cleanup my attached patches, so that only the latest one is left, including all necessary changes.
          Show
          Andreas Lehmkühler added a comment - Is there someone who is able to spare some time to overview/commit my patch, or do I have to wait until late october 2009? ;-))) I just cleanup my attached patches, so that only the latest one is left, including all necessary changes.
          Hide
          Brian M Dube added a comment -
          Committed revision 766959.

          I'm not up to speed with this issue, but I've applied the patch and thank you for your patience. I tested briefly and found no regressions. Please test.
          Show
          Brian M Dube added a comment - Committed revision 766959. I'm not up to speed with this issue, but I've applied the patch and thank you for your patience. I tested briefly and found no regressions. Please test.
          Hide
          Brian M Dube added a comment -
          I've reverted the patch in r766976.

          Our docs fail to build with these changes in place and I don't have time this evening to do anything other than revert.
          Show
          Brian M Dube added a comment - I've reverted the patch in r766976. Our docs fail to build with these changes in place and I don't have time this evening to do anything other than revert.
          Hide
          Andreas Lehmkühler added a comment -
          I've a look at the forrest build logs and it seems to be a problem with my changes to the forrest documentation concerning the wholesite feature. I'll fix it and provide an improved patch.

          Show
          Andreas Lehmkühler added a comment - I've a look at the forrest build logs and it seems to be a problem with my changes to the forrest documentation concerning the wholesite feature. I'll fix it and provide an improved patch.
          Hide
          Andreas Lehmkühler added a comment -
          I've fixed the malformed documentation issue which was coming up last time Brian tried to apply the patch.
          Now everything works fine.

          Show
          Andreas Lehmkühler added a comment - I've fixed the malformed documentation issue which was coming up last time Brian tried to apply the patch. Now everything works fine.
          Hide
          Brian M Dube added a comment - - edited
          <broken-links>
            <link message="$FORREST_HOME/site-author/./content/xdocs/docs_0_90/howto/.xml (No such file or directory)">wholesite.html</link>
            <link message="$FORREST_HOME/site-author/./content/xdocs/docs_0_90/howto/.xml (No such file or directory)">pdf-tab.html</link>
            <link message="$FORREST_HOME/site-author/./content/xdocs/docs_0_90/howto/.xml (No such file or directory)">wholesite.pdf</link>
            <link message="$FORREST_HOME/site-author/./content/xdocs/docs_0_90/howto/.xml (No such file or directory)">pdf-tab.pdf</link>
          </broken-links>

          It still breaks for me. Are you running 'forrest' in $FORREST_HOME/site-author?
          Show
          Brian M Dube added a comment - - edited <broken-links>   <link message="$FORREST_HOME/site-author/./content/xdocs/docs_0_90/howto/.xml (No such file or directory)">wholesite.html</link>   <link message="$FORREST_HOME/site-author/./content/xdocs/docs_0_90/howto/.xml (No such file or directory)">pdf-tab.html</link>   <link message="$FORREST_HOME/site-author/./content/xdocs/docs_0_90/howto/.xml (No such file or directory)">wholesite.pdf</link>   <link message="$FORREST_HOME/site-author/./content/xdocs/docs_0_90/howto/.xml (No such file or directory)">pdf-tab.pdf</link> </broken-links> It still breaks for me. Are you running 'forrest' in $FORREST_HOME/site-author?
          Hide
          Andreas Lehmkühler added a comment -
          I ran some tests and a xml validator but obviously there is at least one test left I didn't run.

          First of all the error message is a little bit confusing. It is correct that these files are missing. They are some sort of virtual file as target for the docs with the aggregated content.
          It is quite a long time ago when I created this patch, perhaps I'm missing something....
          I'll have a look at that issue and thanks for your help
          Show
          Andreas Lehmkühler added a comment - I ran some tests and a xml validator but obviously there is at least one test left I didn't run. First of all the error message is a little bit confusing. It is correct that these files are missing. They are some sort of virtual file as target for the docs with the aggregated content. It is quite a long time ago when I created this patch, perhaps I'm missing something.... I'll have a look at that issue and thanks for your help
          Hide
          Brian M Dube added a comment -
          At this point I'm not running any specific tests, only building our docs because the patch makes changes in site-author.

          It seems the patch has become outdated with respect to trunk. Yes, the virtual targets do not exist on disk; but the pipelines which generate their content are failing and causing the error shown above. I may have more time this weekend.
          Show
          Brian M Dube added a comment - At this point I'm not running any specific tests, only building our docs because the patch makes changes in site-author. It seems the patch has become outdated with respect to trunk. Yes, the virtual targets do not exist on disk; but the pipelines which generate their content are failing and causing the error shown above. I may have more time this weekend.
          Hide
          Tim Williams added a comment -
          Moving to future release.
          Show
          Tim Williams added a comment - Moving to future release.

            People

            • Assignee:
              Unassigned
              Reporter:
              David Crossley
            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development