[ 
http://jira.codehaus.org/browse/MSITE-378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=162324#action_162324
 ] 

Mark Struberg commented on MSITE-378:
-------------------------------------

There was such a functionality in a very rudimentary form in  beta-6 already, 
but it did not work properly.

{noformat}
Site descriptors are inherited along the same lines as project descriptors are. 
When you deploy a project, its site descriptor is also deployed so that it can 
be inherited.

By default, only the basic settings are inherited. From the body, only the 
links are inherited, and these accumulate to contain all the parents' site 
descriptor links.

However, it is possible to inherit menus as well. To do so, use the inherit 
attribute in the site descriptor. This can be either top or bottom , indicating 
where in the menu it will be placed after inheritance. For example:
{noformat}
See 
http://maven.apache.org/plugins/maven-site-plugin/examples/sitedescriptor.html 
for more information

This has lead to menu items in sub menus which are not intended because even if 
you inherit  a menu entry to news1.html,  where does the page come from?

I am cured from this weird behaviour since I use beta-7 now.  

To only inherit menu items is simply not enough sadly...

> Support polymorphism for menu inheritance
> -----------------------------------------
>
>                 Key: MSITE-378
>                 URL: http://jira.codehaus.org/browse/MSITE-378
>             Project: Maven 2.x Site Plugin
>          Issue Type: New Feature
>          Components: inheritance
>    Affects Versions: 2.0-beta-7
>            Reporter: Thorsten Möller
>
> Inheritance of menus in an multimodule project environment does not work as 
> intuitively expected (as in OO languages). The following excerpts try to 
> illustrate this. Assume there is a root project R that has one module 
> (project) S. Both contain a site descriptor. Let the site descriptor for R be 
> as follows:
> {code:xml}
> <project name="${project.name}">
>       <!-- ... -->
>       <body>
>               <menu name="Main">
>                       <item name="Introduction" href="/index.html" />
>                       <item name="News" href="/news.html" />
>                       <item name="Overwrite" href="/documentation.html" />
>               </menu>
>       </body>
>       <!-- ... -->
>       
> </project>
> {code}
> And let the site descriptor for S be:
> {code:xml}
> <project name="${project.name}">
>       <!-- ... -->
>       <body>
>               <menu name="Main">
>                       <item name="Introduction" href="/index.html" />
>                       <item name="Overwrite" href="/overwrite.html" />
>                       <item name="Added" href="/added.html" />
>               </menu>
>       </body>
>       <!-- ... -->
>       
> </project>
> {code}
> As I'm used to the way inheritance and polymorphism are defined in OO 
> languages such as Java, I would expect the following properties for the 
> "Main" menu in S:
> - item "Introduction" is overwritten in S but refers to the same index.html 
> file; of course, its path is relative to start directory of S
> - item "News" is missing for S but will be inherited from R, thus, it will be 
> rendered to the site as in R
> - item "Overwrite" is overwritten in S and refers now to overwrite.html 
> (instead of documentation.html as in R)
> - item "Added" is new in S, thus, it will be rendered to the site in addition
> Unfortunately, with the current implementation of the site plugin inheritance 
> is as follows:
> - "Main" menu of R is inherited by S as-is, that is, all changes made to the 
> menu in S are not visible/rendered to the site.
> I would like to propose to implement polymorphism regarding menu inheritance 
> as described above. In addition, I would like to propose a new boolean 
> parameter "inherited" (or "inherit") that can be added to menu items. Its 
> semantics would be equivalent to the "inherited" tag in pom.xml. In the 
> following one example for R:
> {code:xml}
> <project name="${project.name}">
>       <!-- ... -->
>       <body>
>               <menu name="Main">
>                       <item name="Introduction" href="/index.html" />
>                       <item name="News 1" href="/news1.html"  
> inherited="false"/>
>                       <item name="News 2" href="/news2.html"  
> inherited="true"/>
>                       <item name="Overwrite" href="/documentation.html" />
>               </menu>
>       </body>
>       <!-- ... -->
>       
> </project>
> {code}
> With this example only menu item "News 2" would appear in S because its 
> inheritance is not disabled, while menu item "News 1" appears only in R and 
> not in S because its inheritance was disabled (false). The default if the 
> parameter is missing should be "true".
> Btw, the same extension should be made to the <menu ... > tag to allow to 
> enable or disable inheritance of menus entirely.
> Regards,
> Thorsten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to