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.AbstractPreActionResource
ch.tocco.nice2.rest.action.spi.AbstractActionResource
- All Implemented Interfaces:
RestResource
- Direct Known Subclasses:
AbacusExportActionResource
,AbstractCreateVoucherActionResource
,AbstractDmsActionResource
,AbstractInvoiceActionResource
,AbstractMassWageResource
,AbstractOrderMailActionResource
,AbstractSetLookupEntityActionResource
,AccomplishmentDeletionResource
,AccomplishmentUpdateResource
,AccrualPostingResource
,ActivateDuplicateConfigActionResource
,AddCandidateNumbersActionResource
,AdjustArchiveTypeAction
,AnonymizeActionResource
,AvailabilityCreateCalendarSeriesActionResource
,AvailabilityDeleteCalendarSeriesActionResource
,BookIncomingPaymentActionResource
,BookOrderActionResource
,CancelMembershipActionResource
,CancelTaskActionResource
,ChangeBatchJobOwnerResource
,ChangeMembershipTypeActionResource
,CompetenceCreateActionResource
,ConnectInputNodeActionResource
,CopyLicenceResource
,CostDelimitationActionResource
,CreateCalendarExportActionResource
,CreateClassroomActionResource
,CreateDebitorExportResource
,CreateDonationResource
,CreateFinancialYearResource
,CreatePrepaymentVoucherActionResource
,CreateScheduleActionResource
,DeactivateDuplicateConfigActionResource
,DebitorIncomingPaymentActionResource
,DeleteCandidateNumberActionResource
,DeleteClassroomActionResource
,DeleteTaskActionResource
,DisconnectPrincipalResource
,DonationIncomingPaymentActionResource
,EditUrlActionResource
,EducationScheduleLogicCopyActionResource
,EmploymentActionServiceResource
,EntityModelExportActionResource
,EsrImportActionResource
,EvaluationActionResource
,EvaluationQuestionLogicCopyActionResource
,ExcelExportActionResource
,ExportActionResource
,FileUploadActionResource
,FindMissingTranslationsResource
,FulltextIndexBuildResource
,FulltextIndexCheckActionResource
,FulltextIndexClearResource
,FulltextIndexEntityBuildResource
,FulltextIndexEntityCheckActionResource
,FulltextIndexFixResource
,FulltextIndexSetupResource
,GenerateEvaluationExecutionActionResource
,InputEditFinishResource
,InstanceDeleteActionResource
,LogicCopySurveyQuestionActionResource
,LowerDunningLevelResource
,MassContactActionResource
,MassLecturerBookingActionResource
,MassMembershipActionResource
,MassRegistrationActionResource
,MembershipQuestionResource
,OrderLogicCopyActionResource
,PayrexxAccountCredentialsAction
,PayrexxPaymentMethodsAction
,PlanningOverviewResource
,QuestionnaireLogicCopyActionResource
,RegistrationAccomplishmentStatusResource
,RegistrationCancellationResource
,RemoveDebitorExportActionResource
,RemoveQuestionnaireLockActionResource
,RemoveWagesFromExportResource
,RepeatAndUpdateLastDunningActionResource
,ReportGenerationResource
,ReportingLogicCopyActionResource
,RequirementCheckActionResource
,RequirementRuleCompileActionResource
,ResendMessageActionResource
,ReservationExportActionResource
,ReservationLecturerBookingAccomplishmentStatusResource
,ReservationLecturerBookingPlanningStatusResource
,ReservationRegistrationPresenceRateResource
,ResetUrlActionResource
,SalaryExportResource
,SchoolingCreateActionResource
,SeminarLowerActionResource
,SetDonationActionService
,SetGenericTextResource
,SetParentActionResource
,SetSmsPasswordResource
,SetWidgetDomainSecretActionResource
,StintAuctionRegisterLecturerResource
,StockMovementInwardActionResource
,StockMovementOutwardActionResource
,SurveyExportActionResource
,TimereportInfoResource
,TimereportNewResource
,TimereportUpdateResource
,TodoActionResource
,TransferAvailabilityActionResource
,TransferEducationalObjectiveActionResource
,TriggerBatchJobActionResource
,UpdateClientSecretActionResource
,UpdateDueTimeActionResource
,UpdateInputDataActionResource
,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 class
class
static final record
protected static class
Nested classes/interfaces inherited from class ch.tocco.nice2.rest.action.spi.AbstractPreActionResource
AbstractPreActionResource.SelectionType
-
Field Summary
Modifier and TypeFieldDescriptionprotected CommandExecutor
protected EntityBeanRebinder
protected NotificationService
protected TaskSchedulingService
Fields inherited from class ch.tocco.nice2.rest.action.spi.AbstractPreActionResource
businessUnitManager, context, defaultDisplayService, defaultValueService, formBeanService, initialFormEntityName, initialFormName, l10n, log, requiresFormEntity, securityManager, textResources
Fields inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
uriInfo
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractActionResource
(AbstractPreActionResource.SelectionType selectionType) protected
AbstractActionResource
(AbstractPreActionResource.SelectionType selectionType, @Nullable String initialFormEntityName) protected
AbstractActionResource
(AbstractPreActionResource.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 PreActionResponseBean
doValidate
(ActionResourceBean actionResourceBean, ActionDataBean actionDataBean) protected CallableType
per default the callable type (persisted as Task_execution) is DATA_PROCESSING.protected String
getFormEntity
(ActionResourceBean actionResourceBean, String entityModel) For session only entitiesactionDataBean.getFormEntity()
should be used for getting the form entity.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 JobDataMapBuilder
getTaskData
(String taskId, ActionResourceBean actionResourceBean) performAction
(ActionResourceBean actionResourceBean) protected boolean
Override to disable recovery for a particular action resource.void
setCommandExecutor
(CommandExecutor commandExecutor) void
setEntityBeanRebinder
(EntityBeanRebinder entityBeanRebinder) void
setNotificationService
(NotificationService notificationService) void
setTaskContextBuilder
(Supplier<TaskContext> taskContextBuilder) void
setTaskSchedulingService
(TaskSchedulingService taskSchedulingService) protected TextMessage
protected TextMessage
protected @Nullable TextMessage
protected TextMessage
protected TextMessage
protected TextMessage
final PreActionResponseBean
validate
(ActionResourceBean actionResourceBean) If a form is shown in the pre-action, an (optional) validation can be implemented indoValidate(ActionResourceBean, ActionDataBean)
.protected boolean
verifyFormEntityBean
(EntityBean formEntityBean) Methods inherited from class ch.tocco.nice2.rest.action.spi.AbstractPreActionResource
getInitialFormValueResponseBean, getSelectedEntities, getSelectedEntity, loadInitialForm, preAction, setBusinessUnitManager, setContext, setDefaultDisplayService, setDefaultValueService, setFormBeanService, setL10n, setLog, setSecurityManager, setSelectionService, setTextResources
Methods inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
getPathParameter, setUriInfo, tryGetInt
-
Field Details
-
entityBeanRebinder
-
commandExecutor
-
taskSchedulingService
-
notificationService
-
-
Constructor Details
-
AbstractActionResource
-
AbstractActionResource
protected AbstractActionResource(AbstractPreActionResource.SelectionType selectionType, @Nullable @Nullable String initialFormEntityName) -
AbstractActionResource
protected AbstractActionResource(AbstractPreActionResource.SelectionType selectionType, @Nullable @Nullable String initialFormEntityName, @Nullable @Nullable String initialFormName)
-
-
Method Details
-
doPerformAction
protected abstract AbstractActionResource.ActionResultBean doPerformAction(ActionDataBean actionDataBean, ActionResourceBean actionResourceBean, TaskContext taskContext) -
validate
@POST @Path("/validate") @Consumes("application/json") @Produces("application/json") public final PreActionResponseBean validate(ActionResourceBean actionResourceBean) If a form is shown in the pre-action, an (optional) validation can be implemented indoValidate(ActionResourceBean, ActionDataBean)
. -
doValidate
protected PreActionResponseBean doValidate(ActionResourceBean actionResourceBean, ActionDataBean actionDataBean) -
performAction
@POST @Consumes("application/json") @Produces("application/json") public ActionResponseBean performAction(ActionResourceBean actionResourceBean) -
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
-
getFormEntity
For session only entitiesactionDataBean.getFormEntity()
should be used for getting the form entity. If an actual entity is used in the preAction this method should be called that the entity is rebinded and returned. -
verifyFormEntityBean
-
getParentEntity
@Nullable protected @Nullable Entity getParentEntity(@Nullable @Nullable ActionParentEntityBean parent) -
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
-
setCommandExecutor
-
setTaskSchedulingService
-
setNotificationService
-
setTaskContextBuilder
-