From 087f3c4dcdf33a855693fa80d44f02e0d63dce5c Mon Sep 17 00:00:00 2001 From: Jens Pelzetter Date: Mon, 3 Oct 2022 09:03:13 +0200 Subject: [PATCH] View for create step of SciDepartment --- .gitignore | 1 + .../scidepartment/SciDepartmentConfig.java | 2 +- .../scidepartment/ui/SciDepartmentRoles.java | 29 +++++++ .../scidepartment/ui/SciDepartmentTexts.java | 29 +++++++ .../ui/create-scidepartment.xhtml | 86 +++++++++++++++++++ .../scidepartment/DefaultTextKeys.properties | 3 + .../DefaultTextKeys_de.properties | 3 + .../ui/SciDepartmentBundle.properties | 13 +++ .../ui/SciDepartmentBundle_de.properties | 13 +++ 9 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentRoles.java create mode 100644 sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentTexts.java create mode 100644 sci-types-department/src/main/resources/WEB-INF/views/org/scientificcms/contenttypes/scidepartment/ui/create-scidepartment.xhtml create mode 100644 sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/DefaultTextKeys.properties create mode 100644 sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/DefaultTextKeys_de.properties diff --git a/.gitignore b/.gitignore index 1d5b369..13e0f07 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ node_modules /sci-publications/target/ /scicms-bundle-devel-wildfly/target/ /sci-types-project/nbproject/ +/sci-types-department/nbproject/ diff --git a/sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/SciDepartmentConfig.java b/sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/SciDepartmentConfig.java index 283419e..811df1b 100644 --- a/sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/SciDepartmentConfig.java +++ b/sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/SciDepartmentConfig.java @@ -22,7 +22,7 @@ public class SciDepartmentConfig { @Setting private String textKeysBundleName - = "org.scientificcms.contenttypes.scidepartment.TextKeysBundle"; + = "org.scientificcms.contenttypes.scidepartment.DefaultTextKeys"; public static SciDepartmentConfig getConfig() { final ConfigurationManager confManager = CdiUtil diff --git a/sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentRoles.java b/sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentRoles.java new file mode 100644 index 0000000..32e5229 --- /dev/null +++ b/sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentRoles.java @@ -0,0 +1,29 @@ +package org.scientificcms.contenttypes.scidepartment.ui; + +import org.libreccm.configuration.ConfigurationManager; +import org.libreccm.ui.AbstractMessagesBean; +import org.scientificcms.contenttypes.scidepartment.SciDepartmentConfig; + +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; +import javax.inject.Named; + +/** + * + * @author Jens Pelzetter + */ +@RequestScoped +@Named("SciDepartmentRoles") +public class SciDepartmentRoles extends AbstractMessagesBean { + + @Inject + private ConfigurationManager confManager; + + @Override + protected String getMessageBundle() { + return confManager + .findConfiguration(SciDepartmentConfig.class) + .getMemberRolesBundleName(); + } + +} diff --git a/sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentTexts.java b/sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentTexts.java new file mode 100644 index 0000000..96d1d70 --- /dev/null +++ b/sci-types-department/src/main/java/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentTexts.java @@ -0,0 +1,29 @@ +package org.scientificcms.contenttypes.scidepartment.ui; + +import org.libreccm.configuration.ConfigurationManager; +import org.libreccm.ui.AbstractMessagesBean; +import org.scientificcms.contenttypes.scidepartment.SciDepartmentConfig; + +import javax.enterprise.context.RequestScoped; +import javax.inject.Inject; +import javax.inject.Named; + +/** + * + * @author Jens Pelzetter + */ +@RequestScoped +@Named("SciDepartmentTexts") +public class SciDepartmentTexts extends AbstractMessagesBean { + + @Inject + private ConfigurationManager confManager; + + @Override + protected String getMessageBundle() { + return confManager + .findConfiguration(SciDepartmentConfig.class) + .getTextKeysBundleName(); + } + +} diff --git a/sci-types-department/src/main/resources/WEB-INF/views/org/scientificcms/contenttypes/scidepartment/ui/create-scidepartment.xhtml b/sci-types-department/src/main/resources/WEB-INF/views/org/scientificcms/contenttypes/scidepartment/ui/create-scidepartment.xhtml new file mode 100644 index 0000000..c669db6 --- /dev/null +++ b/sci-types-department/src/main/resources/WEB-INF/views/org/scientificcms/contenttypes/scidepartment/ui/create-scidepartment.xhtml @@ -0,0 +1,86 @@ +]> + + + + +
+

#{SciDepartmentMessageBundle['createstep.title']}

+ + + + + +
+ + + + + + + + + + + + #{SciDepartmentMessageBundle['createform.cancel']} + + + + +
+
+ +
+ diff --git a/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/DefaultTextKeys.properties b/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/DefaultTextKeys.properties new file mode 100644 index 0000000..c43c21b --- /dev/null +++ b/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/DefaultTextKeys.properties @@ -0,0 +1,3 @@ + +scidepartment.research=Research +scidepartment.concept=Concept diff --git a/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/DefaultTextKeys_de.properties b/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/DefaultTextKeys_de.properties new file mode 100644 index 0000000..f608bfa --- /dev/null +++ b/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/DefaultTextKeys_de.properties @@ -0,0 +1,3 @@ + +scidepartment.research=Forschung +scidepartment.concept=Leitkonzept diff --git a/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentBundle.properties b/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentBundle.properties index 5e37325..ec666a2 100644 --- a/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentBundle.properties +++ b/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentBundle.properties @@ -5,3 +5,16 @@ authoringsteps.description.label=Description scidepartment.edit.denied=Access denied. authoringsteps.basicproperties.description=Basicproperties of the department. authoringsteps.basicproperties.label=Basic Properties +createstep.title=Create a new department description +createstep.name.help=The name of the new department description. Also used as URL fragment. +createstep.name.label=Name +createform.initial_locale.help=The initial locale of the department description. +createform.initial_locale.label=Summary +createform.title.help=The title of the department. +createform.title.label=Title +createform.summary.help=A summary of the description of the department. +createform.summary.label=Summary +createform.workflow.help=The workflow to use for the department description. +createform.workflow.label=Workflow +createform.cancel=Cancel +createform.submit=Create department diff --git a/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentBundle_de.properties b/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentBundle_de.properties index c7805e8..542fd79 100644 --- a/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentBundle_de.properties +++ b/sci-types-department/src/main/resources/org/scientificcms/contenttypes/scidepartment/ui/SciDepartmentBundle_de.properties @@ -5,3 +5,16 @@ authoringsteps.description.label=Beschreibung scidepartment.edit.denied=Zugriff verweigert. authoringsteps.basicproperties.description=Basiseigenschaften der Abteilung. authoringsteps.basicproperties.label=Basiseigenschaften +createstep.title=Neue Abteilungsbeschriebung anlegen +createstep.name.help=Der Name des neuen Abteilungsbeschreibung. Wird auch als URL-Fragment genutzt. +createstep.name.label=Name +createform.initial_locale.help=Die initiale Sprache der Abteilungsbeschreibung. +createform.initial_locale.label=Zusammenfassung +createform.title.help=Der Titel des Abteilung. +createform.title.label=Titel +createform.summary.help=Eine Zusammenfassung der Beschreibung der Abteilung +createform.summary.label=Zusammenfassung +createform.workflow.help=Der Arbeitsablauf, der f\u00fcr die Abteilungsbeschreibung genutzt werden soll. +createform.workflow.label=Arbeitsablauf +createform.cancel=Abbrechen +createform.submit=Abteilung anlegen