Inhalt · Anhänge (0)
Von Version 8.1
bearbeitet von fichtner
am 08.03.2017
Auf Version 9.1
bearbeitet von ludwig
am 28.06.2017
Änderungskommentar: Es gibt keinen Kommentar für diese Version

Metadatenänderungen

Dokument-Autor
XWiki.fludwichtnerg

Inhaltsänderungen

... ... @@ -1,14 +1,19 @@
1 1 [[image:How To API@Pencil-icon.png||style="float: right;"]]
2 2
3 3
4 -= Start Multi File Import via script or API =
4 += Rename page sets via script =
5 5
6 -Sometimes {{jbeam-sign/}} has to work headless and the postprecessing should be startet by script. To start an Multi-File-Import inside the script via Script you can use the following source:
6 +{{jbeam-sign/}}-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:
7 7
8 8 {{code language="java"}}
9 -import com.AMS.jBEAM.*;
10 -import com.google.common.collect.Iterables;
11 -MultiFileImport mfi = Iterables.getOnlyElement(jC.getComponentsByClass(MultiFileImport.class));
12 -mfi.refreshImportDataFiles();
13 -mfi.startSequence(true);
9 +DesktopManager dm =
10 +(DesktopManager)jB.getComponentManager().getDesktopManager();
11 +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);
12 + if (englishTitle != null && !englishTitle.trim().isEmpty()) {
13 + pageTitle.setString(englishTitle);
14 + pageTitle.setString(null, Locale.ENGLISH);
15 + glf.setPageTitleML(i,pageTitle);
16 + }
17 +}
18 +
14 14 {{/code}}

Copyright by Kistler Chemnitz GmbH 2021
XWiki Enterprise 4.4 - Documentation