Some bugfixes for editing the extended properties of a collected volume.

pull/1/head
Jens Pelzetter 2022-08-06 17:41:38 +02:00
parent ba43a81c54
commit a490ef50ea
5 changed files with 63 additions and 6 deletions

View File

@ -140,14 +140,14 @@ public abstract class AbstractPublicationWithPublisherExtendedPropertiesStep<T e
final Integer numberOfPages = Optional final Integer numberOfPages = Optional
.ofNullable(numberOfPagesParam) .ofNullable(numberOfPagesParam)
.filter(param -> param.matches("\\d*")) .filter(param -> param.matches("\\d+"))
.map(param -> Integer.parseInt(param)) .map(param -> Integer.parseInt(param))
.orElse(null); .orElse(null);
publication.setNumberOfPages(numberOfPages); publication.setNumberOfPages(numberOfPages);
final Integer numberOfVolumes = Optional final Integer numberOfVolumes = Optional
.ofNullable(numberOfVolumesParam) .ofNullable(numberOfVolumesParam)
.filter(param -> param.matches("\\d*")) .filter(param -> param.matches("\\d+"))
.map(param -> Integer.parseInt(param)) .map(param -> Integer.parseInt(param))
.orElse(null); .orElse(null);
if (numberOfVolumes != null) { if (numberOfVolumes != null) {
@ -156,7 +156,7 @@ public abstract class AbstractPublicationWithPublisherExtendedPropertiesStep<T e
final Integer volume = Optional final Integer volume = Optional
.ofNullable(volumeParam) .ofNullable(volumeParam)
.filter(param -> param.matches("\\d*")) .filter(param -> param.matches("\\d+"))
.map(param -> Integer.parseInt(param)) .map(param -> Integer.parseInt(param))
.orElse(null); .orElse(null);
if (volume != null) { if (volume != null) {

View File

@ -6,7 +6,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.SortedMap; import java.util.Optional;
import javax.enterprise.context.RequestScoped; import javax.enterprise.context.RequestScoped;
import javax.inject.Named; import javax.inject.Named;
@ -64,7 +64,11 @@ public class PublicationExtendedPropertiesStepModel {
} }
public List<String> getLanguageOfPublicationSelectedOptions() { public List<String> getLanguageOfPublicationSelectedOptions() {
return List.of(languageOfPublication); if (languageOfPublication == null) {
return Collections.emptyList();
} else {
return List.of(languageOfPublication);
}
} }
public void setLanguageOfPublication(final String languageOfPublication) { public void setLanguageOfPublication(final String languageOfPublication) {

View File

@ -86,12 +86,31 @@
<ui:define name="publicationExtendedPropertyWidgets"> <ui:define name="publicationExtendedPropertyWidgets">
<libreccm:localizedStringEditor <libreccm:localizedStringEditor
addButtonLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.add.label']}"
addDialogCancelLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.add.cancel']}"
addDialogLocaleSelectHelp="#{SciPublicationsUiMessageBundle['extendedproperties.edition.add.locale.help']}"
addDialogLocaleSelectLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.add.locale.label']}"
addDialogSubmitLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.add.submit']}"
addDialogTitle="#{SciPublicationsUiMessageBundle['extendedproperties.edition.add.title']}"
addDialogValueHelp="#{SciPublicationsUiMessageBundle['extendedproperties.edition.add.value.help']}"
addDialogValueLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.add.value.label']}"
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationExtendedPropertiesStepModel.editStepUrlFragment}/edition/@add" addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationExtendedPropertiesStepModel.editStepUrlFragment}/edition/@add"
readOnly="#{!CmsSelectedDocumentModel.canEdit}" editButtonLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.edit.label']}"
editDialogCancelLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.edit.cancel']}"
editDialogSubmitLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.edit.submit']}"
editDialogTitle="#{SciPublicationsUiMessageBundle['extendedproperties.edition.edit.title']}"
editDialogValueHelp="#{SciPublicationsUiMessageBundle['extendedproperties.edition.add.value.help']}"
editDialogValueLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.add.value.label']}"
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationExtendedPropertiesStepModel.editStepUrlFragment}/edition/@edit" editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationExtendedPropertiesStepModel.editStepUrlFragment}/edition/@edit"
editorId="edition-editor" editorId="edition-editor"
hasUnusedLocales="#{!SciCmsPublicationWithPublisherExtendedPropertiesStep.unusedEditionLocales.isEmpty()}" hasUnusedLocales="#{!SciCmsPublicationWithPublisherExtendedPropertiesStep.unusedEditionLocales.isEmpty()}"
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}" objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
readOnly="#{!CmsSelectedDocumentModel.canEdit}"
removeButtonLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.remove.label']}"
removeDialogCancelLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.remove.cancel']}"
removeDialogSubmitLabel="#{SciPublicationsUiMessageBundle['extendedproperties.edition.remove.submit']}"
removeDialogText="#{SciPublicationsUiMessageBundle['extendedproperties.edition.remove.text']}"
removeDialogTitle="#{SciPublicationsUiMessageBundle['extendedproperties.edition.remove.title']}"
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationExtendedPropertiesStepModel.editStepUrlFragment}/edition/@remove" removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@#{SciCmsPublicationExtendedPropertiesStepModel.editStepUrlFragment}/edition/@remove"
title="#{SciPublicationsUiMessageBundle['extendedproperties.edition.editdialog.title']}" title="#{SciPublicationsUiMessageBundle['extendedproperties.edition.editdialog.title']}"
unusedLocales="#{SciCmsPublicationWithPublisherExtendedPropertiesStep.unusedEditionLocales}" unusedLocales="#{SciCmsPublicationWithPublisherExtendedPropertiesStep.unusedEditionLocales}"

View File

@ -467,3 +467,20 @@ collectedvolume.basicproperties.articles.start_page=First page
collectedvolume.basicproperties.articles.end_page=Last Page collectedvolume.basicproperties.articles.end_page=Last Page
collectedvolume.basicproperties.articles.header=Articles collectedvolume.basicproperties.articles.header=Articles
articleincollectedvolume.basicproperties.collectedvolume.none=This article is not assigned to a collected volume. articleincollectedvolume.basicproperties.collectedvolume.none=This article is not assigned to a collected volume.
extendedproperties.edition.add.label=Add
extendedproperties.edition.add.cancel=Cancel
extendedproperties.edition.add.locale.help=The language of the edition value.
extendedproperties.edition.add.locale.label=Language
extendedproperties.edition.add.submit=Add
extendedproperties.edition.add.title=Add edition label
extendedproperties.edition.add.value.help=The label of the edition, for example: 3rd, revised and extendend edition
extendedproperties.edition.add.value.label=Edition
extendedproperties.edition.edit.label=Edit
extendedproperties.edition.edit.cancel=Cancel
extendedproperties.edition.edit.submit=Save
extendedproperties.edition.edit.title=Edit edition label
extendedproperties.edition.remove.label=Remove
extendedproperties.edition.remove.cancel=Cancel
extendedproperties.edition.remove.submit=Remove
extendedproperties.edition.remove.text=Are you sure to remove the following edition label:
extendedproperties.edition.remove.title=Remove edition label

View File

@ -467,3 +467,20 @@ collectedvolume.basicproperties.articles.start_page=Erste Seite
collectedvolume.basicproperties.articles.end_page=Letzte Seite collectedvolume.basicproperties.articles.end_page=Letzte Seite
collectedvolume.basicproperties.articles.header=Artikel collectedvolume.basicproperties.articles.header=Artikel
articleincollectedvolume.basicproperties.collectedvolume.none=Dieser Artikel wurde noch keinem Sammelband zugewiesen. articleincollectedvolume.basicproperties.collectedvolume.none=Dieser Artikel wurde noch keinem Sammelband zugewiesen.
extendedproperties.edition.add.label=Hinzuf\u00fcgen
extendedproperties.edition.add.cancel=Abbrechen
extendedproperties.edition.add.locale.help=Die Sprache der Angabe der Ausgabe.
extendedproperties.edition.add.locale.label=Sprache
extendedproperties.edition.add.submit=Hinzuf\u00fcgen
extendedproperties.edition.add.title=Angabe zur Ausgabe hinzuf\u00fcgen
extendedproperties.edition.add.value.help=Die Bezeichnung der Ausgabe, zum Beispiel: 3., \u00fcberarbeitete und erweiterte Auflage.
extendedproperties.edition.add.value.label=Auflage
extendedproperties.edition.edit.label=Bearbeiten
extendedproperties.edition.edit.cancel=Abbrechen
extendedproperties.edition.edit.submit=Speichern
extendedproperties.edition.edit.title=Bezeichnung der Ausgabe bearbeiten
extendedproperties.edition.remove.label=Entfernen
extendedproperties.edition.remove.cancel=Abbrechen
extendedproperties.edition.remove.submit=Entfernen
extendedproperties.edition.remove.text=Sind Sie sicher, dass Sie die folgenden Ausgaben-Bezeichnung entfernen wollen:
extendedproperties.edition.remove.title=Angabe zur Ausgabe entfernen