Modification des champs de mutualisation Une nouvelle action du cycle de vie est à rajouter dans le fichier de cycle de vie "utilisateurs". Cette action est appelée lors de la modification des champs de mutualisation.
Il faut donc ajouter l'action commune 222 ci-dessous dans le fichier de cycle de vie :
WEB-INF/param/workflows/course.xml (exemple ) Ajouter l'action suivante dans la section <common-actions>
Oups ! La copie dans le presse papier a échouée. Ouvrez le code et copier-le manuellement.<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> <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> Voir le code
<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> puis ajoutez sa référence pour chaque état (step) du workflow :
Oups ! La copie dans le presse papier a échouée. Ouvrez le code et copier-le manuellement.<step id="X" name="....">
<actions>
<!-- Edit Action -->
<common-action id="2" />
<common-action id="22" />
<common-action id="222" />
// ...
<actions>
</step> <step id="X" name="....">
<actions>
<!-- Edit Action -->
<common-action id="2" />
<common-action id="22" />
<common-action id="222" />
// ...
<actions>
</step>
<step id="X" name="....">
<actions>
<!-- Edit Action -->
<common-action id="2" />
<common-action id="22" />
<common-action id="222" />
// ...
<actions>
</step> Ensuite, il faut rajouter les clés i18n suivantes dans le plugin "default-odf-workflow" de l'application :
Oups ! La copie dans le presse papier a échouée. Ouvrez le code et copier-le manuellement.<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"><strong>{user}</strong> a modifié les champs de mutualisation.</message> <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"><strong>{user}</strong> a modifié les champs de mutualisation.</message>
<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"><strong>{user}</strong> a modifié les champs de mutualisation.</message> Et enfin exclure l'action de la vue des boutons du cycle de vie général des éléments pédagogiques. Pour cela, aller sur l'extension ayant pour identifiant : "org.ametys.odf.course.workflow.WorkflowSteps" dans le fichier plugin.xml du plugin "default-odf-workflow" et exclure l'action 222 :
Oups ! La copie dans le presse papier a échouée. Ouvrez le code et copier-le manuellement.<workflow-actions mode="exclude">
<action>2</action>
...
<action>222</action>
...
</workflow-actions> <workflow-actions mode="exclude">
<action>2</action>
...
<action>222</action>
...
</workflow-actions>
<workflow-actions mode="exclude">
<action>2</action>
...
<action>222</action>
...
</workflow-actions>