Created
November 29, 2016 14:37
-
-
Save AFaust/baee9a32a10c8e7110bfa54d9b512292 to your computer and use it in GitHub Desktop.
Alfresco JavaScript Console script to reset the theme of all sites in Alfresco to the system default
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sites, idx, site, dashboard, xmlConfig; | |
sites = search.query({ language: 'fts-alfresco', query: 'TYPE:"st:sites"'}); | |
for (idx = 0; idx < sites.length; idx++) | |
{ | |
site = sites[idx]; | |
dashboard = site.childrenByXPath('cm:surf-config/cm:pages/cm:site/cm:' + site.name + '/cm:dashboard.xml')[0]; | |
xmlConfig = dashboard.content; | |
if (/<theme>/.test(xmlConfig)) | |
{ | |
print('Resetting theme for site ' + site.name); | |
xmlConfig = String(xmlConfig).replace(/<theme>[^<]+<\/theme>/, ''); | |
dashboard.content = xmlConfig; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment