Class ToggleItemLockAction
- java.lang.Object
-
- com.hybris.cockpitng.engine.impl.AbstractComponentWidgetAdapterAware
-
- com.hybris.backoffice.widgets.actions.locking.ToggleItemLockAction
-
- All Implemented Interfaces:
com.hybris.cockpitng.actions.CockpitAction<java.lang.Object,java.lang.Object>
,com.hybris.cockpitng.engine.ComponentWidgetAdapterAware
public class ToggleItemLockAction extends com.hybris.cockpitng.engine.impl.AbstractComponentWidgetAdapterAware implements com.hybris.cockpitng.actions.CockpitAction<java.lang.Object,java.lang.Object>
Action allows to lock and unlock an item or items. It is impossible to delete, edit or save locked items.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
GLOBAL_EVENT_ITEM_LOCKED_STATE_CHANGED
protected static java.lang.String
LOCK_CONFIRMATION_MESSAGE
protected static java.lang.String
LOCK_CONFIRMATION_MESSAGE_MULTI
protected static java.lang.String
UNLOCK_CONFIRMATION_MESSAGE
protected static java.lang.String
UNLOCK_CONFIRMATION_MESSAGE_MULTI
-
Constructor Summary
Constructors Constructor Description ToggleItemLockAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bulkChangeLock(java.util.Collection<?> collection)
boolean
canPerform(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx)
protected void
changeLock(ItemModel data, boolean lock)
java.lang.String
getConfirmationMessage(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx)
protected com.hybris.cockpitng.dataaccess.util.CockpitGlobalEventPublisher
getEventPublisher()
protected ItemLockingService
getItemLockingService()
protected com.hybris.backoffice.widgets.notificationarea.NotificationService
getNotificationService()
boolean
needsConfirmation(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx)
com.hybris.cockpitng.actions.ActionResult<java.lang.Object>
perform(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx)
protected void
publishGlobalNotificationOnLockingStateChange(java.util.Collection<?> data)
void
setEventPublisher(com.hybris.cockpitng.dataaccess.util.CockpitGlobalEventPublisher eventPublisher)
void
setItemLockingService(ItemLockingService itemLockingService)
void
setNotificationService(com.hybris.backoffice.widgets.notificationarea.NotificationService notificationService)
protected void
showNotifications(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx, ItemModel data)
protected void
showNotifications(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx, java.util.Collection<?> dataList)
-
-
-
Field Detail
-
GLOBAL_EVENT_ITEM_LOCKED_STATE_CHANGED
protected static final java.lang.String GLOBAL_EVENT_ITEM_LOCKED_STATE_CHANGED
- See Also:
- Constant Field Values
-
LOCK_CONFIRMATION_MESSAGE
protected static final java.lang.String LOCK_CONFIRMATION_MESSAGE
- See Also:
- Constant Field Values
-
UNLOCK_CONFIRMATION_MESSAGE
protected static final java.lang.String UNLOCK_CONFIRMATION_MESSAGE
- See Also:
- Constant Field Values
-
LOCK_CONFIRMATION_MESSAGE_MULTI
protected static final java.lang.String LOCK_CONFIRMATION_MESSAGE_MULTI
- See Also:
- Constant Field Values
-
UNLOCK_CONFIRMATION_MESSAGE_MULTI
protected static final java.lang.String UNLOCK_CONFIRMATION_MESSAGE_MULTI
- See Also:
- Constant Field Values
-
-
Method Detail
-
perform
public com.hybris.cockpitng.actions.ActionResult<java.lang.Object> perform(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx)
- Specified by:
perform
in interfacecom.hybris.cockpitng.actions.CockpitAction<java.lang.Object,java.lang.Object>
-
bulkChangeLock
protected void bulkChangeLock(java.util.Collection<?> collection)
-
changeLock
protected void changeLock(ItemModel data, boolean lock)
-
showNotifications
protected void showNotifications(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx, ItemModel data)
-
showNotifications
protected void showNotifications(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx, java.util.Collection<?> dataList)
-
canPerform
public boolean canPerform(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx)
- Specified by:
canPerform
in interfacecom.hybris.cockpitng.actions.CockpitAction<java.lang.Object,java.lang.Object>
-
needsConfirmation
public boolean needsConfirmation(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx)
- Specified by:
needsConfirmation
in interfacecom.hybris.cockpitng.actions.CockpitAction<java.lang.Object,java.lang.Object>
-
getConfirmationMessage
public java.lang.String getConfirmationMessage(com.hybris.cockpitng.actions.ActionContext<java.lang.Object> ctx)
- Specified by:
getConfirmationMessage
in interfacecom.hybris.cockpitng.actions.CockpitAction<java.lang.Object,java.lang.Object>
-
publishGlobalNotificationOnLockingStateChange
protected void publishGlobalNotificationOnLockingStateChange(java.util.Collection<?> data)
-
getItemLockingService
protected ItemLockingService getItemLockingService()
-
setItemLockingService
public void setItemLockingService(ItemLockingService itemLockingService)
-
getEventPublisher
protected com.hybris.cockpitng.dataaccess.util.CockpitGlobalEventPublisher getEventPublisher()
-
setEventPublisher
public void setEventPublisher(com.hybris.cockpitng.dataaccess.util.CockpitGlobalEventPublisher eventPublisher)
-
getNotificationService
protected com.hybris.backoffice.widgets.notificationarea.NotificationService getNotificationService()
-
setNotificationService
public void setNotificationService(com.hybris.backoffice.widgets.notificationarea.NotificationService notificationService)
-
-