SEBSERV-370 fixed
This commit is contained in:
parent
96ce3ac3a7
commit
729dd23577
2 changed files with 22 additions and 3 deletions
|
@ -888,4 +888,23 @@ public final class Utils {
|
||||||
* ((descending) ? -1 : 1);
|
* ((descending) ? -1 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String toFileName(final String name) {
|
||||||
|
if (name == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return name
|
||||||
|
.replace("ä", "ae")
|
||||||
|
.replace("ö", "oe")
|
||||||
|
.replace("ü", "ue")
|
||||||
|
.replace("Ä", "Ae")
|
||||||
|
.replace("Ö", "Oe")
|
||||||
|
.replace("Ü", "Ue")
|
||||||
|
.replace("è", "e")
|
||||||
|
.replace("é", "e")
|
||||||
|
.replace("à", "a")
|
||||||
|
.replace(" ", "_")
|
||||||
|
.replaceAll("[^A-Za-z0-9_]", "");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ import java.util.function.Predicate;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.eclipse.rap.rwt.RWT;
|
import org.eclipse.rap.rwt.RWT;
|
||||||
import org.eclipse.rap.rwt.client.service.UrlLauncher;
|
import org.eclipse.rap.rwt.client.service.UrlLauncher;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
@ -74,8 +73,9 @@ public class ExamCreateClientConfigPopup {
|
||||||
return action -> {
|
return action -> {
|
||||||
|
|
||||||
final DateTime now = DateTime.now(DateTimeZone.UTC);
|
final DateTime now = DateTime.now(DateTimeZone.UTC);
|
||||||
final String downloadFileName = StringUtils.remove(examName, " ") + "_" + now.getYear() + "-"
|
final String downloadFileName =
|
||||||
+ now.getMonthOfYear() + "-" + now.getDayOfMonth() + ".seb";
|
Utils.toFileName(examName) + "_" + now.getYear() + "-"
|
||||||
|
+ now.getMonthOfYear() + "-" + now.getDayOfMonth() + ".seb";
|
||||||
|
|
||||||
final ModalInputDialog<FormHandle<?>> dialog =
|
final ModalInputDialog<FormHandle<?>> dialog =
|
||||||
new ModalInputDialog<FormHandle<?>>(
|
new ModalInputDialog<FormHandle<?>>(
|
||||||
|
|
Loading…
Reference in a new issue