You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2022/11/04 10:48:57 UTC
[isis] branch master updated (2d0a07484b -> 0f4de40846)
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
from 2d0a07484b Merge branch 'ISIS-3271'
new 05d7d4d932 ISIS-3272: support menu bars layout loading based on mime type (in principal)
new 0f4de40846 ISIS-3272: move config section 'Application' from viewer/wicket to viewer/common
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../MenuBarsLoaderService_010-implementation.adoc | 8 +-
.../applib/services/grid/GridLoaderService.java | 4 +-
.../services/menu/MenuBarsLoaderService.java | 29 ++-
.../applib/services/menu/MenuBarsService.java | 2 -
.../causeway/applib/value/NamedWithMimeType.java | 36 ++++
.../core/config/CausewayConfiguration.java | 212 +++++++++++----------
.../services/layout/LayoutServiceDefault.java | 5 +-
.../runtimeservices/src/main/java/module-info.java | 1 -
.../CausewayModuleCoreRuntimeServices.java | 8 +-
.../MenuBarsLoaderServiceBootstrap.java} | 108 +++++++----
...erviceBS.java => MenuBarsServiceBootstrap.java} | 26 +--
.../RuntimeServicesTestAbstract.java | 12 +-
.../menubars/bootstrap/MenuBarsServiceBSTest.java | 9 +-
.../confmenu/ConfigurationViewServiceDefault.java | 4 +-
.../_infra/resources/AsciiDocReaderService.java | 2 +-
.../resources/MarkupVariableResolverService.java | 8 +-
.../demo/domain/src/main/resources/application.yml | 5 +-
.../vaadin/ui/pages/login/VaadinLoginView.java | 10 +-
.../viewer/vaadin/ui/pages/main/TabUtil.java | 4 +-
.../testdomain/rest/MenuBarsResourceTest.java | 42 ++--
.../branding/BrandingUiServiceDefault.java | 4 +-
.../services/menu/MenuUiServiceDefault.java | 2 +
.../viewer/wicket/model/models/AboutModel.java | 6 +-
.../wicket/model/models/HasCommonContext.java | 5 +
.../wicket/ui/components/about/AboutPanel.java | 2 +-
.../wicket/ui/components/footer/FooterPanel.java | 2 +-
.../viewer/wicket/ui/pages/PageAbstract.java | 8 +-
.../viewer/wicket/ui/pages/WebPageBase.java | 2 +-
.../accmngt/AccountManagementPageAbstract.java | 6 +-
.../password_reset/PasswordResetEmailPanel.java | 2 +-
.../accmngt/signup/RegistrationFormPanel.java | 2 +-
.../wicket/ui/pages/mmverror/MmvErrorPage.java | 8 +-
32 files changed, 339 insertions(+), 245 deletions(-)
rename core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/{MenuBarsLoaderServiceDefault.java => bootstrap/MenuBarsLoaderServiceBootstrap.java} (53%)
rename core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/{MenuBarsServiceBS.java => MenuBarsServiceBootstrap.java} (96%)
[isis] 01/02: ISIS-3272: support menu bars layout loading based on mime type (in principal)
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 05d7d4d93294dee591e233b6342133e5d68900dd
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Nov 4 11:28:56 2022 +0100
ISIS-3272: support menu bars layout loading based on mime type (in
principal)
- yet only implementing XML (no changes here)
---
.../applib/services/grid/GridLoaderService.java | 4 +-
.../services/menu/MenuBarsLoaderService.java | 29 ++++--
.../applib/services/menu/MenuBarsService.java | 2 -
.../causeway/applib/value/NamedWithMimeType.java | 36 +++++++
.../core/config/CausewayConfiguration.java | 12 ++-
.../services/layout/LayoutServiceDefault.java | 5 +-
.../runtimeservices/src/main/java/module-info.java | 1 -
.../CausewayModuleCoreRuntimeServices.java | 8 +-
.../MenuBarsLoaderServiceBootstrap.java} | 108 +++++++++++++--------
...erviceBS.java => MenuBarsServiceBootstrap.java} | 26 ++---
.../RuntimeServicesTestAbstract.java | 12 +--
.../menubars/bootstrap/MenuBarsServiceBSTest.java | 9 +-
.../viewer/vaadin/ui/pages/main/TabUtil.java | 4 +-
.../testdomain/rest/MenuBarsResourceTest.java | 42 ++++----
.../services/menu/MenuUiServiceDefault.java | 2 +
15 files changed, 192 insertions(+), 108 deletions(-)
diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/grid/GridLoaderService.java b/api/applib/src/main/java/org/apache/causeway/applib/services/grid/GridLoaderService.java
index 7e2adb12b8..37833c16ee 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/services/grid/GridLoaderService.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/services/grid/GridLoaderService.java
@@ -63,12 +63,12 @@ public interface GridLoaderService {
* Returns a new instance of a {@link Grid} for the specified domain class, eg from a
* <code>layout.xml</code> file, else <code>null</code>.
*/
- default Grid load(Class<?> domainClass) {
+ default Grid load(final Class<?> domainClass) {
return load(domainClass, null);
}
/**
- * Loads a specic alternative {@link Grid} layout for the specified domain
+ * Loads a specific alternative {@link Grid} layout for the specified domain
* class.
*
* <p>
diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/menu/MenuBarsLoaderService.java b/api/applib/src/main/java/org/apache/causeway/applib/services/menu/MenuBarsLoaderService.java
index d351c83b22..5e5986e269 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/services/menu/MenuBarsLoaderService.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/services/menu/MenuBarsLoaderService.java
@@ -18,14 +18,17 @@
*/
package org.apache.causeway.applib.services.menu;
-import org.apache.causeway.applib.layout.menubars.bootstrap.BSMenuBars;
+import java.util.EnumSet;
+import java.util.Optional;
+
+import org.apache.causeway.applib.layout.menubars.MenuBars;
+import org.apache.causeway.applib.value.NamedWithMimeType.CommonMimeType;
/**
- * Returns the {@link BSMenuBars} instance (bootstrap3-specific subtype of
- * {@link org.apache.causeway.applib.layout.menubars.MenuBars}, for the UI.
+ * Returns the {@link MenuBars} instance for the UI.
*
* <p>
- * The default implementation deserializes the `menubars.layout.xml` file
+ * The default implementation de-serializes the `menubars.layout...` file
* read from the classpath.
* </p>
*
@@ -34,9 +37,11 @@ import org.apache.causeway.applib.layout.menubars.bootstrap.BSMenuBars;
* {@link MenuBarsService}.
* </p>
*
- * @since 1.x {@index}
+ * @since 1.x - revised for 2.0 {@index}
*/
-public interface MenuBarsLoaderService {
+public interface MenuBarsLoaderService<T extends MenuBars> {
+
+ Class<T> implementedMenuBarsClass();
/**
* Whether dynamic reloading of layouts is enabled.
@@ -49,9 +54,15 @@ public interface MenuBarsLoaderService {
boolean supportsReloading();
/**
- * Returns a new instance of a {@link BSMenuBars} if possible,
- * else <tt>null</tt>.
+ * Supported format(s) for {@link #menuBars()}.
+ */
+ EnumSet<CommonMimeType> supportedFormats();
+
+ /**
+ * Returns a new instance of a {@link MenuBars} if possible,
+ * else <tt>Optional.empty()</tt>.
+ * @throws UnsupportedOperationException - when format is not supported
*/
- BSMenuBars menuBars();
+ Optional<T> menuBars();
}
diff --git a/api/applib/src/main/java/org/apache/causeway/applib/services/menu/MenuBarsService.java b/api/applib/src/main/java/org/apache/causeway/applib/services/menu/MenuBarsService.java
index 654359f435..994e5f392b 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/services/menu/MenuBarsService.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/services/menu/MenuBarsService.java
@@ -39,8 +39,6 @@ import org.apache.causeway.commons.internal.exceptions._Exceptions;
*/
public interface MenuBarsService {
- @Named(CausewayModuleApplib.NAMESPACE + ".services.menu.MenuBarsService.Type")
- @Value
enum Type {
/**
diff --git a/api/applib/src/main/java/org/apache/causeway/applib/value/NamedWithMimeType.java b/api/applib/src/main/java/org/apache/causeway/applib/value/NamedWithMimeType.java
index 8917d43258..73a7df0e48 100644
--- a/api/applib/src/main/java/org/apache/causeway/applib/value/NamedWithMimeType.java
+++ b/api/applib/src/main/java/org/apache/causeway/applib/value/NamedWithMimeType.java
@@ -19,14 +19,19 @@
package org.apache.causeway.applib.value;
import java.io.Serializable;
+import java.util.Optional;
+import java.util.stream.Stream;
import javax.activation.MimeType;
import javax.activation.MimeTypeParseException;
+import org.springframework.lang.Nullable;
+
import org.apache.causeway.commons.collections.Can;
import org.apache.causeway.commons.internal.base._Strings;
import lombok.Getter;
+import lombok.val;
/**
* @since 1.x {@index}
@@ -207,6 +212,37 @@ extends
return mimeType.match(otherMimeType);
}
+ /**
+ * Tries to match fileExt with any {@link CommonMimeType}.
+ */
+ public static Optional<CommonMimeType> valueOfFileExtension(final @Nullable String fileExt) {
+ if(_Strings.isNullOrEmpty(fileExt)) {
+ return Optional.empty();
+ }
+ val fileExtLower = fileExt.toLowerCase();
+ return Stream.of(CommonMimeType.values())
+ .filter(mime->mime.getProposedFileExtensions().contains(fileExtLower))
+ .findFirst();
+ }
+
+ /**
+ * Parses fileName for its extension and tries to match with any {@link CommonMimeType}.
+ */
+ public static Optional<CommonMimeType> valueOfFileName(final @Nullable String fileName) {
+ if(_Strings.isNullOrEmpty(fileName)) {
+ return Optional.empty();
+ }
+ final int p = fileName.lastIndexOf('.');
+ if(p<0) {
+ return Optional.empty();
+ }
+ final int beginIndex = p + 1;
+ if ((fileName.length() - beginIndex) < 0) {
+ return Optional.empty();
+ }
+ return valueOfFileExtension(fileName.substring(beginIndex));
+ }
+
}
}
diff --git a/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java b/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
index 4fee76a0bc..0a0f08dcd8 100644
--- a/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
+++ b/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
@@ -42,7 +42,11 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
import javax.activation.DataSource;
import javax.inject.Named;
-import javax.validation.*;
+import javax.validation.Constraint;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+import javax.validation.Payload;
+import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
@@ -2248,6 +2252,10 @@ public class CausewayConfiguration {
*/
private boolean wicketSourcePlugin = false;
+ /**
+ * @deprecated common to all viewers - needs to be moved out of Wicket
+ */
+ @Deprecated
private final Application application = new Application();
@Data
public static class Application {
@@ -2325,7 +2333,7 @@ public class CausewayConfiguration {
* </p>
*/
@NotNull @NotEmpty
- private String menubarsLayoutXml = "menubars.layout.xml";
+ private String menubarsLayoutFile = "menubars.layout.xml";
/**
* Identifies the application on the sign-in page
diff --git a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/layout/LayoutServiceDefault.java b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/layout/LayoutServiceDefault.java
index d1db5d9c43..b6f46171c7 100644
--- a/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/layout/LayoutServiceDefault.java
+++ b/core/metamodel/src/main/java/org/apache/causeway/core/metamodel/services/layout/LayoutServiceDefault.java
@@ -39,7 +39,6 @@ import org.apache.causeway.applib.services.jaxb.JaxbService;
import org.apache.causeway.applib.services.layout.LayoutExportStyle;
import org.apache.causeway.applib.services.layout.LayoutService;
import org.apache.causeway.applib.services.menu.MenuBarsService;
-import org.apache.causeway.applib.services.menu.MenuBarsService.Type;
import org.apache.causeway.applib.util.ZipWriter;
import org.apache.causeway.applib.value.NamedWithMimeType.CommonMimeType;
import org.apache.causeway.commons.functional.Try;
@@ -104,7 +103,9 @@ public class LayoutServiceDefault implements LayoutService {
}
@Override
- public String menuBarsLayout(final Type type, final CommonMimeType format) {
+ public String menuBarsLayout(
+ final MenuBarsService.Type type,
+ final CommonMimeType format) {
switch(format) {
case XML:{
final MenuBars menuBars = menuBarsService.menuBars(type);
diff --git a/core/runtimeservices/src/main/java/module-info.java b/core/runtimeservices/src/main/java/module-info.java
index bc734ebd4e..69986102e3 100644
--- a/core/runtimeservices/src/main/java/module-info.java
+++ b/core/runtimeservices/src/main/java/module-info.java
@@ -30,7 +30,6 @@ module org.apache.causeway.core.runtimeservices {
exports org.apache.causeway.core.runtimeservices.interaction;
exports org.apache.causeway.core.runtimeservices.jaxb;
exports org.apache.causeway.core.runtimeservices.locale;
- exports org.apache.causeway.core.runtimeservices.menubars;
exports org.apache.causeway.core.runtimeservices.menubars.bootstrap;
exports org.apache.causeway.core.runtimeservices.message;
exports org.apache.causeway.core.runtimeservices.placeholder;
diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/CausewayModuleCoreRuntimeServices.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/CausewayModuleCoreRuntimeServices.java
index d47c144b99..526ac6c74b 100644
--- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/CausewayModuleCoreRuntimeServices.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/CausewayModuleCoreRuntimeServices.java
@@ -44,8 +44,8 @@ import org.apache.causeway.core.runtimeservices.interaction.InteractionDtoFactor
import org.apache.causeway.core.runtimeservices.jaxb.JaxbServiceDefault;
import org.apache.causeway.core.runtimeservices.locale.LanguageProviderDefault;
import org.apache.causeway.core.runtimeservices.locale.LocaleChoiceProviderDefault;
-import org.apache.causeway.core.runtimeservices.menubars.MenuBarsLoaderServiceDefault;
-import org.apache.causeway.core.runtimeservices.menubars.bootstrap.MenuBarsServiceBS;
+import org.apache.causeway.core.runtimeservices.menubars.bootstrap.MenuBarsLoaderServiceBootstrap;
+import org.apache.causeway.core.runtimeservices.menubars.bootstrap.MenuBarsServiceBootstrap;
import org.apache.causeway.core.runtimeservices.message.MessageServiceDefault;
import org.apache.causeway.core.runtimeservices.placeholder.PlaceholderRenderServiceDefault;
import org.apache.causeway.core.runtimeservices.publish.CommandPublisherDefault;
@@ -103,8 +103,8 @@ import org.apache.causeway.core.runtimeservices.xmlsnapshot.XmlSnapshotServiceDe
LanguageProviderDefault.class,
LocaleChoiceProviderDefault.class,
MemberExecutorServiceDefault.class,
- MenuBarsLoaderServiceDefault.class,
- MenuBarsServiceBS.class,
+ MenuBarsLoaderServiceBootstrap.class,
+ MenuBarsServiceBootstrap.class,
MessageServiceDefault.class,
ObjectIconServiceDefault.class,
ObjectLifecyclePublisherDefault.class,
diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/MenuBarsLoaderServiceDefault.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsLoaderServiceBootstrap.java
similarity index 53%
rename from core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/MenuBarsLoaderServiceDefault.java
rename to core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsLoaderServiceBootstrap.java
index 74d43571bc..217c5390c5 100644
--- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/MenuBarsLoaderServiceDefault.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsLoaderServiceBootstrap.java
@@ -16,11 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.causeway.core.runtimeservices.menubars;
+package org.apache.causeway.core.runtimeservices.menubars.bootstrap;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
+import java.util.EnumSet;
+import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Priority;
@@ -36,54 +38,73 @@ import org.apache.causeway.applib.annotation.PriorityPrecedence;
import org.apache.causeway.applib.layout.menubars.bootstrap.BSMenuBars;
import org.apache.causeway.applib.services.jaxb.JaxbService;
import org.apache.causeway.applib.services.menu.MenuBarsLoaderService;
+import org.apache.causeway.applib.value.NamedWithMimeType.CommonMimeType;
import org.apache.causeway.commons.internal.base._Strings;
-import org.apache.causeway.core.config.CausewayConfiguration;
-import org.apache.causeway.core.config.environment.CausewaySystemEnvironment;
import org.apache.causeway.core.config.viewer.web.WebAppContextPath;
+import org.apache.causeway.core.metamodel.context.MetaModelContext;
import org.apache.causeway.core.runtimeservices.CausewayModuleCoreRuntimeServices;
+import lombok.Getter;
import lombok.val;
+import lombok.experimental.Accessors;
import lombok.extern.log4j.Log4j2;
@Service
-@Named(CausewayModuleCoreRuntimeServices.NAMESPACE + ".MenuBarsLoaderServiceDefault")
+@Named(CausewayModuleCoreRuntimeServices.NAMESPACE + ".MenuBarsLoaderServiceBootstrap")
@Priority(PriorityPrecedence.MIDPOINT)
@Qualifier("Default")
@Log4j2
-public class MenuBarsLoaderServiceDefault
-implements MenuBarsLoaderService {
+public class MenuBarsLoaderServiceBootstrap
+implements MenuBarsLoaderService<BSMenuBars> {
private final JaxbService jaxbService;
private final boolean supportsReloading;
- private final AtomicReference<AbstractResource> menubarsLayoutXmlResourceRef;
+
+ @Getter(onMethod_={@Override}) @Accessors(fluent = true)
+ private final EnumSet<CommonMimeType> supportedFormats = EnumSet.of(CommonMimeType.XML);
+
+ private final AtomicReference<AbstractResource> menubarsLayoutResourceRef;
@Inject
- public MenuBarsLoaderServiceDefault(
- final CausewaySystemEnvironment causewaySystemEnvironment,
- final JaxbService jaxbService,
- final CausewayConfiguration causewayConfiguration) {
+ public MenuBarsLoaderServiceBootstrap(
+ final MetaModelContext mmc,
+ final JaxbService jaxbService) {
this.jaxbService = jaxbService;
- this.supportsReloading = causewaySystemEnvironment.isPrototyping();
-
- val menubarsLayoutXmlResource =
- new ClassPathResource(causewayConfiguration.getViewer().getWicket().getApplication().getMenubarsLayoutXml());
- this.menubarsLayoutXmlResourceRef = new AtomicReference<>(menubarsLayoutXmlResource);
+ this.supportsReloading = mmc.getSystemEnvironment().isPrototyping();
+
+ val menubarsLayoutFile = mmc.getConfiguration().getViewer().getWicket().getApplication()
+ .getMenubarsLayoutFile();
+ val menubarsLayoutResource = new ClassPathResource(menubarsLayoutFile);
+ if(!menubarsLayoutResource.exists()) {
+ log.warn("menubarsLayoutFile {} (as configured for Apache Causeway) not found",
+ menubarsLayoutFile);
+ }
+ this.menubarsLayoutMimeType = CommonMimeType.valueOfFileName(menubarsLayoutFile)
+ .filter(supportedFormats::contains)
+ .orElse(CommonMimeType.XML); // fallback default
+ this.menubarsLayoutResourceRef = new AtomicReference<>(menubarsLayoutResource);
}
// JUnit support
- public MenuBarsLoaderServiceDefault(
+ public MenuBarsLoaderServiceBootstrap(
final JaxbService jaxbService,
- final AtomicReference<AbstractResource> menubarsLayoutXmlResourceRef) {
+ final AtomicReference<AbstractResource> menubarsLayoutResourceRef) {
this.jaxbService = jaxbService;
this.supportsReloading = true;
- menubarsLayoutXmlResourceRef.getAndUpdate(r->r!=null
+ menubarsLayoutResourceRef.getAndUpdate(r->r!=null
? r
: new AbstractResource() {
@Override public String getDescription() { return "Empty Resource"; }
@Override public InputStream getInputStream() throws IOException { return null; }}
);
- this.menubarsLayoutXmlResourceRef = menubarsLayoutXmlResourceRef;
+ this.menubarsLayoutResourceRef = menubarsLayoutResourceRef;
+ this.menubarsLayoutMimeType = CommonMimeType.XML;
+ }
+
+ @Override
+ public Class<BSMenuBars> implementedMenuBarsClass() {
+ return BSMenuBars.class;
}
@Override
@@ -92,16 +113,23 @@ implements MenuBarsLoaderService {
}
@Override
- public BSMenuBars menuBars() {
- return loadMenuBars(loadMenubarsLayoutResource());
+ public Optional<BSMenuBars> menuBars() {
+ return Optional.ofNullable(loadMenuBars(loadMenubarsLayoutResource()));
}
// public, in support of JUnit testing
- public BSMenuBars loadMenuBars(String xmlString) {
- try {
- return jaxbService.fromXml(BSMenuBars.class, xmlString);
- } catch (Exception e) {
- severeCannotLoad(menubarsLayoutXmlResourceRef.get(), e);
+ public BSMenuBars loadMenuBars(final String layoutFileContent) {
+
+ switch(menubarsLayoutMimeType) {
+ case XML:{
+ try {
+ return jaxbService.fromXml(BSMenuBars.class, layoutFileContent);
+ } catch (Exception e) {
+ severeCannotLoad(menubarsLayoutResourceRef.get(), e);
+ return null;
+ }
+ }
+ default:
return null;
}
}
@@ -110,31 +138,32 @@ implements MenuBarsLoaderService {
private String loadMenubarsLayoutResource() {
- val menubarsLayoutXmlResource = menubarsLayoutXmlResourceRef.get();
+ val menubarsLayoutResource = menubarsLayoutResourceRef.get();
try {
- if(!menubarsLayoutXmlResource.exists()) {
+ if(!menubarsLayoutResource.exists()) {
return null;
}
- val source = menubarsLayoutXmlResource.getInputStream(); // throws if not found
- final String xml =
+ val source = menubarsLayoutResource.getInputStream(); // throws if not found
+ final String layoutFileContent =
_Strings.read(source, StandardCharsets.UTF_8);
- if(xml == null) {
- warnNotFound(menubarsLayoutXmlResource);
+ if(layoutFileContent == null) {
+ warnNotFound(menubarsLayoutResource);
}
- return xml;
+ return layoutFileContent;
} catch (Exception e) {
- severeCannotLoad(menubarsLayoutXmlResource, e);
+ severeCannotLoad(menubarsLayoutResource, e);
return null;
}
}
private boolean warnedOnce = false;
+ private CommonMimeType menubarsLayoutMimeType;
- private void warnNotFound(AbstractResource menubarsLayoutXmlResource) {
+ private void warnNotFound(final AbstractResource menubarsLayoutResource) {
if(warnedOnce) {
return;
}
@@ -142,16 +171,17 @@ implements MenuBarsLoaderService {
log.warn(
"{}: could not find readable resource {} for the Menubars-Layout.",
WebAppContextPath.class.getName(),
- menubarsLayoutXmlResource);
+ menubarsLayoutResource);
warnedOnce = true;
}
- private void severeCannotLoad(AbstractResource menubarsLayoutXmlResource, Exception cause) {
+ private void severeCannotLoad(final AbstractResource menubarsLayoutResource, final Exception cause) {
log.error("{}: could not find readable resource {} for the Menubars-Layout.",
WebAppContextPath.class.getName(),
- menubarsLayoutXmlResource,
+ menubarsLayoutResource,
cause);
}
+
}
diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsServiceBS.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsServiceBootstrap.java
similarity index 96%
rename from core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsServiceBS.java
rename to core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsServiceBootstrap.java
index bbdcec8e01..0b426692d5 100644
--- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsServiceBS.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsServiceBootstrap.java
@@ -20,7 +20,6 @@ package org.apache.causeway.core.runtimeservices.menubars.bootstrap;
import java.util.List;
import java.util.Map;
-import java.util.Optional;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@@ -37,6 +36,7 @@ import org.apache.causeway.applib.annotation.DomainServiceLayout;
import org.apache.causeway.applib.annotation.NatureOfService;
import org.apache.causeway.applib.annotation.PriorityPrecedence;
import org.apache.causeway.applib.layout.component.ServiceActionLayoutData;
+import org.apache.causeway.applib.layout.menubars.MenuBars;
import org.apache.causeway.applib.layout.menubars.bootstrap.BSMenu;
import org.apache.causeway.applib.layout.menubars.bootstrap.BSMenuBar;
import org.apache.causeway.applib.layout.menubars.bootstrap.BSMenuBars;
@@ -51,7 +51,6 @@ import org.apache.causeway.commons.internal.base._Strings;
import org.apache.causeway.commons.internal.collections._Lists;
import org.apache.causeway.commons.internal.collections._Maps;
import org.apache.causeway.commons.internal.collections._Sets;
-import org.apache.causeway.core.config.environment.CausewaySystemEnvironment;
import org.apache.causeway.core.metamodel.context.MetaModelContext;
import org.apache.causeway.core.metamodel.facetapi.Facet.Precedence;
import org.apache.causeway.core.metamodel.facetapi.FacetUtil;
@@ -81,12 +80,12 @@ import lombok.val;
import lombok.extern.log4j.Log4j2;
@Service
-@Named(CausewayModuleCoreRuntimeServices.NAMESPACE + ".MenuBarsServiceBS")
+@Named(CausewayModuleCoreRuntimeServices.NAMESPACE + ".MenuBarsServiceBootstrap")
@Priority(PriorityPrecedence.MIDPOINT)
@Qualifier("BS")
@RequiredArgsConstructor(onConstructor_ = {@Inject})
@Log4j2
-public class MenuBarsServiceBS
+public class MenuBarsServiceBootstrap
implements MenuBarsService {
public static final String MB3_TNS = "http://causeway.apache.org/applib/layout/menubars/bootstrap3";
@@ -98,18 +97,18 @@ implements MenuBarsService {
public static final String LINKS_TNS = GridServiceDefault.LINKS_TNS;
public static final String LINKS_SCHEMA_LOCATION = GridServiceDefault.LINKS_SCHEMA_LOCATION;
- private final MenuBarsLoaderService menuBarsLoaderService;
+ private final MenuBarsLoaderService<BSMenuBars> loader;
private final MessageService messageService;
private final JaxbService jaxbService;
- private final CausewaySystemEnvironment causewaySystemEnvironment;
private final MetaModelContext metaModelContext;
- private final _Lazy<BSMenuBars> menuBarsFromAnnotationsOnly = _Lazy.threadSafe(this::menuBarsFromAnnotationsOnly);
+ private final _Lazy<BSMenuBars> menuBarsFromAnnotationsOnly =
+ _Lazy.threadSafe(this::menuBarsFromAnnotationsOnly);
BSMenuBars menuBars;
@Override
- public BSMenuBars menuBars(final Type type) {
+ public MenuBars menuBars(final Type type) {
val menuBarsFromAnnotationsOnly = this.menuBarsFromAnnotationsOnly.get();
@@ -127,16 +126,17 @@ implements MenuBarsService {
val menuBarsFromAnnotationsOnly = this.menuBarsFromAnnotationsOnly.get();
// load (and only fallback if nothing could be loaded)...
- if(menuBars == null || menuBarsLoaderService.supportsReloading()) {
+ if(menuBars == null || loader.supportsReloading()) {
this.menuBars = loadOrElse(menuBarsFromAnnotationsOnly);
}
return menuBars;
}
- private BSMenuBars loadOrElse(final BSMenuBars menuBarsFromAnnotationsOnly) {
+ private BSMenuBars loadOrElse(
+ final BSMenuBars menuBarsFromAnnotationsOnly) {
- val menuBars = Optional.ofNullable(menuBarsLoaderService.menuBars())
+ val menuBars = loader.menuBars()
.map(this::updateFacetsFromActionLayoutXml)
.map(this::addTnsAndSchemaLocation)
.orElse(menuBarsFromAnnotationsOnly);
@@ -271,7 +271,7 @@ implements MenuBarsService {
menuBars.setMetadataError(
"Exactly one menu must have 'unreferencedActions' flag set; found " + size + " such menus");
- if(causewaySystemEnvironment.isPrototyping()) {
+ if(metaModelContext.getSystemEnvironment().isPrototyping()) {
messageService.warnUser("Menubars metadata errors; check the error log");
}
log.error("Menubar layout metadata errors:\n\n{}\n\n", jaxbService.toXml(menuBars));
@@ -502,5 +502,7 @@ implements MenuBarsService {
}
+
+
}
diff --git a/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/RuntimeServicesTestAbstract.java b/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/RuntimeServicesTestAbstract.java
index 1b02c498b3..3565b936b8 100644
--- a/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/RuntimeServicesTestAbstract.java
+++ b/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/RuntimeServicesTestAbstract.java
@@ -33,8 +33,8 @@ import org.apache.causeway.core.metamodel._testing.MetaModelContext_forTesting;
import org.apache.causeway.core.metamodel._testing.MetaModelContext_forTesting.MetaModelContext_forTestingBuilder;
import org.apache.causeway.core.metamodel.context.HasMetaModelContext;
import org.apache.causeway.core.metamodel.context.MetaModelContext;
-import org.apache.causeway.core.runtimeservices.menubars.MenuBarsLoaderServiceDefault;
-import org.apache.causeway.core.runtimeservices.menubars.bootstrap.MenuBarsServiceBS;
+import org.apache.causeway.core.runtimeservices.menubars.bootstrap.MenuBarsLoaderServiceBootstrap;
+import org.apache.causeway.core.runtimeservices.menubars.bootstrap.MenuBarsServiceBootstrap;
import lombok.Getter;
import lombok.val;
@@ -68,7 +68,7 @@ implements HasMetaModelContext {
.forTestingLazy(MenuBarsLoaderService.class, ()->{
val jaxbService = getServiceRegistry().lookupServiceElseFail(JaxbService.class);
- return new MenuBarsLoaderServiceDefault(
+ return new MenuBarsLoaderServiceBootstrap(
jaxbService,
menubarsLayoutXmlResourceRef);
}));
@@ -81,13 +81,11 @@ implements HasMetaModelContext {
val messageService = getServiceRegistry().lookupServiceElseFail(MessageService.class);
val jaxbService = getServiceRegistry().lookupServiceElseFail(JaxbService.class);
val menuBarsLoaderService = getServiceRegistry().lookupServiceElseFail(MenuBarsLoaderService.class);
- return new MenuBarsServiceBS(
+ return new MenuBarsServiceBootstrap(
menuBarsLoaderService,
messageService,
jaxbService,
- getSystemEnvironment(),
metaModelContext);
-
}));
@@ -105,7 +103,7 @@ implements HasMetaModelContext {
metaModelContext = null;
}
- protected void onSetUp(MetaModelContext_forTestingBuilder mmcBuilder) {
+ protected void onSetUp(final MetaModelContext_forTestingBuilder mmcBuilder) {
}
protected void afterSetUp() {
diff --git a/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsServiceBSTest.java b/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsServiceBSTest.java
index 4b1a1cc995..1590ac3e4b 100644
--- a/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsServiceBSTest.java
+++ b/core/runtimeservices/src/test/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsServiceBSTest.java
@@ -39,15 +39,14 @@ import org.apache.causeway.core.metamodel._testing.MetaModelContext_forTesting.M
import org.apache.causeway.core.metamodel.facetapi.Facet.Precedence;
import org.apache.causeway.core.metamodel.facets.all.named.MemberNamedFacet;
import org.apache.causeway.core.runtimeservices.RuntimeServicesTestAbstract;
-import org.apache.causeway.core.runtimeservices.menubars.MenuBarsLoaderServiceDefault;
import lombok.val;
class MenuBarsServiceBSTest
extends RuntimeServicesTestAbstract {
- private MenuBarsServiceBS menuBarsService;
- private MenuBarsLoaderServiceDefault menuBarsLoaderService;
+ private MenuBarsServiceBootstrap menuBarsService;
+ private MenuBarsLoaderServiceBootstrap menuBarsLoaderService;
private LayoutService layoutService;
@Override
@@ -61,8 +60,8 @@ extends RuntimeServicesTestAbstract {
getConfiguration().getCore().getMetaModel().getIntrospector().setValidateIncrementally(false);
layoutService = getServiceRegistry().lookupServiceElseFail(LayoutService.class);
- menuBarsService = (MenuBarsServiceBS) getServiceRegistry().lookupServiceElseFail(MenuBarsService.class);
- menuBarsLoaderService = (MenuBarsLoaderServiceDefault) getServiceRegistry().lookupServiceElseFail(MenuBarsLoaderService.class);
+ menuBarsService = (MenuBarsServiceBootstrap) getServiceRegistry().lookupServiceElseFail(MenuBarsService.class);
+ menuBarsLoaderService = (MenuBarsLoaderServiceBootstrap) getServiceRegistry().lookupServiceElseFail(MenuBarsLoaderService.class);
// double check, we are all set
assertNotNull(getSpecificationLoader().loadSpecification(Bar.class));
diff --git a/incubator/viewers/vaadin/ui/src/main/java/org/apache/causeway/incubator/viewer/vaadin/ui/pages/main/TabUtil.java b/incubator/viewers/vaadin/ui/src/main/java/org/apache/causeway/incubator/viewer/vaadin/ui/pages/main/TabUtil.java
index e6f81b1898..b498bb85ab 100644
--- a/incubator/viewers/vaadin/ui/src/main/java/org/apache/causeway/incubator/viewer/vaadin/ui/pages/main/TabUtil.java
+++ b/incubator/viewers/vaadin/ui/src/main/java/org/apache/causeway/incubator/viewer/vaadin/ui/pages/main/TabUtil.java
@@ -28,7 +28,7 @@ import com.vaadin.flow.component.tabs.Tabs;
import com.vaadin.flow.router.RouteConfiguration;
import com.vaadin.flow.router.RouterLink;
-import org.apache.causeway.core.runtimeservices.menubars.bootstrap.MenuBarsServiceBS;
+import org.apache.causeway.core.runtimeservices.menubars.bootstrap.MenuBarsServiceBootstrap;
import lombok.experimental.UtilityClass;
@@ -36,7 +36,7 @@ import lombok.experimental.UtilityClass;
@UtilityClass
final class TabUtil {
- static void createMenuTabs(final MenuBarsServiceBS menuBarsService, final Consumer<Tab> onTabCreated) {
+ static void createMenuTabs(final MenuBarsServiceBootstrap menuBarsService, final Consumer<Tab> onTabCreated) {
// onTabCreated.accept(TabUtil.createTab("Dashboard", DashboardView.class));
}
diff --git a/regressiontests/incubating/src/test/java/org/apache/causeway/testdomain/rest/MenuBarsResourceTest.java b/regressiontests/incubating/src/test/java/org/apache/causeway/testdomain/rest/MenuBarsResourceTest.java
index 17bbc652df..4c50440991 100644
--- a/regressiontests/incubating/src/test/java/org/apache/causeway/testdomain/rest/MenuBarsResourceTest.java
+++ b/regressiontests/incubating/src/test/java/org/apache/causeway/testdomain/rest/MenuBarsResourceTest.java
@@ -46,11 +46,11 @@ import org.apache.causeway.viewer.restfulobjects.viewer.resources.serialization.
import lombok.val;
@SpringBootTest(
- classes = {
+ classes = {
Configuration_headless.class,
Configuration_usingActionSemantics.class,
MenuBarsResourceTest.TestSetup.class
- },
+ },
properties = {
"causeway.core.meta-model.introspector.mode=FULL",
"causeway.applib.annotation.domain-object.editing=TRUE",
@@ -62,7 +62,7 @@ import lombok.val;
CausewayPresets.SilenceProgrammingModel
})
class MenuBarsResourceTest {
-
+
@Inject private MenuBarsResourceServerside menuBarsResourceServerside;
@Inject private MenuBarsService menuBarsService;
@@ -71,50 +71,50 @@ class MenuBarsResourceTest {
MenuBarsResourceServerside.class
})
static class TestSetup {
-
+
}
-
+
@Test
void blobDemoMenu_fromMenuBarsResourceServerside_shouldBe_GET() {
-
+
assertNotNull(menuBarsResourceServerside);
-
- val layoutResourceDescriptor =
+
+ val layoutResourceDescriptor =
ResourceDescriptor
.of(RepresentationType.MENUBARS, Where.ANYWHERE, RepresentationService.Intent.NOT_APPLICABLE);
-
+
val resourceContext = menuBarsResourceServerside.resourceContextForTesting(layoutResourceDescriptor, /*params*/null);
val linksForServiceActionsAddingVisitor = MenuBarsResourceServerside.linksForServiceActionsAddingVisitor(resourceContext);
-
+
val menuBars = menuBarsService.menuBars();
-
+
menuBars.visit(linksForServiceActionsAddingVisitor);
-
+
assertNotNull(menuBars);
-
+
val blobDemoMenuRef = _Refs.<ServiceActionLayoutData>objectRef(null);
-
+
// find service action by object-type
menuBars.visit(actionLayoutData->{
if("regressiontests.BlobDemoMenu".equals(actionLayoutData.getObjectType())) {
blobDemoMenuRef.setValue(actionLayoutData);
}
});
-
+
val blobDemoMenu = blobDemoMenuRef.getValue().orElse(null);
-
+
assertNotNull(blobDemoMenu);
-
+
val jaxbEntity = SerializationStrategy.JSON_INDENTED.entity(blobDemoMenu);
-
+
assertNotNull(jaxbEntity);
-
+
final long methodCount = _Strings.grep(jaxbEntity.toString(), "\"method\"")
.filter(line->line.contains("GET"))
.count();
-
+
assertEquals(1L, methodCount);
-
+
}
}
diff --git a/viewers/commons/services/src/main/java/org/apache/causeway/viewer/commons/services/menu/MenuUiServiceDefault.java b/viewers/commons/services/src/main/java/org/apache/causeway/viewer/commons/services/menu/MenuUiServiceDefault.java
index 5950776583..7b34e4499c 100644
--- a/viewers/commons/services/src/main/java/org/apache/causeway/viewer/commons/services/menu/MenuUiServiceDefault.java
+++ b/viewers/commons/services/src/main/java/org/apache/causeway/viewer/commons/services/menu/MenuUiServiceDefault.java
@@ -56,10 +56,12 @@ implements MenuUiService {
private final MetaModelContext metaModelContext;
private final MenuBarsService menuBarsService;
+ @Override
public MenuUiModel getMenu(final DomainServiceLayout.MenuBar menuBarSelect) {
return MenuUiModel.of(menuBarSelect, select(menuBarSelect));
}
+ @Override
public void buildMenuItems(
final MenuUiModel menuUiModel,
final MenuVisitor menuBuilder) {
[isis] 02/02: ISIS-3272: move config section 'Application' from viewer/wicket to viewer/common
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 0f4de40846330e31256a73ab7be813d3afc49158
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Nov 4 11:48:50 2022 +0100
ISIS-3272: move config section 'Application' from viewer/wicket to
viewer/common
---
.../MenuBarsLoaderService_010-implementation.adoc | 8 +-
.../core/config/CausewayConfiguration.java | 210 +++++++++++----------
.../bootstrap/MenuBarsLoaderServiceBootstrap.java | 2 +-
.../confmenu/ConfigurationViewServiceDefault.java | 4 +-
.../_infra/resources/AsciiDocReaderService.java | 2 +-
.../resources/MarkupVariableResolverService.java | 8 +-
.../demo/domain/src/main/resources/application.yml | 5 +-
.../vaadin/ui/pages/login/VaadinLoginView.java | 10 +-
.../branding/BrandingUiServiceDefault.java | 4 +-
.../viewer/wicket/model/models/AboutModel.java | 6 +-
.../wicket/model/models/HasCommonContext.java | 5 +
.../wicket/ui/components/about/AboutPanel.java | 2 +-
.../wicket/ui/components/footer/FooterPanel.java | 2 +-
.../viewer/wicket/ui/pages/PageAbstract.java | 8 +-
.../viewer/wicket/ui/pages/WebPageBase.java | 2 +-
.../accmngt/AccountManagementPageAbstract.java | 6 +-
.../password_reset/PasswordResetEmailPanel.java | 2 +-
.../accmngt/signup/RegistrationFormPanel.java | 2 +-
.../wicket/ui/pages/mmverror/MmvErrorPage.java | 8 +-
19 files changed, 153 insertions(+), 143 deletions(-)
diff --git a/antora/components/refguide-index/modules/applib/pages/index/services/menu/hooks/MenuBarsLoaderService_010-implementation.adoc b/antora/components/refguide-index/modules/applib/pages/index/services/menu/hooks/MenuBarsLoaderService_010-implementation.adoc
index 99bee0456a..ec7406bdc4 100644
--- a/antora/components/refguide-index/modules/applib/pages/index/services/menu/hooks/MenuBarsLoaderService_010-implementation.adoc
+++ b/antora/components/refguide-index/modules/applib/pages/index/services/menu/hooks/MenuBarsLoaderService_010-implementation.adoc
@@ -8,7 +8,7 @@
The framework provides a default implementation of this service, namely `o.a.i.core.runtimeservices.menubars.MenuBarsLoaderServiceDefault`.
This searches for a classpath resource `menubars.layout.xml`, located ni the root package.
-If using the Wicket viewer, the location of this file (and its name) can be overridden using the `causeway.viewer.wicket.application.menubars-layout-xml` configuration property.
+If using the Wicket viewer, the location of this file (and its name) can be overridden using the `causeway.viewer.wicket.application.menubars-layout-file` configuration property.
For example:
@@ -17,9 +17,9 @@ For example:
----
causeway:
viewer:
- wicket:
+ common:
application:
- menubars-layout-xml: demoapp/dom/menubars.layout.xml
+ menubars-layout-file: demoapp/dom/menubars.layout.xml
----
-The default implementaiton supports reloading only in prototype mode.
+The default implementation supports reloading only in prototype mode.
diff --git a/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java b/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
index 0a0f08dcd8..80493968ae 100644
--- a/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
+++ b/core/config/src/main/java/org/apache/causeway/core/config/CausewayConfiguration.java
@@ -1851,6 +1851,113 @@ public class CausewayConfiguration {
private final Viewer viewer = new Viewer();
@Data
public static class Viewer {
+
+ private final Common common = new Common();
+ @Data
+ public static class Common {
+
+ private final Application application = new Application();
+ @Data
+ public static class Application {
+
+ /**
+ * Label used on the about page.
+ */
+ private String about;
+
+ /**
+ * Either the location of the image file (relative to the class-path resource root),
+ * or an absolute URL.
+ *
+ * <p>
+ * This is rendered on the header panel. An image with a size of 160x40 works well.
+ * If not specified, the application.name is used instead.
+ * </p>
+ */
+ @javax.validation.constraints.Pattern(regexp="^[^/].*$")
+ private Optional<String> brandLogoHeader = Optional.empty();
+
+ /**
+ * Either the location of the image file (relative to the class-path resource root),
+ * or an absolute URL.
+ *
+ * <p>
+ * This is rendered on the sign-in page. An image with a size of 400x40 works well.
+ * If not specified, the {@link Application#getName() application name} is used instead.
+ * </p>
+ */
+ @javax.validation.constraints.Pattern(regexp="^[^/].*$")
+ private Optional<String> brandLogoSignin = Optional.empty();
+
+ /**
+ * URL of file to read any custom CSS, relative to <code>static</code> package on the class path.
+ *
+ * <p>
+ * A typical value is <code>css/application.css</code>. This will result in this file being read
+ * from the <code>static/css</code> directory (because static resources such as CSS are mounted by
+ * Spring by default under <code>static</code> package).
+ * </p>
+ */
+ @javax.validation.constraints.Pattern(regexp="^[^/].*$")
+ private Optional<String> css = Optional.empty();
+
+ /**
+ * Specifies the URL to use of the favIcon.
+ *
+ * <p>
+ * This is expected to be a local resource.
+ * </p>
+ */
+ @javax.validation.constraints.Pattern(regexp="^[^/].*$")
+ private Optional<String> faviconUrl = Optional.empty();
+
+ /**
+ */
+ /**
+ * URL of file to read any custom JavaScript, relative to <code>static</code> package on the class path.
+ *
+ * <p>
+ * A typical value is <code>js/application.js</code>. This will result in this file being read
+ * from the <code>static/js</code> directory (because static resources such as CSS are mounted by
+ * Spring by default under <code>static</code> package).
+ * </p>
+ */
+ @javax.validation.constraints.Pattern(regexp="^[^/].*$")
+ private Optional<String> js = Optional.empty();
+
+ /**
+ * Specifies the file name containing the menubars.
+ *
+ * <p>
+ * This is expected to be a local resource.
+ * </p>
+ */
+ @NotNull @NotEmpty
+ private String menubarsLayoutFile = "menubars.layout.xml";
+
+ /**
+ * Identifies the application on the sign-in page
+ * (unless a {@link Application#brandLogoSignin sign-in} image is configured) and
+ * on top-left in the header
+ * (unless a {@link Application#brandLogoHeader header} image is configured).
+ */
+ @NotNull @NotEmpty
+ private String name = "Apache Causeway ™";
+
+ /**
+ * The version of the application, eg 1.0, 1.1, etc.
+ *
+ * <p>
+ * If present, then this will be shown in the footer on every page as well as on the
+ * about page.
+ * </p>
+ */
+ private String version;
+ }
+
+
+ }
+
private final Restfulobjects restfulobjects = new Restfulobjects();
@Data
public static class Restfulobjects {
@@ -2252,109 +2359,6 @@ public class CausewayConfiguration {
*/
private boolean wicketSourcePlugin = false;
- /**
- * @deprecated common to all viewers - needs to be moved out of Wicket
- */
- @Deprecated
- private final Application application = new Application();
- @Data
- public static class Application {
-
- /**
- * Label used on the about page.
- */
- private String about;
-
- /**
- * Either the location of the image file (relative to the class-path resource root),
- * or an absolute URL.
- *
- * <p>
- * This is rendered on the header panel. An image with a size of 160x40 works well.
- * If not specified, the application.name is used instead.
- * </p>
- */
- @javax.validation.constraints.Pattern(regexp="^[^/].*$")
- private Optional<String> brandLogoHeader = Optional.empty();
-
- /**
- * Either the location of the image file (relative to the class-path resource root),
- * or an absolute URL.
- *
- * <p>
- * This is rendered on the sign-in page. An image with a size of 400x40 works well.
- * If not specified, the {@link Application#getName() application name} is used instead.
- * </p>
- */
- @javax.validation.constraints.Pattern(regexp="^[^/].*$")
- private Optional<String> brandLogoSignin = Optional.empty();
-
- /**
- * URL of file to read any custom CSS, relative to <code>static</code> package on the class path.
- *
- * <p>
- * A typical value is <code>css/application.css</code>. This will result in this file being read
- * from the <code>static/css</code> directory (because static resources such as CSS are mounted by
- * Spring by default under <code>static</code> package).
- * </p>
- */
- @javax.validation.constraints.Pattern(regexp="^[^/].*$")
- private Optional<String> css = Optional.empty();
-
- /**
- * Specifies the URL to use of the favIcon.
- *
- * <p>
- * This is expected to be a local resource.
- * </p>
- */
- @javax.validation.constraints.Pattern(regexp="^[^/].*$")
- private Optional<String> faviconUrl = Optional.empty();
-
- /**
- */
- /**
- * URL of file to read any custom JavaScript, relative to <code>static</code> package on the class path.
- *
- * <p>
- * A typical value is <code>js/application.js</code>. This will result in this file being read
- * from the <code>static/js</code> directory (because static resources such as CSS are mounted by
- * Spring by default under <code>static</code> package).
- * </p>
- */
- @javax.validation.constraints.Pattern(regexp="^[^/].*$")
- private Optional<String> js = Optional.empty();
-
- /**
- * Specifies the file name containing the menubars.
- *
- * <p>
- * This is expected to be a local resource.
- * </p>
- */
- @NotNull @NotEmpty
- private String menubarsLayoutFile = "menubars.layout.xml";
-
- /**
- * Identifies the application on the sign-in page
- * (unless a {@link Application#brandLogoSignin sign-in} image is configured) and
- * on top-left in the header
- * (unless a {@link Application#brandLogoHeader header} image is configured).
- */
- @NotNull @NotEmpty
- private String name = "Apache Causeway ™";
-
- /**
- * The version of the application, eg 1.0, 1.1, etc.
- *
- * <p>
- * If present, then this will be shown in the footer on every page as well as on the
- * about page.
- * </p>
- */
- private String version;
- }
-
private final BookmarkedPages bookmarkedPages = new BookmarkedPages();
@Data
public static class BookmarkedPages {
diff --git a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsLoaderServiceBootstrap.java b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsLoaderServiceBootstrap.java
index 217c5390c5..41d4c89922 100644
--- a/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsLoaderServiceBootstrap.java
+++ b/core/runtimeservices/src/main/java/org/apache/causeway/core/runtimeservices/menubars/bootstrap/MenuBarsLoaderServiceBootstrap.java
@@ -72,7 +72,7 @@ implements MenuBarsLoaderService<BSMenuBars> {
this.jaxbService = jaxbService;
this.supportsReloading = mmc.getSystemEnvironment().isPrototyping();
- val menubarsLayoutFile = mmc.getConfiguration().getViewer().getWicket().getApplication()
+ val menubarsLayoutFile = mmc.getConfiguration().getViewer().getCommon().getApplication()
.getMenubarsLayoutFile();
val menubarsLayoutResource = new ClassPathResource(menubarsLayoutFile);
if(!menubarsLayoutResource.exists()) {
diff --git a/core/webapp/src/main/java/org/apache/causeway/core/webapp/confmenu/ConfigurationViewServiceDefault.java b/core/webapp/src/main/java/org/apache/causeway/core/webapp/confmenu/ConfigurationViewServiceDefault.java
index 8dfab6777a..2f0a893654 100644
--- a/core/webapp/src/main/java/org/apache/causeway/core/webapp/confmenu/ConfigurationViewServiceDefault.java
+++ b/core/webapp/src/main/java/org/apache/causeway/core/webapp/confmenu/ConfigurationViewServiceDefault.java
@@ -109,7 +109,7 @@ implements
val sb = new StringBuilder();
String head = String.format("APACHE CAUSEWAY %s (%s) ",
- configuration.getViewer().getWicket().getApplication().getVersion(),
+ configuration.getViewer().getCommon().getApplication().getVersion(),
systemEnvironment.getDeploymentType().name());
final Map<String, ConfigurationProperty> map = config.get();
@@ -138,7 +138,7 @@ implements
private Map<String, ConfigurationProperty> loadEnvironment() {
final Map<String, ConfigurationProperty> map = _Maps.newTreeMap();
- add("Causeway Version", configuration.getViewer().getWicket().getApplication().getVersion(), map);
+ add("Causeway Version", configuration.getViewer().getCommon().getApplication().getVersion(), map);
add("Deployment Type", systemEnvironment.getDeploymentType().name(), map);
//add("Unit Testing", ""+systemEnvironment.isUnitTesting(), map);
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/resources/AsciiDocReaderService.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/resources/AsciiDocReaderService.java
index 4cc1789195..5e342c42cb 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/resources/AsciiDocReaderService.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/resources/AsciiDocReaderService.java
@@ -66,7 +66,7 @@ public class AsciiDocReaderService {
private String replaceVersion(final String adoc) {
return adoc.replace("{causeway-version}",
- configuration.getViewer().getWicket().getApplication().getVersion());
+ configuration.getViewer().getCommon().getApplication().getVersion());
}
private AsciiDoc toAsciiDoc(final StringReference adocRef, final Class<?> aClass) {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/resources/MarkupVariableResolverService.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/resources/MarkupVariableResolverService.java
index 4eb1ea432b..5b0789022b 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/resources/MarkupVariableResolverService.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/resources/MarkupVariableResolverService.java
@@ -39,13 +39,13 @@ public class MarkupVariableResolverService {
private final Map<String, String> constants;
@Inject
- public MarkupVariableResolverService(CausewayConfiguration configuration) {
+ public MarkupVariableResolverService(final CausewayConfiguration configuration) {
constants = _Maps.unmodifiable(
"SOURCES_CAUSEWAY", "https://github.com/apache/causeway/blob/master/core/applib/src/main/java",
"SOURCES_DEMO", "https://github.com/apache/causeway/tree/master/examples/demo/domain/src/main/java",
"ISSUES_DEMO", "https://issues.apache.org/jira/",
"CAUSEWAY_VERSION", Optional.ofNullable(
- configuration.getViewer().getWicket().getApplication().getVersion())
+ configuration.getViewer().getCommon().getApplication().getVersion())
.orElse("unkown-version")
);
}
@@ -54,7 +54,7 @@ public class MarkupVariableResolverService {
* For the given {@code input} replaces '${var-name}' with the variable's value.
* @param input
*/
- public String resolveVariables(String input) {
+ public String resolveVariables(final String input) {
val stringRef = _Refs.objectRef(input);
constants.forEach((k, v)->{
stringRef.update(string->string.replace(var(k), v));
@@ -62,7 +62,7 @@ public class MarkupVariableResolverService {
return stringRef.getValueElseDefault(input);
}
- private String var(String name) {
+ private String var(final String name) {
return String.format("${%s}", name);
}
diff --git a/examples/demo/domain/src/main/resources/application.yml b/examples/demo/domain/src/main/resources/application.yml
index 58a6f4b1ea..52ec794e45 100644
--- a/examples/demo/domain/src/main/resources/application.yml
+++ b/examples/demo/domain/src/main/resources/application.yml
@@ -69,9 +69,9 @@ causeway:
mode: disabled
viewer:
- wicket:
+ common:
application:
- menubars-layout-xml: demoapp/dom/menubars.layout.xml
+ menubars-layout-file: demoapp/dom/menubars.layout.xml
favicon-url: images/gift.svg
brand-logo-header: images/gift_48.png
brand-logo-signin: images/gift_256.png
@@ -82,6 +82,7 @@ causeway:
css: css/application.css
js: scripts/application.js
about: This application demonstrates many aspects of the Apache Causeway programming model, as well as some of the most significant domain services and extensions such as the WrapperFactory, security, commands and publishing.
+ wicket:
credit:
- url: http://causeway.apache.org
diff --git a/incubator/viewers/vaadin/ui/src/main/java/org/apache/causeway/incubator/viewer/vaadin/ui/pages/login/VaadinLoginView.java b/incubator/viewers/vaadin/ui/src/main/java/org/apache/causeway/incubator/viewer/vaadin/ui/pages/login/VaadinLoginView.java
index b875c14dd8..8ae9bc05e6 100644
--- a/incubator/viewers/vaadin/ui/src/main/java/org/apache/causeway/incubator/viewer/vaadin/ui/pages/login/VaadinLoginView.java
+++ b/incubator/viewers/vaadin/ui/src/main/java/org/apache/causeway/incubator/viewer/vaadin/ui/pages/login/VaadinLoginView.java
@@ -88,7 +88,7 @@ public class VaadinLoginView extends VerticalLayout {
// -- HELPER
- private void doLogin(String userName, String secret) {
+ private void doLogin(final String userName, final String secret) {
val authenticationRequest = new AuthenticationRequestPassword(userName, secret);
if(vaadinAuthenticationHandler.loginToSession(authenticationRequest)) {
getUI().ifPresent(ui->ui.navigate(MainViewVaa.class));
@@ -98,14 +98,14 @@ public class VaadinLoginView extends VerticalLayout {
}
/** @deprecated early development only */
+ @Deprecated
private void doLoginAsSven() {
doLogin("sven", "pass");
}
- private void addTitleAndLogo(CausewayConfiguration causewayConfiguration, WebAppContextPath webAppContextPath) {
- //TODO application name/logo borrowed from Wicket's configuration
- val applicationName = causewayConfiguration.getViewer().getWicket().getApplication().getName();
- val applicationLogo = causewayConfiguration.getViewer().getWicket().getApplication().getBrandLogoSignin();
+ private void addTitleAndLogo(final CausewayConfiguration causewayConfiguration, final WebAppContextPath webAppContextPath) {
+ val applicationName = causewayConfiguration.getViewer().getCommon().getApplication().getName();
+ val applicationLogo = causewayConfiguration.getViewer().getCommon().getApplication().getBrandLogoSignin();
applicationLogo.ifPresent(logoUrl->{
add(new Image(webAppContextPath.prependContextPathIfLocal(logoUrl), "logo"));
diff --git a/viewers/commons/services/src/main/java/org/apache/causeway/viewer/commons/services/branding/BrandingUiServiceDefault.java b/viewers/commons/services/src/main/java/org/apache/causeway/viewer/commons/services/branding/BrandingUiServiceDefault.java
index a2600e6243..7bcc65b6fb 100644
--- a/viewers/commons/services/src/main/java/org/apache/causeway/viewer/commons/services/branding/BrandingUiServiceDefault.java
+++ b/viewers/commons/services/src/main/java/org/apache/causeway/viewer/commons/services/branding/BrandingUiServiceDefault.java
@@ -27,7 +27,7 @@ import org.springframework.stereotype.Service;
import org.apache.causeway.applib.annotation.PriorityPrecedence;
import org.apache.causeway.core.config.CausewayConfiguration;
-import org.apache.causeway.core.config.CausewayConfiguration.Viewer.Wicket.Application;
+import org.apache.causeway.core.config.CausewayConfiguration.Viewer.Common.Application;
import org.apache.causeway.viewer.commons.applib.services.branding.BrandingUiModel;
import org.apache.causeway.viewer.commons.applib.services.branding.BrandingUiService;
import org.apache.causeway.viewer.commons.services.CausewayModuleViewerCommonsServices;
@@ -45,7 +45,7 @@ implements BrandingUiService {
public BrandingUiServiceDefault(final CausewayConfiguration causewayConfiguration) {
//TODO application name/logo borrowed from Wicket's configuration,
// we might generalize this config option to all viewers
- this.appConfig = causewayConfiguration.getViewer().getWicket().getApplication();
+ this.appConfig = causewayConfiguration.getViewer().getCommon().getApplication();
}
@Override
diff --git a/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/AboutModel.java b/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/AboutModel.java
index ea6e00d87c..f5c5516b82 100644
--- a/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/AboutModel.java
+++ b/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/AboutModel.java
@@ -26,7 +26,7 @@ import org.apache.causeway.core.metamodel.context.MetaModelContext;
* Model providing welcome text.
*/
public final class AboutModel
-extends ModelAbstract<CausewayConfiguration.Viewer.Wicket.Application> {
+extends ModelAbstract<CausewayConfiguration.Viewer.Common.Application> {
private static final long serialVersionUID = 1L;
@@ -35,8 +35,8 @@ extends ModelAbstract<CausewayConfiguration.Viewer.Wicket.Application> {
}
@Override
- protected CausewayConfiguration.Viewer.Wicket.Application load() {
- return getWicketViewerSettings().getApplication();
+ protected CausewayConfiguration.Viewer.Common.Application load() {
+ return getApplicationSettings();
}
}
diff --git a/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/HasCommonContext.java b/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/HasCommonContext.java
index 923d704cd4..95d1a018ff 100644
--- a/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/HasCommonContext.java
+++ b/viewers/wicket/model/src/main/java/org/apache/causeway/viewer/wicket/model/models/HasCommonContext.java
@@ -19,6 +19,7 @@
package org.apache.causeway.viewer.wicket.model.models;
import org.apache.causeway.applib.services.i18n.TranslationContext;
+import org.apache.causeway.core.config.CausewayConfiguration.Viewer.Common.Application;
import org.apache.causeway.core.config.CausewayConfiguration.Viewer.Wicket;
import org.apache.causeway.core.metamodel.context.HasMetaModelContext;
@@ -28,6 +29,10 @@ public interface HasCommonContext extends HasMetaModelContext {
return getConfiguration().getViewer().getWicket();
}
+ default Application getApplicationSettings() {
+ return getConfiguration().getViewer().getCommon().getApplication();
+ }
+
/**
* Translate without context: Tooltips, Button-Labels, etc.
*/
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/about/AboutPanel.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/about/AboutPanel.java
index 418b1169df..03a0873d90 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/about/AboutPanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/about/AboutPanel.java
@@ -39,7 +39,7 @@ import org.apache.causeway.viewer.wicket.ui.panels.PanelAbstract;
* {@link HomePage}).
*/
public class AboutPanel
-extends PanelAbstract<CausewayConfiguration.Viewer.Wicket.Application, AboutModel> {
+extends PanelAbstract<CausewayConfiguration.Viewer.Common.Application, AboutModel> {
private static final long serialVersionUID = 1L;
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/footer/FooterPanel.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/footer/FooterPanel.java
index dbaba10be5..60829f2015 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/footer/FooterPanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/footer/FooterPanel.java
@@ -162,7 +162,7 @@ extends PanelAbstract<String, Model<String>> {
add(aboutLink);
final String applicationVersion =
- getWicketViewerSettings().getApplication().getVersion();
+ getApplicationSettings().getVersion();
Wkt.labelAdd(aboutLink, ID_ABOUT_MESSAGE,
_Strings.isNotEmpty(applicationVersion)
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/PageAbstract.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/PageAbstract.java
index c87f21d9a6..a723b6c461 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/PageAbstract.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/PageAbstract.java
@@ -144,7 +144,7 @@ implements ActionPromptProvider {
themeDiv = Wkt.containerAdd(this, ID_THEME);
- String applicationName = getWicketViewerSettings().getApplication().getName();
+ String applicationName = getApplicationSettings().getName();
Wkt.cssAppend(themeDiv, Wkt.cssNormalize(applicationName));
boolean devUtilitiesEnabled = getApplication().getDebugSettings().isDevelopmentUtilitiesEnabled();
@@ -227,7 +227,7 @@ implements ActionPromptProvider {
protected void setTitle(final String title) {
Wkt.labelAdd(this, ID_PAGE_TITLE, title != null
? title
- : getWicketViewerSettings().getApplication().getName());
+ : getApplicationSettings().getName());
}
private Class<? extends Page> getSignInPage() {
@@ -261,12 +261,12 @@ implements ActionPromptProvider {
new JGrowlBehaviour(getMetaModelContext())
.renderFeedbackMessages(response);
- getWicketViewerSettings().getApplication().getCss()
+ getApplicationSettings().getCss()
.ifPresent(applicationCss -> {
response.render(CssReferenceHeaderItem.forUrl(applicationCss));
});
- getWicketViewerSettings().getApplication().getJs()
+ getApplicationSettings().getJs()
.ifPresent(applicationJs -> {
response.render(JavaScriptReferenceHeaderItem.forUrl(applicationJs));
});
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/WebPageBase.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/WebPageBase.java
index 1c73f1da0b..947bb2be6d 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/WebPageBase.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/WebPageBase.java
@@ -56,7 +56,7 @@ implements HasCommonContext {
// -- FAVICON SUPPORT
protected void renderFavicon(final IHeaderResponse response) {
- getWicketViewerSettings().getApplication().getFaviconUrl()
+ getApplicationSettings().getFaviconUrl()
.filter(_Strings::isNotEmpty)
.map(getWebAppContextPath()::prependContextPathIfLocal)
.ifPresent(faviconUrl->{
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.java
index 0e79a2633d..1eabf97c98 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/AccountManagementPageAbstract.java
@@ -92,7 +92,7 @@ public class AccountManagementPageAbstract extends WebPageBase {
private void addPageTitle() {
- val applicationName = getWicketViewerSettings().getApplication().getName();
+ val applicationName = getApplicationSettings().getName();
Wkt.labelAdd(this, ID_PAGE_TITLE, applicationName);
}
@@ -112,10 +112,10 @@ public class AccountManagementPageAbstract extends WebPageBase {
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(
BootstrapJavaScriptReference.instance())));
- getWicketViewerSettings().getApplication().getCss()
+ getApplicationSettings().getCss()
.ifPresent(css -> response.render(CssReferenceHeaderItem.forUrl(css)));
- getWicketViewerSettings().getApplication().getJs()
+ getApplicationSettings().getJs()
.ifPresent(js -> response.render(JavaScriptReferenceHeaderItem.forUrl(js)));
}
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.java
index 9c2fd84df0..4a140cffa3 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/password_reset/PasswordResetEmailPanel.java
@@ -90,7 +90,7 @@ public class PasswordResetEmailPanel extends PanelBase<Void> {
val passwordResetEvent = new PasswordResetEvent(
email,
confirmationUrl,
- getWicketViewerSettings().getApplication().getName());
+ getApplicationSettings().getName());
boolean emailSent = super.getEmailNotificationService().send(passwordResetEvent);
if (emailSent) {
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPanel.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPanel.java
index 366ee18db9..e6a416a6c0 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/accmngt/signup/RegistrationFormPanel.java
@@ -90,7 +90,7 @@ public class RegistrationFormPanel extends PanelBase<Void> {
final EmailRegistrationEvent emailRegistrationEvent = new EmailRegistrationEvent(
email,
confirmationUrl,
- getWicketViewerSettings().getApplication().getName());
+ getApplicationSettings().getName());
boolean emailSent = emailNotificationService.send(emailRegistrationEvent);
if (emailSent) {
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/mmverror/MmvErrorPage.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/mmverror/MmvErrorPage.java
index 3c2c7a06a9..963b5679ff 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/mmverror/MmvErrorPage.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/pages/mmverror/MmvErrorPage.java
@@ -66,12 +66,12 @@ public class MmvErrorPage extends WebPageBase {
private void addPageTitle() {
Wkt.labelAdd(this, ID_PAGE_TITLE,
- getWicketViewerSettings().getApplication().getName());
+ getApplicationSettings().getName());
}
private void addApplicationName() {
Wkt.labelAdd(this, ID_APPLICATION_NAME,
- getWicketViewerSettings().getApplication().getName());
+ getApplicationSettings().getName());
}
private void addValidationErrors() {
@@ -87,10 +87,10 @@ public class MmvErrorPage extends WebPageBase {
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())));
response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(BootstrapJavaScriptReference.instance())));
- getWicketViewerSettings().getApplication().getCss()
+ getApplicationSettings().getCss()
.ifPresent(css -> response.render(CssReferenceHeaderItem.forUrl(css)));
- getWicketViewerSettings().getApplication().getJs()
+ getApplicationSettings().getJs()
.ifPresent(js -> response.render(JavaScriptReferenceHeaderItem.forUrl(js)));
}