Class EntityViewFactoryAttributes
java.lang.Object
com.foreach.across.modules.entity.views.EntityViewFactoryAttributes
Contains common
EntityViewFactory
configuration attributes.
During view processing these can usually be retrieved using EntityViewRequest.getConfigurationAttributes()
.- Since:
- 3.0.0
- Author:
- Arne Vandamme
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Contains ajava.util.function.BiPredicate<EntityViewFactory,EntityViewContext>
that is to be used for checking if access to theEntityViewFactory
is allowed.static final String
Contains aConsumer
that takes anEntityAdminMenuEvent
as parameter.static final String
Contains the name of the view.static final String
Contains the template name of the view. -
Method Summary
Modifier and TypeMethodDescriptionReturns a default access validator implementation that checks if there is anAllowableAction
attribute on theEntityViewFactory
and expects the action to be present in theEntityViewContext.getAllowableActions()
.
-
Field Details
-
VIEW_NAME
Contains the name of the view. -
VIEW_TEMPLATE_NAME
Contains the template name of the view. -
ADMIN_MENU
Contains aConsumer
that takes anEntityAdminMenuEvent
as parameter. Any view with this attribute will usually generate a menu item when the entity menu is being built. -
ACCESS_VALIDATOR
Contains ajava.util.function.BiPredicate<EntityViewFactory,EntityViewContext>
that is to be used for checking if access to theEntityViewFactory
is allowed. Usually the value ofdefaultAccessValidator()
instance will be set, which checks on the presence of anAllowableAction
. Note that it is not strictly required to have aEntityViewContext
for using the validator, meaning that implementations should take into account that the second argument can benull
.
-
-
Method Details
-
defaultAccessValidator
Returns a default access validator implementation that checks if there is anAllowableAction
attribute on theEntityViewFactory
and expects the action to be present in theEntityViewContext.getAllowableActions()
. If there is noAllowableAction
registered, the predicate will always allow access. If there is anAllowableAction
but noEntityViewContext
available, access will always be denied. A predicate like this is usually registered as theACCESS_VALIDATOR
attribute.- Returns:
- predicate
-