Uploaded image for project: 'Maven Doxia Sitetools'
  1. Maven Doxia Sitetools
  2. DOXIASITETOOLS-185

add helpers to traverse custom skin parameters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.5
    • 1.8
    • Site model
    • None

    Description

      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:

      #if ( $decoration.custom.getChild( 'fluidoSkin' ) && $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'skipGenerationDate' )
                 && $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'skipGenerationDate' ).getValue() == 'true' )

      or

      #if ( $decoration.custom.getChild('fluidoSkin')
                 && $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'navBarStyle' ) )
        #set ( $navBarStyle = $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'navBarStyle' ).getValue() )

      or

      #if ( $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'breadcrumbDivider' ) )
        #set ( $breadcrumbDivider = $decoration.custom.getChild( 'fluidoSkin' ).getChild( 'breadcrumbDivider' ).getValue() )
      #else
        #set ( $breadcrumbDivider = '/' )
      #end

      Adding 3 methods to decoration:

      • getCustomChild( "fluidoSkin.navBarStyle" )
      • getCustomChildValue( "fluidoSkin.navBarStyle" )
      • getCustomChildValue( "fluidoSkin.breadcrumbDivider", "/" )

      would permit to simplify:

      #if ( $decoration.getCustomChildValue( 'fluidoSkin.skipGenerationDate' ) == 'true' )

      and

      #if ( $decoration.getCustomChild('fluidoSkin.navBarStyle' ) )
        #set ( $navBarStyle = $decoration.getCustomChild('fluidoSkin.navBarStyle' ).getValue() )

      and

      #set ( $breadcrumbDivider = $decoration.getCustomValue( 'fluidoSkin.breadcrumbDivider', '/' ) )

      Attachments

        Issue Links

          Activity

            People

              hboutemy Herve Boutemy
              hboutemy Herve Boutemy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: