Release Notes for XWiki 4.2 Milestone 2

Last modified by Thomas Mortagne on 2017/03/24

This is the release notes for XWiki Platform, XWiki Enterprise and XWiki Enterprise Manager. They share the same release notes as they are released together and have the same version.

This is the second milestone of the XWiki 4.2 version (Roadmap). This release adds support for storing an email address and a list of wiki page names in XWiki objects using dedicated xclass property types. It also adds the ability to have an object property whose value is computed from the other properties. For developers this release introduces default custom displayers for easier customization of the way XWiki object properties are displayed.

New and Noteworthy (since XWiki 4.2 Milestone 1)

New field types for email and list of pages

Two new types of class properties have been added:

  • The Email type extends the normal String type, adding by default a validation regular expression that should accept only a valid email address
  • The Page type extends the normal DBList type, and allows to select one or more documents from the current wiki

These two new properties are still in development, and further improvements will be implemented in the next milestone.

Computed class fields

Another new type of class fields adds support for virtual values computed live from other class values, data from the database, data obtained from an external service, or practically any other source of data. These fields are non-editable and aren't stored in the database, since they only provide some wiki content that will be rendered each time such a property is displayed.

Traditionally, this kind of computation would have been written directly in the sheet used to display instances of that class, but putting it in a class field allows easier reuse of the code, since the property will be displayed in livetables, when indexing the document in Lucene, when displaying documents in an index page, and so on.

Improvements to the Extension Repository Application

We modified the extension sheet to display the release notes for all the available versions of an extension. Check for instance the release notes for the Extended TODO Application:

ER-releaseNotes.png

Improvements to Extension Manager

An administrator of a subwiki can now install XAR extension (as long as it does not require a JAR extension).

For Developers

Default custom displayers for Easier customization of the way object fields are displayed

While XWiki allowed to specify a custom display for a given field, it was impossible to change the way field types, such as DateProperty or IntegerProperty, are displayed in general. Now it is possible to define custom displayers at the farm or wiki level, which gives the administrators more power to change the look and feel of the wiki. For example, this allows to use HTML5 input types for dates and numbers, to use custom suggestions for list of users fields, or to always add a validation input for all the password field types.

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.

Next, there are three places where a default custom displayer can be defined.

  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.
  2. 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.
  3. 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.

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.

As with property custom displayers, when evaluating the display code several objects are placed in the context:

  • name is the name of the property being displayed
  • 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_
  • object is the object owning the displayed property, an instance of the public com.xpn.xwiki.api.Object class
  • type is the target display type, one of view, edit, hidden or search

New API to manipulate log level

Several method as been added to org.xwiki.logging.LoggerManager to manipulate the log level of registered loggers.

    /**
     * Associate the passed logger to the passed log level.
     *
     * @param loggerName the logger
     * @param level the level of the logger
     */

   void setLoggerLevel(String loggerName, LogLevel level);

   /**
     * @param loggerName the logger
     * @return the log level associated to the logger
     */

    LogLevel getLoggerLevel(String loggerName);

   /**
     * @return all the registered loggers
     */

    Collection<Logger> getLoggers();

Upgrades

The following dependencies have been upgraded:

  • GWT 2.5 RC1
  • Selenium 2.25

Miscellaneous

  • Office Importer/Exporter encoding issues have been fixed ().

Translations

The following translations have been updated: 

Tested Browsers

Here's the list of browsers tested with this version (i.e. browsers that we've tested as working - Check the list of supported browsers):

Firefox
11.0

Known issues

Backward Compatibility and Migration Notes

General Notes

You may also want to import the default wiki XAR in order to benefit from all the improvements listed above.

Always make sure you compare your xwiki.cfg and xwiki.properties files with the newest version since some configuration parameters were added. Note that you should add xwiki.store.migration=1 so that XWiki will attempt to automatically migrate your current database to the new schema. Make sure you backup your Database before doing anything.

API Breakages

The following APIs were modified since 4.1.3:

  • The logging module is new and is still considered a "young API". Added new methods to manipulate loggers levels.
    org.xwiki.logging.LoggerManager: Method 'public org.xwiki.logging.LogLevel getLoggerLevel(java.lang.String)' has been added to an interface
    org.xwiki.logging.LoggerManager: Method 'public java.util.Collection getLoggers()' has been added to an interface
    org.xwiki.logging.LoggerManager: Method 'public void setLoggerLevel(java.lang.String, org.xwiki.logging.LogLevel)' has been added to an interface
  • The Job module is new and is still considered a "young API". Moved from Exception to Throwable parameter for extending jobs. Also added two new methods to check and remove custom properties.
    org.xwiki.job.AbstractJob: Parameter 1 of 'protected void jobFinished(java.lang.Exception)' has changed its type to java.lang.Throwable
    org.xwiki.job.Request: Method 'public boolean containsProperty(java.lang.String)' has been added to an interface
    org.xwiki.job.Request: Method 'public java.lang.Object removeProperty(java.lang.String)' has been added to an interface
  • New InstalledExtension#isValid() method.
    org.xwiki.extension.InstalledExtension: Method 'public boolean isValid(java.lang.String)' has been added to an interface
  • The Extension module is relatively new and is still undergoing some API tuning. New method to access environment extension. Also added new methods to execute custom checking before installing/uninstalling an extension.
    org.xwiki.extension.repository.CoreExtensionRepository: Method 'public org.xwiki.extension.CoreExtension getEnvironmentExtension()' has been added to an interface
    org.xwiki.extension.handler.ExtensionHandler: Method 'public void checkInstall(org.xwiki.extension.Extension, java.lang.String, org.xwiki.job.Request)' has been added to an interface
    org.xwiki.extension.handler.ExtensionHandler: Method 'public void checkUninstall(org.xwiki.extension.InstalledExtension, java.lang.String, org.xwiki.job.Request)' has been added to an interface
  • Fix method name typo (adding new method). This interface is not really supposed to be implemented except by internal class.
    org.xwiki.properties.PropertyDescriptor: Method 'public java.lang.reflect.Field getField()' has been added to an interface
  • Added method to get the author of the macro.
    org.xwiki.rendering.macro.wikibridge.WikiMacro: Method 'public org.xwiki.model.reference.DocumentReference getAuthorReference()' has been added to an interface
  • Add a method to the oldcore/wikimacro bridge.
    org.xwiki.rendering.macro.wikibridge.WikiMacroFactory: Method 'public boolean isAllowed(org.xwiki.model.reference.DocumentReference, org.xwiki.rendering.macro.wikibridge.WikiMacroVisibility)' has been added to an interface
  • These classes below have never been used. It was supposed to be the start of the removal of Struts but since it hasn't progressed so far we're removing stray code from master. Experiments should be done on feature branches.
    org.xwiki.container.servlet.XWikiServlet: Class org.xwiki.container.servlet.XWikiServlet removed
  • Removed protected method (registerWikiMacros) that was not supposed to be used from outside (was protected for unit tests hacks).
    com.xpn.xwiki.XWiki: Method 'protected void registerWikiMacros()' has been removed
  • Chart plugin has been moved from oldcore to its own module. There's no API breakage for the user.
    com.xpn.xwiki.plugin.charts.Chart: Class com.xpn.xwiki.plugin.charts.Chart removed
    com.xpn.xwiki.plugin.charts.ChartCustomizer: Class com.xpn.xwiki.plugin.charts.ChartCustomizer removed
    com.xpn.xwiki.plugin.charts.ChartImpl: Class com.xpn.xwiki.plugin.charts.ChartImpl removed
    com.xpn.xwiki.plugin.charts.ChartingMacro: Class com.xpn.xwiki.plugin.charts.ChartingMacro removed
    com.xpn.xwiki.plugin.charts.ChartingPlugin: Class com.xpn.xwiki.plugin.charts.ChartingPlugin removed
    com.xpn.xwiki.plugin.charts.ChartingPluginApi: Class com.xpn.xwiki.plugin.charts.ChartingPluginApi removed
    com.xpn.xwiki.plugin.charts.CustomXWikiRenderingEngine: Class com.xpn.xwiki.plugin.charts.CustomXWikiRenderingEngine removed
    com.xpn.xwiki.plugin.charts.RadeoxHelper: Class com.xpn.xwiki.plugin.charts.RadeoxHelper removed
    com.xpn.xwiki.plugin.charts.actions.ChartingAction: Class com.xpn.xwiki.plugin.charts.actions.ChartingAction removed
    com.xpn.xwiki.plugin.charts.exceptions.ChartingException: Class com.xpn.xwiki.plugin.charts.exceptions.ChartingException removed
    com.xpn.xwiki.plugin.charts.exceptions.ColumnIndexOutOfBoundsException: Class com.xpn.xwiki.plugin.charts.exceptions.ColumnIndexOutOfBoundsException removed
    com.xpn.xwiki.plugin.charts.exceptions.DataSourceException: Class com.xpn.xwiki.plugin.charts.exceptions.DataSourceException removed
    com.xpn.xwiki.plugin.charts.exceptions.EmptyDataSourceException: Class com.xpn.xwiki.plugin.charts.exceptions.EmptyDataSourceException removed
    com.xpn.xwiki.plugin.charts.exceptions.GenerateException: Class com.xpn.xwiki.plugin.charts.exceptions.GenerateException removed
    com.xpn.xwiki.plugin.charts.exceptions.InvalidArgumentException: Class com.xpn.xwiki.plugin.charts.exceptions.InvalidArgumentException removed
    com.xpn.xwiki.plugin.charts.exceptions.InvalidParamException: Class com.xpn.xwiki.plugin.charts.exceptions.InvalidParamException removed
    com.xpn.xwiki.plugin.charts.exceptions.MissingArgumentException: Class com.xpn.xwiki.plugin.charts.exceptions.MissingArgumentException removed
    com.xpn.xwiki.plugin.charts.exceptions.MissingDataSourceException: Class com.xpn.xwiki.plugin.charts.exceptions.MissingDataSourceException removed
    com.xpn.xwiki.plugin.charts.exceptions.MissingMandatoryParamException: Class com.xpn.xwiki.plugin.charts.exceptions.MissingMandatoryParamException removed
    com.xpn.xwiki.plugin.charts.exceptions.NoHeaderColumnException: Class com.xpn.xwiki.plugin.charts.exceptions.NoHeaderColumnException removed
    com.xpn.xwiki.plugin.charts.exceptions.NoHeaderRowException: Class com.xpn.xwiki.plugin.charts.exceptions.NoHeaderRowException removed
    com.xpn.xwiki.plugin.charts.exceptions.ParamException: Class com.xpn.xwiki.plugin.charts.exceptions.ParamException removed
    com.xpn.xwiki.plugin.charts.exceptions.RowIndexOutOfBoundsException: Class com.xpn.xwiki.plugin.charts.exceptions.RowIndexOutOfBoundsException removed
    com.xpn.xwiki.plugin.charts.params.AbstractChartParam: Class com.xpn.xwiki.plugin.charts.params.AbstractChartParam removed
    com.xpn.xwiki.plugin.charts.params.BooleanChartParam: Class com.xpn.xwiki.plugin.charts.params.BooleanChartParam removed
    com.xpn.xwiki.plugin.charts.params.CategoryLabelPositionsChartParam: Class com.xpn.xwiki.plugin.charts.params.CategoryLabelPositionsChartParam removed
    com.xpn.xwiki.plugin.charts.params.ChartParam: Class com.xpn.xwiki.plugin.charts.params.ChartParam removed
    com.xpn.xwiki.plugin.charts.params.ChartParams: Class com.xpn.xwiki.plugin.charts.params.ChartParams removed
    com.xpn.xwiki.plugin.charts.params.ChoiceChartParam: Class com.xpn.xwiki.plugin.charts.params.ChoiceChartParam removed
    com.xpn.xwiki.plugin.charts.params.ColorChartParam: Class com.xpn.xwiki.plugin.charts.params.ColorChartParam removed
    com.xpn.xwiki.plugin.charts.params.DateChartParam: Class com.xpn.xwiki.plugin.charts.params.DateChartParam removed
    com.xpn.xwiki.plugin.charts.params.DateFormatChartParam: Class com.xpn.xwiki.plugin.charts.params.DateFormatChartParam removed
    com.xpn.xwiki.plugin.charts.params.DateTickMarkPositionChartParam: Class com.xpn.xwiki.plugin.charts.params.DateTickMarkPositionChartParam removed
    com.xpn.xwiki.plugin.charts.params.DateTickUnitChartParam: Class com.xpn.xwiki.plugin.charts.params.DateTickUnitChartParam removed
    com.xpn.xwiki.plugin.charts.params.DefaultChartParams: Class com.xpn.xwiki.plugin.charts.params.DefaultChartParams removed
    com.xpn.xwiki.plugin.charts.params.DefaultChartParams2: Class com.xpn.xwiki.plugin.charts.params.DefaultChartParams2 removed
    com.xpn.xwiki.plugin.charts.params.DoubleChartParam: Class com.xpn.xwiki.plugin.charts.params.DoubleChartParam removed
    com.xpn.xwiki.plugin.charts.params.FloatChartParam: Class com.xpn.xwiki.plugin.charts.params.FloatChartParam removed
    com.xpn.xwiki.plugin.charts.params.FontChartParam: Class com.xpn.xwiki.plugin.charts.params.FontChartParam removed
    com.xpn.xwiki.plugin.charts.params.HorizontalAlignmentChartParam: Class com.xpn.xwiki.plugin.charts.params.HorizontalAlignmentChartParam removed
    com.xpn.xwiki.plugin.charts.params.IntegerChartParam: Class com.xpn.xwiki.plugin.charts.params.IntegerChartParam removed
    com.xpn.xwiki.plugin.charts.params.ListChartParam: Class com.xpn.xwiki.plugin.charts.params.ListChartParam removed
    com.xpn.xwiki.plugin.charts.params.LocaleChartParam: Class com.xpn.xwiki.plugin.charts.params.LocaleChartParam removed
    com.xpn.xwiki.plugin.charts.params.MapChartParam: Class com.xpn.xwiki.plugin.charts.params.MapChartParam removed
    com.xpn.xwiki.plugin.charts.params.NumberFormatChartParam: Class com.xpn.xwiki.plugin.charts.params.NumberFormatChartParam removed
    com.xpn.xwiki.plugin.charts.params.NumberTickUnitChartParam: Class com.xpn.xwiki.plugin.charts.params.NumberTickUnitChartParam removed
    com.xpn.xwiki.plugin.charts.params.PlotOrientationChartParam: Class com.xpn.xwiki.plugin.charts.params.PlotOrientationChartParam removed
    com.xpn.xwiki.plugin.charts.params.Point2DChartParam: Class com.xpn.xwiki.plugin.charts.params.Point2DChartParam removed
    com.xpn.xwiki.plugin.charts.params.RangeTypeChartParam: Class com.xpn.xwiki.plugin.charts.params.RangeTypeChartParam removed
    com.xpn.xwiki.plugin.charts.params.RectangleAnchorChartParam: Class com.xpn.xwiki.plugin.charts.params.RectangleAnchorChartParam removed
    com.xpn.xwiki.plugin.charts.params.RectangleEdgeChartParam: Class com.xpn.xwiki.plugin.charts.params.RectangleEdgeChartParam removed
    com.xpn.xwiki.plugin.charts.params.RectangleInsetsChartParam: Class com.xpn.xwiki.plugin.charts.params.RectangleInsetsChartParam removed
    com.xpn.xwiki.plugin.charts.params.RendererClassChartParam: Class com.xpn.xwiki.plugin.charts.params.RendererClassChartParam removed
    com.xpn.xwiki.plugin.charts.params.ShapeChartParam: Class com.xpn.xwiki.plugin.charts.params.ShapeChartParam removed
    com.xpn.xwiki.plugin.charts.params.StringChartParam: Class com.xpn.xwiki.plugin.charts.params.StringChartParam removed
    com.xpn.xwiki.plugin.charts.params.StrokeChartParam: Class com.xpn.xwiki.plugin.charts.params.StrokeChartParam removed
    com.xpn.xwiki.plugin.charts.params.TimePeriodClassChartParam: Class com.xpn.xwiki.plugin.charts.params.TimePeriodClassChartParam removed
    com.xpn.xwiki.plugin.charts.params.VerticalAlignmentChartParam: Class com.xpn.xwiki.plugin.charts.params.VerticalAlignmentChartParam removed
    com.xpn.xwiki.plugin.charts.plots.AreaPlotFactory: Class com.xpn.xwiki.plugin.charts.plots.AreaPlotFactory removed
    com.xpn.xwiki.plugin.charts.plots.BarPlotFactory: Class com.xpn.xwiki.plugin.charts.plots.BarPlotFactory removed
    com.xpn.xwiki.plugin.charts.plots.CategoryPlotFactory: Class com.xpn.xwiki.plugin.charts.plots.CategoryPlotFactory removed
    com.xpn.xwiki.plugin.charts.plots.LinePlotFactory: Class com.xpn.xwiki.plugin.charts.plots.LinePlotFactory removed
    com.xpn.xwiki.plugin.charts.plots.PiePlotFactory: Class com.xpn.xwiki.plugin.charts.plots.PiePlotFactory removed
    com.xpn.xwiki.plugin.charts.plots.PlotFactory: Class com.xpn.xwiki.plugin.charts.plots.PlotFactory removed
    com.xpn.xwiki.plugin.charts.plots.TableXYDatasetFactory: Class com.xpn.xwiki.plugin.charts.plots.TableXYDatasetFactory removed
    com.xpn.xwiki.plugin.charts.plots.TimePlotFactory: Class com.xpn.xwiki.plugin.charts.plots.TimePlotFactory removed
    com.xpn.xwiki.plugin.charts.plots.TimeSeriesCollectionFactory: Class com.xpn.xwiki.plugin.charts.plots.TimeSeriesCollectionFactory removed
    com.xpn.xwiki.plugin.charts.plots.XYPlotFactory: Class com.xpn.xwiki.plugin.charts.plots.XYPlotFactory removed
    com.xpn.xwiki.plugin.charts.source.DataSource: Class com.xpn.xwiki.plugin.charts.source.DataSource removed
    com.xpn.xwiki.plugin.charts.source.DataSourceFactory: Class com.xpn.xwiki.plugin.charts.source.DataSourceFactory removed
    com.xpn.xwiki.plugin.charts.source.DefaultDataSource: Class com.xpn.xwiki.plugin.charts.source.DefaultDataSource removed
    com.xpn.xwiki.plugin.charts.source.MainDataSourceFactory: Class com.xpn.xwiki.plugin.charts.source.MainDataSourceFactory removed
    com.xpn.xwiki.plugin.charts.source.ObjectDataSourceFactory: Class com.xpn.xwiki.plugin.charts.source.ObjectDataSourceFactory removed
    com.xpn.xwiki.plugin.charts.source.ObjectidDataSourceFactory: Class com.xpn.xwiki.plugin.charts.source.ObjectidDataSourceFactory removed
    com.xpn.xwiki.plugin.charts.source.TableDataSource: Class com.xpn.xwiki.plugin.charts.source.TableDataSource removed
    com.xpn.xwiki.plugin.charts.source.TableDataSourceFactory: Class com.xpn.xwiki.plugin.charts.source.TableDataSourceFactory removed
    com.xpn.xwiki.plugin.charts.wizard.DatasourceDefaultsHelper: Class com.xpn.xwiki.plugin.charts.wizard.DatasourceDefaultsHelper removed
    com.xpn.xwiki.plugin.charts.wizard.FontHelper: Class com.xpn.xwiki.plugin.charts.wizard.FontHelper removed
  • TODOAndreas, please explain why we have to break backward compatibility for the Chart module.
    org.xwiki.chart.model.ChartModel: Method 'public org.jfree.chart.axis.Axis getAxis(int)' has been added to an interface
    org.xwiki.chart.model.ChartModel: Method 'public java.lang.Number getCellValue(int, int)' has been removed
    org.xwiki.chart.model.ChartModel: Method 'public int getColumnCount()' has been removed
    org.xwiki.chart.model.ChartModel: Method 'public java.lang.String getColumnHeader(int)' has been removed
    org.xwiki.chart.model.ChartModel: Method 'public org.jfree.data.general.Dataset getDataset()' has been added to an interface
    org.xwiki.chart.model.ChartModel: Method 'public int getRowCount()' has been removed
    org.xwiki.chart.model.ChartModel: Method 'public java.lang.String getRowHeader(int)' has been removed
    org.xwiki.chart.model.DefaultChartModel: Class org.xwiki.chart.model.DefaultChartModel removed
    org.xwiki.rendering.macro.chart.ChartDataSource: Field PARAMS has been removed, but it was previously a constant
    org.xwiki.rendering.macro.chart.ChartDataSource: Field SOURCE has been removed, but it was previously a constant
Tags:
   

Get Connected