maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hervé Boutemy (JIRA) <j...@apache.org>
Subject [jira] [Commented] (DOXIASITETOOLS-185) add helpers to traverse custom skin parameters
Date Thu, 21 Dec 2017 12:57:00 GMT

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

Hervé Boutemy commented on DOXIASITETOOLS-185:
----------------------------------------------

https://gitbox.apache.org/repos/asf?p=maven-doxia-sitetools.git&a=commit&h=e10a843bce0f2620caaf808cddae584c11a90461

> add helpers to traverse custom skin parameters
> ----------------------------------------------
>
>                 Key: DOXIASITETOOLS-185
>                 URL: https://issues.apache.org/jira/browse/DOXIASITETOOLS-185
>             Project: Maven Doxia Sitetools
>          Issue Type: Improvement
>          Components: Decoration model
>    Affects Versions: 1.7.5
>            Reporter: Hervé Boutemy
>            Assignee: Hervé Boutemy
>             Fix For: 1.8
>
>
> custom field is an open XML element, that Velocity has to traverse to find expected data:
on each traversal, a test has to be added.
> That leads to code like in Fluido skin:
> {code}#if ( $decoration.custom.getChild( 'fluidoSkin' ) && $decoration.custom.getChild(
'fluidoSkin' ).getChild( 'skipGenerationDate' )
>            && $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'skipGenerationDate'
).getValue() == 'true' ){code}
> or
> {code}#if ( $decoration.custom.getChild('fluidoSkin')
>            && $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'navBarStyle'
) )
>   #set ( $navBarStyle = $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'navBarStyle'
).getValue() ){code}
> or
> {code}#if ( $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'breadcrumbDivider'
) )
>   #set ( $breadcrumbDivider = $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'breadcrumbDivider'
).getValue() )
> #else
>   #set ( $breadcrumbDivider = '/' )
> #end{code}
> Adding 3 methods to decoration:
> - {{getCustomChild( "fluidoSkin.navBarStyle" )}}
> - {{getCustomChildValue( "fluidoSkin.navBarStyle" )}}
> - {{getCustomChildValue( "fluidoSkin.breadcrumbDivider", "/" )}}
> would permit to simplify:
> {code}#if ( $decoration.getCustomChildValue( 'fluidoSkin.skipGenerationDate' ) == 'true'
){code}
> and
> {code}#if ( $decoration.getCustomChild('fluidoSkin.navBarStyle' ) )
>   #set ( $navBarStyle = $decoration.getCustomChild('fluidoSkin.navBarStyle' ).getValue()
){code}
> and
> {code}#set ( $breadcrumbDivider = $decoration.getCustomValue( 'fluidoSkin.breadcrumbDivider',
'/' ) ){code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message