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
Nested ClassesModifier and TypeClassDescriptionstatic enumDefine which type of selection the action resource expects. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BusinessUnitManagerprotected Contextprotected DefaultDisplayServiceprotected EntityDefaultValueServiceprotected FormBeanServiceprotected final Stringprotected final Stringprotected L10Nprotected org.slf4j.Loggerprotected final booleanprotected SecurityManagerprotected TextResourcesFields inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
uriInfo -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPreActionResource(AbstractPreActionResource.SelectionType selectionType) protectedAbstractPreActionResource(AbstractPreActionResource.SelectionType selectionType, @Nullable String initialFormEntityName) protectedAbstractPreActionResource(AbstractPreActionResource.SelectionType selectionType, @Nullable String initialFormEntityName, @Nullable String initialFormName) -
Method Summary
Modifier and TypeMethodDescriptionprotected InitialFormValueResponseBeangetInitialFormValueResponseBean(String formName) protected PrimaryKeyListgetSelectedEntities(EntitySelectionBean selection) protected EntitygetSelectedEntity(EntitySelectionBean selection) protected InitialFormValueResponseBeanpreAction(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 executionvoidsetBusinessUnitManager(BusinessUnitManager businessUnitManager) voidsetContext(Context context) voidsetDefaultDisplayService(DefaultDisplayService defaultDisplayService) voidsetDefaultValueService(EntityDefaultValueService defaultValueService) voidsetFormBeanService(FormBeanService formBeanService) voidvoidsetLog(org.slf4j.Logger log) voidsetSecurityManager(SecurityManager securityManager) voidsetSelectionService(SelectionService selectionService) voidsetTextResources(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
-