Package ch.tocco.nice2.rest.action.spi
Class AbstractActionResource
java.lang.Object
ch.tocco.nice2.rest.core.spi.AbstractRestResource
ch.tocco.nice2.rest.action.spi.AbstractActionResource
- All Implemented Interfaces:
RestResource
- Direct Known Subclasses:
AbacusExportActionResource
,AbstractCreateVoucherActionResource
,AbstractCustomActionResource
,AbstractDmsActionResource
,AbstractInvoiceActionResource
,AbstractMassWageResource
,AbstractOrderMailActionResource
,AbstractSetLookupEntityActionResource
,AccomplishmentDeletionResource
,AccomplishmentUpdateResource
,AccrualPostingResource
,AddCandidateNumbersActionResource
,AdjustArchiveTypeAction
,AnonymizeActionResource
,AvailabilityCreateCalendarSeriesActionResource
,AvailabilityDeleteCalendarSeriesActionResource
,BookIncomingPaymentActionResource
,BookOrderActionResource
,CancelMembershipActionResource
,CancelTaskActionResource
,ChangeBatchJobOwnerResource
,ChangeMembershipTypeActionResource
,ConnectInputNodeActionResource
,CopyLicenceResource
,CostDelimitationActionResource
,CreateClassroomActionResource
,CreateDebitorExportResource
,CreateDonationResource
,CreateFinancialYearResource
,CreatePrepaymentVoucherActionResource
,DebitorIncomingPaymentActionResource
,DeleteCandidateNumberActionResource
,DeleteClassroomActionResource
,DeleteTaskActionResource
,DisconnectPrincipalResource
,DonationIncomingPaymentActionResource
,EditUrlActionResource
,EducationScheduleLogicCopyActionResource
,EmploymentActionServiceResource
,EsrImportActionResource
,ExcelExportActionResource
,ExportActionResource
,FileUploadActionResource
,FindMissingTranslationsResource
,FulltextIndexBuildResource
,FulltextIndexCheckActionResource
,FulltextIndexClearResource
,FulltextIndexEntityBuildResource
,FulltextIndexEntityCheckActionResource
,FulltextIndexFixResource
,FulltextIndexSetupResource
,GenerateEvaluationExecutionActionResource
,InputEditFinishResource
,InstanceDeleteActionResource
,LowerDunningLevelResource
,MassContactActionResource
,MassMembershipActionResource
,MassRegistrationActionResource
,MembershipQuestionResource
,OrderLogicCopyActionResource
,PayrexxAccountCredentialsAction
,PayrexxPaymentMethodsAction
,PlanningOverviewResource
,RegistrationAccomplishmentStatusResource
,RegistrationCancellationResource
,RemoveDebitorExportActionResource
,RemoveQuestionnaireLockActionResource
,RemoveWagesFromExportResource
,RepeatAndUpdateLastDunningActionResource
,ReportGenerationResource
,RequirementCheckActionResource
,RequirementRuleCompileActionResource
,ResendMessageActionResource
,ReservationExportActionResource
,ReservationLecturerBookingAccomplishmentStatusResource
,ReservationLecturerBookingPlanningStatusResource
,ReservationRegistrationPresenceRateResource
,ResetUrlActionResource
,SalaryExportResource
,SchoolingCreateActionResource
,SeminarLowerActionResource
,SetDonationActionService
,SetGenericTextResource
,SetParentActionResource
,SetSmsPasswordResource
,SetWidgetDomainSecretActionResource
,StintAuctionRegisterLecturerResource
,SurveyExportActionResource
,TimereportInfoResource
,TimereportNewResource
,TimereportUpdateResource
,TodoActionResource
,TransferAvailabilityActionResource
,UpdateClientSecretActionResource
,UpdateDueTimeActionResource
,VCardExportActionResource
,VCardImportActionResource
,WageSimulationActionResource
Abstract base class for action resources.
This class provides data binding functionality and can wrap the actual action
in a task job so that it can be executed asynchronously.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
static final record
static class
class
static final record
protected static class
static enum
Define which type of selection the action resource expects. -
Field Summary
Modifier and TypeFieldDescriptionprotected BusinessUnitManager
protected CommandExecutor
protected Context
protected DefaultDisplayService
protected EntityDefaultValueService
protected EntityBeanRebinder
protected FormBeanService
protected L10N
protected org.slf4j.Logger
protected NotificationService
protected SecurityManager
protected TaskSchedulingService
protected TextResources
Fields inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
uriInfo
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractActionResource
(AbstractActionResource.SelectionType selectionType) protected
AbstractActionResource
(AbstractActionResource.SelectionType selectionType, @Nullable String initialFormEntityName) protected
AbstractActionResource
(AbstractActionResource.SelectionType selectionType, @Nullable String initialFormEntityName, @Nullable String initialFormName) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TextMessage
name of the action displayed in the notification center if no specific text is setprotected abstract AbstractActionResource.ActionResultBean
doPerformAction
(ActionDataBean actionDataBean, ActionResourceBean actionResourceBean, TaskContext taskContext) protected ActionResponseBean
protected CallableType
per default the callable type (persisted as Task_execution) is DATA_PROCESSING.protected String
protected InitialFormValueResponseBean
getInitialFormValueResponseBean
(String formName) protected abstract Class
<? extends AbstractJob> each action resource needs an empty job class as inner class which either implements AbstractActionJob or AbstractInterruptableActionJob.protected @Nullable Entity
getParentEntity
(@Nullable ActionParentEntityBean parent) protected PrimaryKeyList
getSelectedEntities
(EntitySelectionBean selection) protected Entity
getSelectedEntity
(EntitySelectionBean selection) protected JobDataMapBuilder
getTaskData
(String taskId, ActionResourceBean actionResourceBean) protected boolean
protected InitialFormValueResponseBean
performAction
(ActionResourceBean actionResourceBean) 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 executionprotected boolean
Override to disable recovery for a particular action resource.void
setBusinessUnitManager
(BusinessUnitManager businessUnitManager) void
setCommandExecutor
(CommandExecutor commandExecutor) void
setContext
(Context context) void
setDefaultDisplayService
(DefaultDisplayService defaultDisplayService) void
setDefaultValueService
(EntityDefaultValueService defaultValueService) void
setEntityBeanRebinder
(EntityBeanRebinder entityBeanRebinder) void
setFormBeanService
(FormBeanService formBeanService) void
void
setLog
(org.slf4j.Logger log) void
setNotificationService
(NotificationService notificationService) void
setSecurityManager
(SecurityManager securityManager) void
setSelectionService
(SelectionService selectionService) void
setTaskSchedulingService
(TaskSchedulingService taskSchedulingService) void
setTextResources
(TextResources textResources) protected TextMessage
protected TextMessage
protected @Nullable TextMessage
protected TextMessage
protected TextMessage
protected TextMessage
protected boolean
verifyFormEntityBean
(EntityBean formEntityBean) Methods inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
getPathParameter, setUriInfo, tryGetInt
-
Field Details
-
entityBeanRebinder
-
context
-
textResources
-
commandExecutor
-
taskSchedulingService
-
log
protected org.slf4j.Logger log -
formBeanService
-
l10n
-
businessUnitManager
-
securityManager
-
defaultValueService
-
notificationService
-
defaultDisplayService
-
-
Constructor Details
-
AbstractActionResource
-
AbstractActionResource
protected AbstractActionResource(AbstractActionResource.SelectionType selectionType, @Nullable @Nullable String initialFormEntityName) -
AbstractActionResource
protected AbstractActionResource(AbstractActionResource.SelectionType selectionType, @Nullable @Nullable String initialFormEntityName, @Nullable @Nullable String initialFormName)
-
-
Method Details
-
doPerformAction
protected abstract AbstractActionResource.ActionResultBean doPerformAction(ActionDataBean actionDataBean, ActionResourceBean actionResourceBean, TaskContext taskContext) -
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 -
performAction
@POST @Consumes("application/json") @Produces("application/json") public ActionResponseBean performAction(ActionResourceBean actionResourceBean) -
formEntityMissing
-
getCallableType
per default the callable type (persisted as Task_execution) is DATA_PROCESSING. however for some action a more specific type can be set -
actionName
name of the action displayed in the notification center if no specific text is set -
taskSchedulingMessage
-
taskStartedMessage
-
taskFinishedMessage
-
taskFailedTitle
-
taskFailedMessage
-
taskCancelledMessage
-
getTaskData
-
getCurrentUsername
-
loadInitialForm
-
getInitialFormValueResponseBean
-
verifyFormEntityBean
-
getParentEntity
@Nullable protected @Nullable Entity getParentEntity(@Nullable @Nullable ActionParentEntityBean parent) -
getSelectedEntity
- Throws:
NotFoundException
-
getSelectedEntities
protected PrimaryKeyList getSelectedEntities(EntitySelectionBean selection) throws NotFoundException - Throws:
NotFoundException
-
ignoreMissingEntities
protected boolean ignoreMissingEntities()- Returns:
- should the action be executed even if at least one of the given entities was not found (deleted, no permission)?
-
getJobClass
each action resource needs an empty job class as inner class which either implements AbstractActionJob or AbstractInterruptableActionJob. the class is needed to run the job in the task scheduler. if AbstractInterruptableActionJob is used the doPerformAction must implement a cancellation handling -
recoveryEnabled
protected boolean recoveryEnabled()Override to disable recovery for a particular action resource.- Returns:
- true if the job should be recovered after Nice restart, else false (default: true)
-
setEntityBeanRebinder
-
setContext
-
setTextResources
-
setCommandExecutor
-
setTaskSchedulingService
-
setLog
@Autowired public void setLog(org.slf4j.Logger log) -
setSelectionService
-
setFormBeanService
-
setL10n
-
setBusinessUnitManager
-
setSecurityManager
-
setDefaultValueService
-
setNotificationService
-
setDefaultDisplayService
-