Download jars from plugin and add them (ametys-plugin-glossary-1.2.0.jar and ametys-plugin-glossary-resources-1.2.0.jar) to your application's WEB-INF/lib directory. Ametys
Add a button to open the glossary tool in the WEB-INF/params/cms-ribbon-default.xml. The button identifier is org.ametys.plugins.glossary.Glossary. We recommend adding it to the Home tab, in the "Tools" group.
In this same file, to be able to add a definition in the content editor, also add the button org.ametys.glossary.editor.AddDefinition in the org.ametys.cms.content.EditionTab
In the same file, import the ribbon file specific to the glossary plugin:glossary://cms-ribbon.xml
Oops!
Copy to clipboard failed. Open the code and copy it manually.
Please note! If the group contains a description , and , the button must be added to the 3.
Restart the server
Data migration 1.4 => 1.5
Oops!
Copy to clipboard failed. Open the code and copy it manually.
function getUniqueName (rootNode, defaultName)
{
var uniqueName = defaultName;
var index = 2;
while (rootNode.hasNode(uniqueName))
{
uniqueName = defaultName + "-" + index;
index++;
}
return uniqueName;
}
var qm = session.getWorkspace().getQueryManager();
var query = qm.createQuery("//element(*, ametys:site)/ametys-internal:plugins/glossary/*/ametys:wordDefinitions/element(ametys:definition, ametys:wordDefinition)", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var count = 0;
while (nodes.hasNext())
{
var node = nodes.next();
var word = node.getProperty('ametys-internal:word').getString();
var defaultName = org.ametys.cms.FilterNameHelper.filterName(word)
var newName = getUniqueName (node.getParent(), defaultName);
session.move(node.getPath(), node.getParent().getPath() + '/' + newName);
count++;
}
if (count > 0)
{
session.save();
}
println(count + " word have been renamed");
function getUniqueName (rootNode, defaultName)
{
var uniqueName = defaultName;
var index = 2;
while (rootNode.hasNode(uniqueName))
{
uniqueName = defaultName + "-" + index;
index++;
}
return uniqueName;
}
var qm = session.getWorkspace().getQueryManager();
var query = qm.createQuery("//element(*, ametys:site)/ametys-internal:plugins/glossary/*/ametys:wordDefinitions/element(ametys:definition, ametys:wordDefinition)", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var count = 0;
while (nodes.hasNext())
{
var node = nodes.next();
var word = node.getProperty('ametys-internal:word').getString();
var defaultName = org.ametys.cms.FilterNameHelper.filterName(word)
var newName = getUniqueName (node.getParent(), defaultName);
session.move(node.getPath(), node.getParent().getPath() + '/' + newName);
count++;
}
if (count > 0)
{
session.save();
}
println(count + " word have been renamed");
function getUniqueName (rootNode, defaultName)
{
var uniqueName = defaultName;
var index = 2;
while (rootNode.hasNode(uniqueName))
{
uniqueName = defaultName + "-" + index;
index++;
}
return uniqueName;
}
var qm = session.getWorkspace().getQueryManager();
var query = qm.createQuery("//element(*, ametys:site)/ametys-internal:plugins/glossary/*/ametys:wordDefinitions/element(ametys:definition, ametys:wordDefinition)", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var count = 0;
while (nodes.hasNext())
{
var node = nodes.next();
var word = node.getProperty('ametys-internal:word').getString();
var defaultName = org.ametys.cms.FilterNameHelper.filterName(word)
var newName = getUniqueName (node.getParent(), defaultName);
session.move(node.getPath(), node.getParent().getPath() + '/' + newName);
count++;
}
if (count > 0)
{
session.save();
}
println(count + " word have been renamed");