Allgemeine Aktionen:
Anmelden
Registrieren
Start ▼: Wiki Verzeichnis
»
Bereich: Panels
»
Seite: DocumentInformation
default
Aktionen:
Exportieren ▼: Als PDF exportieren Als RTF exportieren Als HTML exportieren
Weitere Aktionen ▼: Druckvorschau Zeige den Quellcode
Willkommen bei bytebang » Menüleisten » Document Information

# Wiki-Quellcode von Document Information

Zuletzt geändert von Administrator am 2014/06/29 19:28
Kommentare (0) · Anhänge (0)
Zeilennummern anzeigen {{velocity output="false"}} #macro(convertDocument $targetDoc $error $oldSyntaxId $newSyntaxId) #if ($targetDoc.realLanguage == $xwiki.languagePreference) #if ($request.content) ## Use the content received from the client if the target document is the edited one (could be also a translation of the edited document). #set ($void = $targetDoc.setContent($request.content)) #end #end ## Use the syntax received from the client as the user might have made some changes that are not saved yet. #set ($void = $targetDoc.setSyntaxId($oldSyntaxId)) #if (!$services.csrf.isTokenValid($request.form_token) || !$targetDoc.convertSyntax($newSyntaxId)) #set ($error = true) #else #set ($void = $targetDoc.save("Document converted from syntax $oldSyntaxId to syntax $newSyntaxId")) #end #end {{/velocity}} {{velocity wiki="false"}} #if ("$!request.action" == 'convertSyntax') #set ($oldSyntaxId = $request.oldSyntaxId) #set ($newSyntaxId = $request.newSyntaxId) #set ($targetDoc = $xwiki.getDocument($request.documentName)) #set ($error = false) ## ## Convert the specified document ## #convertDocument($targetDoc $error $oldSyntaxId $newSyntaxId) ## ## Convert all the translations of the specified document ## #set($languages = $targetDoc.translationList) #if (!$error) #foreach ($language in $languages) #if (!$error) #set ($translatedDoc = $targetDoc.getTranslatedDocument($language)) #if ($translatedDoc.language != $targetDoc.language) #convertDocument($translatedDoc $error $oldSyntaxId $newSyntaxId) #end #end #end #end ## ## Error management ## #if (!$error) ## Conversion successful. The "ok:" prefix is needed, since otherwise an empty content will result in a "This template does not exist" exception. ok:${targetDoc.content}## #else $response.setStatus(501) ## TODO: Find a way to put the exception in the context and send it to the client. failed #end #end {{/velocity}}

# Blog Kategorien

- http://ci.bytebang.at/bin/Blog/CategoryRss?xpage=plain&amp;category=Blog.Database" title="RSS"> http://ci.bytebang.at/bin/Blog/Database">Database (6)
- http://ci.bytebang.at/bin/Blog/CategoryRss?xpage=plain&amp;category=Blog.Electronics" title="RSS"> http://ci.bytebang.at/bin/Blog/Electronics">Electronics (17)
- http://ci.bytebang.at/bin/Blog/CategoryRss?xpage=plain&amp;category=Blog.Ham+Radio" title="RSS"> http://ci.bytebang.at/bin/Blog/Ham+Radio">Ham Radio (15)
- http://ci.bytebang.at/bin/Blog/CategoryRss?xpage=plain&amp;category=Blog.Programming" title="RSS"> http://ci.bytebang.at/bin/Blog/Programming">Programming (50)
- http://ci.bytebang.at/bin/Blog/CategoryRss?xpage=plain&amp;category=Blog.System+Administration" title="RSS"> http://ci.bytebang.at/bin/Blog/System+Administration">System Administration (39)
- http://ci.bytebang.at/bin/Blog/CategoryRss?xpage=plain&amp;category=Blog.Virtualisation" title="RSS"> http://ci.bytebang.at/bin/Blog/Virtualisation">Virtualisation (6)

# Get Social

Tweet

# Show some love

Do you like ths blog ?
... Buy me a beer!

1Ja5cxfZcRd5ufXNE 9g6vAAJTnQ4ToGaoD

(c) 2026, by bytebang e.U. - Impressum - Datenschutz / Nutzungsbedingungen
-