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 :

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");                                     

 

Retour en haut

Social networking