Hervé Boutemy created DOXIASITETOOLS-185:
--------------------------------------------

             Summary: 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}

Adding 2 methods to decoration:
- {{getCustomChild( "fluidoSkin.navBarStyle" )}}
- {{getCustomChildValue( "fluidoSkin.navBarStyle" )}}

would permit to simplify:
{code}#if ( $decoration.getCustomChildValue( 'fluidoSkin.skipGenerationDate' ) 
== 'true' ){code}
or
{code}#if ( $decoration.getCustomChild('fluidoSkin.navBarStyle' ) )
#*    *##set ( $navBarStyle = 
$decoration.getCustomChild('fluidoSkin.navBarStyle' ).getValue()){code}




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

Reply via email to