From cd949dae10d5df61fe0bde0cadabcf23a0f6d056 Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Thu, 16 Jul 2015 09:31:23 +0200
Subject: [PATCH] OO-1608: check the file size before saving, make the cancel
 button a real cancel, change to handle gracefully maxPostSize of Tomcat

---
 .../htmleditor/HTMLEditorController.java      | 62 +++++++++++--------
 .../_i18n/LocalStrings_ar.properties          |  1 +
 .../_i18n/LocalStrings_bg.properties          |  1 +
 .../_i18n/LocalStrings_cs.properties          |  1 +
 .../_i18n/LocalStrings_da.properties          |  1 +
 .../_i18n/LocalStrings_de.properties          |  2 +
 .../_i18n/LocalStrings_el.properties          |  1 +
 .../_i18n/LocalStrings_en.properties          |  2 +
 .../_i18n/LocalStrings_es.properties          |  1 +
 .../_i18n/LocalStrings_fa.properties          |  1 +
 .../_i18n/LocalStrings_fr.properties          |  1 +
 .../_i18n/LocalStrings_it.properties          |  1 +
 .../_i18n/LocalStrings_jp.properties          |  1 +
 .../_i18n/LocalStrings_lt.properties          |  1 +
 .../_i18n/LocalStrings_nl_NL.properties       |  1 +
 .../_i18n/LocalStrings_pl.properties          |  1 +
 .../_i18n/LocalStrings_pt_BR.properties       |  1 +
 .../_i18n/LocalStrings_pt_PT.properties       |  1 +
 .../_i18n/LocalStrings_ru.properties          |  1 +
 .../_i18n/LocalStrings_sq.properties          |  1 +
 .../_i18n/LocalStrings_zh_CN.properties       |  1 +
 .../_i18n/LocalStrings_zh_TW.properties       |  1 +
 .../ui/QTI12PullTestsToolController.java      | 19 ++++++
 23 files changed, 77 insertions(+), 27 deletions(-)

diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/HTMLEditorController.java b/src/main/java/org/olat/core/commons/editor/htmleditor/HTMLEditorController.java
index 12e1f6c6478..d63b0ca78ab 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/HTMLEditorController.java
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/HTMLEditorController.java
@@ -23,7 +23,6 @@ import java.io.InputStream;
 import java.util.Date;
 
 import org.olat.core.commons.controllers.linkchooser.CustomLinkTreeModel;
-import org.olat.core.commons.editor.plaintexteditor.PlainTextEditorController;
 import org.olat.core.commons.modules.bc.FolderConfig;
 import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.components.form.flexible.FormItem;
@@ -32,6 +31,7 @@ import org.olat.core.gui.components.form.flexible.elements.FormLink;
 import org.olat.core.gui.components.form.flexible.elements.RichTextElement;
 import org.olat.core.gui.components.form.flexible.impl.FormBasicController;
 import org.olat.core.gui.components.form.flexible.impl.FormEvent;
+import org.olat.core.gui.components.form.flexible.impl.elements.FormCancel;
 import org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextConfiguration;
 import org.olat.core.gui.components.link.Link;
 import org.olat.core.gui.components.velocity.VelocityContainer;
@@ -45,7 +45,6 @@ import org.olat.core.util.FileUtils;
 import org.olat.core.util.Formatter;
 import org.olat.core.util.SimpleHtmlParser;
 import org.olat.core.util.StringHelper;
-import org.olat.core.util.Util;
 import org.olat.core.util.coordinate.CoordinatorManager;
 import org.olat.core.util.coordinate.LockResult;
 import org.olat.core.util.resource.OresHelper;
@@ -103,7 +102,8 @@ public class HTMLEditorController extends FormBasicController {
 	private RichTextElement htmlElement;
 	private VFSContainer baseContainer;
 	private VFSLeaf fileLeaf;
-	private FormLink cancel, save, saveClose;
+	private FormCancel cancel;
+	private FormLink save, saveClose;
 	private CustomLinkTreeModel customLinkTreeModel;
 	
 	private VelocityContainer metadataVC;
@@ -152,7 +152,6 @@ public class HTMLEditorController extends FormBasicController {
 		long size = fileLeaf.getSize();
 		if ( size > FolderConfig.getMaxEditSizeLimit()) {
 			// limit to reasonable size, see OO-57
-			setTranslator(Util.createPackageTranslator(PlainTextEditorController.class, getLocale(),getTranslator()));
 			fileToLargeError = translate("plaintext.error.tolarge", new String[]{(size / 1000) + "", (FolderConfig.getMaxEditSizeLimit()/1000)+""});
 			this.body = "";
 			this.editable = false;
@@ -169,7 +168,7 @@ public class HTMLEditorController extends FormBasicController {
 			// is already locked by someone else. Since the lock token must be smaller than 50 characters we us an 
 			// MD5 hash of the absolute file path which will always be 32 characters long and virtually unique.
 			String lockToken = Encoder.md5hash(getFileDebuggingPath(baseContainer, relFilePath));
-			this.lock = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(lockResourceable, ureq.getIdentity(), lockToken);
+			lock = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(lockResourceable, ureq.getIdentity(), lockToken);
 			VelocityContainer vc = (VelocityContainer) flc.getComponent();
 			if (!lock.isSuccess()) {
 				vc.contextPut("locked", Boolean.TRUE);
@@ -216,11 +215,16 @@ public class HTMLEditorController extends FormBasicController {
 	 */
 	@Override
 	protected void formOK(UserRequest ureq) {
-		// form does not have button, form ok is triggered when user presses
-		// command-save or uses the save icon in the toolbar
-		doSaveData();
+		// do not save data, Tomcat will not send content bigger than the maxPostSize
+		// (default size 2 megabytes) 
 		// override dirtyness of form layout container to prevent redrawing of editor
-		this.flc.setDirty(false);
+		flc.setDirty(false);
+	}
+	
+	@Override
+	protected void formCancelled(UserRequest ureq) {
+		fireEvent(ureq, Event.CANCELLED_EVENT);
+		releaseLock();
 	}
 
 	@Override
@@ -229,12 +233,14 @@ public class HTMLEditorController extends FormBasicController {
 		if (source == htmlElement) {
 			// nothing to catch
 		} else if (source == save && lock != null) {
-			doSaveData();
-			newFile = false;//saved, it's not a new file anymore
+			if(doSaveData()) {
+				newFile = false;//saved, it's not a new file anymore
+			}
 		} else if (source == saveClose && lock != null) {
-			doSaveData();
-			fireEvent(ureq, Event.DONE_EVENT);
-			releaseLock();
+			if(doSaveData()) {
+				fireEvent(ureq, Event.DONE_EVENT);
+				releaseLock();
+			}
 		} else if (source == cancel) {
 			fireEvent(ureq, Event.CANCELLED_EVENT);
 			releaseLock();
@@ -263,13 +269,9 @@ public class HTMLEditorController extends FormBasicController {
 
 			// The buttons
 			save = uifactory.addFormLink("savebuttontext", formLayout, Link.BUTTON);
-
-			save.addActionListener(FormEvent.ONCLICK);
-			cancel = uifactory.addFormLink("cancel", formLayout, Link.BUTTON);
-			cancel.addActionListener(FormEvent.ONCLICK);
+			cancel = uifactory.addFormCancelButton("cancel", formLayout, ureq, getWindowControl());
 			saveClose = uifactory.addFormLink("saveandclosebuttontext", formLayout, Link.BUTTON);
-			saveClose.addActionListener(FormEvent.ONCLICK);
-			//
+			
 			// Add some file metadata		
 			VelocityContainer vc = (VelocityContainer) formLayout.getComponent();
 			metadataVC = createVelocityContainer("metadata");		
@@ -394,7 +396,7 @@ public class HTMLEditorController extends FormBasicController {
 	 * 
 	 * @param ureq
 	 */
-	private void doSaveData() {
+	private boolean doSaveData() {
 		// No XSS checks, are done in the HTML editor - users can upload illegal
 		// stuff, JS needs to be enabled for users
 		String content = htmlElement.getRawValue();
@@ -417,6 +419,16 @@ public class HTMLEditorController extends FormBasicController {
 			fileContent.append(preface).append(content).append(CLOSE_BODY_HTML);
 		}
 		
+		int fileSize = fileContent.toString().getBytes().length;
+		if(fileSize >= FolderConfig.getMaxEditSizeLimit()) {
+			String msg = translate("plaintext.error.tolarge", new String[] {
+					(fileSize / 1000) + "",
+					(FolderConfig.getMaxEditSizeLimit() / 1000) + ""
+			});
+			getWindowControl().setError(msg);
+			return false;
+		}
+		
 		// save the file
 		if(versions && fileLeaf instanceof Versionable && ((Versionable)fileLeaf).getVersions().isVersioned()) {
 			InputStream inStream = FileUtils.getInputStream(fileContent.toString(), charSet);
@@ -429,7 +441,8 @@ public class HTMLEditorController extends FormBasicController {
 		long lm = fileLeaf.getLastModified();
 		metadataVC.contextPut("lastModified", Formatter.getInstance(getLocale()).formatDateAndTime(new Date(lm)));
 		// Set new content as default value in element
-		htmlElement.setNewOriginalValue(content);		
+		htmlElement.setNewOriginalValue(content);
+		return true;
 	}
 
 	
@@ -443,7 +456,6 @@ public class HTMLEditorController extends FormBasicController {
 	 */
 	private String getFileDebuggingPath(VFSContainer root, String relPath) {
 		String path = relPath;
-		//fxdiff: FXOLAT-167
 		VFSItem item = root.resolve(relPath);
 		if (item instanceof LocalFileImpl) {
 			LocalFileImpl file = (LocalFileImpl) item;
@@ -475,8 +487,4 @@ public class HTMLEditorController extends FormBasicController {
 	public void setNewFile(boolean newFile) {
 		this.newFile = newFile;
 	}
-	
-	public void setmedia() {
-		
-	}
 }
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_ar.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_ar.properties
index 078c2324b56..7676da06c56 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_ar.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_ar.properties
@@ -4,3 +4,4 @@ lastModified=\u0622\u062E\u0631 \u062A\u0639\u062F\u064A\u0644
 saveandclosebuttontext=\u062D\u0641\u0638 \u062B\u0645 \u0625\u063A\u0644\u0627\u0642
 savebuttontext=\u062D\u0641\u0638
 warn.foreigneditor=\u0627\u0646\u062A\u0628\u0627\u0647\! \u062A\u0645 \u0625\u0646\u0634\u0627\u0621 \u0647\u0630\u0627 \u0627\u0644\u0645\u0644\u0641 \u0645\u0639 \u0645\u062D\u0631\u0631 \u0623\u062A\u0634 \u062A\u0649 \u0623\u0645 \u0623\u0644 \u0622\u062E\u0631\u060C \u0648\u0625\u0630\u0627 \u062A\u0645 \u062A\u0639\u062F\u064A\u0644\u0647 \u0648\u062D\u0641\u0638\u0647 \u0628\u0648\u0627\u0633\u0637\u0629 \u0645\u062D\u0631\u0631 \u0623\u0648\u0644\u0627\u062A \u0641\u0625\u0646 \u0631\u0645\u0648\u0632 \u0648\u062A\u0646\u0633\u064A\u0642 \u0627\u0644\u0645\u0635\u062F\u0631 \u0633\u064A\u062A\u0645 \u062A\u063A\u064A\u064A\u0631\u0647\u0645\u0627\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_bg.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_bg.properties
index eae309fd76e..9037f56a2ce 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_bg.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_bg.properties
@@ -4,3 +4,4 @@ lastModified=\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u043E \u043F\u0440\u043E
 saveandclosebuttontext=\u0417\u0430\u043F\u0430\u0437\u0435\u0442\u0435 \u0438 \u0437\u0430\u0442\u0432\u043E\u0440\u0435\u0442\u0435
 savebuttontext=\u0417\u0430\u043F\u0430\u0437\u0435\u0442\u0435
 warn.foreigneditor=\u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435\! \u0422\u043E\u0437\u0438 \u0444\u0430\u0439\u043B \u0435 \u0441\u044A\u0437\u0434\u0430\u0434\u0435\u043D \u0441 \u0434\u0440\u0443\u0433 HTML \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440. \u0410\u043A\u043E \u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u043D \u0438 \u0437\u0430\u043F\u0430\u0437\u0435\u043D \u0441 \u0432\u044A\u0442\u0440\u0435\u0448\u043D\u0438\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440 \u043D\u0430 \u0441\u0438\u0441\u0442\u0435\u043C\u0430\u0442\u0430, \u0424\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u0430\u043D\u0435\u0442\u043E \u0438 \u0438\u0437\u0445\u043E\u0434\u043D\u0438\u044F \u043A\u043E\u0434 \u0449\u0435 \u0431\u044A\u0434\u0430\u0442 \u043F\u0440\u043E\u043C\u0435\u043D\u0435\u043D\u0438\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_cs.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_cs.properties
index 18e826c0750..da87371d5fe 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_cs.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_cs.properties
@@ -4,3 +4,4 @@ lastModified=Posledn\u00ED zm\u011Bna
 saveandclosebuttontext=Ulo\u017Eit a zav\u0159\u00EDt
 savebuttontext=Ulo\u017Eit
 warn.foreigneditor=Pozor\! Tento soubor byl p\u016Fvodn\u011B vytvo\u0159en v jin\u00E9m editoru. Pokud bude upravov\u00E1n p\u0159\u00EDmo v OLATu, jeho form\u00E1tov\u00E1n\u00ED a zdrojov\u00FD k\u00F3d se pravd\u011Bpodobn\u011B zm\u011Bn\u00ED\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_da.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_da.properties
index aa0b8785c43..4a70af06292 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_da.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_da.properties
@@ -4,3 +4,4 @@ lastModified=Sidst \u00E6ndret
 saveandclosebuttontext=Gem og afslut
 savebuttontext=Gem 
 warn.foreigneditor=Bem\u00E6rk denne fil er oprettet med en anden HTML editor. Hvis den rettes og gemmes med den interne OLAT editor, vil dens formatering og kildetekst blive \u00E6ndret\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_de.properties
index 2115eb47c6a..eb2a900bf49 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_de.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_de.properties
@@ -4,3 +4,5 @@ lastModified=Zuletzt ge\u00E4ndert
 saveandclosebuttontext=Speichern und schliessen
 savebuttontext=Speichern
 warn.foreigneditor=Achtung\! Diese Datei wurde urspr\u00FCnglich mit einem anderen HTML-Editor erstellt. Wenn sie mit dem OLAT-internen Editor bearbeitet und gespeichert wird, kann die Formatierung und der resultierende Quellcode stark ver\u00E4ndert werden\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
+file.too.large.server=Die Datei konnte nicht gespeichert werden da sie zu gross ist. 
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_el.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_el.properties
index a7d66ad6dca..b3572205427 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_el.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_el.properties
@@ -4,3 +4,4 @@ lastModified=\u03A4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03B1 \u03C4\u03C1
 saveandclosebuttontext=\u0391\u03C0\u03BF\u03B8\u03AE\u03BA\u03B5\u03C5\u03C3\u03B7 \u03BA\u03B1\u03B9 \u03BA\u03BB\u03B5\u03AF\u03C3\u03B9\u03BC\u03BF
 savebuttontext=\u0391\u03C0\u03BF\u03B8\u03AE\u03BA\u03B5\u03C5\u03C3\u03B7
 warn.foreigneditor=\u03A0\u03C1\u03BF\u03C3\u03BF\u03C7\u03AE\! \u03A4\u03BF \u03B1\u03C1\u03C7\u03B5\u03AF\u03BF \u03AD\u03C7\u03B5\u03B9 \u03B4\u03B7\u03BC\u03B9\u03BF\u03C5\u03C1\u03B3\u03B7\u03B8\u03B5\u03AF \u03BC\u03B5 \u03AC\u03BB\u03BB\u03BF \u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03C4\u03AE HTML. \u0395\u03AC\u03BD \u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03C4\u03B5\u03AF \u03BA\u03B1\u03B9 \u03B1\u03C0\u03BF\u03B8\u03B7\u03BA\u03B5\u03C5\u03C4\u03B5\u03AF \u03BC\u03B5 \u03C4\u03BF\u03BD \u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03C4\u03AE \u03C4\u03BF\u03C5 OLAT \u03B8\u03B1 \u03B1\u03BB\u03BB\u03AC\u03BE\u03B5\u03B9 \u03B7 \u03BC\u03BF\u03C6\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03AE \u03C4\u03BF\u03C5 \u03BA\u03B1\u03B9 \u03BF \u03C0\u03B7\u03B3\u03B1\u03AF\u03BF\u03C2 \u03BA\u03CE\u03B4\u03B9\u03BA\u03AC\u03C2 \u03C4\u03BF\u03C5\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
\ No newline at end of file
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_en.properties
index 32f6083a37c..7a40729b131 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_en.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_en.properties
@@ -4,3 +4,5 @@ lastModified=Last modified
 saveandclosebuttontext=Save and close
 savebuttontext=Save
 warn.foreigneditor=Attention\! This file was created with another HTML editor. If it is edited and saved by means of the internal OLAT editor, its formatting and source code will be changed\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
+file.too.large.server=This document could not be saved since it is too large:
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_es.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_es.properties
index e84dd56af03..84edaeae89d 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_es.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_es.properties
@@ -4,3 +4,4 @@ lastModified=\u00DAltima modificaci\u00F3n
 saveandclosebuttontext=Guardar y Cerrar
 savebuttontext=Guardar
 warn.foreigneditor=\u00A1Atenci\u00F3n\! Originalmente este archivo se cre\u00F3 con otro editor HTML. \u00A1Si se edita y guarda con el editor interno de OLAT su formato y el c\u00F3digo fuente resultante podr\u00EDan cambiar\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_fa.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_fa.properties
index 9f04cf48f9d..8bc36624da0 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_fa.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_fa.properties
@@ -3,3 +3,4 @@ lastModified=Last modified
 saveandclosebuttontext=Save and close
 savebuttontext=Save
 warn.foreigneditor=Attention\! This file was created with another HTML editor. If it is edited and saved by means of the internal OLAT editor, its formatting and source code will be changed\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_fr.properties
index 227c5a59e15..2bd9070815d 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_fr.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_fr.properties
@@ -4,3 +4,4 @@ lastModified=Derni\u00E8re modification
 saveandclosebuttontext=Enregistrer et fermer
 savebuttontext=Enregistrer
 warn.foreigneditor=Attention\! Ce fichier a \u00E9t\u00E9 cr\u00E9\u00E9 initialement avec un autre \u00E9diteur. S'il est modifi\u00E9 et sauvegard\u00E9 avec OLAT, le format et le code r\u00E9sultant peuvent \u00EAtre fortement modifi\u00E9s\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_it.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_it.properties
index 313641623cb..2dd9df67825 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_it.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_it.properties
@@ -4,3 +4,4 @@ lastModified=Ultima modifica
 saveandclosebuttontext=Salvare e chiudere
 savebuttontext=Salvare
 warn.foreigneditor=Attenzione\! Questo file \u00E8 stato creato originariamente con un altro editore. Se viene elaborato e salvato con l'editore OLAT, la formattazione e il codice di sorgente risultante potrebbero venire modificati notevolmente\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_jp.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_jp.properties
index 9717fabbf3e..a91504cc66d 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_jp.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_jp.properties
@@ -4,3 +4,4 @@ lastModified=\u6700\u7D42\u66F4\u65B0\u65E5
 saveandclosebuttontext=\u4FDD\u5B58\u3057\u3066\u9589\u3058\u308B
 savebuttontext=\u4FDD\u5B58
 warn.foreigneditor=\u6CE8\u610F\! \u3053\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u5225\u306EHTML\u30A8\u30C7\u30A3\u30BF\u3067\u4F5C\u6210\u3055\u308C\u305F\u3088\u3046\u3067\u3059\u3002\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u3092OLAT\u5185\u90E8\u30A8\u30C7\u30A3\u30BF\u3067\u7DE8\u96C6\u304A\u3088\u3073\u4FDD\u5B58\u3057\u305F\u5834\u5408\u3001\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u304A\u3088\u3073\u30BD\u30FC\u30B9\u30B3\u30FC\u30C9\u304C\u5909\u66F4\u3055\u308C\u3066\u3057\u307E\u3044\u307E\u3059\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_lt.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_lt.properties
index d7ace9ba506..a03ec804d11 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_lt.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_lt.properties
@@ -4,3 +4,4 @@ lastModified=Paskutin\u0117 pakeista
 saveandclosebuttontext=I\u0161saugokite ir u\u017Edarykite
 savebuttontext=I\u0161saugokite
 warn.foreigneditor=D\u0117mesio\! \u0160i rinkmena buvo sukurta su kitu HTML redaktoriumi. Jei ji pakeista ir i\u0161saugota su vidiniu OLAT redaktoriumi, tai jos formatavimas ir pirminis kodas bus pakeistas\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_nl_NL.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_nl_NL.properties
index 8ac168c6265..5d750eeb5f0 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_nl_NL.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_nl_NL.properties
@@ -4,3 +4,4 @@ lastModified=Laatst gewijzigd
 saveandclosebuttontext=Opslaan en sluiten
 savebuttontext=Opslaan
 warn.foreigneditor=Opgelet\! Dit bestand werd met een andere HTML-editor aangemaakt. Indien het bewerkt en opgeslagen wordt door middel van de interne OLAT-editor, zal de formatteer- en broncode veranderd worden\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pl.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pl.properties
index 37618ce7df3..6eee9bd3970 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pl.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pl.properties
@@ -4,3 +4,4 @@ lastModified=Ostatnio zmodyfikowano
 saveandclosebuttontext=Zapisz i zamknij
 savebuttontext=Zapisz
 warn.foreigneditor=Uwaga\! Ten plik zosta\u0142 stworzony przy u\u017Cyciu innego edytora HTML. Podczas zapisu jego kod ulegnie zmianie\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pt_BR.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pt_BR.properties
index e1ef148c7a9..f16bfb84862 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pt_BR.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pt_BR.properties
@@ -4,3 +4,4 @@ lastModified=\u00DAltima modifica\u00E7\u00E3o
 saveandclosebuttontext=Salvar e fechar
 savebuttontext=Salvar
 warn.foreigneditor=Aten\u00E7\u00E3o\! Este arquivo foi criado com outro editor HTML. Se este for editado e salvo por meio do editor interno do OLAT, seu c\u00F3digo do formato e da fonte ser\u00E1 mudado\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pt_PT.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pt_PT.properties
index e1ef148c7a9..f16bfb84862 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pt_PT.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_pt_PT.properties
@@ -4,3 +4,4 @@ lastModified=\u00DAltima modifica\u00E7\u00E3o
 saveandclosebuttontext=Salvar e fechar
 savebuttontext=Salvar
 warn.foreigneditor=Aten\u00E7\u00E3o\! Este arquivo foi criado com outro editor HTML. Se este for editado e salvo por meio do editor interno do OLAT, seu c\u00F3digo do formato e da fonte ser\u00E1 mudado\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_ru.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_ru.properties
index 46eb45d2065..682687001e3 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_ru.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_ru.properties
@@ -4,3 +4,4 @@ lastModified=\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 \u0438\u0437
 saveandclosebuttontext=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0438 \u0417\u0430\u043A\u0440\u044B\u0442\u044C
 savebuttontext=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
 warn.foreigneditor=\u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435\! \u0414\u0430\u043D\u043D\u044B\u0439 \u0444\u0430\u0439\u043B \u0431\u044B\u043B \u043F\u0435\u0440\u0432\u043E\u043D\u0430\u0447\u0430\u043B\u044C\u043D\u043E \u0441\u043E\u0437\u0434\u0430\u043D \u0441 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043C \u0434\u0440\u0443\u0433\u043E\u0433\u043E HTML-\u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\u0430. \u0415\u0441\u043B\u0438 \u044D\u0442\u043E\u0442 \u0444\u0430\u0439\u043B \u0431\u0443\u0434\u0435\u0442 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D HTML-\u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\u043E\u043C \u0441\u0438\u0441\u0442\u0435\u043C\u044B OLAT \u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0451\u043D, \u0442\u043E \u0444\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435, \u0438 \u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u0442\u0435\u043A\u0441\u0442 HTML, \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0441\u0438\u043B\u044C\u043D\u043E \u0438\u0437\u043C\u0435\u043D\u0451\u043D\!       
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_sq.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_sq.properties
index 22aa6b11362..fd9fc93d0ad 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_sq.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_sq.properties
@@ -4,3 +4,4 @@ lastModified=Nd\u00EBruar s\u00EB fundmi
 saveandclosebuttontext=Ruaj dhe mbyll
 savebuttontext=Ruaj
 warn.foreigneditor=Vini ri\! Ky skedar \u00EBsht\u00EB krijuar me nj\u00EB HTML redaktor tjet\u00EBr. N\u00EBse \u00EBsht\u00EB redaktuar dhe ruajtur me an\u00EB t\u00EB redaktorit t\u00EB brendsh\u00EBm t\u00EB OLAT-it, formatimi dhe kodi burimor do t\u00EB nd\u00EBrrohet\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_zh_CN.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_zh_CN.properties
index d583ca9ac69..be1c84d9fcf 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_zh_CN.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_zh_CN.properties
@@ -4,3 +4,4 @@ lastModified=\u6700\u540E\u7684\u4FEE\u6539
 saveandclosebuttontext=\u4FDD\u5B58\u5E76\u5173\u95ED
 savebuttontext=\u4FDD\u5B58
 warn.foreigneditor=\u6CE8\u610F\! \u8BE5\u6587\u4EF6\u7531\u5176\u5B83HTML\u7F16\u8F91\u5668\u521B\u5EFA . \u5982\u679C\u5B83\u901A\u8FC7\u5185\u5728\u7684OLAT\u7F16\u8F91\u5668\u7F16\u8F91\u548C\u4FDD\u5B58, \u5176\u683C\u5F0F\u548C\u6E90\u4EE3\u7801\u4F1A\u6539\u53D8\!
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_zh_TW.properties b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_zh_TW.properties
index 8708b898e46..9b385e48154 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_zh_TW.properties
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/_i18n/LocalStrings_zh_TW.properties
@@ -4,3 +4,4 @@ lastModified=\u6700\u5F8C\u4FEE\u6539
 saveandclosebuttontext=\u5132\u5B58\u4E26\u95DC\u9589
 savebuttontext=\u5132\u5B58
 warn.foreigneditor=\u6CE8\u610F\uFF01\u9019\u500B\u6A94\u6848\u7531\u5176\u4ED6 HTML \u7DE8\u8F2F\u5668\u5EFA\u7ACB\u3002\u5982\u679C\u900F\u904E OLAT \u5167\u5EFA\u7684\u7DE8\u8F2F\u5668\u7DE8\u8F2F\u4E26\u5132\u5B58\u5F8C\uFF0C\u5B83\u7684\u683C\u5F0F\u548C\u539F\u59CB\u78BC\u6703\u88AB\u6539\u8B8A\uFF01
+plaintext.error.tolarge=$org.olat.core.commons.editor.plaintexteditor\:plaintext.error.tolarge
diff --git a/src/main/java/org/olat/ims/qti/statistics/ui/QTI12PullTestsToolController.java b/src/main/java/org/olat/ims/qti/statistics/ui/QTI12PullTestsToolController.java
index f3053c1a107..9f3aecb86e7 100644
--- a/src/main/java/org/olat/ims/qti/statistics/ui/QTI12PullTestsToolController.java
+++ b/src/main/java/org/olat/ims/qti/statistics/ui/QTI12PullTestsToolController.java
@@ -1,3 +1,22 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
 package org.olat.ims.qti.statistics.ui;
 
 import java.io.File;
-- 
GitLab