XWiki Documents (xwikidoc)

Version 19.2 by Manuel Smeria on 2013/02/22

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 
db_key.gifXWS_ID BIGINT(20) db_check.gif    
db_field.gifXWD_FULLNAMEVARCHAR(255) db_check.gif    
db_field.gifXWD_NAME VARCHAR(255) db_check.gif    
db_field.gifXWD_TITLE VARCHAR(255) db_check.gif    
db_field.gifXWD_LANGUAGE VARCHAR(5)    null 
db_field.gifXWD_DEFAULT_LANGUAGE VARCHAR(5)    null 
db_field.gifXWD_TRANSLATION INTEGER db_check.gif   0 
db_field.gifXWD_DATE DATETIME db_check.gif   0000-00-00 00:00:00 
db_field.gifXWD_CONTENT_UPDATE_DATE DATETIME db_check.gif   0000-00-00 00:00:00 
db_field.gifXWD_CREATION_DATE DATETIME db_check.gif   0000-00-00 00:00:00 
db_field.gifXWD_AUTHOR VARCHAR(255) db_check.gif    
db_field.gifXWD_CONTENT_AUTHOR VARCHAR(255) db_check.gif    
db_field.gifXWD_CREATOR VARCHAR(255) db_check.gif    
db_field.gifXWD_WEB VARCHAR(255) db_check.gif    
db_field.gifXWD_CONTENT MEDIUMTEXT db_check.gif    
db_field.gifXWD_VERSION VARCHAR(255) db_check.gif    
db_field.gifXWD_CUSTOM_CLASS VARCHAR(255) db_check.gif    
db_field.gifXWD_PARENTTEXT db_check.gif    
db_field.gifXWD_CLASS_XML TEXT   null 
db_field.gifXWD_ELEMENTS INTEGER    null 
db_field.gifXWD_DEFAULT_TEMPLATE VARCHAR(255) db_check.gif    
db_field.gifXWD_VALIDATION_SCRIPT VARCHAR(255) db_check.gif    
db_field.gifXWD_COMMENT TEXT db_check.gif    
db_field.gifXWD_MINOREDIT BIT db_check.gif    
db_field.gifXWD_SYNTAX_IDVARCHAR(50)    null 
db_field.gifXWD_HIDDEN BIT   null 

Get Connected