Changes for page Release Notes for XWiki 4.2 Milestone 2
Last modified by Thomas Mortagne on 2017/03/24
Change comment:
Documented the default custom displayers
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. ThomasMortagne1 +XWiki.Sergiu - Content
-
... ... @@ -32,14 +32,21 @@ 32 32 33 33 To use this feature, first you need to compute a //type// name for your property type. This is obtained from the java class simple name, removing the ##Class## suffix, and lowercasing. For example, for numbers the java class used is ##com.xpn.xwiki.objects.classes.NumberClass##, with the simple name ##NumberClass##, which gives ##number## as the type name. For a database list, we get ##dblist## from ##DBListClass##. 34 34 35 -Next, there are three places where a default custom displayer. 35 +Next, there are three places where a default custom displayer can be defined. 36 36 37 -If a specific field provides custom display code in the XClass, then that code takes priority over the 37 +1. If a document whose name is the //type// capitalized and suffixed with ##Displayer## exists in the ##XWiki## space in the current wiki, then its content is used as the default custom displayer for that type of property. For example, ##localwiki:XWiki.NumberDisplayer## and ##localwiki:XWiki.DblistDisplayer##. 38 +1. If a document whose name is the //type// capitalized and suffixed with ##Displayer## exists in the ##XWiki## space in the main wiki, then its content is used as the default custom displayer for that type of property. For example, ##xwiki:XWiki.NumberDisplayer## and ##xwiki:XWiki.DblistDisplayer##. 39 +1. If a velocity template whose name is the //type// suffixed with ##.vm## exists in the current skin, then it is evaluated as the default custom displayer for that type of property. A skin file can be defined in many places, such as an attachment of a skin document, a file in a named skin on the filesystem, or a file in the ##templates/## directory. 38 38 39 -{{warning}} 40 -For the moment, the location of the default custom displayer is cached the first time a 41 -{{/warning}} 41 +If a specific class property provides custom display code in the XClass, then that code takes priority over an eventual default custom displayer for that property. 42 42 43 +As with property custom displayers, when evaluating the display code several objects are placed in the context: 44 + 45 +* ##name## is the name of the property being displayed 46 +* ##prefix## is the HTML name prefix to append to an eventual input field name, and contains the XClass name, an underscore, the object number, and another underscore, for example ##XWiki.XWikiUsers_0_## 47 +* ##object## is the object owning the displayed property, an instance of the public ##com.xpn.xwiki.api.Object## class 48 +* ##type## is the target display type, one of ##view##, ##edit##, ##hidden## or ##search## 49 + 43 43 == New API to manipulate log level == 44 44 45 45 Several method as been added to ##org.xwiki.logging.LoggerManager## to manipulate the log level of registered loggers.