Changes for page Create Application

Last modified by Ludovic Dubost on 2024/07/22 15:51

From version 4.1
edited by Ludovic Dubost
on 2015/09/01 11:46
Change comment: Install extension [org.xwiki.platform:xwiki-platform-appwithinminutes-ui-7.1]
To version 1.1
edited by Ludovic Dubost
on 2014/03/30 19:43
Change comment: Imported from XAR

Summary

Details

Page properties
Content
... ... @@ -1,4 +1,4 @@
1 -{{include reference="AppWithinMinutes.WizardStep"/}}
1 +{{include document="AppWithinMinutes.WizardStep"/}}
2 2  
3 3  {{velocity output="false"}}
4 4  #macro(showStep)
... ... @@ -13,7 +13,7 @@
13 13   (% class="description" %)$services.localization.render("platform.appwithinminutes.wizardStep${index}Description")
14 14   #end
15 15   )))
16 - <form action="$doc.getURL()" method="post" class="xform wizard-body">
16 + <form action="" method="post" class="xform wizard-body">
17 17   ; <label for="appName">$services.localization.render('platform.appwithinminutes.appNameLabel')</label>
18 18   (% class="xHint" %)$services.localization.render('platform.appwithinminutes.appNameHint')
19 19   : <input type="text" id="appName" name="appName" />
... ... @@ -33,8 +33,7 @@
33 33  
34 34  #macro(processStep)
35 35   ## Check if the application already exists.
36 - #set($appName = $request.appName)
37 - #getAppDescriptor($appName)
36 + #getAppDescriptor($request.appName)
38 38   #if($appDescriptor)
39 39   ## Edit an existing application. Use the configured class name.
40 40   #set($classStringRef = $appDescriptor.getObject($appDescriptorClassName).getProperty('class').value)
... ... @@ -42,15 +42,12 @@
42 42   #set($classRef = $services.model.resolveDocument($classStringRef, 'explicit', $appDescriptor.documentReference))
43 43   #else
44 44   ## Create a new application. Use the default class name.
45 - #set($className = "#toXMLName($appName)")
46 - #set($classRef = $services.model.createDocumentReference($doc.wiki, "${className}Code", "${className}Class"))
44 + #set($classRef = $services.model.createDocumentReference($doc.wiki, $request.appName, "#toXMLName($request.appName)Class"))
47 47   #end
48 48   #set($queryString = 'wizard=true')
49 49   #if(!$xwiki.exists($classRef))
50 - #set($classTitle = "$appName Class")
51 - #set($appHomeRef = $services.model.createDocumentReference($doc.wiki, $appName, 'WebHome'))
52 - #set($classParent = $services.model.serialize($appHomeRef))
53 - #set($queryString = "$queryString&editor=inline&template=AppWithinMinutes.ClassTemplate&parent=$escapetool.url($classParent)&title=$escapetool.url($classTitle)&AppWithinMinutes.MetadataClass_0_dataSpaceName=$escapetool.url($appName)")
48 + #set($classTitle = "$request.appName Class")
49 + #set($queryString = "$queryString&editor=inline&template=AppWithinMinutes.ClassTemplate&parent=WebHome&title=$escapetool.url($classTitle)")
54 54   #end
55 55   $response.sendRedirect($xwiki.getURL($classRef, 'edit', $queryString))
56 56  #end
... ... @@ -70,15 +70,13 @@
70 70   (% class="xErrorMsg" %)$services.localization.render('platform.appwithinminutes.appNameInvalidClassNameError')
71 71   #end
72 72   #set($appHomeRef = $services.model.createDocumentReference($doc.wiki, $appName, 'WebHome'))
73 - #set($appClassRef = $services.model.createDocumentReference($doc.wiki, "$!{className}Code", "$!{className}Class"))
69 + #set($appClassRef = $services.model.createDocumentReference($doc.wiki, $appName, "$!{className}Class"))
74 74   #end
75 75   #set($appHomeURL = $stringtool.removeEnd($xwiki.getDocument($appHomeRef).getExternalURL(), 'WebHome'))
76 76   ; $services.localization.render('platform.appwithinminutes.appNamePreviewHomePageUrlLabel')
77 77   : {{{$!appHomeURL}}}
78 78   ; $services.localization.render('platform.appwithinminutes.appNamePreviewDataSpaceLabel')
79 - : {{{$appHomeRef.wikiReference.name}}} » {{{$appHomeRef.lastSpaceReference.name}}}
80 - ; $services.localization.render('platform.appwithinminutes.appNamePreviewCodeSpaceLabel')
81 - : {{{$appClassRef.wikiReference.name}}} » {{{$appClassRef.lastSpaceReference.name}}}
75 + : {{{$doc.wiki}}} » {{{$appName}}}
82 82   ; $services.localization.render('platform.appwithinminutes.appNamePreviewClassReferenceLabel')
83 83   : {{{$appClassRef.wikiReference.name}}} » {{{$appClassRef.lastSpaceReference.name}}} » {{{$appClassRef.name}}}
84 84   #if($appDescriptor || $xwiki.exists($appHomeRef) || $xwiki.exists($appClassRef))
... ... @@ -99,5 +99,4 @@
99 99  #else
100 100   #showStep()
101 101  #end
102 -#set($docextras=[])
103 103  {{/velocity}}