Wiki source code of Configuration
Last modified by Eleni Cojocariu on 2026/10/14 10:58
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{box cssClass="floatinginfobox" title="**Contents**"}} | ||
| 2 | {{toc/}} | ||
| 3 | {{/box}} | ||
| 4 | |||
| 5 | {{warning}} | ||
| 6 | WIP: this page is being refactored on the [[Configuration>>xwiki:documentation.xs.admin.configuration.WebHome]] topic in the new documentation location. | ||
| 7 | {{/warning}} | ||
| 8 | |||
| 9 | Once you have XWiki [[installed>>xwiki:documentation.xs.admin.installation.WebHome]] you'll want to configure it. This introduction has moved to [[Configuration>>xwiki:documentation.xs.admin.configuration.WebHome]] in the new documentation. | ||
| 10 | |||
| 11 | = Enable superadmin account = | ||
| 12 | |||
| 13 | Moved to [[Enable the Superadmin Account>>xwiki:documentation.xs.admin.configuration.superadmin-account.WebHome]]. | ||
| 14 | |||
| 15 | = Language settings = | ||
| 16 | |||
| 17 | Moved to [[Language Configuration>>xwiki:documentation.xs.admin.language.WebHome]], whose ##xwiki.cfg## options are listed on [[Language Parameters>>xwiki:documentation.xs.admin.language.parameters.WebHome]]. | ||
| 18 | |||
| 19 | == Algorithm == | ||
| 20 | |||
| 21 | Moved to [[Language Resolution>>xwiki:documentation.xs.admin.language.resolution.WebHome]]. | ||
| 22 | |||
| 23 | = Date format = | ||
| 24 | |||
| 25 | Moved to [[Set the Date Format>>xwiki:documentation.xs.admin.base.content-organization.administer-wiki.set-date-format.WebHome]]. | ||
| 26 | |||
| 27 | = Enabling/Disabling Statistics = | ||
| 28 | |||
| 29 | Moved to [[Statistics Configuration>>xwiki:documentation.xs.admin.statistics.WebHome]], whose ##xwiki.cfg## options are listed on [[Statistics Parameters>>xwiki:documentation.xs.admin.statistics.parameters.WebHome]]. Turning statistics on for a single subwiki is [[Enable Statistics for a Subwiki>>xwiki:documentation.xs.admin.statistics.enable-statistics-subwiki.WebHome]]. | ||
| 30 | |||
| 31 | = Optional Store Features = | ||
| 32 | |||
| 33 | Moved to [[Optional Store Features>>xwiki:documentation.xs.admin.store.optional-features.WebHome]]. | ||
| 34 | |||
| 35 | == Document versioning == | ||
| 36 | |||
| 37 | Moved to [[Optional Store Features>>xwiki:documentation.xs.admin.store.optional-features.WebHome]]. | ||
| 38 | |||
| 39 | == Document recycle bin == | ||
| 40 | |||
| 41 | Moved to [[Optional Store Features>>xwiki:documentation.xs.admin.store.optional-features.WebHome]]. | ||
| 42 | |||
| 43 | == Attachment recycle bin == | ||
| 44 | |||
| 45 | Moved to [[Optional Store Features>>xwiki:documentation.xs.admin.store.optional-features.WebHome]]. | ||
| 46 | |||
| 47 | = Customizing error pages = | ||
| 48 | |||
| 49 | Moved to [[Error Pages>>xwiki:documentation.xs.admin.configuration.error-pages.WebHome]], and the procedure to [[Customize an Error Page>>xwiki:documentation.xs.admin.configuration.error-pages.customize.WebHome]]. | ||
| 50 | |||
| 51 | = Customizing the Skin = | ||
| 52 | |||
| 53 | See [[Skins>>documentation.xs.admin.skins.WebHome]]. | ||
| 54 | |||
| 55 | = Security configuration = | ||
| 56 | |||
| 57 | See the [[Security Guide>>Documentation.AdminGuide.Security]]. | ||
| 58 | |||
| 59 | = HTTPS/SSL = | ||
| 60 | |||
| 61 | By default, the protocol to use to generate external URLs (HTTPS, HTTP) is extracted from requests to XWiki, so most of the time you don't have anything to do if you properly configure your proxy, but it's possible to force a specific protocol using ##xwiki.url.protocol## property in ##xwiki.cfg##. | ||
| 62 | |||
| 63 | To set up HTTPS/SSL, you may need to configure your Servlet Container and any front-end web server or proxy in front of XWiki. For example: | ||
| 64 | |||
| 65 | * [[Tomcat>>documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-tomcat.WebHome]] | ||
| 66 | * [[Jetty>>documentation.xs.admin.installation.methods.install-xwiki-war.configure-servlet-container.configure-jetty.WebHome]] | ||
| 67 | |||
| 68 | = Customizing Menus = | ||
| 69 | |||
| 70 | The first thing to understand is that menus depend on the skin you're using. If you're using the 1.0 skin you're likely using the [[Panels Application>>extensions:Extension.Panels Application]] to provide the different menu panels you see on the left or right of your wikis. Check the [[Panels Application>>extensions:Extension.Panels Application]] to know more on how to configure/modify them. | ||
| 71 | |||
| 72 | = Encoding = | ||
| 73 | |||
| 74 | Moved to [[Character Encoding>>xwiki:documentation.xs.admin.configuration.character-encoding.WebHome]]. | ||
| 75 | |||
| 76 | = User Authentication = | ||
| 77 | |||
| 78 | See the [[User Authentication documentation>>documentation.xs.admin.authentication.WebHome]]. | ||
| 79 | |||
| 80 | == Customizing the Verified Registration Page == | ||
| 81 | |||
| 82 | The Verified Registration Page is part of the [[Administration Application>>extensions:Extension.Administration Application]]. It allows you to require users to fill in a captcha and validates user input on both the server side and the client side using Javascript. The configuration allows you to add fields and validation constraints to the fields. | ||
| 83 | |||
| 84 | To enable captcha, see the [[Captcha configuration>>Documentation.AdminGuide.Access Rights.Captcha configuration.WebHome]]. | ||
| 85 | |||
| 86 | For more information about configuring the registration page, you can visit the page on the [[Administration Application>>extensions:Extension.Administration Application]]. | ||
| 87 | |||
| 88 | = Default User Preferences = | ||
| 89 | |||
| 90 | See the [[User Module documentation>>extensions:Extension.User Module.API.WebHome#HConfiguration]]. | ||
| 91 | |||
| 92 | = Initial Groups = | ||
| 93 | |||
| 94 | Moved to [[Set the Initial Groups of New Users>>xwiki:documentation.xs.admin.user.set-initial-groups-new-users.WebHome]]. | ||
| 95 | |||
| 96 | = Logging = | ||
| 97 | |||
| 98 | See the [[Logging page>>Documentation.AdminGuide.Logging]]. | ||
| 99 | |||
| 100 | = Configuring Interwiki links = | ||
| 101 | |||
| 102 | Moved to [[Configure Interwiki Links>>xwiki:documentation.xs.admin.configuration.configure-interwiki-links.WebHome]]. | ||
| 103 | |||
| 104 | {{id name="HInterwikilinks28XWikiSyntax1.029"/}} | ||
| 105 | |||
| 106 | {{id name="HInterwikilinks28XWikiSyntax2.x29"/}} | ||
| 107 | |||
| 108 | = Link URLs = | ||
| 109 | |||
| 110 | Moved to [[HTTP Reverse Proxy for XWiki>>xwiki:documentation.xs.admin.installation.http-reverse-proxy.WebHome]], which covers the headers XWiki reads to build its links and the ##xwiki.home## property that holds the public address. | ||
| 111 | |||
| 112 | == Reverse proxy setup == | ||
| 113 | |||
| 114 | Moved to [[HTTP Reverse Proxy for XWiki>>xwiki:documentation.xs.admin.installation.http-reverse-proxy.WebHome]]. Forcing the protocol with ##xwiki.url.protocol## is covered on [[HTTPS for XWiki in Docker>>xwiki:documentation.xs.admin.installation.methods.install-xwiki-docker.configuration.https.WebHome]]. | ||
| 115 | |||
| 116 | == Short URLs == | ||
| 117 | |||
| 118 | It's possible to [[configure XWiki to use shorter URLs>>Documentation.AdminGuide.ShortURLs]]. | ||
| 119 | |||
| 120 | = Configure the names of database schemas = | ||
| 121 | |||
| 122 | Sometimes, especially in a complex environment, we need to control the names of database schemas other than the default. | ||
| 123 | |||
| 124 | * **##xwiki.db##**: name of database schema for the main wiki (including the name of the wiki in a single-wiki environment, otherwise the database name comes from the Hibernate configuration file). | ||
| 125 | * **##xwiki.db.prefix##**: useful mainly for [[sub wikis>>Documentation.AdminGuide.Virtualization.WebHome]], where we have a separate database schema for each sub wiki. This prefix is added to the database schema name after usual mapping between wiki names and schemas. Note that this is also applied to the main wiki database name. | ||
| 126 | |||
| 127 | = Controlling Page Tabs = | ||
| 128 | |||
| 129 | You can do this from the [[Administration>>extensions:Extension.Administration Application#HPresentation]]. | ||
| 130 | |||
| 131 | If you wish to turn on/off comments/annotations/attachments/history/information tabs only for a single page you just need to [[define some properties in a script in the page>>Documentation.DevGuide.Scripting#HControllingPageTabs]]. | ||
| 132 | |||
| 133 | Last, suppose you wish to turn them off based on some programmatic rule (such as display them only for Administrators). In that case, you should define the properties in the ##layoutExtraVars.vm## template file from your XWiki installation. For example: | ||
| 134 | |||
| 135 | {{code language="none"}} | ||
| 136 | #if (!$hasAdmin) | ||
| 137 | ## Hide tabs | ||
| 138 | #set($displayDocExtra = false) | ||
| 139 | ## Hide viewer shortcuts in the menu | ||
| 140 | #set ($displayShortcuts = false) | ||
| 141 | #end | ||
| 142 | {{/code}} | ||
| 143 | |||
| 144 | = Configure "Version Summary" behavior = | ||
| 145 | |||
| 146 | When editing a page, you can add a brief description of your changes in the "Version Summary" field by default (look at [[Common edit actions>>xwiki:documentation.xs.user.base.page.edit.common-edit-actions.WebHome]]). You can disable this feature by setting ##xwiki.editcomment=0## in ##xwiki.cfg##. | ||
| 147 | |||
| 148 | When the "Version Summary" feature is enabled, you can also make "Version Summary" mandatory by setting ##xwiki.editcomment.mandatory=1## in ##xwiki.cfg##. This will show a pop-up window with the request to write a short comment if no comment is entered. It doesn't allow you to enter an empty comment. If you want a popup, but you also want to be able to enter an empty comment, set ##xwiki.editcomment.suggested=1## in ##xwiki.cfg##. | ||
| 149 | |||
| 150 | If you set "Version Summary" as mandatory or suggested, you can remove the "Version Summary" field and use only a pop-up window to write a comment. Set ##xwiki.editcomment.hidden=0## in ##xwiki.cfg## to do this. | ||
| 151 | |||
| 152 | You can use the special fields in the ##XWikiPreferences## object instead of editing ##xwiki.cfg##. These fields are: ##editcomment##, ##editcomment_mandatory##. | ||
| 153 | |||
| 154 | = Configuring Directories = | ||
| 155 | |||
| 156 | See [[XWiki Directories>>documentation.xs.admin.configuration.directories.WebHome]]. | ||
| 157 | |||
| 158 | == Permanent Directory == | ||
| 159 | |||
| 160 | See [[Permanent Directory>>documentation.xs.admin.configuration.directories.permanent-directory.WebHome]], [[Configure the Permanent Directory>>documentation.xs.admin.configuration.directories.permanent-directory.configure.WebHome]], [[Find the Current Permanent Directory>>documentation.xs.admin.configuration.directories.permanent-directory.find.WebHome]] and [[Sub-Directories in the Permanent Directory>>documentation.xs.admin.configuration.directories.permanent-directory.sub-directories.WebHome]]. | ||
| 161 | |||
| 162 | == Temporary Directory == | ||
| 163 | |||
| 164 | See [[Temporary Directory>>documentation.xs.admin.configuration.directories.temporary-directory.WebHome]]. | ||
| 165 | |||
| 166 | {{version since="17.10.0RC1"}} | ||
| 167 | = Configuring the Blob Store = | ||
| 168 | |||
| 169 | See the documentation about the [[configuration of the blob store>>documentation.xs.admin.store.blob.WebHome]] and [[how to configure the S3 blob store>>documentation.extensions.admin.s3-blob-store.configure-s3.WebHome]]. | ||
| 170 | {{/version}} | ||
| 171 | |||
| 172 | = Redirections = | ||
| 173 | |||
| 174 | XWiki supports defining redirections for incoming requests. To activate this feature, modify your ##xwiki.cfg## file and set the following property: {{code}}xwiki.preferences.redirect=1{{/code}}. | ||
| 175 | Then, for each redirection you want to add, add a ##XWiki.GlobalRedirect## object to your main wiki's ##XWiki.XWikiPreferences## document. The ##XWiki.GlobalRedirect## object has 2 fields: ##pattern## and ##destination##. The URL received is matched on ##pattern##, and if there's a match, it's replaced with the value from the ##destination##. XWiki then redirects to the new URL. | ||
| 176 | |||
| 177 | == Trusted domains == | ||
| 178 | |||
| 179 | By default, redirections are only allowed to the trusted domains of the wiki. Those trusted domains are coming from two sources: | ||
| 180 | - all domains used to access the wiki are trusted by definition, as well as the aliases used for subwikis, | ||
| 181 | - in ##xwiki.properties##, it's possible to specify the property ##url.trustedDomains## to specify other domains that should be trusted. | ||
| 182 | |||
| 183 | In case a redirection is attempted on a domain not trusted, a warning is displayed in logs, and the redirection is prevented. | ||
| 184 | Note that this whole mechanism can be switched off by setting ##url.trustedDomainsEnabled## to ##false## in ##xwiki.properties##. | ||
| 185 | |||
| 186 | {{version since="17.9.0RC1,16.10.13,17.4.6"}} | ||
| 187 | A new mechanisms ensure that users get asked before being driven to an untrusted domain when clicking on a link in the wiki. That mechanism reuses the configured list of trusted domain, but also a new configuration to allow specific URLs without allowing an entire domain: ##url.allowedFrontendUrls##. | ||
| 188 | |||
| 189 | It's possible to also disable this mechanism by using ##url.frontendUrlCheckEnabled=false## in ##xwiki.properties##. | ||
| 190 | {{/version}} | ||
| 191 | |||
| 192 | = Customizing the PDF export Look & Feel = | ||
| 193 | |||
| 194 | {{info}} | ||
| 195 | The default PDF export now uses the [[client-side PDF Export Application>>extensions:Extension.PDF Export Application.WebHome]]. The documentation below is for the older server-side PDF export (implemented with Apache FOP) | ||
| 196 | {{/info}} | ||
| 197 | |||
| 198 | == General Architecture == | ||
| 199 | |||
| 200 | Here's how the PDF and RTF exports currently work: | ||
| 201 | {{image reference="XWikiExport201010290119.png"/}} | ||
| 202 | |||
| 203 | As shown in the diagram, you can customize 4 parts: | ||
| 204 | |||
| 205 | * The templates, ##pdf.vm## and the referenced subparts, ##pdfhtmlheader.vm##, ##pdfheader.vm##, ##pdffooter.vm##, ##pdftoc.vm##, ##pdfcover.vm##, which can be overridden by a copy located in a custom skin | ||
| 206 | * The CSS is used to render the content as PDF/RTF. There is no ##pdf.css## by default. It could be created in ##/templates## or a skin; a copy in a skin, and override the one located in ##/templates## | ||
| 207 | * The XHTML2FO XSL transformation. The default one, ##{{scm project="xwiki-platform" path="xwiki-platform-core/xwiki-platform-oldcore/src/main/resources/xhtml2fo.xsl"}}xhtml2fo.xsl{{/scm}}##, is packed in a core jar, but could be overridden by a new one in a template or an ##xhtml2fo.xsl## file in ##WEB-INF/classes## directory, if customization needed. | ||
| 208 | * The FOP XSL transformation. The default ##fop.xsl## is also packed in a core jar. | ||
| 209 | |||
| 210 | After the export request triggers XWiki ExportAction, the content of your document is parsed by Velocity to get the initial XHTML content. **[[JTidy>>http://jtidy.sourceforge.net/]]**, a HTML/XHTML syntax checker and pretty printer, will clean the initial XHTML to make it XHTML compliant. No customization is possible in this step. | ||
| 211 | |||
| 212 | In order to provide your customization you need to start by tweaking the default templates (they can also be copied to a new skin) and/or by creating a new [[XWiki Class>>xwiki:documentation.xs.user.base.page.edit.edit-class-editor.WebHome]]. To do that, simply create a new page called //XWiki.PDFClass// and edit it in class mode (for ex. //{{{http://yourserver.com/xwiki/bin/edit/XWiki/PDFClass?editor=class}}}//). Add the following "Text Area" properties as needed (they are all optional, so you only need to define the ones you need to use): | ||
| 213 | |||
| 214 | * ##style##: contains the CSS information that will overwrite or complement the default ##pdf.css## values if they exist. **[[css4j>>https://css4j.github.io/]]**, a CSS API implementation for the Javaâ„¢ platform, will handle this. | ||
| 215 | * ##xhtmlxsl##: contains the XHTML to FO XSL overriding the default one. It is processed by **[[Apache Xalan>>http://xml.apache.org/xalan-j/]]**, a XSLT processor for transforming XML documents into HTML, text, or other XML document types. This field needs to be the actual content of the customized ##xhtml2fo.xsl##. Note that you can also use velocity in this field (useful to get the content of an attached .xsl file, which comes in very handy when you need to fill in a big file, since the limit of textarea properties is 60 000 characters) | ||
| 216 | * ##fopxsl##: contains the FOP to PDF/RTF XSL overriding the default one. It is processed by **[[Apache FOP>>http://xmlgraphics.apache.org/fop/]]**. | ||
| 217 | |||
| 218 | {{warning}} | ||
| 219 | The name of the class must be ##XWiki.PDFClass##. | ||
| 220 | {{/warning}} | ||
| 221 | |||
| 222 | The good thing about fop/xsl-fo is that the xsl-fo document is independent of the final result. So we can export the wiki documents into many formats. | ||
| 223 | |||
| 224 | Then create a new page (say ##XWiki.PDFTemplate##) and add the ##XWiki.PDFClass## object to it. | ||
| 225 | |||
| 226 | Last use that page when calling the PDF/RTF export using the ##pdftemplate## parameter as in //{{{http://yourserver/xwiki/bin/export/Space/Page?format=pdf&language=en&pdftemplate=XWiki.PDFTemplate}}}//. | ||
| 227 | |||
| 228 | {{warning}} | ||
| 229 | No template is used by default. | ||
| 230 | {{/warning}} | ||
| 231 | |||
| 232 | {{info}} | ||
| 233 | As mentioned, the ##style## property stores CSS code. The field is parsed by the Velocity engine, so you can use the [[current color theme>>extensions:Extension.Color Theme Application#HUsingColorThemesvariables]] to style your PDF. Also, you can insert a page break in a PDF file with the ##page-break-before## CSS instruction. For example: | ||
| 234 | |||
| 235 | {{code language="css"}} | ||
| 236 | #template('colorThemeInit.vm') | ||
| 237 | h2 { | ||
| 238 | color: $theme.titleColor; | ||
| 239 | } | ||
| 240 | |||
| 241 | td { | ||
| 242 | border-color: $theme.borderColor; | ||
| 243 | } | ||
| 244 | |||
| 245 | h1, .my_Page_break { | ||
| 246 | page-break-before:always; | ||
| 247 | } | ||
| 248 | |||
| 249 | {{/code}} | ||
| 250 | {{/info}} | ||
| 251 | |||
| 252 | == Override the PDF Templates == | ||
| 253 | |||
| 254 | === Customize the PDF Footer === | ||
| 255 | |||
| 256 | By default, the PDF footer will display the page number, the last author and the date the last modification was performed. In order to also display a customized message, the template ##pdffooter.vm## must be overridden. To do that, edit the skin class (e.g. //{{{http://yourserver/xwiki/bin/edit/XWiki/XWikiSkins?editor=class}}}//) and add a "TextArea" object named ##pdffooter.vm##: | ||
| 257 | |||
| 258 | {{image reference="OverridePDFFooter.png"/}} | ||
| 259 | |||
| 260 | After adding the ##pdffooter.vm##, you might want to edit it (clicking on it opens a detailed editor) and e.g. give it a "Pretty name". In this editor, also set the "Editor" property to "pure text" as otherwise the WYSIWYG-Editor will be used: | ||
| 261 | |||
| 262 | {{image reference="OverridePDFFooterEdit1.png"/}} | ||
| 263 | |||
| 264 | Next, edit the skin page (e.g. //{{{http://yourserver/xwiki/bin/edit/XWiki/DefaultSkin?editor=object}}}//) and add the following code to the ##pdffooter.vm## property: | ||
| 265 | |||
| 266 | {{code}} | ||
| 267 | $msg.Page <span class="page-number"></span> - $msg.get('lastmodifiedby') | ||
| 268 | $xwiki.getUserName($tdoc.author, false) | ||
| 269 | $msg.get('lastmodifiedon') | ||
| 270 | $!xwiki.formatDate($tdoc.date) | ||
| 271 | <div> | ||
| 272 | <p>CustomName SAS. All rights reserved. Confidential and proprietary document. Printed Copies are not controlled.</p> | ||
| 273 | </div> | ||
| 274 | {{/code}} | ||
| 275 | |||
| 276 | To see the changes, just export any wiki page: | ||
| 277 | |||
| 278 | {{image reference="OverridePDFFooterFinal.png"/}} | ||
| 279 | |||
| 280 | === Customize the PDF Cover === | ||
| 281 | |||
| 282 | For instance, this could be useful when you want to add the company's logo to the PDF cover. In order to do this, the template ##pdfcover.vm## must be overridden. Just like for the PDF header, a "TextArea" property named ##pdfcover.vm## must be added to the ##XWiki.XWikiSkins## class (e.g. //{{{http://yourserver/xwiki/bin/view/XWiki/XWikiSkins?editor=class}}}//). | ||
| 283 | |||
| 284 | {{image reference="OverridePDFCover.png"/}} | ||
| 285 | |||
| 286 | Next, edit the skin page (e.g. //{{{http://yourserver/xwiki/bin/edit/XWiki/DefaultSkin?editor=object}}}//) and add the following code to the ##pdfcover.vm## property: | ||
| 287 | |||
| 288 | {{code}} | ||
| 289 | <img src="$xwiki.getSkinFile("logo.png")"/> | ||
| 290 | |||
| 291 | <div style="text-align: center; width: 100%;"> | ||
| 292 | <h1> | ||
| 293 | #set($title = "$!pdfdoc.display('title', 'rendered')") | ||
| 294 | #if($title == '') | ||
| 295 | $escapetool.xml($!doc.displayTitle) | ||
| 296 | #else | ||
| 297 | $escapetool.xml($title) | ||
| 298 | #end | ||
| 299 | </h1> | ||
| 300 | <br /> | ||
| 301 | <br /> | ||
| 302 | $!xwiki.getUserName($tdoc.author, false) | ||
| 303 | <br /> | ||
| 304 | $!xwiki.formatDate($tdoc.date) | ||
| 305 | </div> | ||
| 306 | {{/code}} | ||
| 307 | |||
| 308 | The last step consists of attaching the image "logo.png" to the skin: | ||
| 309 | |||
| 310 | {{image reference="OverridePDFCoverFinal.png"/}} | ||
| 311 | |||
| 312 | === Override the CSS rules === | ||
| 313 | |||
| 314 | In order to use your template when exporting a page as PDF, you need to create a class in the XWiki space and name it PDFClass. Next, edit the page in "Class" mode (e.g. //{{{http://yourserver/xwiki/bin/edit/XWiki/PDFClass?editor=class}}}//) and add the following ##TextArea## properties: | ||
| 315 | |||
| 316 | * ##style##: contains the CSS rules that will override the default ##pdf.css## values; by default, there won't be a ##pdf.css## file on your filesystem, but you can create it in the folder ##\webapps\xwiki\templates\## or specify it in your skin page | ||
| 317 | * ##xhtmlxsl##: contains the XHTML2FO XSL transformation that will override the default one | ||
| 318 | * ##fopxsl##: contains the FOP XSL transformation that will override the default one | ||
| 319 | |||
| 320 | For each property added, make sure to set the ##Content## property metadata to ##PureText## in order not to get the WYSIWYG editor, which would make it complex to enter XML/XSL. | ||
| 321 | |||
| 322 | {{image reference="CreatePDFClass.png"/}} | ||
| 323 | |||
| 324 | Then, create the wiki page for which you want to customize the PDF export (e.g. ##XWiki.PDFTemplate##) and add a ##XWiki.PDFClass## object. | ||
| 325 | |||
| 326 | Supposing your wiki page ##Sandbox.TestPage1## contains a table, you have to edit it in "Wiki" mode and add a style parameter as shown below: | ||
| 327 | |||
| 328 | {{code}} | ||
| 329 | (% class="mytable" %) | ||
| 330 | |=Column 1|=Column 2 | ||
| 331 | | data|data | ||
| 332 | {{/code}} | ||
| 333 | |||
| 334 | Next, edit the template page (e.g. ##XWiki.PDFTemplate##) in "Objects" mode and write your own CSS rules in the ##style## property: | ||
| 335 | |||
| 336 | {{image reference="CreatePDFTemplate.png"/}} | ||
| 337 | |||
| 338 | Because no template is used by default, you need to specify the ##pdftemplate## parameter in the URL to use your template: //{{{http://yourserver/xwiki/bin/export/Sandbox/TestPage1/?format=pdf&pdftemplate=XWiki.PDFTemplate}}}//. | ||
| 339 | |||
| 340 | {{image reference="SandboxTestPage1PDF.png" width="700"/}} | ||
| 341 | |||
| 342 | **Tip**: download the [[PDF class>>attach:XWiki.PDFClass.xar]] and [[PDF template >>attach:XWiki.PDFTemplate.xar]]for this example and test them on your wiki. | ||
| 343 | |||
| 344 | {{info}} | ||
| 345 | Even though RTF export is expected to work the same way, there are still some issues to be solved affecting how CSS properties control the final layout. | ||
| 346 | {{/info}} | ||
| 347 | |||
| 348 | {{warning}} | ||
| 349 | If some CSS styling doesn't work on PDF export, you could check if CSS instruction is supported by XSL-FO on [[Apacheâ„¢ FOP Compliance Page>>https://xmlgraphics.apache.org/fop/compliance.html]]. | ||
| 350 | Furthermore, you can not use multiple attributes to select a CSS element (see issue: [[XWIKI-14653>>https://jira.xwiki.org/browse/XWIKI-14653]]). | ||
| 351 | {{/warning}} | ||
| 352 | |||
| 353 | === Override the xhtml2fo.xsl rules === | ||
| 354 | |||
| 355 | As explained above, the entire code of {{scm project="xwiki-platform" path="xwiki-platform-core/xwiki-platform-oldcore/src/main/resources/xhtml2fo.xsl"}}xhtml2fo.xsl{{/scm}} needs to be copied into the xhtmlxsl textarea and then customized. | ||
| 356 | |||
| 357 | For example, to disable the generation of clickable URLs in the PDF, modify the following section: | ||
| 358 | |||
| 359 | {{code}} | ||
| 360 | <xsl:template match="html:a[@href]" mode="transform"> | ||
| 361 | <fo:basic-link xsl:use-attribute-sets="a-link"> | ||
| 362 | <xsl:call-template name="process-a-link"></xsl:call-template> | ||
| 363 | </fo:basic-link> | ||
| 364 | </xsl:template> | ||
| 365 | {{/code}} | ||
| 366 | |||
| 367 | as | ||
| 368 | |||
| 369 | {{code}} | ||
| 370 | <xsl:template match="html:a[@href]" mode="transform"> | ||
| 371 | <fo:inline> | ||
| 372 | <xsl:call-template name="process-a-link"></xsl:call-template> | ||
| 373 | </fo:inline> | ||
| 374 | </xsl:template> | ||
| 375 | {{/code}} | ||
| 376 | |||
| 377 | or disable the generation of clickable URLs for some specific href links in the PDF | ||
| 378 | |||
| 379 | {{code}} | ||
| 380 | <xsl:template match="html:a[@href]" mode="transform"> | ||
| 381 | <xsl:choose> | ||
| 382 | <!-- disable these internal links ("data-parent" attribute start with "#accordion" or href is "#my_anchor") --> | ||
| 383 | <xsl:when test="starts-with(@data-parent,'#accordion') or @href = '#my_anchor'"> | ||
| 384 | <fo:inline> | ||
| 385 | <xsl:call-template name="process-a-link"></xsl:call-template> | ||
| 386 | </fo:inline> | ||
| 387 | </xsl:when> | ||
| 388 | <xsl:otherwise> | ||
| 389 | <fo:basic-link xsl:use-attribute-sets="a-link"> | ||
| 390 | <xsl:call-template name="process-a-link"></xsl:call-template> | ||
| 391 | </fo:basic-link> | ||
| 392 | </xsl:otherwise> | ||
| 393 | </xsl:choose> | ||
| 394 | </xsl:template> | ||
| 395 | {{/code}} | ||
| 396 | |||
| 397 | === Debugging PDF export === | ||
| 398 | |||
| 399 | To inspect the contents of the created XHTML file (and be able to style it) - turn on logging //{{{http://yourserver/xwiki/bin/view/AdminGuide/Logging}}}// and set ##com.xpn.xwiki## level to ##DEBUG##. After PDF export action, xwiki log file contains intermediates states XHTML code after these lines: | ||
| 400 | |||
| 401 | {{code language="none"}} | ||
| 402 | DEBUG c.x.x.p.i.PdfExportImpl - Cleaning HTML: //(show XHTML code without style)// | ||
| 403 | DEBUG c.x.x.p.i.PdfExportImpl - Cleaned XHTML: | ||
| 404 | DEBUG c.x.x.p.i.PdfExportImpl - Applying the following CSS: //(show CSS properties)// | ||
| 405 | DEBUG c.x.x.p.i.PdfExportImpl - HTML with CSS applied: //(show HTML code with CSS properties merged in tag with "style=" )// | ||
| 406 | DEBUG c.x.x.p.i.PdfExportImpl - Final XHTML for export: | ||
| 407 | DEBUG c.x.x.p.i.PdfExportImpl - Intermediary XSL-FO: //(show document with eXtensible Stylesheet Language - Formatting Objects used to generate PDF files)// | ||
| 408 | DEBUG c.x.x.p.i.PdfExportImpl - Final XSL-FO source: | ||
| 409 | and finally DEBUG c.x.x.p.i.PdfExportImpl - PageSequence x-page-sequence generated 3 pages. | ||
| 410 | {{/code}} | ||
| 411 | |||
| 412 | = Configuring Wiki Syntaxes and default Syntax = | ||
| 413 | |||
| 414 | To configure the [[Wiki syntaxes>>Documentation.UserGuide.Features.XWikiSyntax]] available to the user when writing wiki pages, check the [[Rendering Administration Application>>extensions:Extension.Rendering Administration Application]]. | ||
| 415 | |||
| 416 | = Title behavior = | ||
| 417 | |||
| 418 | The following configuration parameters (found in ##xwiki.cfg##) can be used to control title behavior: | ||
| 419 | |||
| 420 | {{code language="none"}} | ||
| 421 | #-# Defines whether title handling should be using the compatibility mode or not. When the compatibility | ||
| 422 | #-# mode is active, XWiki will try to extract a title from the document content. | ||
| 423 | #-# If the document's content first header (level 1 or level 2) matches the document's title | ||
| 424 | #-# the first header is stripped. | ||
| 425 | #-# The default value is 0. | ||
| 426 | # xwiki.title.compatibility=1 | ||
| 427 | |||
| 428 | #-# Defines the maximum header depth to look for when computing a document's title from its content. If no header | ||
| 429 | #-# equal or lower to the specified depth is found then the computed title falls back to the document name. | ||
| 430 | #-# The default value is 2. | ||
| 431 | # xwiki.title.headerdepth=2 | ||
| 432 | |||
| 433 | #-# Defines if setting the title field must be mandatory in the WYSIWYG and Wiki editors. It is mandatory when this | ||
| 434 | #-# property is set to 1. The default value is 0 (not mandatory). | ||
| 435 | # xwiki.title.mandatory=0 | ||
| 436 | {{/code}} | ||
| 437 | |||
| 438 | = Link Label Generation = | ||
| 439 | |||
| 440 | Starting with XWiki Syntax 2.0 it's possible to configure how labels are generated by the system when the user doesn't provide one (e.g. ##~[~[mywiki:Main.WebHome]]##). | ||
| 441 | |||
| 442 | Here's an extract from the ##xwiki.properties## file, which is where this feature is configurable: | ||
| 443 | |||
| 444 | {{code language="none"}} | ||
| 445 | #-# Specifies how links labels are displayed when the user doesn't specify the label explicitly. | ||
| 446 | #-# Valid values: | ||
| 447 | #-# %w: wiki name | ||
| 448 | #-# %s: full space name (e.g. space1.space2) | ||
| 449 | #-# Note: Prior to 7.4.2/8.0M2 this was only displaying the last space name | ||
| 450 | #-# %ls: last space name. New in 7.4.2/8.0M2 | ||
| 451 | #-# %p: page name | ||
| 452 | #-# %np: nested page name (i.e. will display the space name for Nested Pages). New in 7.4.2/8.0M2 | ||
| 453 | #-# %P: page name with spaces between camel case words, i.e. "My Page" if the page name is "MyPage" | ||
| 454 | #-# %NP: nested page name with spaces between camel case words, i.e. "My Page" if the page name is "MyPage". | ||
| 455 | #-# New in 7.4.2/8.0M2 | ||
| 456 | #-# %t: page title | ||
| 457 | #-# | ||
| 458 | #-# Note that if the page title is empty or not defined then it defaults to %np. This is also the case | ||
| 459 | #-# if the title cannot be retrieved for the document. | ||
| 460 | #-# | ||
| 461 | #-# The default is "%np". Some examples: "%s.%p", "%w:%s.%p". | ||
| 462 | # rendering.linkLabelFormat = %np | ||
| 463 | {{/code}} | ||
| 464 | |||
| 465 | = Rendering Cache = | ||
| 466 | |||
| 467 | See the [[Performance page>>Documentation.AdminGuide.Performances.WebHome#HRenderingcache]]. | ||
| 468 | |||
| 469 | = Allowed Pages for Inactive Users = | ||
| 470 | |||
| 471 | The ##xwiki.cfg## configuration file includes ##xwiki.inactiveuser.allowedpages##. This property can be used to build a whitelist of pages that can be read by inactive users. The format that should be used is a comma-separated list of pages that users marked as inactive can see. | ||
| 472 | |||
| 473 | This property is needed because in XWiki, some users can be marked inactive, for example, when enabling user email verification in the administration. An inactive user has an account, but the account needs to be validated for the user to be able to access the wiki. Access rights do not apply to inactive users (they are recognized neither as XWikiGuest nor as members of XWikiAllGroup). | ||
| 474 | |||
| 475 | {{info}} | ||
| 476 | Inactive users are always allowed to see the ##XWiki.AccountValidation## page is used to validate their account. | ||
| 477 | {{/info}} | ||
| 478 | |||
| 479 | = Rendering Transformations = | ||
| 480 | |||
| 481 | You can control which [[Transformations>>rendering:Main.Architecture]] are active (by default, the [[Macro>>rendering:Main.Architecture]] and [[Icon>>rendering:Main.Transformations#HIconTransformation]] ones are active) by editing ##xwiki.properties##: | ||
| 482 | |||
| 483 | {{code language="none"}} | ||
| 484 | #-# Controls what transformations will be executed when rendering content. | ||
| 485 | #-# A transformation modifies the parsed content. For example the Icon transformation replaces some characters with | ||
| 486 | #-# icons, a WikiWord transformation will automatically create links when it finds wiki words, etc. | ||
| 487 | #-# Note that the Macro transformation is a special transformation that replaces macro markers by the result of the | ||
| 488 | #-# macro execution. If you don't list it, macros won't get executed. | ||
| 489 | #-# The default value is: rendering.transformations = macro, icon | ||
| 490 | {{/code}} | ||
| 491 | |||
| 492 | For example, if you wish to turn off the Icon Transformation in order not to render emoticons, you'd have to define the following property: {{code language="none"}}rendering.transformations = macro{{/code}}. | ||
| 493 | |||
| 494 | = Macros categories and visibility = | ||
| 495 | |||
| 496 | You can override the default categories of a macro by editing ##xwiki.properties##. | ||
| 497 | |||
| 498 | {{code language="properties"}} | ||
| 499 | #-# Overrides default macro categories (Each macro has default categories already defined, for example | ||
| 500 | #-# "Navigation" for the Table of Contents Macro). | ||
| 501 | #-# Note: the categories are case sensitive. | ||
| 502 | #-# | ||
| 503 | #-# Ex: To redefine the macro categories for the TOC macro so that it'd be in the "My Category" and "Deprecated" | ||
| 504 | #-# categories + redefine the category for the Script Macro to be "My Other Category", you'd use: | ||
| 505 | # rendering.transformation.macro.categories = toc = My Category\,Deprecated | ||
| 506 | # rendering.transformation.macro.categories = script = My Other Category | ||
| 507 | {{/code}} | ||
| 508 | |||
| 509 | You can also configure the macro categories for which macros should be hidden by default, by editing ##xwiki.properties##: | ||
| 510 | |||
| 511 | {{code language="properties"}} | ||
| 512 | #-# Override the default hidden macro categories. | ||
| 513 | #-# Note: the categories are case sensitive. | ||
| 514 | #-# | ||
| 515 | #-# The default value is: | ||
| 516 | # rendering.transformation.macro.hiddenCategories = Internal,Deprecated | ||
| 517 | #-# | ||
| 518 | #-# For instance, to make the "Development" category hidden by default, in addition to the "Internal" and | ||
| 519 | #-# "Deprecated" categories, you'd use: | ||
| 520 | # rendering.transformation.macro.hiddenCategories = Development,Internal,Deprecated | ||
| 521 | {{/code}} | ||
| 522 | |||
| 523 | Note that these macros are still visible if your users have configured to show [[hidden pages>>xwiki:documentation.xs.user.base.page.view.hide.hidden-pages.WebHome]] by [[editing the profile preferences>>xwiki:documentation.xs.user.user.edit-profile.edit-profile-preferences.WebHome]]. | ||
| 524 | |||
| 525 | = Securing Groovy Scripts = | ||
| 526 | |||
| 527 | See: | ||
| 528 | |||
| 529 | * The [[Commons Groovy Module>>extensions:Extension.GroovyModuleCommons]] | ||
| 530 | * The [[Platform Groovy Module>>extensions:Extension.GroovyModulePlatform]] | ||
| 531 | |||
| 532 | = Lock Duration = | ||
| 533 | |||
| 534 | By default, when a user starts editing a page, a lock will be set on that page, see [[Page Editing>>Documentation.UserGuide.Features.PageEditing#HLocking]]. The lock is valid by default for 30 minutes, after which it gets invalidated. | ||
| 535 | |||
| 536 | In order to increase this duration, you have 2 options: | ||
| 537 | |||
| 538 | * Add a property named ##lock_Timeout## to your ##xwiki.cfg## configuration file, set the value in seconds (and restart XWiki). For example, for 15 minutes: ##lock_Timeout = 900##. | ||
| 539 | * Or add the configuration in the wiki itself: | ||
| 540 | ** Edit the ##XWiki.XWikiPreferences## document using the class editor | ||
| 541 | ** Add a Number property named ##lock_Timeout## (case sensitive) | ||
| 542 | ** Edit the ##XWiki.XWikiPreferences## document using the object editor | ||
| 543 | ** Find the ##lock_Timeout## property and put the desired number of *seconds* a lock should be valid for | ||
| 544 | ** Don't forget to save the document | ||
| 545 | |||
| 546 | = Editing = | ||
| 547 | |||
| 548 | == Default editor == | ||
| 549 | |||
| 550 | You can choose which default editor to use when editing wiki content (wiki or WYSIWYG editor). XWiki uses the following strategy when deciding which editor to use: | ||
| 551 | |||
| 552 | 1. If editing a [[TextArea object property>>xwiki:documentation.xs.dev.data-model.x-properties.WebHome]] and that property has explicitly specified a specific editor to be used to edit it, then that editor will be used. This is set when [[using the Class editor>>xwiki:documentation.xs.user.base.page.edit.edit-class-editor.WebHome]]. For example:((( | ||
| 553 | {{image reference="editor-class-property.png"/}} | ||
| 554 | ))) | ||
| 555 | 1. Then, if no property editor is defined, or if editing standard wiki content (like page content), XWiki will check if the [[current user has configured an editor for a given content type>>xwiki:documentation.xs.dev.edit.configure-default-editor.WebHome]]. If the current edited content is of that type, then that editor will be used. For example:((( | ||
| 556 | {{image reference="editor-content-user.png"/}} | ||
| 557 | ))) | ||
| 558 | 1. Then, if no property editor is defined, XWiki will check if the [[current (nested) page has configured an editor for a given content type>>xwiki:documentation.xs.dev.edit.configure-default-editor.WebHome]]. If the current edited content is of that type, then that editor will be used. For example:((( | ||
| 559 | {{image reference="editor-content-page.png"/}} | ||
| 560 | ))) | ||
| 561 | 1. Then, if no property editor is defined, XWiki will check if the [[current wiki has configured an editor for a given content type>>xwiki:documentation.xs.dev.edit.configure-default-editor.WebHome]]. If the current edited content is of that type, then that editor will be used. For example:((( | ||
| 562 | {{image reference="editor-content-wiki.png"/}} | ||
| 563 | ))) | ||
| 564 | 1. Then, if no property editor is defined, XWiki will check if there's a [[configuration in ##xwiki.properties## for a given content type>>xwiki:documentation.xs.dev.edit.configure-default-editor.WebHome]] and if the current edited content is of that type, then that editor will be used. For example:((( | ||
| 565 | {{code language="properties"}} | ||
| 566 | edit.defaultEditor.org.xwiki.rendering.syntax.SyntaxContent=text | ||
| 567 | {{/code}} | ||
| 568 | ))) | ||
| 569 | 1. Then, if no editor has been defined, XWiki will check if the current [[user has defined a preferred editor to use>>xwiki:documentation.xs.user.user.edit-profile.edit-profile-preferences.WebHome]]. For example:((( | ||
| 570 | {{image reference="editor-user.png"/}} | ||
| 571 | ))) | ||
| 572 | 1. Then, if no preferred editor to use has been defined for the current user, XWiki will check the default editor set up in the Page Administration (XWiki.XWikiPreferences of the page) . Could be set because of [[XWIKI-17324>>https://jira.xwiki.org/browse/XWIKI-17324]]. For example:((( | ||
| 573 | {{image reference="editor-space-preference-object.png"/}} | ||
| 574 | ))) | ||
| 575 | 1. Then, if no editor has been defined, XWiki will check the [[default editor set up in the Administration UI>>extensions:Extension.Administration Application#HEditing]]. For example:((( | ||
| 576 | {{image reference="editor-admin.png"/}} | ||
| 577 | ))) | ||
| 578 | |||
| 579 | == Default WYSIWYG editor == | ||
| 580 | |||
| 581 | You can configure the [[default WYSIWYG editor to use>>extensions:Extension.CKEditor Integration.WebHome#HAdministrationSection]]. | ||
| 582 | |||
| 583 | See the [[WYSIWYG Editor Configuration>>extensions:Extension.CKEditor Integration.WebHome#HConfiguretheEditor]] page to find out how to enable or disable editing features. | ||
| 584 | |||
| 585 | == Section Editing == | ||
| 586 | |||
| 587 | By default, section editing is limited to level 1 and level 2 sections. This can be controlled by editing ##xwiki.cfg##: | ||
| 588 | |||
| 589 | {{code}} | ||
| 590 | #-# This parameter controls the depth of sections that have section editing. | ||
| 591 | #-# By default level 1 and level 2 sections have section editing. | ||
| 592 | xwiki.section.depth=2 | ||
| 593 | {{/code}} | ||
| 594 | |||
| 595 | You can also enable/disable section editing with: | ||
| 596 | |||
| 597 | {{code}} | ||
| 598 | #-# This parameter will activate the sectional editing. | ||
| 599 | xwiki.section.edit=1 | ||
| 600 | {{/code}} | ||
| 601 | |||
| 602 | == Editing Conflicts == | ||
| 603 | |||
| 604 | The [[Edit Conflict feature>>Documentation.UserGuide.Features.PageEditing#HEditconflict]] can be disabled since {{version since="11.3.1, 11.4RC1"}} from the ##xwiki.properties## file by setting ##edit.conflictChecking.enabled = false##: | ||
| 605 | |||
| 606 | {{code language="none"}} | ||
| 607 | #-# Indicate if the mechanism to detect and handle edition conflicts should be enabled or not. | ||
| 608 | #-# If disabled, it means that in case of edition conflicts, the latest save will be always take into account, and | ||
| 609 | #-# erase previous data (which can always be recovered in the history of the document). | ||
| 610 | #-# This option is provided because the feature is still experimental and it could be useful is some specific usecases | ||
| 611 | #-# to switch it off. However it is not recommended to do so. | ||
| 612 | #-# | ||
| 613 | #-# The default is: | ||
| 614 | # edit.conflictChecking.enabled = true | ||
| 615 | {{/code}} | ||
| 616 | |||
| 617 | == In-place Editing == | ||
| 618 | |||
| 619 | To disable the in-place WYSIWYG editing mode (and thus default to the Standalone WYSIWYG editing mode), modify the ##xwiki.properties## file and set ##edit.document.inPlaceEditing.enabled = false##: | ||
| 620 | |||
| 621 | {{code language="none"}} | ||
| 622 | #-# Indicate if the XWiki documents should be edited in-place, without leaving the view mode, whenever possible (e.g. if | ||
| 623 | #-# the default edit mode for that document and the preferred editor both support in-place editing). When enabled, | ||
| 624 | #-# clicking on the document Edit button makes the document title and content editable in-place, without leaving the | ||
| 625 | #-# view mode. When disabled, clicking on the document Edit button loads the default (stand-alone) edit mode for that | ||
| 626 | #-# document. | ||
| 627 | #-# | ||
| 628 | #-# The default is: | ||
| 629 | # edit.document.inPlaceEditing.enabled = true | ||
| 630 | {{/code}} | ||
| 631 | |||
| 632 | = Delete Pages = | ||
| 633 | |||
| 634 | This section is hidden when the [[recycle bin is not activated>>#HDocumentrecyclebin]]. | ||
| 635 | |||
| 636 | == Enabling Advanced users to skip the recycle bin == | ||
| 637 | |||
| 638 | Advanced users can choose to skip the recycle bin (and remove the pages permanently) when deleting pages. | ||
| 639 | |||
| 640 | To do so, search for the "Delete" section and set "can skip the recycle bin" to Yes. The default value is No. | ||
| 641 | |||
| 642 | {{image reference="skip_recycle_bin_admin_cropped.png"/}} | ||
| 643 | |||
| 644 | The configuration is resolved by looking in three locations, from the most specific to the least specific: | ||
| 645 | |||
| 646 | * In the configuration of the current wiki | ||
| 647 | * In the configuration of the main wiki | ||
| 648 | * In ##xwiki.properties## (see the property details below) | ||
| 649 | |||
| 650 | If the default value is found in one location, the next one is tried. If no value is found, the recycle bin skipping is not activated. | ||
| 651 | |||
| 652 | Details of the configuration on ##xwiki.properties##: | ||
| 653 | |||
| 654 | {{code language="none"}} | ||
| 655 | #-# Indicates whether skipping the recycle bin when deleting pages is allowed for Advanced users. | ||
| 656 | #-# It is disabled by default. | ||
| 657 | #-# This setting is only used if the wiki has a recycle bin activated (xwiki.recyclebin=1 in xwiki.cfg). | ||
| 658 | #-# This setting can be overloaded: | ||
| 659 | #-# * By the main wiki in the Refactoring.Code.RefactoringConfigurationClass class of the | ||
| 660 | #-# Refactoring.Code.RefactoringConfiguration document of the main wiki. | ||
| 661 | #-# * By sub-wikis in the Refactoring.Code.RefactoringConfigurationClass class of the | ||
| 662 | #-# Refactoring.Code.RefactoringConfiguration document of the sub-wikis (itself overloading the main wiki's | ||
| 663 | #-# configuration). | ||
| 664 | #-# | ||
| 665 | #-# The default value is: | ||
| 666 | # refactoring.isRecycleBinSkippingActivated = false | ||
| 667 | {{/code}} | ||
| 668 | |||
| 669 | = Readonly = | ||
| 670 | |||
| 671 | In order to configure your XWiki instance to be readonly (useful when doing an upgrade by setting up a new instance and you don't want new content to be created, for example). | ||
| 672 | |||
| 673 | To achieve this, you need to edit the ##xwiki.cfg## configuration file and set the ##xwiki.readonly## property to true and restart XWiki. | ||
| 674 | |||
| 675 | If you want to turn on the readonly mode live without a restart, you can also execute a small snippet with a user having programming rights (a restart of XWiki will remove the readonly mode in this case), while waiting for a future feature (see issue [[XWIKI-10119>>https://jira.xwiki.org/browse/XWIKI-10119]]): | ||
| 676 | |||
| 677 | {{code language="none"}} | ||
| 678 | {{groovy}} | ||
| 679 | def xwiki = xcontext.getXWiki() | ||
| 680 | xwiki.isReadOnly = true | ||
| 681 | {{/groovy}} | ||
| 682 | {{/code}} | ||
| 683 | |||
| 684 | Note that this flag doesn't prevent against any modifications in your wiki, there're still some places where it's not taken into account (see issue [[XWIKI-18437>>https://jira.xwiki.org/browse/XWIKI-18437]])). | ||
| 685 | |||
| 686 | = Sample ##xwiki.cfg## = | ||
| 687 | |||
| 688 | See {{scm path="xwiki-platform-tools/xwiki-platform-tool-configuration-resources/src/main/resources/xwiki.cfg.vm"}}xwiki.cfg.vm{{/scm}} | ||
| 689 | |||
| 690 | Note that we generate the default ##xwiki.cfg## file from this template file by applying Velocity during the build, so all ##$<something>## properties you see in this file are replaced at build time. | ||
| 691 | |||
| 692 | = Sample ##xwiki.properties## = | ||
| 693 | |||
| 694 | See {{scm path="xwiki-platform-tools/xwiki-platform-tool-configuration-resources/src/main/resources/xwiki.properties.vm"}}xwiki.properties.vm{{/scm}} | ||
| 695 | |||
| 696 | Note that we generate the default ##xwiki.properties## file from this template file by applying Velocity during the build, so all ##$<something>## properties that you see in this file are replaced at build time.{{/version}} | ||
| 697 | |||
| 698 | from the ##xwiki.properties## file by setting ##edit.conflictChecking.enabled = false##: | ||
| 699 | |||
| 700 | {{code language="none"}} | ||
| 701 | #-# Indicate if the mechanism to detect and handle edition conflicts should be enabled or not. | ||
| 702 | #-# If disabled, it means that in case of edition conflicts, the latest save will be always take into account, and | ||
| 703 | #-# erase previous data (which can always be recovered in the history of the document). | ||
| 704 | #-# This option is provided because the feature is still experimental and it could be useful is some specific usecases | ||
| 705 | #-# to switch it off. However it is not recommended to do so. | ||
| 706 | #-# | ||
| 707 | #-# The default is: | ||
| 708 | # edit.conflictChecking.enabled = true | ||
| 709 | {{/code}} | ||
| 710 | |||
| 711 | = System properties and environment variables = | ||
| 712 | |||
| 713 | Everything you find in the xwiki.cfg and xwiki.properties files can also be configured through Java system properties or environment variables. This is very usefull for example when you have a setup where it's much easier to pass parameter then editing files. | ||
| 714 | |||
| 715 | See [[extensions:Extension.Configuration Module||anchor="HSystempropertiesandenvironmentvariables"]] for more details. | ||
| 716 | |||
| 717 | = In-place Editing = | ||
| 718 | |||
| 719 | To disable the in-place WYSIWYG editing mode (and thus default to the Standalone WYSIWYG editing mode), modify the ##xwiki.properties## file and set ##edit.document.inPlaceEditing.enabled = false##: | ||
| 720 | |||
| 721 | {{code language="none"}} | ||
| 722 | #-# Indicate if the XWiki documents should be edited in-place, without leaving the view mode, whenever possible (e.g. if | ||
| 723 | #-# the default edit mode for that document and the preferred editor both support in-place editing). When enabled, | ||
| 724 | #-# clicking on the document Edit button makes the document title and content editable in-place, without leaving the | ||
| 725 | #-# view mode. When disabled, clicking on the document Edit button loads the default (stand-alone) edit mode for that | ||
| 726 | #-# document. | ||
| 727 | #-# | ||
| 728 | #-# The default is: | ||
| 729 | # edit.document.inPlaceEditing.enabled = true | ||
| 730 | {{/code}} | ||
| 731 | |||
| 732 | = Delete Pages = | ||
| 733 | |||
| 734 | This section is hidden when the [[recycle bin is not activated>>#HDocumentrecyclebin]]. | ||
| 735 | |||
| 736 | == Enabling Advanced users to skip the recycle bin == | ||
| 737 | |||
| 738 | Advanced users can choose to skip the recycle bin (and remove the pages permanently) when deleting pages. | ||
| 739 | |||
| 740 | To do so, search for the "Delete" section and set "can skip the recycle bin" to Yes. The default value is No. | ||
| 741 | |||
| 742 | {{image reference="skip_recycle_bin_admin_cropped.png"/}} | ||
| 743 | |||
| 744 | The configuration is resolved by looking in three locations, from the most specific to the least specific: | ||
| 745 | |||
| 746 | * In the configuration of the current wiki | ||
| 747 | * In the configuration of the main wiki | ||
| 748 | * In ##xwiki.properties## (see the property details below) | ||
| 749 | |||
| 750 | If the default value is found in one location, the next one is tried. If no value is found, the recycle bin skipping is not activated. | ||
| 751 | |||
| 752 | Details of the configuration on ##xwiki.properties##: | ||
| 753 | |||
| 754 | {{code language="none"}} | ||
| 755 | #-# Indicates whether skipping the recycle bin when deleting pages is allowed for Advanced users. | ||
| 756 | #-# It is disabled by default. | ||
| 757 | #-# This setting is only used if the wiki has a recycle bin activated (xwiki.recyclebin=1 in xwiki.cfg). | ||
| 758 | #-# This setting can be overloaded: | ||
| 759 | #-# * By the main wiki in the Refactoring.Code.RefactoringConfigurationClass class of the | ||
| 760 | #-# Refactoring.Code.RefactoringConfiguration document of the main wiki. | ||
| 761 | #-# * By sub-wikis in the Refactoring.Code.RefactoringConfigurationClass class of the | ||
| 762 | #-# Refactoring.Code.RefactoringConfiguration document of the sub-wikis (itself overloading the main wiki's | ||
| 763 | #-# configuration). | ||
| 764 | #-# | ||
| 765 | #-# The default value is: | ||
| 766 | # refactoring.isRecycleBinSkippingActivated = false | ||
| 767 | {{/code}} | ||
| 768 | |||
| 769 | = Readonly = | ||
| 770 | |||
| 771 | In order to configure your XWiki instance to be readonly (useful when doing an upgrade by setting up a new instance and you don't want new content to be created, for example). | ||
| 772 | |||
| 773 | To achieve this, you need to edit the ##xwiki.cfg## configuration file and set the ##xwiki.readonly## property to true and restart XWiki. | ||
| 774 | |||
| 775 | If you want to turn on the readonly mode live without a restart, you can also execute a small snippet with a user having programming rights (a restart of XWiki will remove the readonly mode in this case), while waiting for a future feature (see issue [[XWIKI-10119>>https://jira.xwiki.org/browse/XWIKI-10119]]): | ||
| 776 | |||
| 777 | {{code language="none"}} | ||
| 778 | {{groovy}} | ||
| 779 | def xwiki = xcontext.getXWiki() | ||
| 780 | xwiki.isReadOnly = true | ||
| 781 | {{/groovy}} | ||
| 782 | {{/code}} | ||
| 783 | |||
| 784 | Note that this flag doesn't prevent against any modifications in your wiki, there're still some places where it's not taken into account (see issue [[XWIKI-18437>>https://jira.xwiki.org/browse/XWIKI-18437]])). | ||
| 785 | |||
| 786 | = Sample ##xwiki.cfg## = | ||
| 787 | |||
| 788 | See {{scm path="xwiki-platform-tools/xwiki-platform-tool-configuration-resources/src/main/resources/xwiki.cfg.vm"}}xwiki.cfg.vm{{/scm}} | ||
| 789 | |||
| 790 | Note that we generate the default ##xwiki.cfg## file from this template file by applying Velocity during the build, so all ##$<something>## properties you see in this file are replaced at build time. | ||
| 791 | |||
| 792 | = Sample ##xwiki.properties## = | ||
| 793 | |||
| 794 | See {{scm path="xwiki-platform-tools/xwiki-platform-tool-configuration-resources/src/main/resources/xwiki.properties.vm"}}xwiki.properties.vm{{/scm}} | ||
| 795 | |||
| 796 | Note that we generate the default ##xwiki.properties## file from this template file by applying Velocity during the build, so all ##$<something>## properties that you see in this file are replaced at build time. | ||
| 797 | |||
| 798 | |||
| 799 | from the ##xwiki.properties## file by setting ##edit.conflictChecking.enabled = false##: | ||
| 800 | |||
| 801 | {{code language="none"}} | ||
| 802 | #-# Indicate if the mechanism to detect and handle edition conflicts should be enabled or not. | ||
| 803 | #-# If disabled, it means that in case of edition conflicts, the latest save will be always take into account, and | ||
| 804 | #-# erase previous data (which can always be recovered in the history of the document). | ||
| 805 | #-# This option is provided because the feature is still experimental and it could be useful is some specific usecases | ||
| 806 | #-# to switch it off. However it is not recommended to do so. | ||
| 807 | #-# | ||
| 808 | #-# The default is: | ||
| 809 | # edit.conflictChecking.enabled = true | ||
| 810 | {{/code}} | ||
| 811 | |||
| 812 | == In-place Editing == | ||
| 813 | |||
| 814 | To disable the in-place WYSIWYG editing mode (and thus default to the Standalone WYSIWYG editing mode), modify the ##xwiki.properties## file and set ##edit.document.inPlaceEditing.enabled = false##: | ||
| 815 | |||
| 816 | {{code language="none"}} | ||
| 817 | #-# Indicate if the XWiki documents should be edited in-place, without leaving the view mode, whenever possible (e.g. if | ||
| 818 | #-# the default edit mode for that document and the preferred editor both support in-place editing). When enabled, | ||
| 819 | #-# clicking on the document Edit button makes the document title and content editable in-place, without leaving the | ||
| 820 | #-# view mode. When disabled, clicking on the document Edit button loads the default (stand-alone) edit mode for that | ||
| 821 | #-# document. | ||
| 822 | #-# | ||
| 823 | #-# The default is: | ||
| 824 | # edit.document.inPlaceEditing.enabled = true | ||
| 825 | {{/code}} | ||
| 826 | |||
| 827 | = Delete Pages = | ||
| 828 | |||
| 829 | This section is hidden when the [[recycle bin is not activated>>#HDocumentrecyclebin]]. | ||
| 830 | |||
| 831 | == Enabling Advanced users to skip the recycle bin == | ||
| 832 | |||
| 833 | Advanced users can choose to skip the recycle bin (and remove the pages permanently) when deleting pages. | ||
| 834 | |||
| 835 | To do so, search for the "Delete" section and set "can skip the recycle bin" to Yes. The default value is No. | ||
| 836 | |||
| 837 | {{image reference="skip_recycle_bin_admin_cropped.png"/}} | ||
| 838 | |||
| 839 | The configuration is resolved by looking in three locations, from the most specific to the least specific: | ||
| 840 | |||
| 841 | * In the configuration of the current wiki | ||
| 842 | * In the configuration of the main wiki | ||
| 843 | * In ##xwiki.properties## (see the property details below) | ||
| 844 | |||
| 845 | If the default value is found in one location, the next one is tried. If no value is found, the recycle bin skipping is not activated. | ||
| 846 | |||
| 847 | Details of the configuration on ##xwiki.properties##: | ||
| 848 | |||
| 849 | {{code language="none"}} | ||
| 850 | #-# Indicates whether skipping the recycle bin when deleting pages is allowed for Advanced users. | ||
| 851 | #-# It is disabled by default. | ||
| 852 | #-# This setting is only used if the wiki has a recycle bin activated (xwiki.recyclebin=1 in xwiki.cfg). | ||
| 853 | #-# This setting can be overloaded: | ||
| 854 | #-# * By the main wiki in the Refactoring.Code.RefactoringConfigurationClass class of the | ||
| 855 | #-# Refactoring.Code.RefactoringConfiguration document of the main wiki. | ||
| 856 | #-# * By sub-wikis in the Refactoring.Code.RefactoringConfigurationClass class of the | ||
| 857 | #-# Refactoring.Code.RefactoringConfiguration document of the sub-wikis (itself overloading the main wiki's | ||
| 858 | #-# configuration). | ||
| 859 | #-# | ||
| 860 | #-# The default value is: | ||
| 861 | # refactoring.isRecycleBinSkippingActivated = false | ||
| 862 | {{/code}} | ||
| 863 | |||
| 864 | = Readonly = | ||
| 865 | |||
| 866 | In order to configure your XWiki instance to be readonly (useful when doing an upgrade by setting up a new instance and you don't want new content to be created, for example). | ||
| 867 | |||
| 868 | To achieve this, you need to edit the ##xwiki.cfg## configuration file and set the ##xwiki.readonly## property to true and restart XWiki. | ||
| 869 | |||
| 870 | If you want to turn on the readonly mode live without a restart, you can also execute a small snippet with a user having programming rights (a restart of XWiki will remove the readonly mode in this case), while waiting for a future feature (see issue [[XWIKI-10119>>https://jira.xwiki.org/browse/XWIKI-10119]]): | ||
| 871 | |||
| 872 | {{code language="none"}} | ||
| 873 | {{groovy}} | ||
| 874 | def xwiki = xcontext.getXWiki() | ||
| 875 | xwiki.isReadOnly = true | ||
| 876 | {{/groovy}} | ||
| 877 | {{/code}} | ||
| 878 | |||
| 879 | Note that this flag doesn't prevent against any modifications in your wiki, there're still some places where it's not taken into account (see issue [[XWIKI-18437>>https://jira.xwiki.org/browse/XWIKI-18437]])). | ||
| 880 | |||
| 881 | = Sample ##xwiki.cfg## = | ||
| 882 | |||
| 883 | See {{scm path="xwiki-platform-tools/xwiki-platform-tool-configuration-resources/src/main/resources/xwiki.cfg.vm"}}xwiki.cfg.vm{{/scm}} | ||
| 884 | |||
| 885 | Note that we generate the default ##xwiki.cfg## file from this template file by applying Velocity during the build, so all ##$<something>## properties you see in this file are replaced at build time. | ||
| 886 | |||
| 887 | = Sample ##xwiki.properties## = | ||
| 888 | |||
| 889 | See {{scm path="xwiki-platform-tools/xwiki-platform-tool-configuration-resources/src/main/resources/xwiki.properties.vm"}}xwiki.properties.vm{{/scm}} | ||
| 890 | |||
| 891 | Note that we generate the default ##xwiki.properties## file from this template file by applying Velocity during the build, so all ##$<something>## properties that you see in this file are replaced at build time. | ||
| 892 | |||
| 893 | |||
| 894 | from the ##xwiki.properties## file by setting ##edit.conflictChecking.enabled = false##: | ||
| 895 | |||
| 896 | {{code language="none"}} | ||
| 897 | #-# Indicate if the mechanism to detect and handle edition conflicts should be enabled or not. | ||
| 898 | #-# If disabled, it means that in case of edition conflicts, the latest save will be always take into account, and | ||
| 899 | #-# erase previous data (which can always be recovered in the history of the document). | ||
| 900 | #-# This option is provided because the feature is still experimental and it could be useful is some specific usecases | ||
| 901 | #-# to switch it off. However it is not recommended to do so. | ||
| 902 | #-# | ||
| 903 | #-# The default is: | ||
| 904 | # edit.conflictChecking.enabled = true | ||
| 905 | {{/code}} |