var qm = session.getWorkspace().getQueryManager();
var query = qm.createQuery("//element(*, ametys:zoneItem)[ametys-internal:service = 'org.ametys.odf.service.SearchService']", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var count = 0;
while (nodes.hasNext())
{
var searchService = nodes.next();
var serviceParam = searchService.getNode("ametys:service_parameters");
if (serviceParam.hasProperty("ametys:displaySubProgram"))
{
var displaySubProgram = serviceParam.getProperty("ametys:displaySubProgram").getString();
if (displaySubProgram == "true")
{
serviceParam.setProperty("ametys:displaySubProgram", "all");
count++;
}
else if (displaySubProgram == "false")
{
serviceParam.setProperty("ametys:displaySubProgram", "none");
count++;
}
}
else
{
serviceParam.setProperty("ametys:displaySubProgram", "none");
count++;
}
serviceParam.save();
}
print(count + " services have been migrated");
var qm = session.getWorkspace().getQueryManager();
var query = qm.createQuery("//element(*, ametys:zoneItem)[ametys-internal:service = 'org.ametys.odf.service.SearchService']", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var count = 0;
while (nodes.hasNext())
{
var searchService = nodes.next();
var serviceParam = searchService.getNode("ametys:service_parameters");
if (serviceParam.hasProperty("ametys:displaySubProgram"))
{
var displaySubProgram = serviceParam.getProperty("ametys:displaySubProgram").getString();
if (displaySubProgram == "true")
{
serviceParam.setProperty("ametys:displaySubProgram", "all");
count++;
}
else if (displaySubProgram == "false")
{
serviceParam.setProperty("ametys:displaySubProgram", "none");
count++;
}
}
else
{
serviceParam.setProperty("ametys:displaySubProgram", "none");
count++;
}
serviceParam.save();
}
print(count + " services have been migrated");
var qm = session.getWorkspace().getQueryManager();
var query = qm.createQuery("//element(*, ametys:zoneItem)[ametys-internal:service = 'org.ametys.odf.service.SearchService']", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var count = 0;
while (nodes.hasNext())
{
var searchService = nodes.next();
var serviceParam = searchService.getNode("ametys:service_parameters");
if (serviceParam.hasProperty("ametys:displaySubProgram"))
{
var displaySubProgram = serviceParam.getProperty("ametys:displaySubProgram").getString();
if (displaySubProgram == "true")
{
serviceParam.setProperty("ametys:displaySubProgram", "all");
count++;
}
else if (displaySubProgram == "false")
{
serviceParam.setProperty("ametys:displaySubProgram", "none");
count++;
}
}
else
{
serviceParam.setProperty("ametys:displaySubProgram", "none");
count++;
}
serviceParam.save();
}
print(count + " services have been migrated");