Package ch.tocco.nice2.rest.action.spi
Class AbstractSetLookupEntityActionResource
java.lang.Object
ch.tocco.nice2.rest.core.spi.AbstractRestResource
ch.tocco.nice2.rest.action.spi.AbstractActionResource
ch.tocco.nice2.rest.action.spi.AbstractSetLookupEntityActionResource
- All Implemented Interfaces:
RestResource
Abstract class based on
AbstractActionResource
.
This class provides functionality for setting a specific LookupEntity#unique_id,
- #createValidationCondition(PrimaryKeyList selection) can be overridden
- #createPreActionResponseBean() can be overridden
- #createRelationToSet() can be overridden
- #createActionResultBean() can be overridden
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.tocco.nice2.rest.action.spi.AbstractActionResource
AbstractActionResource.AbstractActionJob, AbstractActionResource.AbstractInterruptableActionJob, AbstractActionResource.ActionMessageConfig, AbstractActionResource.ActionResultBean, AbstractActionResource.ActionResultBeanBuilder, AbstractActionResource.ActionResultFlags, AbstractActionResource.GetFormEntityTask, AbstractActionResource.SelectionType
-
Field Summary
Fields inherited from class ch.tocco.nice2.rest.action.spi.AbstractActionResource
businessUnitManager, commandExecutor, context, defaultDisplayService, defaultValueService, entityBeanRebinder, formBeanService, l10n, log, notificationService, securityManager, taskSchedulingService, textResources
Fields inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
uriInfo
-
Constructor Summary
ConstructorDescriptionAbstractSetLookupEntityActionResource
(QueryBuilderFactory queryBuilderFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractActionResource.ActionResultBean
No message is generated and #selectionDeleted() is not executed.protected PreActionResponseBean
No confirm-message is generated.protected String
The relation that is set is retrieved by #getLookupEntityName().protected Condition
createValidationCondition
(PrimaryKeyList selection) All selected entities need to fulfill this condition.protected AbstractActionResource.ActionResultBean
doPerformAction
(ActionDataBean actionDataBean, ActionResourceBean actionResourceBean, TaskContext taskContext) protected abstract String
the model name of the lookup-entity, which is to be setprotected abstract String
the model name of the selected entityprotected abstract String
the unique_id of the desired lookup-entitypreAction
(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 executionMethods inherited from class ch.tocco.nice2.rest.action.spi.AbstractActionResource
actionName, formEntityMissing, getCallableType, getCurrentUsername, getInitialFormValueResponseBean, getJobClass, getParentEntity, getSelectedEntities, getSelectedEntity, getTaskData, ignoreMissingEntities, loadInitialForm, performAction, recoveryEnabled, setBusinessUnitManager, setCommandExecutor, setContext, setDefaultDisplayService, setDefaultValueService, setEntityBeanRebinder, setFormBeanService, setL10n, setLog, setNotificationService, setSecurityManager, setSelectionService, setTaskSchedulingService, setTextResources, taskCancelledMessage, taskFailedMessage, taskFailedTitle, taskFinishedMessage, taskSchedulingMessage, taskStartedMessage, verifyFormEntityBean
Methods inherited from class ch.tocco.nice2.rest.core.spi.AbstractRestResource
getPathParameter, setUriInfo, tryGetInt
-
Field Details
-
queryBuilderFactory
-
-
Constructor Details
-
AbstractSetLookupEntityActionResource
-
-
Method Details
-
preAction
Description copied from class:AbstractActionResource
is ran before the actual logic and can be used to run checks or return a form that needs to be filled before execution- Overrides:
preAction
in classAbstractActionResource
-
doPerformAction
protected AbstractActionResource.ActionResultBean doPerformAction(ActionDataBean actionDataBean, ActionResourceBean actionResourceBean, TaskContext taskContext) - Specified by:
doPerformAction
in classAbstractActionResource
-
createValidationCondition
All selected entities need to fulfill this condition. This condition checks that the unique_id to be set is different from the existing one. - Override for a custom Condition -
createPreActionResponseBean
No confirm-message is generated. - Override for a custom confirm-message: PreCheckResponseBean.confirm(message) -
createRelationToSet
The relation that is set is retrieved by #getLookupEntityName(). - Override for a relation that is different from the lookupEntity -
createActionResultBean
No message is generated and #selectionDeleted() is not executed. - Override for custom-message or/and if #selectionDeleted() should be executed -
getParentEntityName
the model name of the selected entity -
getLookupEntityName
the model name of the lookup-entity, which is to be set -
getUniqueId
the unique_id of the desired lookup-entity
-