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

public abstract class AbstractActionResource extends AbstractRestResource
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)
    • 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

      protected ActionResponseBean formEntityMissing()
    • 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()
    • loadInitialForm

      protected InitialFormValueResponseBean loadInitialForm()
    • getInitialFormValueResponseBean

      protected InitialFormValueResponseBean getInitialFormValueResponseBean(String formName)
    • verifyFormEntityBean

      protected boolean verifyFormEntityBean(EntityBean formEntityBean)
    • getParentEntity

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

      protected Entity getSelectedEntity(EntitySelectionBean selection) throws NotFoundException
      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

      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)
    • setContext

      @Autowired public void setContext(Context context)
    • setTextResources

      @Autowired public void setTextResources(TextResources textResources)
    • setCommandExecutor

      @Autowired public void setCommandExecutor(CommandExecutor commandExecutor)
    • setTaskSchedulingService

      @Autowired public void setTaskSchedulingService(TaskSchedulingService taskSchedulingService)
    • setLog

      @Autowired public void setLog(org.slf4j.Logger log)
    • setSelectionService

      @Autowired public void setSelectionService(SelectionService selectionService)
    • setFormBeanService

      @Autowired public void setFormBeanService(FormBeanService formBeanService)
    • setL10n

      @Autowired public void setL10n(L10N l10n)
    • setBusinessUnitManager

      @Autowired public void setBusinessUnitManager(BusinessUnitManager businessUnitManager)
    • setSecurityManager

      @Autowired public void setSecurityManager(SecurityManager securityManager)
    • setDefaultValueService

      @Autowired public void setDefaultValueService(EntityDefaultValueService defaultValueService)
    • setNotificationService

      @Autowired public void setNotificationService(NotificationService notificationService)
    • setDefaultDisplayService

      @Autowired public void setDefaultDisplayService(DefaultDisplayService defaultDisplayService)