On Thu, Sep 19, 2013 at 9:10 AM, Marius Dumitru
Florea
<mariusdumitru.florea(a)xwiki.com> wrote:
On Wed, Sep 18, 2013 at 4:13 PM, Thomas Mortagne
<thomas.mortagne(a)xwiki.com> wrote:
On Wed, Sep 18, 2013 at 3:08 PM, Marius Dumitru
Florea
<mariusdumitru.florea(a)xwiki.com> wrote:
On Wed, Sep 18, 2013 at 12:26 PM, Thomas
Mortagne
<thomas.mortagne(a)xwiki.com> wrote:
> On Wed, Sep 18, 2013 at 11:09 AM, Guillaume "Louis-Marie" Delhumeau
> <gdelhumeau(a)xwiki.com> wrote:
>> Hi devs.
>> I am testing the migration from XEM 4.5.4 to XE 5.2 (local build). Sorin
>> has already reported some problems in JIRA.
>> For me, the problem occurs when I use the "upgrade all wikis" option.
>>
>> Let me explain it:
>>
>> = Prerequisites =
>>
>> 1. Install a new XEM 4.5.4.
>> 2. Create a workspace with WorkspaceManager (called 'workspace1')
>> 3. Create a new subwiki with WikiManager (called 'subwiki1') - I create
it
>> from a XAR template which is xwiki-enterprise-ui-all.
>>
>> = Upgrade, part 1 =
>>
>> 1. Replace the webapp with a 5.2.
>> 2. Put your own maven directory as the extension repository. (in
>> xwiki.properties:
>> extension.repositories=local:maven:file://${sys:user.home}/.m2/repository)
>> 3. Upgrade the main wiki
>>
>> It works:
>> - For example Main.SpaceIndex is in version 2.1.
>> - In the "installed extensions" menu, I can see all extensions
correctly
>> upgraded.
>>
>> = Upgrade, part 2 =
>>
>> == Scenario 1 ==
>> 1. In the DW, choose "Upgrade all wikis. Choose this option if all wikis
>> are administrated by the same entity.".
>> It displays "All extensions are up to date. "
>>
>> But:
>> 'workspace1' is not upgraded:
>> - for example Panels.WorkspaceInformationPanel is still in version 1.1
>> - In the "installed extensions" menu, I see 'XWiki Enterprise - UI
All'. It
>> has not been upgraded because there is no new version for it. It has been
>> replaced by xwiki-enterprise-ui-wiki-all.
>>
>> 'subwiki1' is not upgraded:
>> - for example Main.SpaceIndex is still in version 1.1
>> - In the "installed extensions" menu, I see 'XWiki Enterprise - UI
All '
>> with the message 'Installed but not valid'. It has not been upgraded
>> because there is no new version for it. It has been replaced by
>> xwiki-enterprise-ui-common.
>>
>> == Scenario 2 ==
>> 1. In the DW, choose "Upgrade only the current wiki. Choose this option if
>> each wiki is administrated by a separate entity. In this case it's best if
>> each wiki is upgraded by its owner. ".
>> 2. Go to every subwiki, logged as Admin. You will see the DW.
>
>> 3. Select "Yes, this is an upgrade".
>
> I don't understand this part, it's not supposed to ask you if it's an
> upgrade. You are supposed to get this question only for old previous
> wikis where there was no extensions registered corresponding to the
> installed pages.
>
> Marius ?
I have this code:
#macro (displayDefaultUIExtension $distributionUIId)
#set ($installedVersion =
$services.extension.getInstalledExtension($distributionUIId.id,
$extensionNamespace))
...
#set ($discard = "#getExtensionJobStatus($distributionUIId.id
$distributionUIId.version.value $distributionUIJobStatus)")
#if (!$installedVersion && (!$distributionUIJobStatus ||
$distributionUIJobStatus.state == 'FINISHED'))
## There is no previous version of the default UI installed on the
current wiki and there is no job running for
## the default UI either.
#set ($documentCount = $xwiki.countDocuments(''))
#if ($distributionState == 'NEW' && $documentCount > 30)
## There are documents in the database but there is no info
about the default UI that was previously installed.
#repairPreviousUI()
#elseif ($distributionState == 'DIFFERENT')
## TODO: Display the previous distribution UI extension to let
the user uninstall it.
#end
#end
...
#end
So $distributionUIId is probably
'org.xwiki.enterprise:xwiki-enterprise-ui-wiki' and $installedVersion
is null because EM doesn't think it's installed. The installed version
is probably xwiki-enterprise-ui. The the upgrade question is displayed
because the id of the default UI has changed. Is there are way to
improve the condition on my side or should EM detect that
'xwiki-enterprise-ui' is a previous version of
'xwiki-enterprise-ui-wiki'?
We talked about it already and the issue is that
you are searching for
xwiki-enterprise-ui-wiki id that you will obviously don't find, you
need to test all features of xwiki-enterprise-ui-wiki. A some point
you worked around it by putting an hardcoded list somewhere of all the
previous ids of XE AFAIK so you could probably just update it but the
best really would be to to it properly by looking at features.
The hard-coded list of XE/XEM XAR ids is still used but only when
repairing the installed UI (when DW doesn't know which version is
currently installed).
I'll update the code to take into account all the features (recursively?).
The last version is supposed to contains all previous names so no need
to do it recursively.