The "User" abstract type has changed.
It now provides the "user" data, which is of type "user".
For projects that have defined their own "user" content type that extends "org.ametys.plugins.userdirectory.Content.user", it will be necessary to change the content metadataset to take the "user" data into account:
If your directory users are linked to CMS users:
When you change the type of SCC, some settings will be reset. To see the old settings, you can look at the "synchronizable-collection.xml" file in the /data/config folder.
This file will be overwritten when you save.
var contentType = "org.ametys.plugin.defaultud.Content.uduser"; // TODO set this field
var sccId = "utilisateurs"; // TODO set this field
var fieldId = "login"; // TODO set this field
var unlock = function(node)
{
var lockToken = node.getProperty(RepositoryConstants.METADATA_LOCKTOKEN).getString();
var lockManager = node.getSession().getWorkspace().getLockManager();
lockManager.addLockToken(lockToken);
lockManager.unlock(node.getPath());
// Remove residual properties
node["setProperty(java.lang.String,javax.jcr.Value)"](RepositoryConstants.METADATA_LOCKTOKEN, null);
node["setProperty(java.lang.String,javax.jcr.Value)"](RepositoryConstants.METADATA_LOCKOWNER, null);
node.getSession().save();
}
var qm = session.getWorkspace().getQueryManager();
var query = qm.createQuery("//element(*, ametys:content)[@ametys-internal:contentType='" + contentType + "' "
+ "and @ametys-internal:scc = '" + sccId + "']", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var nbContent = 0;
while (nodes.hasNext())
{
var content = nodes.next();
if (content.isLocked())
{
unlock(content);
}
content.setProperty("ametys:uniqueId", content.getProperty("ametys:" + fieldId).getString());
content.save();
nbContent++;
}
print(nbContent + " contenu(s) changé(s)");
queryPage = qm.createQuery("//element(*, ametys:defaultPage)[@ametys-internal:virtual ='org.ametys.plugins.userdirectory.page.VirtualUserDirectoryPageFactory']", javax.jcr.query.Query.XPATH);
var nodePages = queryPage.execute().getNodes();
var nbPage = 0;
while (nodePages.hasNext())
{
var page = nodePages.next();
var metadata = page.getProperty("ametys:user-directory-root-classification-metadata").getString();
if (metadata == fieldId)
{
page.setProperty("ametys:user-directory-root-classification-metadata", "uniqueId");
page.save();
nbPage++;
}
}
print(nbPage + " page(s) changée(s)");
Chances are that in your projects you have created your own helper XSLT to override the getCurrentUserContent method.
You can now remove this override and use the getCurrentUserContent core method of the helper org.ametys.plugins.userdirectory.transformation.xslt.UserXSLTHelper.
You should also remember to put this kernel helper back in your XSL in place of the project helper.
What's more, there's probably a workflow condition that's been created in your project to call up your custom Helper (this condition is often called CheckCurrentUserContentCondition)
It's no longer useful either, so you can delete it (along with its declaration in plugin.xml)
And you can call up the kernel condition again org.ametys.plugins.userdirectory.workflow.CheckCurrentUserContentCondition.