Class 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

public abstract class AbstractActionResource extends AbstractPreActionResource
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.
  • Field Details

  • Constructor Details

  • 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 in doValidate(ActionResourceBean, ActionDataBean).
    • doValidate

      protected PreActionResponseBean doValidate(ActionResourceBean actionResourceBean, ActionDataBean actionDataBean)
    • performAction

      @POST @Consumes("application/json") @Produces("application/json") public ActionResponseBean performAction(ActionResourceBean actionResourceBean)
    • getCallableType

      protected CallableType 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

      protected abstract TextMessage actionName()
      name of the action displayed in the notification center if no specific text is set
    • taskSchedulingMessage

      protected TextMessage taskSchedulingMessage()
    • taskStartedMessage

      protected TextMessage taskStartedMessage()
    • taskFinishedMessage

      protected TextMessage taskFinishedMessage()
    • taskFailedTitle

      @Nullable protected @Nullable TextMessage taskFailedTitle()
    • taskFailedMessage

      protected TextMessage taskFailedMessage()
    • taskCancelledMessage

      protected TextMessage taskCancelledMessage()
    • getTaskData

      protected JobDataMapBuilder getTaskData(String taskId, ActionResourceBean actionResourceBean)
    • getCurrentUsername

      protected String getCurrentUsername()
    • getFormEntity

      protected Optional<Entity> getFormEntity(ActionResourceBean actionResourceBean, String entityModel)
      For session only entities actionDataBean.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

      protected boolean verifyFormEntityBean(EntityBean formEntityBean)
    • getParentEntity

      @Nullable protected @Nullable Entity getParentEntity(@Nullable @Nullable ActionParentEntityBean parent)
    • getJobClass

      protected abstract Class<? extends AbstractJob> 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

      @Autowired public void setEntityBeanRebinder(EntityBeanRebinder entityBeanRebinder)
    • setCommandExecutor

      @Autowired public void setCommandExecutor(CommandExecutor commandExecutor)
    • setTaskSchedulingService

      @Autowired public void setTaskSchedulingService(TaskSchedulingService taskSchedulingService)
    • setNotificationService

      @Autowired public void setNotificationService(NotificationService notificationService)
    • setTaskContextBuilder

      @VisibleForTesting public void setTaskContextBuilder(Supplier<TaskContext> taskContextBuilder)