Migration manual 4.0 to 4.1


Modification of mutualization fields

A new lifecycle action is added to the "users" lifecycle file. This action is called up when mutualization fields are modified.

The common action 222 below must therefore be added to the lifecycle file:

  • WEB-INF/param/workflows/course.xml (example)

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

<action id="222" name="plugin.default-odf-workflow:WORKFLOW_ACTION_EDIT_SHAREABLE_COURSE">    
    <restrict-to>    
        <conditions type="AND">    
            <condition type="avalon">    
                <arg name="role">org.ametys.cms.workflow.ContentCheckRightsCondition</arg>    
                <arg name="right">ODF_Rights_Edit_Shareable_Fields</arg>    
            </condition>    
            <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>    
    <pre-functions>    
        <function type="avalon">    
            <arg name="role">org.ametys.cms.workflow.EditContentFunction</arg>    
        </function>    
    </pre-functions>    
    <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>    
               <function type="avalon">    
                    <arg name="role">org.ametys.cms.workflow.CreateVersionFunction</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>    
                <function type="avalon">    
                    <arg name="role">org.ametys.cms.workflow.CreateVersionFunction</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.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.odf.workflow.ValidateODFContentFunction</arg>    
                </function>    
                <function type="avalon">    
                    <arg name="role">org.ametys.odf.workflow.MoveLiveTagOnCoursePartFunction</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>       

then add its reference for each workflow state (step):

<step id="X" name="....">     
    <actions>     
        <!-- Edit Action -->     
        <common-action id="2" />     
        <common-action id="22" />     
        <common-action id="222" />     
        // ...       
    <actions>     
</step>     

Next, add the following i18n keys to the application's "default-odf-workflow" plugin :

<message key="WORKFLOW_ACTION_EDIT_SHAREABLE_COURSE">Modifier les champs de mutualisation</message>   
<message key="WORKFLOW_ACTION_EDIT_SHAREABLE_COURSE_DESCRIPTION">Cliquez ici pour modifier les champs de mutualisation.</message>   
<message key="WORKFLOW_ACTION_EDIT_SHAREABLE_COURSE_ACTION_DESCRIPTION">&lt;strong&gt;{user}&lt;/strong&gt; a modifié les champs de mutualisation.</message>   

And finally, exclude the button view action from the general lifecycle of pedagogical elements. To do this, go to the extension with identifier: "org.ametys.odf.course.workflow.WorkflowSteps" in the plugin.xml file of plugin "default-odf-workflow" and exclude action 222 :

<workflow-actions mode="exclude">   
    <action>2</action>   
    ...   
    <action>222</action>   
    ...   
</workflow-actions>   

 

Back to top