Pencil-icon.png

Rename page sets via script

jBEAM page sets supports localization. The following script sets the english page name as standard page name for the visible pages in graphic 1 and deletes the english localization after:

DesktopManager dm =
(DesktopManager)jB.getComponentManager().getDesktopManager();
GraphLayoutFrame glf = dm.getGraphLayoutFrames().get(0); int pageCount = glf.getActivePages().size(); for (int i = 0; i < pageCount; i++) {  jB_MultiLanguageString pageTitle = glf.getPageTitleML(i);  String englishTitle = pageTitle.getExactString(Locale.ENGLISH);
if (englishTitle != null && !englishTitle.trim().isEmpty()) {
  pageTitle.setString(englishTitle);
  pageTitle.setString(null, Locale.ENGLISH);
  glf.setPageTitleML(i,pageTitle);
}
}

Copyright by Kistler Chemnitz GmbH 2021
XWiki Enterprise 4.4 - Documentation