Technical migration manual from version 2.6.0 to version 2.6.1


  1. 07/03/17 - Limitations on training offer
  2. 03/23/17 - Criteria-values/* pipeline relocation

07/03/17 - Limitations on training offer

It is now possible to restrict the training offer to something other than a component. To add restrictions, you need to define them in a XML file: WEB-INF/param/odf-restrictions.xml. If required, see the ODFWEB template for details and examples).

You need to pass the following migration script in your JCR repository to keep the existing component restrictions.
It is not necessary to add the odf-restrictions.xml to the project.

var OLD_PROP = 'ametys:display-orgunit-only',
    NEW_PROP = 'ametys:odf-restrictions';
 
var qm = session.getWorkspace().getQueryManager(),
    xpath = "//element(*, ametys:site)",
    query = qm.createQuery(xpath, javax.jcr.query.Query.XPATH),
    nodes = query.execute().getNodes(),
    hasChanges = false;
 
var count = 0;
while (nodes.hasNext())
{
  if (_migrateSite(nodes.next()))
  {
    count++;
  }
}
 
if (count > 0) {
  session.save();
  print(count + ' site parameters for ODF restriction has been migrated.');
}
else
{
  print("All sites are up-to-date");
}
 
 
function _migrateSite(siteNode) {
  if (siteNode.hasProperty(OLD_PROP)) {
    oldProperty = siteNode.getProperty(OLD_PROP);
     
    siteNode.setProperty(NEW_PROP, oldProperty.getString());
    oldProperty.remove();
     
    return true;
  }
  return false;
}

03/23/17 - Criteria-values/* pipeline relocation

The criteria-values/* pipeline has been moved from plugin ODF -Web to plugin ODF . Projects using this pipeline must modify it to call the plugin ODF pipeline.

Search for criteria-values in all files and modify references.

Back to top