Skip to content

Commit

Permalink
Merge pull request #5660 from pontus-osterdahl/show-paginationformate…
Browse files Browse the repository at this point in the history
…rror

Show pagination format error
  • Loading branch information
solth authored May 11, 2023
2 parents a739a55 + bc06b5f commit 896e39b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,23 @@ public void startPaginationClick() {
logger.info(e.getMessage());
}
List<Separator> pageSeparators = Separator.factory(ConfigCore.getParameter(ParameterCore.PAGE_SEPARATORS));
String initializer = paginationTypeSelectSelectedItem.format(selectPaginationModeSelectedItem.getValue(),
try {
String initializer = paginationTypeSelectSelectedItem.format(selectPaginationModeSelectedItem.getValue(),
paginationStartValue, fictitiousCheckboxChecked, pageSeparators.get(0).getSeparatorString());
Paginator paginator = new Paginator(initializer);
List<PhysicalDivision> physicalDivisions = dataEditor.getWorkpiece().getAllPhysicalDivisionChildrenFilteredByTypePageAndSorted();
if (selectPaginationScopeSelectedItem) {
for (int i = paginationSelectionSelectedItems.get(0); i < physicalDivisions.size(); i++) {
physicalDivisions.get(i).setOrderlabel(paginator.next());
}
} else {
for (int i : paginationSelectionSelectedItems) {
physicalDivisions.get(i).setOrderlabel(paginator.next());
Paginator paginator = new Paginator(initializer);
List<PhysicalDivision> physicalDivisions = dataEditor.getWorkpiece()
.getAllPhysicalDivisionChildrenFilteredByTypePageAndSorted();
if (selectPaginationScopeSelectedItem) {
for (int i = paginationSelectionSelectedItems.get(0); i < physicalDivisions.size(); i++) {
physicalDivisions.get(i).setOrderlabel(paginator.next());
}
} else {
for (int i : paginationSelectionSelectedItems) {
physicalDivisions.get(i).setOrderlabel(paginator.next());
}
}
} catch (NumberFormatException e) {
Helper.setErrorMessage("paginationFormatError", new Object[] { paginationStartValue });
}
paginationSelectionSelectedItems = new ArrayList<>();
preparePaginationSelectionItems();
Expand Down
1 change: 1 addition & 0 deletions Kitodo/src/main/resources/messages/errors_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ errorOccurred=Es ist ein Fehler aufgetreten:
errorParsingFile=Parsingfehler: verschiedene {0} in der Datei (''{1}'' & ''{2}'').
errorParsingName="Parsingfehler: Vorname nicht mit Komma vom Nachnamen getrennt ('" {0} "')".
errorProjectNoTitleGiven=Kein Titel angegeben. Ein Projekt kann nicht ohne Titel gespeichert werden.
paginationFormatError=Der Paginierungsstartwert "{0}" ist nicht dem gew\u00E4hlten Paginierungstyp entsprechend formatiert.
parameterMissing=Pflichtparameter {ID} nicht gefunden.
passwordsDontMatchOld=Das eingegebene Passwort stimmt nicht mit dem alten Passwort \u00FCberein!
processAssignedError=Diese Produktionsvorlage kann nicht gel\u00F6scht werden, da dieser Vorg\u00E4nge zugewiesen sind.
Expand Down
1 change: 1 addition & 0 deletions Kitodo/src/main/resources/messages/errors_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ errorOccurred=An error has occurred:
errorParsingFile=Error parsing: various {0} in the file (''{1}'' & ''{2}'').
errorParsingName="Error parsing: First name not separated by comma from last name ('" {0} "')".
errorProjectNoTitleGiven=No project title was given. You cannot save a project without a title.
paginationFormatError=The pagination start value "{0}" is malformed according to selected pagination type.
parameterMissing=Mandatory parameter {ID} not found.
processAssignedError=The template could not be deleted because there are already assigned processes.
processCreationErrorFieldIsEmpty={0} contains no value.
Expand Down

0 comments on commit 896e39b

Please sign in to comment.