Technical and graphic migration from 4.0 to 4.1


  1. Compatibility table plugins
  2. Database
  3. New configuration parameters
  4. Technical migration
    1. Update runtime files.xml
    2. Update of plugins (plugin.xml)
    3. Updating workflow files
      1. Front-office modification
      2. Reference table
      3. Depublishing workflow
      4. Content synchronization
    4. Dependencies ivy
    5. Widget "edition.select-page"
    6. API (java)
      1. Change ofAPI on ContentHelper
    7. Reference table
    8. JS renderers and converters (for search engines)
    9. New icons and decorators
    10. Authentication token
  5. Graphics migration
    1. Resized images
    2. Login page CMS
    3. HTML5 player for video and audio galleries
    4. Plugins Zimbra 1.1.0, Exchange 1.1.0, Bluemind 2.1.0
  6. Server Solr
  7. Data migration
    1. Plugin Link directory 2.2.x

 

Compatibility table plugins

Refer to the plugins compatibility table and increment the versions of your plugins (take the most recent 4.1-compatible version for each plugin ): Plugins

Database

The structure of the SQL Authentication_Token table has changed. Delete it so that it can be recreated correctly, or modify the table to add the Creation_Date (DATETIME) column.

MySQL

ALTER TABLE Authentication_Token ADD creation_date datetime;  
ALTER TABLE Authentication_Token ADD last_update_date datetime;  

The rights identifier linked to the reference tables has been modified. Run the following script on the rights DB:

Update rights identifier

#Si besoin il faut passer en safe updates  
#SET SQL_SAFE_UPDATES = 0;  
update Rights_ProfileRights set Right_Id='CMS_Rights_ReferenceTables' Where Right_Id='CMS_Rights_SimpleContents';  
update Rights_ProfileRights set Right_Id='CMS_Rights_ReferenceTables_Create' Where Right_Id='CMS_Rights_SimpleContents_Create';  
update Rights_ProfileRights set Right_Id='CMS_Rights_ReferenceTables_Delete' Where Right_Id='CMS_Rights_SimpleContents_Delete';  
update Rights_ProfileRights set Right_Id='CMS_Rights_ReferenceTables_Import' Where Right_Id='CMS_Rights_SimpleContents_Import';  
#SET SQL_SAFE_UPDATES = 1;  

The assignment of rights to reference tables is stored in the database under the "/reference-tables" context, formerly "/simple-contents".

You must either manually reassign your rights to these content types, or update the database using the following scripts:

MySQL

#Si besoin il faut passer en safe updates  
#SET SQL_SAFE_UPDATES = 0;  
update Rights_AllowedGroups set Context = CONCAT('/reference-tables', SUBSTR(context, 17, LENGTH(context))) Where Context like '/simple-contents%';  
update Rights_AllowedUsers set Context = CONCAT('/reference-tables', SUBSTR(context, 17, LENGTH(context))) Where Context like '/simple-contents%';  
update Rights_AllowedProfilesAnonym set Context = CONCAT('/reference-tables', SUBSTR(context, 17, LENGTH(context))) Where Context like '/simple-contents%';  
update Rights_AllowedProfilesAnyCon set Context = CONCAT('/reference-tables', SUBSTR(context, 17, LENGTH(context))) Where Context like '/simple-contents%';  
update Rights_DeniedGroups set Context = CONCAT('/reference-tables', SUBSTR(context, 17, LENGTH(context))) Where Context like '/simple-contents%';  
update Rights_DeniedUsers set Context = CONCAT('/reference-tables', SUBSTR(context, 17, LENGTH(context))) Where Context like '/simple-contents%';  
update Rights_DeniedProfilesAnonym set Context = CONCAT('/reference-tables', SUBSTR(context, 17, LENGTH(context))) Where Context like '/simple-contents%';  
update Rights_DeniedProfilesAnyCon set Context = CONCAT('/reference-tables', SUBSTR(context, 17, LENGTH(context))) Where Context like '/simple-contents%';  
#SET SQL_SAFE_UPDATES = 1;  

Derby

update rights_allowedusers set Context = '/reference-tables' || SUBSTR(context, 17, LENGTH(context)) Where Context like '/simple-contents%';  
update rights_allowedgroups set Context = '/reference-tables' || SUBSTR(context, 17, LENGTH(context)) Where Context like '/simple-contents%';  
update rights_allowedprofilesanonym set Context = '/reference-tables' || SUBSTR(context, 17, LENGTH(context)) Where Context like '/simple-contents%';  
update rights_allowedprofilesanycon set Context = '/reference-tables' || SUBSTR(context, 17, LENGTH(context)) Where Context like '/simple-contents%';  
update rights_deniedgroups set Context = '/reference-tables' || SUBSTR(context, 17, LENGTH(context)) Where Context like '/simple-contents%';  
update rights_deniedusers set Context = '/reference-tables' || SUBSTR(context, 17, LENGTH(context)) Where Context like '/simple-contents%';  
update rights_deniedprofilesanonym set Context = '/reference-tables' || SUBSTR(context, 17, LENGTH(context)) Where Context like '/simple-contents%';  
update rights_deniedprofilesanycon set Context = '/reference-tables' || SUBSTR(context, 17, LENGTH(context)) Where Context like '/simple-contents%';  

New configuration parameters

When you restart the application, you will be prompted for two new configuration parameters:

  • Search and Index > Server Solr > Solr IP address (cms.solr.core.allowedips)
    Enter server IP address Solr or leave blank if you don't want to protect Solr -> requests. CMS

  • Websites > Front-offices > Empty full cache on startup (web.invalidate.focache.scheduler.enabled)
    Enables site cache to be emptied each time CMS is restarted.
    If the CMS and site applications are on the same server, you don't need to check this box.

Technical migration

Update runtime files.xml

In the file WEB-INF/param/runtime.xml of the applications CMS and site, replace :

http://www.ametys.org/schema/runtime/runtime-4.0.xsd  

by

http://www.ametys.org/schema/runtime/runtime-4.1.xsd  

In the WEB-INF/param/runtime.xml file for thesite application only, replace :

<workspaces default="site"/>  

by

<workspaces default="site">  
     <theme>  
         <workspace name="admin">ametys-admin-site</workspace>  
     </theme>  
</workspaces>  

Dans le fichier WEB-INF/param/runtime.xml de l'application CMS, vous pouvez supprimer les lignes suivantes de la section <exclude>

<feature>explorer/explorer.other.rights</feature>  
<feature>explorer/explorer.calendar.rights</feature>  
<feature>explorer/explorer.threads.rights</feature>  
<feature>explorer/explorer.calendars</feature>  

 

Finally, delete the line containing:

<org.ametys.plugins.repository.provider.WorkspaceSelector>...</org.ametys.plugins.repository.provider.WorkspaceSelector>   

 

Update of plugins (plugin.xml)

In the header

http://www.ametys.org/schema/plugin-2.0.xsd

by

http://www.ametys.org/schema/plugin-4.0.xsd

Updating workflow files

Front-office modification

This section applies to you if you use plugin for front-office editing (front-edition).

To authorize the insertion of attachments to front-office content, a workflow action must be added to the WEB-INF/param/workflow-edition-fo file. xml

In state (step) 1, add:

<!--  Edit attachments -->  
<action id="12" name="plugin.default-workflow:WORKFLOW_ACTION_ATTACH">  
    <restrict-to>  
        <conditions type="AND">  
            <condition type="avalon">  
                <arg name="role">org.ametys.cms.workflow.LockCondition</arg>  
            </condition>  
            <condition type="avalon">  
                <arg name="role">org.ametys.cms.workflow.ContentCheckRightsCondition</arg>  
                <arg name="right">Front_Edition_Access_Right</arg>  
            </condition>  
        </conditions>  
    </restrict-to>  
    <results>  
        <unconditional-result old-status=" " status=" " step="1" />  
    </results>  
    <post-functions>  
        <function type="avalon">  
            <arg name="role">org.ametys.cms.workflow.SetCurrentStepIdAndNotifyFunction</arg>  
        </function>  
        <function type="avalon">  
            <arg name="role">org.ametys.cms.workflow.CreateVersionFunction</arg>  
        </function>  
        <function type="avalon">  
            <arg name="role">org.ametys.web.workflow.ValidateContentFunction</arg>  
        </function>  
        <function type="avalon">  
            <arg name="role">org.ametys.cms.workflow.ValidationStepFunction</arg>  
        </function>  
    </post-functions>  
</action>  

In addition, no rights were checked on the edition. In action n°2, replace the existing condition with :

<restrict-to>  
    <conditions type="AND">  
        <condition type="avalon">  
            <arg name="role">org.ametys.cms.workflow.LockCondition</arg>  
        </condition>  
        <condition type="avalon">  
            <arg name="role">org.ametys.cms.workflow.ContentCheckRightsCondition</arg>  
            <arg name="right">Front_Edition_Access_Right</arg>  
        </condition>  
    </conditions>  
</restrict-to>  

Refer to the workflow-editionfo file.xml of the demo template in case of doubt.
https://code.ametys.org/projects/WEB/repos/template-web/browse/webapp/cms/WEB-INF/param/workflow-editionfo.xml?at=refs%2Fheads%2F4.1.x

Reference table

  • rename workflow-simple-content.xml to workflow-reference-table.xml
  • in the same file, replace:
    org.ametys.cms.workflow.CreateSimpleContentFunction
    with
    org.ametys.cms.workflow.CreateReferenceTableContentFunction
  • Dans le fichier workflows.xml, remplacer :
    <workflow name="simple-content" type="file" location="workflow-simple-content.xml"/>
    par
    <workflow name="reference-table" type="file" location="workflow-reference-table.xml"/>

Depublishing workflow

In your workflow files, look for the unpublish action (normally #10) and add the post-function org.ametys.cms.workflow.SetCurrentStepIdAndNotifyFunction
The absence of this post-function was responsible for this outcome https://issues.ametys.org/browse/CMS -8648

<action id="10" name="plugin.default-workflow:WORKFLOW_ACTION_UNPUBLISH">  
    <restrict-to>  
        <conditions type="AND">  
            <condition type="avalon">  
                <arg name="role">org.ametys.cms.workflow.ContentCheckRightsCondition</arg>  
                <arg name="right">Workflow_Rights_Unpublish</arg>  
            </condition>  
            <condition type="avalon">  
                <arg name="role">org.ametys.cms.workflow.LockCondition</arg>  
            </condition>  
            <condition type="avalon">  
                <arg name="role">org.ametys.web.workflow.ContentPublishedCondition</arg>  
            </condition>  
        </conditions>  
    </restrict-to>  
    <pre-functions>  
        <function type="avalon">  
            <arg name="role">org.ametys.web.workflow.UnpublishContentFunction</arg>  
        </function>  
    </pre-functions>  
    <results>  
        <unconditional-result old-status=" " status=" " step="1" />  
    </results>  
    <post-functions>  
        <function type="avalon">  
            <arg name="role">org.ametys.cms.workflow.SetCurrentStepIdAndNotifyFunction</arg>  
        </function>  
    </post-functions>  
</action>  

Content synchronization

If you use plugin ContentIO and its workflow file workflow-contentio.xml, synchronization actions 810, 820 and 830 have been combined into a single action 800 with conditional results.

Ajoutez l'action 800 suivante dans la section <common-actions>

<!-- Synchronize -->  
<action id="800" name="plugin.contentio:WORKFLOW_ACTION_SYNCHRONIZE">  
 <restrict-to>  
     <conditions type="AND">  
         <condition type="avalon">  
             <arg name="role">org.ametys.cms.workflow.LockCondition</arg>  
            </condition>  
            <condition  type="avalon">  
             <arg name="role">org.ametys.plugins.contentio.synchronize.workflow.ValidateMetadataSynchronizeCondition</arg>  
                <arg name="validation-step">3</arg>  
            </condition>  
        </conditions>  
 </restrict-to>  
    <results>  
     <result old-status=" " status=" " step="1">  
         <conditions type="AND">  
             <condition type="avalon">  
                 <arg name="role">org.ametys.cms.workflow.ContentCurrentStepCondition</arg>  
                    <arg name="step">1</arg>  
                </condition>  
            </conditions>  
            <post-functions>  
             <function type="avalon">  
             <arg name="role">org.ametys.cms.workflow.SetCurrentStepIdAndNotifyFunction</arg>  
             </function>  
            </post-functions>  
        </result>  
        <result old-status=" " status=" " step="2">  
         <conditions type="AND">  
             <condition type="avalon">  
                 <arg name="role">org.ametys.cms.workflow.ContentCurrentStepCondition</arg>  
                    <arg name="step">2</arg>  
                </condition>  
            </conditions>  
         <post-functions>  
             <function type="avalon">  
                 <arg name="role">org.ametys.cms.workflow.SetCurrentStepIdAndNotifyFunction</arg>  
                </function>  
            </post-functions>  
       </result>  
        <result old-status=" " status=" " step="3">  
         <conditions type="AND">  
             <condition type="avalon">  
                 <arg name="role">org.ametys.cms.workflow.ContentCurrentStepCondition</arg>  
                    <arg name="step">3</arg>  
                </condition>  
           </conditions>  
            <post-functions>  
             <function type="avalon">  
                 <arg name="role">org.ametys.plugins.contentio.synchronize.workflow.ValidateSynchronizedContentFunction</arg>  
                </function>  
            <function type="avalon">  
                 <arg name="role">org.ametys.cms.workflow.ValidationStepFunction</arg>  
                </function>  
           </post-functions>  
      </result>  
        <unconditional-result old-status=" " status=" " step="1"/>  
 </results>  
</action>  

Puis supprimez les actions 810, 820, et 830 et les remplacer par la référence à l'action 800 : <common-action id="800" />. Attention, veiller à bien ordonner les action et common-action : d'abord lister les common-action ensuite les actions.

You can also retrieve the workflow-contentio.xml file from the demo template if you haven't made any customizations to this file.

This modification simplifies our workflow files, but the downside is that in the history of content previously synchronized with actions 810, 820 or 830 you'll see "Action unknown" on the few transitions.

Dependencies ivy

If you use project spaces (plugin workspaces), add this line toivy.xml for your site application only:

<dependency org="org.ametys.plugins" name="workspaces-site" branch="1.0.x" rev="latest.release" conf="site_compile,site->default"/>  

Widget "edition.select-page"

A widget parameter has been renamed, and a new parameter has been added.

Search all your files at plugin.xml:

<param name="foSearchModeField">  

and replace with :

<param name="enableWithFieldName">ancienne valeur de foSearchModeField</param>  
<param name="enableOnFieldValues">criteria-only</param>  

 

API (java)

Change ofAPI on ContentHelper

TheAPI java of the org.ametys.cms.content.ContentHelper class has been modified:

The following methods :

  • getMetadataValue(Content content, String metadataPath, boolean resolveReferences)
  • getMetadataValue(Content content, String metadataPath, boolean resolveReferences, boolean returnNullValues)
  • getMetadataValue(CompositeMetadata metadataHolder, MetadataDefinition definition, String metadataPath, boolean resolveReferences, boolean returnNullValues)
  • getMetadataValues(Content content, String metadataPath, boolean resolveReferences, boolean returnNullValues)

become:

  • getMetadataValue(Content content, String metadataPath, Locale defaultLocale, boolean resolveReferences)
  • getMetadataValue(Content content, String metadataPath, Locale defaultLocale, boolean resolveReferences, boolean returnNullValues)
  • getMetadataValue(CompositeMetadata metadataHolder, MetadataDefinition definition, String metadataPath, Locale locale, boolean resolveReferences, boolean returnNullValues)
  • getMetadataValues(Content content, String metadataPath, Locale defaultLocale, boolean resolveReferences, boolean returnNullValues)

The additional "defaultLocale" argument resolves multilingual metadata to the correct locale.
If your content is not multilingual content, or if you don't use multilingual metadata, you can set this argument to null .

If you use this helper in your application's java classes, make the necessary changes.

Reference table

Content types called "simple" become "reference table" content types.
All "reference table" content types have their own search tool, accessible from the "Reference table" menu.
The notion of simple content still exists, i.e. content types with only the metadata of simple types, with no composites or repeaters. A reference table is not necessarily a simple content type.

 

In all your content type definitions :

1) Find widget edition.select-simple-content and replace it with edition.select-referencetable-content

2) Remplacez le tag <cms:tag>simple</cms:tag> par <cms:tag>reference-table</cms:tag>

JS renderers and converters (for search engines)

These JS functions have been moved. If you're defining search patterns, then you're probably referencing some of them.

Search XML Ametys.cms.content.EditContentsGrid.render and replace with Ametys.plugins.cms.search.SearchGridHelper.render

Search the files XML Ametys.cms.content.EditContentsGrid.convert and replace with Ametys.plugins.cms.search.SearchGridHelper.convert

New icons and decorators

Dans le template, le fichier default-workflow/plugin.xml a été modifié par l'ajout de <icon-decorator-type> suivant les balises <icon-decorator>. Faire un diff avec le template par exemple pour ajouter ces nouvelles balises. 
 

Authentication token

Tokens are now encoded in base 64, so the old ones are no longer valid.

No migration is planned for existing tokens, which must be revoked and recreated.

Graphics migration

Resized images

In all your XSL files, look for the use of the resolveBoundedImage method with 4 arguments resolveBoundedImage(String type, String uri, int maxHeight, int maxWidth)

In this method, height and width were inverted by mistake; now it's maxHeight then maxWidth. Check your calls to this method: make sure that the requested height is the 3rd argument, and the width is the 4th argument.

You can search and replace in Eclipse with :

  • rechercher : resolveBoundedImage\s*\(([^(,)]+|[^,)]+\([^)]+\)[^,)]+),([^(,)]+|[^(,)]*\([^()]*\)[^(,)]*),([^(,)]+|[^(,)]*\([^()]*\)[^(,)]*),([^(,)]+|[^(,)]*\([^()]*\)[^(,)]*)\)
  • replace with: resolveBoundedImage($1,$2,$4,$3)

Don't forget to check "Regular expression"!

Login page CMS

The WEB-INF/param/login.xsl file has been redone.
This file is optional, but if you have customized it in your application, start from the one in the web template https://code.ametys.org/projects/WEB/repos/template-web/browse/webapp/cms/WEB-INF/param/login.xsl?at=4.1.x

In addition, the following i18n keys must be modified ( WEB-INF catalog/i18n/application*.xml)

<!-- login.xsl -->  
<message key="LOGIN_SCREEN_INTRO_AMETYS_TITLE">Essayez Ametys</message>  
<message key="LOGIN_SCREEN_INTRO_AMETYS_DESCRIPTION"></message>  
<message key="LOGIN_SCREEN_INTRO_AMETYS_AVAILABLE_IDENTIFIERS">Les identifiants suivants sont disponibles :</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_TITLE">Rejoignez la communauté Ametys</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_DESCRIPTION">Les ressources suivantes vous permettront de trouver la documentation et le support dont vous pourriez avoir besoin.</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_WEBSITE">Site web www.ametys.org</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_DOC">Documentation Wiki Ametys</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_FORUM">Forum de la communauté</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_ISSUES">Signalisation de bugs et demandes d'évolutions</message>  
<message key="LOGIN_SCREEN_INTRO_NETWORKS_TITLE">Suivez-nous sur les réseaux :</message>  
<message key="LOGIN_SCREEN_INTRO_NETWORKS_FACEBOOK">Suivez-nous sur Facebook</message>  
<message key="LOGIN_SCREEN_INTRO_NETWORKS_TWITTER">Suivez-nous sur Twitter</message>  
<message key="LOGIN_SCREEN_INTRO_NETWORKS_GOOGLE_PLUS">Suivez-nous sur Google+</message>  
  
<!-- login.xsl -->  
<message key="LOGIN_SCREEN_INTRO_AMETYS_TITLE">Try Ametys</message>  
<message key="LOGIN_SCREEN_INTRO_AMETYS_DESCRIPTION"></message>  
<message key="LOGIN_SCREEN_INTRO_AMETYS_AVAILABLE_IDENTIFIERS">The following identifiers are available:</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_TITLE">Join the Ametys community</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_DESCRIPTION">The following resources will allow you to find the documentation and support you need:</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_WEBSITE">www.ametys.org website</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_DOC">Ametys wiki documentation</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_FORUM">Community forum</message>  
<message key="LOGIN_SCREEN_INTRO_RESOURCES_ISSUES">Features and issues tracking</message>  
<message key="LOGIN_SCREEN_INTRO_NETWORKS_TITLE">Follow us on social media</message>  
<message key="LOGIN_SCREEN_INTRO_NETWORKS_FACEBOOK">Follow us on Facebook</message>  
<message key="LOGIN_SCREEN_INTRO_NETWORKS_TWITTER">Follow us on Twitter</message>  
<message key="LOGIN_SCREEN_INTRO_NETWORKS_GOOGLE_PLUS">Follow us on Google+</message  

HTML5 player for video and audio galleries

Version 2.1.0 of plugin multimedia replaces the Flash player with an HTML5 player: Plugin Multimedia v2.1.0 - What's new
As a result, the FLV format is no longer supported, in favor of mp4, ogv, ogg and webm formats.

If you have video galleries that use FLV files, you will need to migrate them to the supported formats.
If you have overloaded the gallery rendering, you will certainly need to repeat your overload: Plugin Multimedia - Graphics migration manual 2.0.0 to 2.1.0

In addition, to be able to view videos or audio files inserted into your content in "wrapped" mode (=off-page content), you need to add the CSS and JS provided by plugin "mediaelement" to XSL for rendering "wrapped" content.
To do this, for all your graphic charters, modify the file skins/[SKIN_NAME ]/stylesheets/content/_wrapper/content.xsl, to add a call to the XSL templates"head-js-mediaelement" and"head-css -mediaelement".

 

<xsl:call-template name="head-js-jquery"/>                       
<xsl:call-template name="head-js-pirobox"/>    
<xsl:call-template name="head-js-mediaelement"/>                      
                 
<xsl:call-template name="head-css-jquery"/>                      
<xsl:call-template name="head-css-pirobox"/>  
<xsl:call-template name="head-css-mediaelement"/>  

Plugins Zimbra 1.1.0, Exchange 1.1.0, Bluemind 2.1.0

plugins Zimbra, Exchange and Bluemind now depend on a common plugin Messaging Connector.

You will need to redefine the cache settings in the configuration parameters.

Graphic integration is identical for these 3 plugins: Plugin Bluemind 2.1.0 - Exchange 1.1.0 - Zimbra 1.1.0

For Bluemind

The input data used is replaced by JS. We have to replace the existing one, and start the integration all over again, following the documentation common to all 3 plugins.

For Exchange and Zimbra

The import of XSL specific to exchange and zimbra must be replaced by that of Messaging connector (see common documentation):

  • <xsl:import href="plugin:exchange://stylesheets/exchange.xsl" /> => <xsl:import href="plugin:messaging-connector://stylesheets/messaging-connector.xsl" />
  • <xsl:import href="plugin:exchange://stylesheets/zimbra.xsl" /> => <xsl:import href="plugin:messaging-connector://stylesheets/messaging-connector.xsl" />

The names of the templates XSL have been changed, but the default parameters and HTML product are identical:

  • script-js-zimbra => script-js-messaging-connector
  • script-js-exchange=> script-js-messaging-connector
  • zimbra-card => messaging-connector-card
  • exchange => messaging-connector-card

If you have overloaded, replace it as soon as possible. xsl

  • <xsl:call-template name="exchange-event-date"/> par <xsl:call-template name="messaging-event-date"/>

  • <xsl:call-template name="exchange-event-subject"/> par  <xsl:call-template name="messaging-event-subject"/>

  • <xsl:call-template name="exchange-event-location"/> par <xsl:call-template name="messaging-event-location"/>

  • <i18n:texti18n:key="PLUGINS_EXCHANGE_CARD_INFOUSER_EXCHANGE_RDV_WAITING" i18n:catalogue="plugin.exchange"/> par <i18n:texti18n:key="PLUGINS_MESSAGINGCONNECTOR_CARD_INFOUSER_MESSAGINGCONNECTOR_RDV_WAITING" i18n:catalogue="plugin.messaging-connector"/>

  • <i18n:texti18n:key="PLUGINS_EXCHANGE_CARD_INFOUSER_EXCHANGE_RDV_ERROR" i18n:catalogue="plugin.exchange"/> par <i18n:texti18n:key="PLUGINS_MESSAGINGCONNECTOR_CARD_INFOUSER_MESSAGINGCONNECTOR_RDV_ERROR" i18n:catalogue="plugin.messaging-connector"/>

  • <i18n:texti18n:key="PLUGINS_EXCHANGE_CARD_INFOUSER_EXCHANGE_RDV_NONE_PART1" i18n:catalogue="plugin.exchange"/> par <i18n:texti18n:key="PLUGINS_MESSAGINGCONNECTOR_CARD_INFOUSER_MESSAGINGCONNECTOR_RDV_NONE_PART1" i18n:catalogue="plugin.messaging-connector"/>

  • <i18n:texti18n:key="PLUGINS_EXCHANGE_CARD_INFOUSER_EXCHANGE_RDV_NONE_PART2" i18n:catalogue="plugin.exchange"/> par <i18n:texti18n:key="PLUGINS_MESSAGINGCONNECTOR_CARD_INFOUSER_MESSAGINGCONNECTOR_RDV_NONE_PART2" i18n:catalogue="plugin.messaging-connector"/>

  • <i18n:text i18n:key="PLUGINS_EXCHANGE_CARD_INFOUSER_EXCHANGE_RDV_NONE_PART3" i18n:catalogue="plugin.exchange"/> par <i18n:text i18n:key="PLUGINS_MESSAGINGCONNECTOR_CARD_INFOUSER_MESSAGINGCONNECTOR_RDV_NONE_PART3" i18n:catalogue="plugin.messaging-connector"/>

Si vous utilisez des clés i18 de l'ancien plugin, vous pouvez remplacer : <category i18n="true">plugin.exchange:PLUGINS_EXCHANGE_LOGIN_CATEGORY</category> par <category i18n="true">plugin.messaging-connector:PLUGINS_MESSAGINGCONNECTOR_CONFIG_CATEGORY</category>

If you have overloaded messages.xml from plugin (WEB-INF\i18n\plugins\exchange), rename the directory and then rename the i18 keys contained in the messages* files.xml

CSS classes are prefixed with "messaging" by default. To keep the "exchange" or "zimbra" prefix, use the script-js-messaging-connector and messaging-connector-card templates, adding the "css-class-prefix" parameter:

Server Solr

The Solr server must be reinstalled.
Download version 4.1 http://releases.ametys.org/release/org.ametys / solr-app/4 .1.x/4.1.0/zips/

Don't keep old indexed data.

After restarting the server, run a full index.

Data migration

Supprimez le fichier custom_nodetypes.xml de votre repository (${AMETYS_HOME}/data/repository/repository/nodetypes/custom_nodetypes.xml) puis redémarrer le serveur avant d’exécuter les scripts suivant :

Service migration Site map

var qm = session.getWorkspace().getQueryManager();  
var query = qm.createQuery("//element(*, ametys:zoneItem)[@ametys-internal:type='SERVICE' and @ametys-internal:service='org.ametys.web.service.SitemapService']/ametys:service_parameters[@ametys:all='criteria-only']", javax.jcr.query.Query.XPATH);  
it = query.execute().getNodes();  
var count = 0;  
while (it.hasNext())  
{  
  var node = it.nextNode();  
  node.setProperty("ametys:all", "select-root");  
  node.save();  
    
  count++  
}  
     
print(count + " services have been updated");  

Migration of content and page upload services

var ConsoleHelper = Java.type('org.ametys.workspaces.repository.ConsoleHelper');  
    
var qm = session.getWorkspace().getQueryManager();  
var query = qm.createQuery("//element(*, ametys:zoneItem)[@ametys-internal:type='SERVICE' and @ametys-internal:service='org.ametys.web.service.FilteredContentsService']", javax.jcr.query.Query.XPATH);  
var nodes = query.execute().getNodes();  
    
var count = 0;  
while (nodes.hasNext())  
{  
    var needSave = false;  
    var node = nodes.next();  
    var paramsNode = node.getNode('ametys:service_parameters');  
            
    if (paramsNode.hasNode('ametys:search'))  
    {  
        var entryNodes = paramsNode.getNode('ametys:search').getNodes();  
          
        while (entryNodes.hasNext())  
        {  
            var entryNode = entryNodes.next();  
              
            if (entryNode.hasProperty('ametys:search-context'))  
            {  
                var searchCtx = entryNode.getProperty('ametys:search-context').getString();  
                if (searchCtx == 'CURRENT_SITE' || searchCtx == 'CHILD_PAGES' || searchCtx == 'DIRECT_CHILD_PAGES')  
                {  
                    var s = '{"context":"' + searchCtx + '","page":null}';  
                    entryNode.setProperty('ametys:search-context', new java.lang.String(s));  
                    print('Migrate search context value ' + searchCtx + ' to : ' + s);  
                    paramsNode.save();  
                    count++  
                }  
            }  
         }  
    }  
}  
      
print(count + " content aggregation services have been migrated");  
  
query = qm.createQuery("//element(*, ametys:zoneItem)[@ametys-internal:type='SERVICE' and @ametys-internal:service='org.ametys.web.service.FilteredPagesService']", javax.jcr.query.Query.XPATH);  
nodes = query.execute().getNodes();  
    
count = 0;  
while (nodes.hasNext())  
{  
    var needSave = false;  
    var node = nodes.next();  
    var paramsNode = node.getNode('ametys:service_parameters');  
  
    if (paramsNode.hasProperty('ametys:search-context'))  
    {  
        var searchCtx =  paramsNode.getProperty('ametys:search-context').getString();  
        if (searchCtx == 'CURRENT_SITE' || searchCtx == 'CHILD_PAGES' || searchCtx == 'DIRECT_CHILD_PAGES')  
        {  
            var s = '{"context":"' + searchCtx + '","page":null}';  
            paramsNode.setProperty('ametys:search-context', new java.lang.String(s));  
            print('Migrate search context value ' + searchCtx + ' to : ' + s);  
            paramsNode.save();  
            count++  
        }   
    }  
}  
print(count + " page aggregation services have been migrated");  

Migration of content upload services (sortby parameter with most common values)

var ConsoleHelper = Java.type('org.ametys.workspaces.repository.ConsoleHelper');  

var qm = session.getWorkspace().getQueryManager();  
var query = qm.createQuery("//element(*, ametys:zoneItem)[@ametys-internal:type='SERVICE' and @ametys-internal:service='org.ametys.web.service.FilteredContentsService']", javax.jcr.query.Query.XPATH);  
var nodes = query.execute().getNodes();  

var count = 0;  
while (nodes.hasNext())  
{  
    var needSave = false;  
    var node = nodes.next();  
    var paramsNode = node.getNode('ametys:service_parameters');  

    if (paramsNode.hasProperty("ametys:sortBy"))
    {
      if (paramsNode.getProperty("ametys:sortBy").getString() == "start-date#asc")
      {
          paramsNode.setProperty("ametys:sortBy", "[{\"name\":\"start-date\",\"sort\":\"ASC\"}]");
          session.save();
       count++;
      }
      else if (paramsNode.getProperty("ametys:sortBy").getString() == "start-date#desc")
      {
          paramsNode.setProperty("ametys:sortBy", "[{\"name\":\"start-date\",\"sort\":\"DESC\"}]");
          session.save();
       count++;
      }
      else if (paramsNode.getProperty("ametys:sortBy").getString() == "end-date#desc,start-date#desc")
      {
          paramsNode.setProperty("ametys:sortBy", "[{\"name\":\"end-date\",\"sort\":\"DESC\"},{\"name\":\"start-date\",\"sort\":\"DESC\"}]");
          session.save();
       count++;
      }
      else if (paramsNode.getProperty("ametys:sortBy").getString() == "start-date#desc,end-date#desc"
   || paramsNode.getProperty("ametys:sortBy").getString() == "start-date#desc,end-date#asc")
      {
          paramsNode.setProperty("ametys:sortBy", "[{\"name\":\"start-date\",\"sort\":\"DESC\"},{\"name\":\"end-date\",\"sort\":\"DESC\"}]");
          session.save();
       count++;
      }
      else if (paramsNode.getProperty("ametys:sortBy").getString() == "lastValidationDate#desc")
      {
          paramsNode.setProperty("ametys:sortBy", "[{\"name\":\"lastValidationDate\",\"sort\":\"DESC\"}]");
          session.save();
       count++;
      }
      else if (paramsNode.getProperty("ametys:sortBy").getString().indexOf("#") != -1)
      {
         print(paramsNode.getId() + " - " + paramsNode.getProperty("ametys:sortBy").getString())
      }
    }
}  

print(count + " content aggregation services have been migrated"); 

Color theme migration

var mapping = {  
'804080': '4',  
'0178D6': '8',  
'01BFF3': '9',  
'4FC7D8': '11',  
'81BC26': '15',  
'579741': '16',  
'107C0C': '14',  
'FAD115': '17',  
'FF8800': '18',  
'FD002F': '22',  
'C91717': '24',  
'060606': '28'  
};  
  
jcrXPathQuery("//element(*, ametys:site)").forEach(function(site) {  
 var color = site.getColor();  
 var colorIndex = mapping[color];  
 if (colorIndex)  
 {  
 print("Changing " + site.getTitle() + " -> " + site.getColor() + "\n");  
 site.getNode().setProperty("ametys:color", colorIndex);  
 }  
});  
  
session.save();  

Deleting references JCR

function migrate()  
{  
    var count = {  
        existing: 0,  
        done: 0  
    };  
    jcrXPathQuery("//element(*, ametys:content)").forEach(function(content) {  
        count.existing++;  
        migrateContent(content,  
                        functionsToApply,  
                        true            /* old versions have to be marked incompatible */,  
                        null            /* tag new versions */,  
                        false           /* not verbose */);  
        count.done++;  
    });  
    print(count.done + " contents migrated on " + count.existing + " existing contents");  
}  
  
function _removeRefs(content)  
{  
    _removeRefsRecursively(content.getNode());  
}  
   
function _removeRefsRecursively(node)  
{  
    // Explore nodes recursively  
    var subNodes = node.getNodes();  
    while (subNodes.hasNext())  
    {  
        var subNode = subNodes.nextNode();  
        if (!subNode.getName().startsWith(internalPrefix))  
        {  
            _removeRefsRecursively(subNode);  
        }  
    }  
       
    // Remove reference properties  
    var properties = node.getProperties(jcrRefPattern);  
    while (properties.hasNext())  
    {  
        var prop = properties.nextProperty();  
        prop.remove();  
    }  
}  
  
var _extractOutgoingReferences = (function()  
{  
    var proxy = serviceManager.lookup("org.ametys.cms.workflow.EditContentFunction");  
    var method = org.ametys.cms.workflow.EditContentFunction.class.getDeclaredMethod("_extractOutgoingReferences", org.ametys.cms.repository.ModifiableContent.class);  
    method.setAccessible(true);  
    return function(content)  
    {  
        if (!(content instanceof org.ametys.cms.repository.ModifiableContent))  
        {  
          print("passed arg content (" + (content == null ? "null" : content.getId()) + ") is not modifiable");  
          return;  
        }  
        var args = [content];  
        return java.lang.reflect.Proxy.getInvocationHandler(proxy).invoke(proxy, method, args);  
    }  
})();  
    
var internalPrefix = "ametys-internal:";  
var jcrRefPattern = internalPrefix + "ref-*";  
  
var functionsToApply = [];  
functionsToApply.push(_removeRefs);  
functionsToApply.push(_extractOutgoingReferences);  
  
migrate();  
print("Switching to archives");  
var credentials = new javax.jcr.SimpleCredentials('ametys', []);  
session = repository.login(credentials, 'archives');  
migrate();  

Reference table migration

var qm = session.getWorkspace().getQueryManager();  
var query = qm.createQuery("//element(*)[@oswf:workflowName='simple-content']", javax.jcr.query.Query.XPATH);  
var nodes = query.execute().getNodes();  
var nodeCount = 0;  
while (nodes.hasNext())  
{  
    var node = nodes.next();         
    nodeCount++;  
    node.setProperty('oswf:workflowName','reference-table')  
}  
session.save();  
print("* "+nodeCount+" simple-content modified to reference-table\n");  

 

Plugin Link directory 2.2.x

If you are using plugin Link-directory, you will need to upgrade to version 2.2.x or higher.
Follow the technical and graphical migration guide: Plugin Link-directory - Technical and graphical migration manual 2.1.0 to 2.2.0

Please note that if your previous version was 2.0.x, you must also follow the migration guide for version 2.0.0 to 2.1.0: Plugin Link directory - Technical and graphical migration manual 2.0.0 to 2.1.0

 

Back to top