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
FieldsModifier and TypeFieldDescriptionstatic final StringContains ajava.util.function.BiPredicate<EntityViewFactory,EntityViewContext>that is to be used for checking if access to theEntityViewFactoryis allowed.static final StringContains aConsumerthat takes anEntityAdminMenuEventas parameter.static final StringContains the name of the view.static final StringContains the template name of the view. -
Method Summary
Modifier and TypeMethodDescriptionReturns a default access validator implementation that checks if there is anAllowableActionattribute on theEntityViewFactoryand 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 aConsumerthat takes anEntityAdminMenuEventas 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 theEntityViewFactoryis 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 aEntityViewContextfor 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 anAllowableActionattribute on theEntityViewFactoryand expects the action to be present in theEntityViewContext.getAllowableActions(). If there is noAllowableActionregistered, the predicate will always allow access. If there is anAllowableActionbut noEntityViewContextavailable, access will always be denied. A predicate like this is usually registered as theACCESS_VALIDATORattribute.- Returns:
- predicate
-