Class EnumerationAction
- java.lang.Object
-
- com.hybris.cockpitng.engine.impl.AbstractComponentWidgetAdapterAware
-
- com.hybris.backoffice.widgets.actions.enumeration.EnumerationAction
-
- All Implemented Interfaces:
com.hybris.cockpitng.actions.CockpitAction<java.util.Collection<java.lang.Object>,java.lang.Object>,com.hybris.cockpitng.engine.ComponentWidgetAdapterAware
public class EnumerationAction extends com.hybris.cockpitng.engine.impl.AbstractComponentWidgetAdapterAware implements com.hybris.cockpitng.actions.CockpitAction<java.util.Collection<java.lang.Object>,java.lang.Object>EnumerationAction is a generic class which allows to update a list of selected items with chosen enumeration value. Enumeration action accepts 2 parameters through configuration:-
"qualifier" - is a required
parameter. The type of the items is inferred from the input data and next, the type of the given qualifier is
retrieved. For example, configuration for Product type can be provided as follows:
<y:parameter> <y:name>qualifier</y:name> <y:value>approvalStatus</y:value> </y:parameter>-
"validatorId" - is an optional
parameter. You can provide id of validator's bean which allows to check whether the given data can be updated with
chosen enumeration value. For example:
<y:parameter> <y:name>validatorId</y:name> <y:value>someBeanId</y:value> </y:parameter>
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringDEFAULT_ENUMERATION_VALIDATOR_BEAN_IDprotected static java.lang.StringENUMERATION_KEYprotected static java.lang.StringPARAMETER_QUALIFIERprotected static java.lang.StringPARAMETER_VALIDATOR_ID
-
Constructor Summary
Constructors Constructor Description EnumerationAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidbeginTransaction()Deprecated, for removal: This API element is subject to removal in a future version.since 1808, not used anymore.booleancanPerform(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> ctx)protected voidcommitTransaction()Deprecated, for removal: This API element is subject to removal in a future version.since 1808, not used anymore.protected java.util.Optional<EnumerationValidator>getBean(java.lang.String beanId)java.util.Set<java.lang.String>getDisabledInterceptorsBeanNames()protected java.util.Optional<EnumerationValidator>getEnumerationValidator(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> context)ModelServicegetModelService()com.hybris.backoffice.widgets.notificationarea.NotificationServicegetNotificationService()protected java.lang.StringgetNotificationSource(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> context)com.hybris.cockpitng.dataaccess.facades.object.ObjectFacadegetObjectFacade()com.hybris.cockpitng.type.ObjectValueServicegetObjectValueService()SessionServicegetSessionService()protected voidnotifyUpdateFailed(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> context, java.util.Map<java.lang.Object,? extends java.lang.Exception> map)com.hybris.cockpitng.actions.ActionResult<java.lang.Object>perform(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> context)protected voidrevertChanges(java.util.Collection<java.lang.Object> list)protected voidrollbackTransaction()Deprecated, for removal: This API element is subject to removal in a future version.since 1808, not used anymore.protected com.hybris.cockpitng.actions.ActionResult<java.lang.Object>save(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> context, java.lang.String expression, java.util.Collection<java.lang.Object> list, HybrisEnumValue hybrisEnumValue)protected com.hybris.cockpitng.dataaccess.facades.object.ObjectFacadeOperationResult<java.lang.Object>saveChangesWithoutInterceptors(java.util.Collection<java.lang.Object> itemsToSave)-
Methods inherited from class com.hybris.cockpitng.engine.impl.AbstractComponentWidgetAdapterAware
addSocketInputEventListener, getComponentID, handleSocketInputEvent, initialize, initializeDefaultEventListeners, registerStubInstance, sendOutput, setComponentID, unregisterStubInstance
-
-
-
-
Field Detail
-
DEFAULT_ENUMERATION_VALIDATOR_BEAN_ID
protected static final java.lang.String DEFAULT_ENUMERATION_VALIDATOR_BEAN_ID
- See Also:
- Constant Field Values
-
ENUMERATION_KEY
protected static final java.lang.String ENUMERATION_KEY
- See Also:
- Constant Field Values
-
PARAMETER_QUALIFIER
protected static final java.lang.String PARAMETER_QUALIFIER
- See Also:
- Constant Field Values
-
PARAMETER_VALIDATOR_ID
protected static final java.lang.String PARAMETER_VALIDATOR_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
perform
public com.hybris.cockpitng.actions.ActionResult<java.lang.Object> perform(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> context)
- Specified by:
performin interfacecom.hybris.cockpitng.actions.CockpitAction<java.util.Collection<java.lang.Object>,java.lang.Object>
-
save
protected com.hybris.cockpitng.actions.ActionResult<java.lang.Object> save(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> context, java.lang.String expression, java.util.Collection<java.lang.Object> list, HybrisEnumValue hybrisEnumValue)
-
saveChangesWithoutInterceptors
protected com.hybris.cockpitng.dataaccess.facades.object.ObjectFacadeOperationResult<java.lang.Object> saveChangesWithoutInterceptors(java.util.Collection<java.lang.Object> itemsToSave)
-
revertChanges
protected void revertChanges(java.util.Collection<java.lang.Object> list)
-
notifyUpdateFailed
protected void notifyUpdateFailed(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> context, java.util.Map<java.lang.Object,? extends java.lang.Exception> map)
-
beginTransaction
@Deprecated(since="1808", forRemoval=true) protected void beginTransaction()Deprecated, for removal: This API element is subject to removal in a future version.since 1808, not used anymore.saveChangesWithoutInterceptors(java.util.Collection<java.lang.Object>)uses save method which became transactional in 1808
-
rollbackTransaction
@Deprecated(since="1808", forRemoval=true) protected void rollbackTransaction()Deprecated, for removal: This API element is subject to removal in a future version.since 1808, not used anymore.saveChangesWithoutInterceptors(java.util.Collection<java.lang.Object>)uses save method which became transactional in 1808
-
commitTransaction
@Deprecated(since="1808", forRemoval=true) protected void commitTransaction()Deprecated, for removal: This API element is subject to removal in a future version.since 1808, not used anymore.saveChangesWithoutInterceptors(java.util.Collection<java.lang.Object>)uses save method which became transactional in 1808
-
canPerform
public boolean canPerform(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> ctx)
- Specified by:
canPerformin interfacecom.hybris.cockpitng.actions.CockpitAction<java.util.Collection<java.lang.Object>,java.lang.Object>
-
getNotificationSource
protected java.lang.String getNotificationSource(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> context)
-
getEnumerationValidator
protected java.util.Optional<EnumerationValidator> getEnumerationValidator(com.hybris.cockpitng.actions.ActionContext<java.util.Collection<java.lang.Object>> context)
-
getBean
protected java.util.Optional<EnumerationValidator> getBean(java.lang.String beanId)
-
getObjectValueService
public com.hybris.cockpitng.type.ObjectValueService getObjectValueService()
-
getObjectFacade
public com.hybris.cockpitng.dataaccess.facades.object.ObjectFacade getObjectFacade()
-
getNotificationService
public com.hybris.backoffice.widgets.notificationarea.NotificationService getNotificationService()
-
getModelService
public ModelService getModelService()
-
getSessionService
public SessionService getSessionService()
-
getDisabledInterceptorsBeanNames
public java.util.Set<java.lang.String> getDisabledInterceptorsBeanNames()
-
-