maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Osipov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DOXIASITETOOLS-97) Support polymorphism for menu inheritance
Date Mon, 04 May 2015 20:15:07 GMT

    [ https://issues.apache.org/jira/browse/DOXIASITETOOLS-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14527194#comment-14527194
] 

Michael Osipov commented on DOXIASITETOOLS-97:
----------------------------------------------

Is this still valid with the most recent versions?

> Support polymorphism for menu inheritance
> -----------------------------------------
>
>                 Key: DOXIASITETOOLS-97
>                 URL: https://issues.apache.org/jira/browse/DOXIASITETOOLS-97
>             Project: Maven Doxia Sitetools
>          Issue Type: New Feature
>          Components: Decoration model
>            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 was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message