General Actions:
Log-in
Wiki:
L3D's Wiki
▼
:
Document Index
»
Space:
XWiki
▼
:
Document Index
»
Page:
OfficeImporterResults
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Welcome to your wiki
»
XWiki Space
»
Office Importer
»
Office Importer Results
Wiki source code of
Office Importer Results
Last modified by
Administrator
on 2011/03/02 17:34
Content
·
Comments
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
{{velocity}} #if($isguest) #error($msg.get("xe.officeimporter.notallowed")) #else ######################### ## Validate Input File ## ######################### #set($goBack = "[[$msg.get('xe.officeimporter.results.goback')>>XWiki.OfficeImporter]]") #set($fileUpload=$xwiki.fileupload) #set($fileName=$fileUpload.getFileName("filePath")) #if(! $fileName) {{error}}$msg.get("xe.officeimporter.results.missingfile", [$goBack]){{/error}} #else #set($void=$fileUpload.loadFileList()) #set($officeFileStream=$fileUpload.fileItems.get(0).inputStream) #end ########################### ## Validate Target Space ## ########################### #if(! $request.targetSpace) {{error}}$msg.get("xe.officeimporter.results.missingspace", [$goBack]){{/error}} #else #set($targetSpace=$request.targetSpace.replaceAll("[:/]", "-")) #end ########################## ## Validate Target Page ## ########################## #if(! $request.targetPage) {{error}}$msg.get("xe.officeimporter.results.missingpage", [$goBack]){{/error}} #else #set($targetPage=$request.targetPage.replaceAll("[.:/]", "-")) #end ########################## ## Append Configuration ## ########################## #set($appendContent=false) #if($request.appendContent) #set($appendContent=true) #end ############################# ## Filtering Configuration ## ############################# #set($filterStyles=false) #if($request.filterStyles) #set($filterStyles=true) #end ############################# ## Splitting Configuration ## ############################# #set($splitDocument=false) #if($request.splitDocument) #set($splitDocument=true) #set($headingLevels=$request.getParameterValues("headingLevelsToSplit")) #end ############ ## Import ## ############ #if($fileName && $targetSpace && $targetPage) #set($targetDocumentName="${targetSpace}.${targetPage}") #set($targetDocument=$xwiki.getDocument($targetDocumentName)) #set($resultDocumentLink="[[**$msg.get('xe.officeimporter.results.result')**>>$targetDocument.getExternalURL('view')]]") #set($xdomOfficeDoc=$officeimporter.officeToXDOM($officeFileStream, $fileName, $targetDocumentName, $filterStyles)) #if($xdomOfficeDoc) #if(! $splitDocument) #set($result=$officeimporter.save($xdomOfficeDoc, $targetDocumentName, "xwiki/2.0", null, null, $appendContent)) #if($result) {{info}}$msg.get("xe.officeimporter.results.success", [$resultDocumentLink, $goBack]){{/info}} #else {{error}}$officeimporter.errorMessage{{/error}} #end #else #set($docsMap=$officeimporter.split($xdomOfficeDoc, $headingLevels, $request.childPagesNamingMethod, $targetDocumentName)) #if($docsMap) #foreach($targetDescriptor in $docsMap.keySet()) #set($splitXdomOfficeDoc=$docsMap.get($targetDescriptor)) #set($target=$targetDescriptor.documentReferenceAsString) #set($parent=$targetDescriptor.parentReferenceAsString) #set($result=$officeimporter.save($splitXdomOfficeDoc, $target, "xwiki/2.0", $parent, null, $appendContent)) #if(! $result) {{warning}}$officeimporter.errorMessage{{/warning}} #end #end {{info}}$msg.get("xe.officeimporter.results.success", [$resultDocumentLink, $goBack]){{/info}} #else {{error}}$officeimporter.errorMessage{{/error}} #end #end #else {{error}}$officeimporter.errorMessage{{/error}} #end #end #end {{/velocity}}
Quick Links
L3D Calendar
Wiki Dashboard
Document Index
Blog
Sandbox