Yes we already have this information and there is an internal API to get it. See DistributionInternalScriptService.
On Sat, Jun 17, 2017 at 11:37 AM, Vincent Massol <[email protected]> wrote: > Hi devs, > > I’d like to propose that we also save the previous version of XWiki when we > upgrade. I can think of 2 use cases for that: > > * After the user upgrades we display a What’s New (could be something in the > notification area, in the Admin UI home page, as a popup on the first > connexion after the upgrade, etc) and we take the data from the Release Notes > app on xwiki.org using the previous version information to list what’s new. > > * When a user reports a problem of upgrade, we can ask him to tell us the > previous version that is stored. > > WDYT? > > Note that the info should probably be stored somewhere in the permanent > directory. It could even be stored in the existing status.xml file. > > EDIT: Actually it could already exist maybe. I’ve just checked > distribution/status.xml on xwiki.org and I can see: > > <previousDistributionExtension> > <id>org.xwiki.enterprise:xwiki-enterprise-web</id> > <version class="org.xwiki.extension.version.internal.DefaultVersion" > serialization="custom"> > <org.xwiki.extension.version.internal.DefaultVersion> > <string>8.4.4</string> > </org.xwiki.extension.version.internal.DefaultVersion> > </version> > <hashCode>-1</hashCode> > </previousDistributionExtension> > <previousDistributionExtensionUi> > <id>org.xwiki.enterprise:xwiki-enterprise-ui-mainwiki</id> > <version class="org.xwiki.extension.version.internal.DefaultVersion" > reference="../../previousDistributionExtension/version"/> > <hashCode>-1</hashCode> > </previousDistributionExtensionUi> > <distributionExtension> > <id>org.xwiki.enterprise:xwiki-enterprise-web</id> > <version class="org.xwiki.extension.version.internal.DefaultVersion" > serialization="custom"> > <org.xwiki.extension.version.internal.DefaultVersion> > <string>8.4.4</string> > </org.xwiki.extension.version.internal.DefaultVersion> > </version> > <hashCode>-1</hashCode> > </distributionExtension> > > @Thomas: Any idea with previous version = new version = 8.4.4? > @Thomas: Do we have an API to get that info from a velocity script for > example (or from Java)? > > Thanks > -Vincent > -- Thomas Mortagne

