Class 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 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
    • Constructor Detail

      • ToggleItemLockAction

        public ToggleItemLockAction()
    • 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 interface com.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 interface com.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 interface com.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 interface com.hybris.cockpitng.actions.CockpitAction<java.lang.Object,​java.lang.Object>
      • publishGlobalNotificationOnLockingStateChange

        protected void publishGlobalNotificationOnLockingStateChange​(java.util.Collection<?> data)
      • 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)