Package ch.tocco.nice2.rest.action.spi
Class AbstractPreActionResource
java.lang.Object
ch.tocco.nice2.rest.core.spi.AbstractRestResource
ch.tocco.nice2.rest.action.spi.AbstractPreActionResource
- All Implemented Interfaces:
RestResource
- Direct Known Subclasses:
AbstractActionResource
,ExamEditResource
,InputEditResource
,MergeResource
Abstract base class for custom action resources with some pre-action logic.
If the custom action should just start a React app with no logic before it, then this class does
not necessarily need to be extended.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Define which type of selection the action resource expects. -
Field Summary
Modifier and TypeFieldDescriptionprotected BusinessUnitManager
protected Context
protected DefaultDisplayService
protected EntityDefaultValueService
protected FormBeanService
protected final String
protected final String
protected L10N
protected org.slf4j.Logger
protected final boolean
protected SecurityManager
protected TextResources
Fields inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
uriInfo
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractPreActionResource
(AbstractPreActionResource.SelectionType selectionType) protected
AbstractPreActionResource
(AbstractPreActionResource.SelectionType selectionType, @Nullable String initialFormEntityName) protected
AbstractPreActionResource
(AbstractPreActionResource.SelectionType selectionType, @Nullable String initialFormEntityName, @Nullable String initialFormName) -
Method Summary
Modifier and TypeMethodDescriptionprotected InitialFormValueResponseBean
getInitialFormValueResponseBean
(String formName) protected PrimaryKeyList
getSelectedEntities
(EntitySelectionBean selection) protected Entity
getSelectedEntity
(EntitySelectionBean selection) protected InitialFormValueResponseBean
preAction
(ActionResourceBean actionResourceBean) is ran before the actual logic and can be used to run checks or return a form that needs to be filled before executionvoid
setBusinessUnitManager
(BusinessUnitManager businessUnitManager) void
setContext
(Context context) void
setDefaultDisplayService
(DefaultDisplayService defaultDisplayService) void
setDefaultValueService
(EntityDefaultValueService defaultValueService) void
setFormBeanService
(FormBeanService formBeanService) void
void
setLog
(org.slf4j.Logger log) void
setSecurityManager
(SecurityManager securityManager) void
setSelectionService
(SelectionService selectionService) void
setTextResources
(TextResources textResources) Methods inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
getPathParameter, setUriInfo, tryGetInt
-
Field Details
-
context
-
textResources
-
log
protected org.slf4j.Logger log -
formBeanService
-
l10n
-
businessUnitManager
-
securityManager
-
defaultValueService
-
defaultDisplayService
-
requiresFormEntity
protected final boolean requiresFormEntity -
initialFormEntityName
-
initialFormName
-
-
Constructor Details
-
AbstractPreActionResource
-
AbstractPreActionResource
protected AbstractPreActionResource(AbstractPreActionResource.SelectionType selectionType, @Nullable @Nullable String initialFormEntityName) -
AbstractPreActionResource
protected AbstractPreActionResource(AbstractPreActionResource.SelectionType selectionType, @Nullable @Nullable String initialFormEntityName, @Nullable @Nullable String initialFormName)
-
-
Method Details
-
preAction
@POST @Path("/check") @Consumes("application/json") @Produces("application/json") public PreActionResponseBean preAction(ActionResourceBean actionResourceBean) is ran before the actual logic and can be used to run checks or return a form that needs to be filled before execution -
loadInitialForm
-
getInitialFormValueResponseBean
-
getSelectedEntity
- Throws:
NotFoundException
-
getSelectedEntities
protected PrimaryKeyList getSelectedEntities(EntitySelectionBean selection) throws NotFoundException - Throws:
NotFoundException
-
setContext
-
setTextResources
-
setLog
@Autowired public void setLog(org.slf4j.Logger log) -
setSelectionService
-
setFormBeanService
-
setL10n
-
setBusinessUnitManager
-
setSecurityManager
-
setDefaultValueService
-
setDefaultDisplayService
-