XWiki Documents (xwikidoc)

Last modified by Simon Urli on 2023/10/10

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).

Hence, there are 2 kind of documents in XWiki and you can think of them as:

  • "regular" or "main" documents 
  • "translations" (of "main" documents)

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.

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).

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.

This table contains information about XWiki Documents. This is the main table:

xwikidoc 
 Column Name Datatype Not null auto inc flags Default value Comments 
XWD_ID BIGINT(20)     
XWD_FULLNAMEVARCHAR(255)     
XWD_NAME VARCHAR(255)     
XWD_TITLE VARCHAR(255)     
XWD_LANGUAGE VARCHAR(5)    null 
XWD_DEFAULT_LANGUAGE VARCHAR(5)    null 
XWD_TRANSLATION INTEGER    0 
XWD_DATE DATETIME    0000-00-00 00:00:00 
XWD_CONTENT_UPDATE_DATE DATETIME    0000-00-00 00:00:00 
XWD_CREATION_DATE DATETIME    0000-00-00 00:00:00 
XWD_AUTHOR VARCHAR(255)     
XWD_CONTENT_AUTHOR VARCHAR(255)     
XWD_ORIGINAL_METADATA_AUTHOR VARCHAR(255)     (Since 14.0RC1)
XWD_CREATOR VARCHAR(255)     
XWD_WEB VARCHAR(255)     can be used to join xwikispace#XWD_REFERENCE
XWD_CONTENT MEDIUMTEXT     
XWD_VERSION VARCHAR(255)     
XWD_CUSTOM_CLASS VARCHAR(255)     
XWD_PARENTTEXT     
XWD_CLASS_XML TEXT   null 
XWD_ELEMENTS INTEGER    null 
XWD_DEFAULT_TEMPLATE VARCHAR(255)     
XWD_VALIDATION_SCRIPT VARCHAR(255)     
XWD_COMMENT TEXT     
XWD_MINOREDIT BIT     
XWD_SYNTAX_IDVARCHAR(50)    null 
XWD_HIDDEN BIT   null 
Tags:
   

Get Connected