com.ibm.commerce.pagelayout.widget.management.impl

Class DefaultWidgetManager

  • java.lang.Object
    • com.ibm.commerce.pagelayout.widget.management.impl.DefaultWidgetManager
  • All Implemented Interfaces:
    WidgetManager
    Direct Known Subclasses:
    MarketingWidgetManager


    public class DefaultWidgetManager
    extends java.lang.Object
    implements WidgetManager
    This is the default widget manager associated with widgets that do not specify a widget manager. It provides basic validation capability based on the widget property declaration in the widget definition XML.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void create(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget)
      This method performs no-operation.
      void createExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget, com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType aExtendedData, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
      This method performs no-operation.
      void delete(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
      This method performs no-operation.
      void deleteExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget, com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType aextendedData, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
      This method performs no-operation.
      com.ibm.commerce.pagelayout.facade.datatypes.WidgetDefinitionType getWidgetDefinition()
      Returns the logical widget definition data object for this widget.
      void init(com.ibm.commerce.pagelayout.facade.datatypes.WidgetDefinitionType widgetDefinition)
      This method initializes the widget manager with the widget definition that uses it.
      void retrieve(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO, java.lang.Object... parameters)
      This method performs no-operation.
      void retrieve(com.ibm.commerce.pagelayout.facade.datatypes.PageDesignType aPageDesign, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget, java.lang.Object... parameters)
      This method performs no-operation.
      void retrieveExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO, java.lang.Integer[] aStorePath, java.lang.Integer[] aLanguageIds, SelectionCriteria aCriteria, java.lang.Object... parameters)
      This method performs no-operation.
      void undo(com.ibm.commerce.foundation.internal.server.services.changehistory.beans.TaskGroupChangeHistoryDataSet tgchDataSet, java.lang.String widgetId, LayoutManagementResourceManager layoutResourceManager)
      This method performs the operation to undo data specific to widgets.
      void update(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
      This method performs no-operation.
      void updateExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget, com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType aExtendedData, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
      This method performs no-operation.
      java.util.List<ClientError> validateChange(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
      This method validates the widget properties.
      java.util.List<ClientError> validateChangeExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget, com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType extendedData, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
      This method performs no-operation.
      java.util.List<ClientError> validateCreate(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget)
      This method validates the widget properties.
      java.util.List<ClientError> validateCreateExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget, com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType extendedData, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
      This method performs no-operation.
      java.util.List<ClientError> validateDelete(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
      This method performs no-operation.
      java.util.List<ClientError> validateDeleteExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout, com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget, com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType extendedData, com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
      This method performs no-operation.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultWidgetManager

        public DefaultWidgetManager()
    • Method Detail

      • getWidgetDefinition

        public com.ibm.commerce.pagelayout.facade.datatypes.WidgetDefinitionType getWidgetDefinition()
        Returns the logical widget definition data object for this widget.
        Specified by:
        getWidgetDefinition in interface WidgetManager
        Returns:
        The logical widget definition data object for this widget
      • create

        public void create(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout,
                           com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget)
                    throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        create in interface WidgetManager
        Parameters:
        aLayout - The layout object to which the widget belongs to.
        aWidget - The widget being removed from the page layout.
        Throws:
        LayoutException - This exception is to allow implementation classes to indicate its invoker about the error that occurred while deleting the widget.
      • createExtendedData

        public void createExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout,
                                       com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget,
                                       com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType aExtendedData,
                                       com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
                                throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        createExtendedData in interface WidgetManager
        Parameters:
        aLayout - The layout object to which the widget belongs to.
        aWidget - The widget where the extended data is being created.
        aExtendedData - The extended data being created from the page layout.
        aWidgetSDO - The physical data object object of the widget.
        Throws:
        LayoutException - This exception is to allow implementation classes to indicate its invoker about the error that occurred while deleting the widget.
      • updateExtendedData

        public void updateExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout,
                                       com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget,
                                       com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType aExtendedData,
                                       com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
                                throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        updateExtendedData in interface WidgetManager
        Parameters:
        aLayout - The layout object to which the widget belongs to.
        aWidget - The widget where the extended data is being updated.
        aExtendedData - The extended data being updated from the page layout.
        aWidgetSDO - The physical data object of the widget.
        Throws:
        LayoutException - This exception is to allow implementation classes to indicate its invoker about the error that occurred while deleting the widget.
      • deleteExtendedData

        public void deleteExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout,
                                       com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget,
                                       com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType aextendedData,
                                       com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
                                throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        deleteExtendedData in interface WidgetManager
        Parameters:
        aLayout - The layout object to which the widget belongs to.
        aWidget - The widget where the extended data is being deleted.
        aextendedData - The extended data being deleted from the page layout.
        aWidgetSDO - The physical data object of the widget.
        Throws:
        LayoutException - This exception is to allow implementation classes to indicate its invoker about the error that occurred while deleting the widget.
      • delete

        public void delete(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout,
                           com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget,
                           com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
                    throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        delete in interface WidgetManager
        Parameters:
        aLayout - The layout object to which the widget belongs to.
        aWidget - The widget being removed from the page layout.
        aWidgetSDO - The physical data object of the widget.
        Throws:
        LayoutException - This exception is to allow implementation classes to indicate its invoker about the error that occurred while deleting the widget.
      • init

        public void init(com.ibm.commerce.pagelayout.facade.datatypes.WidgetDefinitionType widgetDefinition)
        This method initializes the widget manager with the widget definition that uses it. Subclasses should call this super method before implementing custom behavior.
        Specified by:
        init in interface WidgetManager
        Parameters:
        widgetDefinition - The widget definition object
      • retrieve

        public void retrieve(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout,
                             com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget,
                             com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO,
                             java.lang.Object... parameters)
                      throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        retrieve in interface WidgetManager
        Parameters:
        aLayout - The layout object to which the widget belongs to.
        aWidget - The widget object that needs to be populated.
        aWidgetSDO - The physical data object of the widget.
        parameters - This list would contain the selection criteria object.
        Throws:
        LayoutException - This exception is to allow implementation classes to indicate its invoker about the error that occurred while retrieving the widget information.
      • retrieve

        public void retrieve(com.ibm.commerce.pagelayout.facade.datatypes.PageDesignType aPageDesign,
                             com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget,
                             java.lang.Object... parameters)
                      throws PageDesignException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        retrieve in interface WidgetManager
        Parameters:
        aPageDesign - The page design object to which the widget belongs to.
        aWidget - The widget object that needs to be populated.
        parameters - This list would contain the selection criteria object.
        Throws:
        PageDesignException - This exception is to allow implementation classes to indicate its invoker about the error that occurred while retrieving the widget information.
      • update

        public void update(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout,
                           com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget,
                           com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
                    throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        update in interface WidgetManager
        Parameters:
        aLayout - The layout object to which the widget belongs to.
        aWidget - The widget being updated on a page layout.
        aWidgetSDO - The physical data object of the widget.
        Throws:
        LayoutException - This exception is to allow implementation classes to indicate its invoker about the error that occurred while persisting the widget.
      • validateChange

        public java.util.List<ClientError> validateChange(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout,
                                                          com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget,
                                                          com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
                                                   throws LayoutException
        This method validates the widget properties. It checks if all mandatory widget properties are specified and also check if the widget property values are valid. Subclasses should call this super method before implementing custom behavior.
        Specified by:
        validateChange in interface WidgetManager
        Parameters:
        layout - The layout object to which the widget belongs to.
        widget - The widget being updated on a page layout.
        aWidgetSDO - The physical data object object of the widget.
        Returns:
        A list of client errors that indicate validation errors. Null, if there are no errors.
        Throws:
        LayoutException - This exception is to provide the implementation classes the convenience of throwing an exception instead of returning a list of application errors.
      • validateCreate

        public java.util.List<ClientError> validateCreate(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout,
                                                          com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget)
                                                   throws LayoutException
        This method validates the widget properties. It checks if all mandatory widget properties are specified and also check if the widget property values are valid. Subclasses should call this super method before implementing custom behavior.
        Specified by:
        validateCreate in interface WidgetManager
        Parameters:
        layout - The layout object to which the widget is being added.
        widget - The widget being added to the page layout.
        Returns:
        A list of client errors that indicate validation errors. Null, if there are no errors.
        Throws:
        LayoutException - This exception is to provide the implementation classes the convenience of throwing an exception instead of returning a list of application errors.
      • validateDelete

        public java.util.List<ClientError> validateDelete(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout,
                                                          com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget,
                                                          com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
                                                   throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior. Subclasses should call this super method before implementing custom behavior.
        Specified by:
        validateDelete in interface WidgetManager
        Parameters:
        layout - The layout object to which the widget belongs to.
        widget - The widget being updated on a page layout.
        aWidgetSDO - The physical data object object of the widget.
        Returns:
        A list of client errors that indicate validation errors. Null, if there are no errors.
        Throws:
        LayoutException - This exception is to provide the implementation classes the convenience of throwing an exception instead of returning a list of application errors.
      • validateChangeExtendedData

        public java.util.List<ClientError> validateChangeExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout,
                                                                      com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget,
                                                                      com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType extendedData,
                                                                      com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
                                                               throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        validateChangeExtendedData in interface WidgetManager
        Parameters:
        layout - The layout object to which the widget is being upated.
        widget - The widget where the extended data is being deleted.
        extendedData - The extended data being deleted from the widget.
        aWidgetSDO - The physical data object object of the widget.
        Returns:
        A list of client errors that indicate validation errors. Null, if there are no errors.
        Throws:
        LayoutException - This exception is to provide the implementation classes the convenience of throwing an exception instead of returning a list of application errors.
      • validateCreateExtendedData

        public java.util.List<ClientError> validateCreateExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout,
                                                                      com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget,
                                                                      com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType extendedData,
                                                                      com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
                                                               throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        validateCreateExtendedData in interface WidgetManager
        Parameters:
        layout - The layout object to which the widget is being upated.
        widget - The widget where the extended data is being deleted.
        extendedData - The extended data being deleted from the widget.
        aWidgetSDO - The physical data object object of the widget.
        Returns:
        A list of client errors that indicate validation errors. Null, if there are no errors.
        Throws:
        LayoutException - This exception is to provide the implementation classes the convenience of throwing an exception instead of returning a list of application errors.
      • validateDeleteExtendedData

        public java.util.List<ClientError> validateDeleteExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType layout,
                                                                      com.ibm.commerce.pagelayout.facade.datatypes.WidgetType widget,
                                                                      com.ibm.commerce.pagelayout.facade.datatypes.ExtendedDataType extendedData,
                                                                      com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO)
                                                               throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        validateDeleteExtendedData in interface WidgetManager
        Parameters:
        layout - The layout object to which the widget is being upated.
        widget - The widget where the extended data is being deleted.
        extendedData - The extended data being deleted from the widget.
        aWidgetSDO - The physical data object object of the widget.
        Returns:
        A list of client errors that indicate validation errors. Null, if there are no errors.
        Throws:
        LayoutException - This exception is to provide the implementation classes the convenience of throwing an exception instead of returning a list of application errors.
      • retrieveExtendedData

        public void retrieveExtendedData(com.ibm.commerce.pagelayout.facade.datatypes.LayoutType aLayout,
                                         com.ibm.commerce.pagelayout.facade.datatypes.WidgetType aWidget,
                                         com.ibm.commerce.pagelayout.facade.server.entity.datatypes.PageLayoutWidget aWidgetSDO,
                                         java.lang.Integer[] aStorePath,
                                         java.lang.Integer[] aLanguageIds,
                                         SelectionCriteria aCriteria,
                                         java.lang.Object... parameters)
                                  throws LayoutException
        This method performs no-operation. Subclasses must override to implement custom behavior.
        Specified by:
        retrieveExtendedData in interface WidgetManager
        Parameters:
        aLayout - The layout object to which the widget belongs to.
        aWidget - The widget object that needs to be populated.
        aWidgetSDO - The physical data object of the widget.
        aStorePath - The store path of the request.
        aLanguageIds - The requested language ids.
        aCriteria - The selection criteria of the request.
        parameters - This list would contain the selection criteria object.
        Throws:
        LayoutException - This exception is thrown when error occurs while retrieving the widget display title information.
      • undo

        public void undo(com.ibm.commerce.foundation.internal.server.services.changehistory.beans.TaskGroupChangeHistoryDataSet tgchDataSet,
                         java.lang.String widgetId,
                         LayoutManagementResourceManager layoutResourceManager)
                  throws LayoutException
        This method performs the operation to undo data specific to widgets. Subclasses may override to implement custom behavior. Default behavior in this sub class is to remove all PLWIDGETNVP records associated to the widget within the specified task group. Sub classes can change which PLWIDGETNVP records to remove.
        Specified by:
        undo in interface WidgetManager
        Parameters:
        tgchDataSet - The change history record
        widgetId - The widget id
        layoutResourceManager - The Layout Resource Manager
        Throws:
        LayoutException - If there is an error. This should be raised if all undo actions performed by the underlying infrastructure should be rolled back.