forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iss...@cocoondev.org
Subject [issues] New comment: (FOR-111) Seem to get all tab menus, not default tab's menus.
Date Thu, 01 Jan 1970 00:00:00 GMT
The following comment has been added to this issue:

     Author: Lorenz Froihofer
    Created: Mon, 24 May 2004 2:57 PM
       Body:
I cannot verify the posted links because they are out of date, but the issue seems to be the
same for which I posted a solution to the mailing list.

I will add the patch here because it resolves this issue.

My posting follows:
===================

My site.xml contains something similar to:

<site>
  <category1 tab="tab-1" href="category1/" label="Category 1">
    <entry1 label="My Entry 1" href="entry1/index.html" />
    <entry2 label="My Entry 2" href="../entry2/index.html" />
...

All entries should correspond to the tab "tab-1". During pipeline processing the hrefs of
the entries are translated to
href="category1/entry1/index.html" for entry 1
href="category1/../entry2/index.html" for entry 2

In resources/stylesheets/site2site-selectnodes.xsl a path comparison is performed for incomming
requests by using the starts-with() method.

The issue is now that an incomming request for entry2 is
"entry2/index.html" but the entry in the site.xml during processing is "category1/../entry2/index.html".
Therefore, the comparison fails with the result that for entry 2 the content of all available
tabs is shown in the menu.

To resolve this issue, I suggest to normalize the href-attributes before calling "site2site-selectnodes.xsl".
This can be achieved by copying the attached normalizehrefs.xsl  to the "resources/stylesheets"
directory and applying the patch to "context/menu.xmap".

The patch adds one line to menu.xmap:
<map:transform src="resources/stylesheets/normalizehrefs.xsl" />


After this, the href attribute of entry2 in the example above is normalized to "entry2/index.html"
and the comparison by using the starts-with() function succeeds.

---------------------------------------------------------

Additional posting:
Try the following setup:

<site>
  <category1 tab="tab-1" href="category1/" label="Category 1">
    <entry1 label="My Entry 1" href="entry1.html" />
    <entry2 label="My Entry 2" href="../dir-entry2/entry2.html" />
  </category1>
  <category2 tab="tab-2" href="category2/" label="Category 2">
    <entry3 label="My Entry 3" href="dir-entry3/entry2.html />
  </category3>
</site>

A request to entry1.html shows the menu corresponding to tab-1. A request to entry3.html shows
the menu corresponding to tab-2. But: a request to entry2.html show the menus of tab-1 and
tab-2.

The reason is that entry2.html has at the time of comparison in resources/stylesheets/site2site-selectnodes.xsl
the value "category1/../dir-entry2/entry2.html" which is different to the incomming request
to "dir-entry2/entry2.html". Therefore, the comparison by using the starts-with() function
fails and it cannot be found that entry2.html belongs to tab "tab-1".

---------------------------------------------------------------------
View the issue:

  http://issues.cocoondev.org/jira//secure/ViewIssue.jspa?key=FOR-111


Here is an overview of the issue:
---------------------------------------------------------------------
        Key: FOR-111
    Summary: Seem to get all tab menus, not default tab's menus.
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Forrest
  Component: Forrest skins
   Versions:
             HEAD

   Assignee: 
   Reporter: Adam Jack

    Created: Tue, 20 Jan 2004 12:39 AM
    Updated: Tue, 23 Mar 2004 5:27 AM
Environment: Linux

Description:
With this site.xml and with this tabs.xml:


http://cvs.apache.org/viewcvs.cgi/jakarta-gump/template/forrest/src/documentation/content/xdocs/site.xml?rev=1.14&view=markup

http://cvs.apache.org/viewcvs.cgi/jakarta-gump/template/forrest/src/documentation/content/xdocs/tabs.xml?rev=1.5&view=markup


These are ok:

http://lsd.student.utwente.nl/gump/
http://lsd.student.utwente.nl/gump/gump_stats/index.html

but these (it seems, in sub-directories) do not:

http://lsd.student.utwente.nl/gump/ant-contrib/ant-contrib-test.html

[they have all menu options, not the default's tabs menu options ]

I assume it is to do with me putting things in directories other that ones named in the tabs.xml,
but I thought this set the defaults:

 <site  ....  tab="home">



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org/jira//Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message