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 AbstractActionResource
AbstractActionResource.AbstractActionJob, AbstractActionResource.AbstractInterruptableActionJob, AbstractActionResource.ActionResultBean, AbstractActionResource.ActionResultBeanBuilder, AbstractActionResource.ActionResultFlags, AbstractActionResource.GetFormEntityTaskNested classes/interfaces inherited from class AbstractPreActionResource
AbstractPreActionResource.SelectionType -
Field Summary
FieldsFields inherited from class AbstractActionResource
commandExecutor, entityBeanRebinder, notificationService, taskSchedulingServiceFields inherited from class AbstractPreActionResource
businessUnitManager, context, defaultDisplayService, defaultValueService, formBeanService, initialFormEntityName, initialFormName, l10n, log, requiresFormEntity, securityManager, textResourcesFields inherited from class AbstractRestResource
uriInfo -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSetLookupEntityActionResource(QueryBuilderFactory queryBuilderFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractActionResource.ActionResultBeanNo message is generated and #selectionDeleted() is not executed.protected PreActionResponseBeanNo confirm-message is generated.protected StringThe relation that is set is retrieved by #getLookupEntityName().protected ConditioncreateValidationCondition(PrimaryKeyList selection) All selected entities need to fulfill this condition.protected AbstractActionResource.ActionResultBeandoPerformAction(ActionDataBean actionDataBean, ActionResourceBean actionResourceBean, TaskContext taskContext) protected abstract Stringthe model name of the lookup-entity, which is to be setprotected abstract Stringthe model name of the selected entityprotected abstract Stringthe 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 AbstractActionResource
actionName, doValidate, getCallableType, getCurrentUsername, getFormEntity, getJobClass, getParentEntity, getTaskData, performAction, recoveryEnabled, setCommandExecutor, setEntityBeanRebinder, setNotificationService, setTaskContextBuilder, setTaskSchedulingService, taskCancelledMessage, taskFailedMessage, taskFailedTitle, taskFinishedMessage, taskSchedulingMessage, taskStartedMessage, validate, verifyFormEntityBeanMethods inherited from class AbstractPreActionResource
getInitialFormValueResponseBean, getSelectedEntities, getSelectedEntity, loadInitialForm, setBusinessUnitManager, setContext, setDefaultDisplayService, setDefaultValueService, setFormBeanService, setL10n, setLog, setSecurityManager, setSelectionService, setTextResourcesMethods inherited from class AbstractRestResource
getPathParameter, setUriInfo, tryGetInt
-
Field Details
-
queryBuilderFactory
-
-
Constructor Details
-
AbstractSetLookupEntityActionResource
-
-
Method Details
-
preAction
Description copied from class:AbstractPreActionResourceis ran before the actual logic and can be used to run checks or return a form that needs to be filled before execution- Overrides:
preActionin classAbstractPreActionResource
-
doPerformAction
protected AbstractActionResource.ActionResultBean doPerformAction(ActionDataBean actionDataBean, ActionResourceBean actionResourceBean, TaskContext taskContext) - Specified by:
doPerformActionin 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
-