Wiki source code of Optional Store Features
Last modified by Eleni Cojocariu on 2026/11/25 14:46
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | Two of the things the store keeps can be switched off, and where it keeps them can be changed: the history of documents and attachments, and the recycle bins they go to when deleted. All of the properties below live in ##xwiki/WEB-INF/xwiki.cfg##, all of them ship commented out at the default shown, and all of them are read at startup, so a change takes effect on the next restart. | ||
| 2 | |||
| 3 | Keeping the full history is what lets a reader revert vandalism or read what a page said last month, and on an active wiki that history grows to be far larger than the current content. Switching it off is a trade of that safety for that space. | ||
| 4 | |||
| 5 | == Features that can be switched off == | ||
| 6 | |||
| 7 | |=Property|=Default|=Switching it off means | ||
| 8 | |##xwiki.store.versioning##|##1##|Documents no longer keep a history. | ||
| 9 | |##xwiki.store.attachment.versioning##|##1##|Attachments no longer keep their versions. Setting ##xwiki.store.attachment.versioning.hint## to ##void## has the same effect. | ||
| 10 | |##xwiki.recyclebin##|##1##|A deleted page is removed instead of going to the recycle bin. | ||
| 11 | |##storage.attachment.recyclebin##|##1##|A deleted attachment is removed instead of going to the attachment recycle bin. | ||
| 12 | |##xwiki.store.rollbackattachmentwithdocuments##|##1##|Reverting a document to an older version leaves its attachments as they are. | ||
| 13 | |||
| 14 | Two traps in that table: | ||
| 15 | |||
| 16 | * **Only the exact value ##0## switches off the first four.** They are read as "anything that is not ##0##", so ##false##, ##no## or ##off## leave the feature on. | ||
| 17 | * **The last one is the other way round**: only the exact value ##1## keeps it on, so any other value switches it off. | ||
| 18 | |||
| 19 | And note that ##storage.attachment.recyclebin## is the one property here **without** the ##xwiki.## prefix. | ||
| 20 | |||
| 21 | {{warning}} | ||
| 22 | With the document recycle bin switched off, a deleted page cannot be brought back at all: neither [[Restore a Page>>doc:documentation.xs.admin.page.index.restore-page.WebHome]] nor [[Restore Entire Batches>>doc:documentation.xs.admin.page.index.restore-batches.WebHome]] has anything to restore from, and only a database backup is left. The same goes for [[Restore a Deleted Attachment>>doc:documentation.xs.user.attachments.restore-attachment.WebHome]] once the attachment recycle bin is off. | ||
| 23 | {{/warning}} | ||
| 24 | |||
| 25 | == Where each of them is stored == | ||
| 26 | |||
| 27 | Each store has a hint that selects its implementation. The metadata stores default to the database, the content stores to the [[permanent directory>>doc:documentation.xs.admin.installation.directories.permanent-directory.WebHome]], the latter since XWiki 10.5. The first row is the odd one out: it is not one of the features above but the store holding the content of the attachments a wiki currently has, set in the same file and the same way. | ||
| 28 | |||
| 29 | |=Property|=Default|=What it stores | ||
| 30 | |##xwiki.store.attachment.hint##|##file##|The content of attachments. | ||
| 31 | |##xwiki.store.versioning.hint##|##hibernate##|The history of documents. | ||
| 32 | |##xwiki.store.recyclebin.hint##|##hibernate##|The metadata of deleted pages. | ||
| 33 | |##xwiki.store.recyclebin.content.hint##|##file##|The content of deleted pages. | ||
| 34 | |##xwiki.store.attachment.recyclebin.hint##|##hibernate##|The metadata of deleted attachments. | ||
| 35 | |##xwiki.store.attachment.recyclebin.content.hint##|##file##|The content of deleted attachments. | ||
| 36 | |##xwiki.store.attachment.versioning.hint##|##file##|The versions of attachments, or nothing at all with the value ##void##. | ||
| 37 | |||
| 38 | The two content hints apply to what is deleted **after** the change: they are read when a page or an attachment is deleted, so what is already in a recycle bin stays where it was written. ##xwiki.store.attachment.hint## works the same way: it decides where the next attachment saved is written and leaves every file already stored where it is. [[The Attachment Store>>doc:documentation.xs.admin.attachments.store.WebHome]] compares the two stores it chooses between, and [[Switch to the Database Attachment Store>>doc:documentation.xs.admin.attachments.store.switch-database.WebHome]] is the procedure. Where the files a file-based store writes finally land is a separate matter again. See [[Blob Store>>doc:documentation.xs.admin.attachments.store.blob.WebHome]]. |