Wiki source code of XWiki Documents (xwikidoc)

Last modified by Simon Urli on 2023/10/10

Show last authors
1 XWiki documents are identified by //XWD_WEB// and //XWD_NAME// (see the user guide for more information about this). But for a given URL (with a unique //XWD_WEB// and //XWD_NAME//), you may find different XWiki documents because some offshoots of the original document called translations may have been added and they have been tagged with their own specific language code (e.g., "en" for English, "fr" for French).
2
3 Hence, there are 2 kind of documents in XWiki and you can think of them as:
4
5 * "regular" or "main" documents
6 * "translations" (of "main" documents)
7
8 The first kind has a value of 0 in the //XWD_TRANSLATION// field whereas the second kind has a value of 1. If you look at the database, there should exist at most one document for each //XWD_WEB// and //XWD_NAME// combination that comes with a value of 0 for the //XWD_TRANSLATION// attribute. All the other documents bearing the same //XWD_WEB// and //XWD_NAME// attribute values will have a value of 1 for the //XWD_TRANSLATION// attribute.
9
10 Of course, in practice the user doesn't have to worry about that as she would use XWiki's interface to add or remove translations and original documents. But there have been situations in which the database gets corrupted and as a result you could see 2 documents with the same values for //XWD_WEB//, //XWD_NAME// and //XWD_LANGUAGE// (e.g., in practice 2 "en" buttons appear on the web page and you can only access one of these translation documents from the interface, the other one is masked).
11
12 If that happens to you, remove the document bearing a 1 in //XWD_TRANSLATION// to fix the database (or tag it as another language, "it" for example). //XWD_ID// is a number which is generated by taking a hashcode of the database name and //XWD_FULLNAME//. If the document is a translation, the language is also part of the text which is hashed. This means a document's //XWD_ID// will change when it is renamed.
13
14 This table contains information about XWiki Documents. This is the main table:
15
16 {{velocity}}
17 |=(% colspan="8" %)xwikidoc
18 |= |=Column Name |=Datatype |=Not null |=auto inc |=flags |=Default value |=Comments
19 |$services.icon.render('key')|XWD_ID |BIGINT(20) |$services.icon.render('check') | | |0 |
20 ||XWD_FULLNAME|VARCHAR(255) |$services.icon.render('check') | | ||
21 ||XWD_NAME |VARCHAR(255) |$services.icon.render('check') | | ||
22 ||XWD_TITLE |VARCHAR(255) |$services.icon.render('check') | | ||
23 ||XWD_LANGUAGE |VARCHAR(5) | | | |null|
24 ||XWD_DEFAULT_LANGUAGE |VARCHAR(5) | | | |null|
25 ||XWD_TRANSLATION |INTEGER |$services.icon.render('check') | | |0|
26 ||XWD_DATE |DATETIME |$services.icon.render('check') | | |0000-00-00 00:00:00|
27 ||XWD_CONTENT_UPDATE_DATE |DATETIME |$services.icon.render('check') | | |0000-00-00 00:00:00|
28 ||XWD_CREATION_DATE |DATETIME |$services.icon.render('check') | | |0000-00-00 00:00:00|
29 ||XWD_AUTHOR |VARCHAR(255) |$services.icon.render('check') | | ||
30 ||XWD_CONTENT_AUTHOR |VARCHAR(255) |$services.icon.render('check') | | ||
31 ||XWD_ORIGINAL_METADATA_AUTHOR |VARCHAR(255) |$services.icon.render('check') | | || (Since 14.0RC1)
32 ||XWD_CREATOR |VARCHAR(255) |$services.icon.render('check') | | ||
33 ||XWD_WEB |VARCHAR(255) |$services.icon.render('check') | | || can be used to join [[xwikispace#XWD_REFERENCE>>xwiki:Documentation.DevGuide.DsXwikiSpace]]
34 ||XWD_CONTENT |MEDIUMTEXT |$services.icon.render('check') | | ||
35 ||XWD_VERSION |VARCHAR(255) |$services.icon.render('check') | | ||
36 ||XWD_CUSTOM_CLASS |VARCHAR(255) |$services.icon.render('check') | | ||
37 ||XWD_PARENT|TEXT |$services.icon.render('check') | | ||
38 ||XWD_CLASS_XML |TEXT || | |null|
39 ||XWD_ELEMENTS |INTEGER | | | |null|
40 ||XWD_DEFAULT_TEMPLATE |VARCHAR(255) |$services.icon.render('check') | | ||
41 ||XWD_VALIDATION_SCRIPT |VARCHAR(255) |$services.icon.render('check') | | ||
42 ||XWD_COMMENT |TEXT |$services.icon.render('check') | | ||
43 ||XWD_MINOREDIT |BIT |$services.icon.render('check') | | ||
44 ||XWD_SYNTAX_ID|VARCHAR(50) | | | |null|
45 ||XWD_HIDDEN |BIT || | |null|
46 {{/velocity}}

Get Connected