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
Hide line numbers
1: {{velocity filter="none"}} 2: #** 3: * Generic property display. 4: *# 5: #macro(displayProperty $property $indentation) 6: ${indentation}; <label for="${doc.fullName}_0_$property.name">${escapetool.d}doc.displayPrettyName('$property.name', false, false)</label>${escapetool.h}${escapetool.h} 7: ${indentation} (% class="xHint" %)${escapetool.d}msg.get('$!property.hint') 8: ${indentation}: ${escapetool.d}doc.display('$property.name') 9: #end 10: #** 11: * Unfortunately the custom display mechanism for properties doesn't offer a clean way to overwrite the display only when 12: * some conditions are met (e.g. a specific action) so we're putting the custom display code in the sheet. 13: *# 14: #macro(displayBooleanProperty $property) 15: ${escapetool.h}if(${escapetool.d}context.display == 'edit') 16: ; <label for="${doc.fullName}_0_$property.name">${escapetool.d}doc.display('$property.name')${escapetool.d}doc.displayPrettyName('$property.name', false, false)</label> 17: : (% class="xHint" %)${escapetool.d}msg.get('$!property.hint') 18: ${escapetool.h}else 19: #displayProperty($property ' ') 20: ${escapetool.h}end 21: #end 22: {{{## 23: {{velocity}} 24: {{html wiki="true"}} 25: ${escapetool.d}xwiki.ssx.use('AppWithinMinutes.ClassSheetGenerator') 26: ${escapetool.h}set(${escapetool.d}discard = ${escapetool.d}doc.use('$doc.fullName')) 27: ${escapetool.h}${escapetool.h} We don't have access to the form element to set the CSS class for the vertical form layout standard. 28: (% class="xform half" %) 29: ((( 30: #foreach($property in $doc.getxWikiClass().properties) 31: #set($displayFormType = $property.getProperty('displayFormType')) 32: #if($property.type.indexOf('Boolean') != -1 && "$!displayFormType.value" == 'checkbox') 33: #displayBooleanProperty($property) 34: #else 35: #displayProperty($property ' ') 36: #end 37: #end 38: ))) 39: {{/html}} 40: {{/velocity}}## 41: }}} 42: {{/velocity}}