Dernière publication:05/11/2019à 15:05CarolineBayle
Service Twitter
L'utilisation des widget twitter n'est plus supportée. Le paramètre de site correspondant peut être supprimé. Pour cela, exécutez le script suivant :
Oups !
La copie dans le presse papier a échouée. Ouvrez le code et copier-le manuellement.
function deleteTwitterWidgetIDSiteParameter()
{
var query = qm.createQuery("//element(*, ametys:site)", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var widgetIdPropertyName = 'ametys:twitter-widget-id';
var count = 0;
var hasChanges = false;
while (nodes.hasNext())
{
var siteNode = nodes.nextNode();
if (siteNode.hasProperty(widgetIdPropertyName))
{
siteNode.getProperty(widgetIdPropertyName).remove();
count++;
}
}
if (count > 0)
{
session.save();
print(count + " sites have been migrated.");
}
}
var qm = session.getWorkspace().getQueryManager();
deleteTwitterWidgetIDSiteParameter();
print("End of migration, you can rebuild the Live workspace");
function deleteTwitterWidgetIDSiteParameter()
{
var query = qm.createQuery("//element(*, ametys:site)", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var widgetIdPropertyName = 'ametys:twitter-widget-id';
var count = 0;
var hasChanges = false;
while (nodes.hasNext())
{
var siteNode = nodes.nextNode();
if (siteNode.hasProperty(widgetIdPropertyName))
{
siteNode.getProperty(widgetIdPropertyName).remove();
count++;
}
}
if (count > 0)
{
session.save();
print(count + " sites have been migrated.");
}
}
var qm = session.getWorkspace().getQueryManager();
deleteTwitterWidgetIDSiteParameter();
print("End of migration, you can rebuild the Live workspace");
function deleteTwitterWidgetIDSiteParameter()
{
var query = qm.createQuery("//element(*, ametys:site)", javax.jcr.query.Query.XPATH);
var nodes = query.execute().getNodes();
var widgetIdPropertyName = 'ametys:twitter-widget-id';
var count = 0;
var hasChanges = false;
while (nodes.hasNext())
{
var siteNode = nodes.nextNode();
if (siteNode.hasProperty(widgetIdPropertyName))
{
siteNode.getProperty(widgetIdPropertyName).remove();
count++;
}
}
if (count > 0)
{
session.save();
print(count + " sites have been migrated.");
}
}
var qm = session.getWorkspace().getQueryManager();
deleteTwitterWidgetIDSiteParameter();
print("End of migration, you can rebuild the Live workspace");