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.AbstractPreActionResource
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.ActionResultBean, AbstractActionResource.ActionResultBeanBuilder, AbstractActionResource.ActionResultFlags, AbstractActionResource.GetFormEntityTask
Nested classes/interfaces inherited from class ch.tocco.nice2.rest.action.spi.AbstractPreActionResource
AbstractPreActionResource.SelectionType
-
Field Summary
Fields inherited from class ch.tocco.nice2.rest.action.spi.AbstractActionResource
commandExecutor, entityBeanRebinder, notificationService, 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
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, doValidate, getCallableType, getCurrentUsername, getFormEntity, getJobClass, getParentEntity, getTaskData, performAction, recoveryEnabled, setCommandExecutor, setEntityBeanRebinder, setNotificationService, setTaskContextBuilder, setTaskSchedulingService, taskCancelledMessage, taskFailedMessage, taskFailedTitle, taskFinishedMessage, taskSchedulingMessage, taskStartedMessage, validate, verifyFormEntityBean
Methods inherited from class ch.tocco.nice2.rest.action.spi.AbstractPreActionResource
getInitialFormValueResponseBean, getSelectedEntities, getSelectedEntity, loadInitialForm, 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
-
queryBuilderFactory
-
-
Constructor Details
-
AbstractSetLookupEntityActionResource
-
-
Method Details
-
preAction
Description copied from class:AbstractPreActionResource
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 classAbstractPreActionResource
-
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
-