Changes for page Create Application
Last modified by Administrator on 2020/09/21 16:05
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-appwithinminutes-ui/11.10.10]
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Syntax
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki 2. 01 +XWiki 2.1 - Content
-
... ... @@ -1,20 +1,31 @@ 1 -{{include reference="AppWithinMinutes. WizardStep"/}}1 +{{include reference="AppWithinMinutes.VelocityMacros"/}} 2 2 3 +{{velocity}} 4 +#if ($request.wizard == 'true') 5 + {{include reference="AppWithinMinutes.WizardStep"/}} 6 +#end 7 +{{/velocity}} 8 + 3 3 {{template name="locationPicker_macros.vm" /}} 4 4 5 5 {{velocity output="false"}} 6 -#macro(showStep) 7 - {{html wiki="true"}} 12 +#macro (showStep) 8 8 #appWizardHeader('name') 9 - (% class="wizard-help" %) 10 - ((( 11 - **$services.localization.render('platform.appwithinminutes.wizardStepHelpTitle')** $services.localization.render('platform.appwithinminutes.wizardStepHelpDescription') 12 - (% class="steps vertical" %) 13 - #foreach($step in $awmSteps) 14 - * (% class="number" %)$mathtool.add($foreach.index, 1)(%%) (% class="name" %)$services.localization.render("appWithinMinutes.wizardStep.${step}.name")(%%) 15 - (% class="description" %)$services.localization.render("appWithinMinutes.wizardStep.${step}.description") 16 - #end 17 - ))) 14 + <div class="wizard-help"> 15 + <p> 16 + <strong>$services.localization.render('platform.appwithinminutes.wizardStepHelpTitle')</strong> 17 + $services.localization.render('platform.appwithinminutes.wizardStepHelpDescription') 18 + </p> 19 + <ul class="steps vertical"> 20 + #foreach($step in $awmSteps) 21 + <li> 22 + <span class="number">$mathtool.add($foreach.index, 1)</span> 23 + <span class="name">$services.localization.render("appWithinMinutes.wizardStep.${step}.name")</span> 24 + <span class="description">$services.localization.render("appWithinMinutes.wizardStep.${step}.description")</span> 25 + </li> 26 + #end 27 + </ul> 28 + </div> 18 18 <form action="$doc.getURL()" method="post" class="xform wizard-body"> 19 19 #locationPicker({ 20 20 'id': 'app', ... ... @@ -38,7 +38,6 @@ 38 38 <div class="appName-preview"></div> 39 39 #appWizardFooter(1) 40 40 </form> 41 - {{/html}} 42 42 #end 43 43 44 44 #macro (processStep) ... ... @@ -46,10 +46,9 @@ 46 46 #getAppReference 47 47 #getAppDescriptor($appReference) 48 48 #if ($appDescriptor) 49 - ## Edit an existing application. Use the configured class name. 50 - #set ($appClassRef = $appDescriptor.getObject($appDescriptorClassName).getValue('class')) 51 - ## The class reference is relative to the document holding the application descriptor. 52 - #set ($appClassRef = $services.model.resolveDocument($appClassRef, 'explicit', $appDescriptor.documentReference)) 59 + ## Edit an existing application. 60 + #getAppClassReference($appDescriptor) 61 + #set ($appClassRef = $classReference) 53 53 #else 54 54 ## Create a new application. Use the default class name. 55 55 #set ($appCodeRef = $services.model.createSpaceReference('Code', $appReference)) ... ... @@ -70,28 +70,29 @@ 70 70 #macro (validateAppName) 71 71 #getAppReference 72 72 #if (!$appReference) 73 - (%class="xErrorMsg"%)$services.localization.render('platform.appwithinminutes.appNameEmptyError')82 + <span class="xErrorMsg">$services.localization.render('platform.appwithinminutes.appNameEmptyError')</span> 74 74 #else 75 75 #getAppDescriptor($appReference) 76 76 #if ($appDescriptor) 77 77 ## Edit an existing application. 78 - #set ($appDescriptorObj = $appDescriptor.getObject($appDescriptorClassName)) 79 - #set ($appClassRef = $appDescriptorObj.getValue('class')) 80 - ## The class reference is relative to the document holding the application descriptor. 81 - #set ($appClassRef = $services.model.resolveDocument($appClassRef, 'explicit', $appDescriptor.documentReference)) 87 + #getAppClassReference($appDescriptor) 88 + #set ($appClassRef = $classReference) 82 82 #else 83 83 ## Create a new application. 84 84 #set ($appCodeRef = $services.model.createSpaceReference('Code', $appReference)) 85 85 #set ($appClassRef = $services.model.createDocumentReference("$!{appReference.name}Class", $appCodeRef)) 86 86 #end 87 - ; $services.localization.render('platform.appwithinminutes.appNamePreviewHomePageUrlLabel') 88 - : {{{$!xwiki.getDocument($appReference).externalURL}}} 89 - ; $services.localization.render('platform.appwithinminutes.appNamePreviewCodeSpaceLabel') 90 - : {{html clean="false"}}#hierarchy($appClassRef.parent){{/html}} 94 + <dl> 95 + <dt>$services.localization.render('platform.appwithinminutes.appNamePreviewHomePageUrlLabel')</dt> 96 + <dd><pre>$!escapetool.xml($xwiki.getDocument($appReference).externalURL)</pre></dd> 97 + <dt>$services.localization.render('platform.appwithinminutes.appNamePreviewCodeSpaceLabel')</dt> 98 + <dd>#hierarchy($appClassRef.parent)</dd> 99 + </dl> 91 91 #set ($appHomeRef = $services.model.resolveDocument('', 'default', $appReference)) 92 92 #if ($appDescriptor || $xwiki.exists($appHomeRef) || $xwiki.exists($appClassRef)) 93 - 94 - {{warning}}$services.localization.render('platform.appwithinminutes.appNameIsUsedWarning'){{/warning}} 102 + <div class="box warningmessage"> 103 + $services.localization.render('platform.appwithinminutes.appNameIsUsedWarning') 104 + </div> 95 95 #end 96 96 #end 97 97 #end ... ... @@ -117,11 +117,14 @@ 117 117 #set ($appDescriptors = $services.query.xwql($appDescriptorStatement).bindValue('space', $localSpaceReference).execute()) 118 118 #if ($appDescriptors.size() > 0) 119 119 #set ($appDescriptor = $xwiki.getDocument($appDescriptors.get(0))) 130 + #else 131 + #set ($appDescriptor = $NULL) 120 120 #end 121 121 #end 122 122 {{/velocity}} 123 123 124 124 {{velocity}} 137 +{{html clean="false"}} 125 125 #if ("$!request.appName" != '') 126 126 #if ($xcontext.action == 'get') 127 127 #validateAppName ... ... @@ -129,8 +129,9 @@ 129 129 ## CSRF protection is not needed because this step only redirects to the next one passing data in the query string. 130 130 #processStep 131 131 #end 132 -#else 145 +#elseif ($request.wizard == 'true') 133 133 #showStep 147 + #set ($displayDocExtra = false) 134 134 #end 135 - #set($displayDocExtra = false)149 +{{/html}} 136 136 {{/velocity}}