Administrator's manual


Activate pooling

To activate pedagogical elements, go to the CMS configuration in the Training offer tab and tick Activate mutualization

 

 

Configuration file

When a teaching element is created, the sharing fields are automatically initialized.

You can configure this initialization by adding the file shareable-configuration.xml to your application's WEB-INF/param .

<shareable-fields auto-validated="true">    
 <shareable>true</shareable>    
 <shareable-programs>OWN</shareable-programs>    
 <shareable-degrees>OWN</shareable-degrees>    
 <shareable-periods>OWN</shareable-periods>    
 <shareable-orgunits>OWN</shareable-orgunits>    
</shareable-fields>    

 <shareable>

true to say that pedagogical elements are open to sharing when they are created.
false by default

<shareable-programs> 

OWN so that, when teaching elements are created, this field is initialized with the identifiers of the parent programs of the teaching element.
id1,id2,id3 the identifiers JCR of the programs (separated by a comma) on which this field will be initialized.

By default, no value is entered. The field will therefore not be initialized.

<shareable-degrees>

OWN so that when pedagogical elements are created, this field is initialized with the diploma type identifiers of the parent programs of the pedagogical element.
cdm1,cdm2 the CDM codes of the diploma types (separated by a comma) on which this field will be initialized.

By default, no value is entered. The field will therefore not be initialized.

 <shareable-periods>

OWN so that when pedagogical elements are created, this field is initialized with the semester identifiers of the parent containers of the pedagogical element.
cdm1,cdm2 the CDM codes of the semesters (separated by a comma) on which this field will be initialized.

By default, no value is entered. The field will therefore not be initialized.

 <shareable-orgunits>

OWN so that when teaching elements are created, this field is initialized with the identifiers of the parent program components.
id1,id2,id3 the JCR component identifiers (separated by a comma) on which this field will be initialized.

By default, no value is entered. The field will therefore not be initialized.

 auto-validated

true to say that teaching elements are validated for pooling when they are created.
false by default

Script initialization

All existing teaching elements can be initialized using script JCR . This script will be based on the above configuration file.

This script can take several hours if there is a lot of data.

var shareableCourseHelper = serviceManager.lookup("org.ametys.odf.course.ShareableCourseHelper");   
   
var count = {   
    existing: 0,   
    done: 0   
};   
   
jcrXPathQuery("//element(*, ametys:courseContent)[@ametys-internal:contentType='org.ametys.plugins.odf.Content.course']").forEach(function (content) {   
   
    count.existing++;   
   
    migrateContent(content,   
        [_initializeShareableFields],   
        false,   
        null,   
        false);   
   
    count.done++;   
   
})   
   
print(count.done + " ELP(s) migrated on " + count.existing + " existing ELP(s)");   

function _initializeShareableFields(content)   
{   
    var courseListParents = content.getParentCourseLists();   
    shareableCourseHelper.initializeShareableFields(content, courseListParents, org.ametys.core.user.population.UserPopulationDAO.SYSTEM_USER_IDENTITY, true);   
}   

 After this script, we must :

  • If you are on a WEB application, rebuild the complete live.
  • Otherwise, run a full indexing operation.
Back to top