Show last authors
1 {{velocity}}
2 #set($displayDocExtra = false)
3 #if ($isguest)
4 {{error}}$services.localization.render('xe.officeimporter.notallowed'){{/error}}
5 #elseif (!$services.officemanager.isConnected())
6 #if ($hasAdmin)
7 {{error}}$services.localization.render('xe.officeimporter.error.adminuser', ['[[', '>>http://extensions.xwiki.org/xwiki/bin/Extension/Office%20Importer%20Application]]']){{/error}}
8 #else
9 {{error}}$services.localization.render('xe.officeimporter.error.normaluser'){{/error}}
10 #end
11 #elseif("$!request.page" == '')
12 ## This page does not propose to select the target page anymore. We redirect to the create action instead
13 ## Note: we make the URL from the main page and not from the current one. Because the user have probably not the
14 ## create right on the "XWiki" space, and this space should be reserved for technical usage.
15  {{error}}$services.localization.render('office.form.error.noDocument', ['[[', ">>path:$xwiki.getURL($services.wiki.currentWikiDescriptor.mainPageReference, 'create', 'type=office')]]"]){{/error}}
16 #else
17 #set ($targetReference = $services.model.resolveDocument($request.page))
18 #set ($targetDoc = $xwiki.getDocument($targetReference))
19 #set ($discard = $xwiki.jsx.use('XWiki.OfficeImporter'))
20 #set ($discard = $xwiki.jsfx.use('uicomponents/widgets/validation/livevalidation_prototype.js'))
21 #set ($discard = $xwiki.ssfx.use('uicomponents/widgets/validation/livevalidation.css', true))
22
23 {{html}}
24 <form action="$xwiki.getURL('XWiki.OfficeImporterResults','view')" enctype="multipart/form-data" method="post" class="xform" id="officeImportForm">
25 <dl class="row">
26 ##
27 ## Left part
28 ##
29 <div class="col-xs-12 col-md-6">
30 ##
31 ## Document
32 ##
33 <dt>
34 <label for="filepath">$escapetool.xml($services.localization.render('xe.officeimporter.import.document'))</label>
35 </dt>
36 <dd class="buttonwrapper">
37 <input id="filepath" type="file" name="filePath" value="" size="40" class="button secondary" />
38 </dd>
39 ##
40 ## Target
41 ##
42 <dt>
43 <label>Target</label>
44 </dt>
45 <dd>
46 #template('hierarchy_macros.vm')
47 #hierarchy($targetReference)
48 </dd>
49 ##
50 ## Append result
51 ##
52 #if (!$targetDoc.isNew())
53 <dt class="warningmessage">
54 <label for="appendContentInputId">$escapetool.xml($services.localization.render('xe.officeimporter.import.appendresult'))</label>
55 <span class="xHint">$escapetool.xml($services.localization.render('office.form.append.hint'))</span>
56 </dt>
57 <dd class="warningmessage">
58 <input id="appendContentInputId" name="appendContent" type="checkbox" value="true" />
59 </dd>
60 #end
61 </div>
62 ##
63 ## Right part
64 ##
65 <div class="col-xs-12 col-md-6">
66 ##
67 ## Styles
68 ##
69 <dt>
70 <label for="filterStylesInputId">$escapetool.xml($services.localization.render('xe.officeimporter.import.filterstyles'))</label>
71 <span class="xHint">$escapetool.xml($services.localization.render('xe.officeimporter.import.help.styles'))</span>
72 </dt>
73 <dd>
74 <input id="filterStylesInputId" name="filterStyles" type="checkbox" value="strict" checked="checked"/>
75 </dd>
76 ##
77 ## Splitting
78 ##
79 <dt>
80 <label for="splitDocumentInputId">$escapetool.xml($services.localization.render('xe.officeimporter.import.splitting.splitdocument'))</label>
81 <span class="xHint">$escapetool.xml($services.localization.render('xe.officeimporter.import.help.splitting'))</span>
82 </dt>
83 <dd>
84 <input id="splitDocumentInputId" name="splitDocument" type="checkbox" value="true"/>
85 </dd>
86 ##
87 ## Heading level splits
88 ##
89 <dt>
90 <label for="headingLevelsToSplitInputId" class="multipleselect">$escapetool.xml($services.localization.render('xe.officeimporter.import.splitting.headinglevels'))</label>
91 </dt>
92 <dd>
93 <select id="headingLevelsToSplitInputId" size="5" multiple="multiple" name="headingLevelsToSplit">
94 #foreach($h in [1..6])
95 <option value="${h}"#if ($foreach.count == 1) selected="selected"#end>$escapetool.xml($services.localization.render('xe.officeimporter.import.splitting.heading'))-${h}</option>
96 #end
97 </select>
98 </dd>
99 ##
100 ## Child pages naming method:
101 ##
102 #if ($targetDoc.documentReference.name == 'WebHome')
103 ## When the target page is not terminal, the only logical strategy to use is "headingNames". It creates pages
104 ## as children of the target, which seems to be the correct way in the nested pages paradigm.
105  ## The other choices have no sense:
106 ## - "mainPageNameAndHeading" will create pages called "WebHome-Title1" instead of "targetDoc/Title1".
107 ## - "mainPageNameAndNumbering" will create pages called "WebHome-1" instead of "targetDoc/1".
108 ## In both cases, the "WebHome" part of the names are meaningless.
109 ##
110 ## NOTE: The created children are terminal until https://jira.xwiki.org/browse/XWIKI-12569 is fixed.
111 <input type="hidden" name="childPagesNamingMethod" value="headingNames" />
112 #else
113 <dt>
114 <label for="childPagesNamingMethodInputId">$escapetool.xml($services.localization.render('xe.officeimporter.import.splitting.naming'))</label>
115 </dt>
116 <dd>
117 <select id="childPagesNamingMethodInputId" name="childPagesNamingMethod">
118 <option value="headingNames">$escapetool.xml($services.localization.render('xe.officeimporter.import.splitting.naming.headingnames'))</option>
119 <option value="mainPageNameAndHeading">$escapetool.xml($services.localization.render('xe.officeimporter.import.splitting.naming.mainpagenameandheading'))</option>
120 <option value="mainPageNameAndNumbering">$escapetool.xml($services.localization.render('xe.officeimporter.import.splitting.naming.mainpagenameandnumbering'))</option>
121 </select>
122 </dd>
123 #end
124 </div>
125 </dl>
126 <div class="clearfloats"></div>
127 ##
128 ## Hidden inputs
129 ##
130 <input type="hidden" name="form_token" value="$!{services.csrf.getToken()}" />
131 ## Normalize the parent reference of the new document so that even in a subwiki it points to the current wiki
132 #set ($normalizedParentReference = $services.model.resolveDocument("$!request.parent", 'current'))
133 <input type="hidden" name="parent" value="$normalizedParentReference" />
134 <input type="hidden" name="target" value="$escapetool.xml($services.model.serialize($targetReference, 'default'))" id="target"/>
135 ##
136 ## Confirm button
137 ##
138 <span class="buttonwrapper">
139 <input type="submit" value="$services.localization.render('xe.officeimporter.import.import')" class="button" id="submit"/>
140 </span>
141 </form>
142 {{/html}}
143 #end
144 {{/velocity}}
Partita IVA: 01131710376 - Copyright © 2008-2021 APICe@DISI Research Group - PRIVACY