General Actions:
Log-in
Register
Wiki:
Main wiki
▼
:
Document Index
»
Space:
AppWithinMinutes
▼
:
Document Index
»
Page:
ClassSheetGenerator
Search
default
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Main wiki
»
App Within Minutes
»
ClassSheetGenerator
Wiki source code of
ClassSheetGenerator
Last modified by
Administrator
on 2012/03/21 17:41
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
{{velocity filter="none"}} #** * Generic property display. *# #macro(displayProperty $property $indentation) ${indentation}; <label for="${doc.fullName}_0_$property.name">${escapetool.d}doc.displayPrettyName('$property.name', false, false)</label>${escapetool.h}${escapetool.h} ${indentation} (% class="xHint" %)${escapetool.d}msg.get('$!property.hint') ${indentation}: ${escapetool.d}doc.display('$property.name') #end #** * Unfortunately the custom display mechanism for properties doesn't offer a clean way to overwrite the display only when * some conditions are met (e.g. a specific action) so we're putting the custom display code in the sheet. *# #macro(displayBooleanProperty $property) ${escapetool.h}if(${escapetool.d}context.display == 'edit') ; <label for="${doc.fullName}_0_$property.name">${escapetool.d}doc.display('$property.name')${escapetool.d}doc.displayPrettyName('$property.name', false, false)</label> : (% class="xHint" %)${escapetool.d}msg.get('$!property.hint') ${escapetool.h}else #displayProperty($property ' ') ${escapetool.h}end #end {{{## {{velocity}} {{html wiki="true"}} ${escapetool.d}xwiki.ssx.use('AppWithinMinutes.ClassSheetGenerator') ${escapetool.h}set(${escapetool.d}discard = ${escapetool.d}doc.use('$doc.fullName')) ${escapetool.h}${escapetool.h} We don't have access to the form element to set the CSS class for the vertical form layout standard. (% class="xform half" %) ((( #foreach($property in $doc.getxWikiClass().properties) #set($displayFormType = $property.getProperty('displayFormType')) #if($property.type.indexOf('Boolean') != -1 && "$!displayFormType.value" == 'checkbox') #displayBooleanProperty($property) #else #displayProperty($property ' ') #end #end ))) {{/html}} {{/velocity}}## }}} {{/velocity}}