Last published:23/02/2018à 14:54DavidCartier-Michaud
Technical migration 1.2.0 to 1.3.0
Changes have been made to the storage format so that links can be "typed" to create links to an external URL or a Ametys page.
After updating plugin and before starting the application for the first time, the file custom_nodetypes.xml (located in the <chemin_repository>/repository/nodetypes) must be deleted. The file will be automatically recreated when the server is restarted.
Then run the following script in the repository console, to set the "type" property on your existing links:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
var qm = session.getWorkspace().getQueryManager();
var query = qm.createQuery("//element(*, ametys:directoryLink)", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var count = 0;
while (nodes.hasNext())
{
var node = nodes.next();
if (!node.hasProperty('ametys-internal:url-type'))
{
node.setProperty('ametys-internal:url-type', 'URL');
count++;
}
}
session.save();
print(count + " links have been updated.");
var qm = session.getWorkspace().getQueryManager();
var query = qm.createQuery("//element(*, ametys:directoryLink)", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var count = 0;
while (nodes.hasNext())
{
var node = nodes.next();
if (!node.hasProperty('ametys-internal:url-type'))
{
node.setProperty('ametys-internal:url-type', 'URL');
count++;
}
}
session.save();
print(count + " links have been updated.");
var qm = session.getWorkspace().getQueryManager();
var query = qm.createQuery("//element(*, ametys:directoryLink)", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var count = 0;
while (nodes.hasNext())
{
var node = nodes.next();
if (!node.hasProperty('ametys-internal:url-type'))
{
node.setProperty('ametys-internal:url-type', 'URL');
count++;
}
}
session.save();
print(count + " links have been updated.");
Graphics migration 1.2.0 to 1.3.0
Links can now be external or internal.
If you have overloaded the XSL rendering services, you will need to take the new link type into account. In the input XML , the attribute urlType gives you the type of link and the attribute pageTitle gives you the title of the page in the case of an internal link.
Example of XML for an external link
Oops!
Copy to clipboard failed. Open the code and copy it manually.