com.ibm.commerce.pagelayout.facade.client

Class PageLayoutFacadeClient



  • public class PageLayoutFacadeClient
    extends AbstractPageLayoutFacadeClient

    This class provides common methods that this and other utility class to the PageLayout facade can use. This class also provides a set of convenient Java API to represent particular PageLayout operations. This set of Java API also include APIs for Web based requests to transform the name value pair request into the appropriate request documents.

    • Constructor Summary

      Constructors 
      Constructor and Description
      PageLayoutFacadeClient()
      Creates an instance of the client to communicate with the PageLayout facade.
      PageLayoutFacadeClient(BusinessContextType businessContext, javax.security.auth.callback.CallbackHandler callbackHandler)
      Creates an instance of the client to communicate with the PageLayout facade.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static ExpressionType buildGetWidgetDefinitionByWidgetTypesExpression(java.util.Map parameters)
      This method constructs the expression to retrieve widget definitions based on the widget types specified.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> createLayouts(java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> layouts)
      This method creates a given list of Layouts by invoking the ProcessLayout service.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> createPages(java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> pages)
      This method creates a given list of Pages by invoking the ProcessPage service.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> fetchAllLayouts(java.lang.String accessProfile, boolean isTemplate)
      This method returns either all Layouts or all Layout Templates for the current store path & site based on the given isTemplate flag.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchAllPages(java.lang.String accessProfile, java.lang.String dataLanguageIDs)
      This method fetches all the Pages for the current store path as well as the site.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchAllURLConfigurablePages(java.lang.String isURLConfigurable, java.lang.String accessProfile, java.lang.String dataLanguageIDs)
      This method fetches all the URL configurable Pages for the current store path as well as the site.
      java.util.Map<java.lang.String,java.util.Map<java.lang.String,com.ibm.commerce.pagelayout.facade.datatypes.LayoutType>> fetchDefaultLayoutsByLayoutGroups(java.util.Set<java.lang.String> layoutGroups, java.util.Set<java.lang.String> deviceClasses, java.lang.String accessProfile)
      This method fetches default Layouts by Layout Groups & Device Classes.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> fetchLayoutsById(java.util.List<java.lang.String> uniqueIdList, java.lang.String accessProfile)
      This method returns the layouts with given Unique Ids in the current store.
      java.util.Map<java.lang.String,com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> fetchLayoutsByNamesForStore(java.util.Set<java.lang.String> names, java.lang.String storeId, java.lang.String accessProfile)
      This method fetches Layout nouns by names for a given Store ID.
      java.util.Map<java.lang.String,com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> fetchLayoutsByOwnerID(java.lang.String ownerId, java.lang.String accessProfile)
      This method fetches Layout nouns by ownerID.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> fetchLayoutsByPage(java.lang.String pageGroup, java.lang.String pageId, java.lang.String accessProfile)
      This method returns all the applicable layouts for the given Page Group and Page Id in the current store.
      java.util.List fetchLayoutTemplatesByDeviceClass(java.lang.String deviceClass, java.lang.String accessProfile)
      This method returns the list of Layout templates by device type.
      com.ibm.commerce.pagelayout.facade.datatypes.PageDesignType fetchPageDesign(java.lang.String pageGroup, java.lang.String objectIdentifier, java.lang.String deviceClass, java.lang.String accessProfile, java.util.Map<java.lang.String,java.lang.String> controlParams)
      This method fetches a Page Design for the given Page Group and the Object Identifier of the Object being rendered in the Store Page.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchPagesById(java.util.List<java.lang.String> uniqueIdList, java.lang.String accessProfile, java.lang.String dataLanguageIDs)
      This method returns the pages with given Unique Ids in the current store path.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchPagesByNames(java.util.List<java.lang.String> pageNames, java.lang.String accessProfile)
      This method returns the pages with given names for the current store path & site
      java.util.Map<java.lang.String,com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchPagesByNamesForStore(java.util.Set<java.lang.String> names, java.lang.String storeId, java.lang.String accessProfile, java.lang.String dataLanguageIDs)
      This method fetches Page nouns by names for a given Store ID.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchPagesByPageGroup(java.lang.String pageGroup, java.lang.String accessProfile, java.lang.String dataLanguageIDs)
      This method returns a list of Page nouns fetching by page group.
      java.util.List getWidgetDefinitionByIdentifier(java.lang.String widgetIdentifier, java.lang.String accessProfile)
      This method returns the widget definition based on the widgets external identifier.
      java.util.List getWidgetDefinitionByUniqueId(java.lang.String widgetId, java.lang.String accessProfile)
      This method returns the widget definition based on the widgets uniqueId.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.WidgetDefinitionType> getWidgetDefinitionByUniqueIds(java.util.List<java.lang.String> widgetId, java.lang.String accessProfile)
      This method returns the widget definition based on the widgets uniqueId.
      java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> searchLayouts(java.lang.String name, java.lang.String accessProfile, java.util.Map<java.lang.String,java.lang.String> controlParams)
      This method returns a list of Layout nouns that satisfies the search criteria.
      java.util.Map<java.lang.String,com.ibm.commerce.pagelayout.facade.datatypes.PageType> searchPagesByName(java.lang.String name, java.lang.String accessProfile, java.lang.String dataLanguageIDs)
      This method returns a Map of Page nouns with the Page name as the key.
      • Methods inherited from class java.lang.Object

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

      • PageLayoutFacadeClient

        public PageLayoutFacadeClient()
        Creates an instance of the client to communicate with the PageLayout facade.
      • PageLayoutFacadeClient

        public PageLayoutFacadeClient(BusinessContextType businessContext,
                                      javax.security.auth.callback.CallbackHandler callbackHandler)
        Creates an instance of the client to communicate with the PageLayout facade.
        Parameters:
        businessContext - The default business context to associate with the messages when making requests.
        callbackHandler - Used for authentication purposes so the controller can give the authentication information to the transport when required.
    • Method Detail

      • fetchPagesById

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchPagesById(java.util.List<java.lang.String> uniqueIdList,
                                                                                                    java.lang.String accessProfile,
                                                                                                    java.lang.String dataLanguageIDs)
                                                                                             throws PageException
        This method returns the pages with given Unique Ids in the current store path.
        Parameters:
        uniqueIdList - The list of Unique Ids for pages.
        accessProfile - The access profile.
        dataLanguageIDs - The comma separated list of data language ids for which the SEO properties need to be returned. This parameter is required only for access profiles that return the SEO properties.
        Returns:
        A list of page nouns.
        Throws:
        PageException
      • fetchPagesByNames

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchPagesByNames(java.util.List<java.lang.String> pageNames,
                                                                                                       java.lang.String accessProfile)
                                                                                                throws PageException
        This method returns the pages with given names for the current store path & site
        Parameters:
        pageNames - The list of page name
        accessProfile - The access profile to use. If no access profile is specified, IBM_Store_Summary is used.
        Returns:
        A list of page nouns
        Throws:
        PageException
      • fetchPagesByNamesForStore

        public java.util.Map<java.lang.String,com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchPagesByNamesForStore(java.util.Set<java.lang.String> names,
                                                                                                                               java.lang.String storeId,
                                                                                                                               java.lang.String accessProfile,
                                                                                                                               java.lang.String dataLanguageIDs)
                                                                                                                        throws PageException
        This method fetches Page nouns by names for a given Store ID.
        Parameters:
        names - The given set of names.
        storeId - The given Store ID.
        accessProfile - The access profile to use to fetch the Page nouns.
        dataLanguageIDs - The comma separated list of data language ids for which the SEO properties need to be returned. This parameter is required only for access profiles that return the SEO properties.
        Returns:
        The Map of Page nouns with the Page Name as the key.
        Throws:
        PageException - If any exception occurs.
      • fetchAllPages

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchAllPages(java.lang.String accessProfile,
                                                                                                   java.lang.String dataLanguageIDs)
                                                                                            throws PageException
        This method fetches all the Pages for the current store path as well as the site.
        Parameters:
        accessProfile - The access profile to use to fetch the Page nouns.
        dataLanguageIDs - The comma separated list of data language ids for which the SEO properties need to be returned. This parameter is required only for access profiles that return the SEO properties.
        Returns:
        The list of Page nouns.
        Throws:
        PageException - If any exception occurs.
      • fetchAllURLConfigurablePages

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchAllURLConfigurablePages(java.lang.String isURLConfigurable,
                                                                                                                  java.lang.String accessProfile,
                                                                                                                  java.lang.String dataLanguageIDs)
                                                                                                           throws PageException
        This method fetches all the URL configurable Pages for the current store path as well as the site.
        Parameters:
        isURLConfigurable - The flag to indicate if the page is URL configurable or not. The value could be 'true' or 'false'.
        accessProfile - The access profile to use to fetch the Page nouns.
        dataLanguageIDs - The comma separated list of data language ids for which the SEO properties need to be returned. This parameter is required only for access profiles that return the SEO properties.
        Returns:
        The list of Page nouns.
        Throws:
        PageException - If any exception occurs.
      • fetchPagesByPageGroup

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> fetchPagesByPageGroup(java.lang.String pageGroup,
                                                                                                           java.lang.String accessProfile,
                                                                                                           java.lang.String dataLanguageIDs)
                                                                                                    throws PageException
        This method returns a list of Page nouns fetching by page group.
        Parameters:
        pageGroup - The page group to use for fetching the Pages. Cannot be null or empty.
        accessProfile - The Access Profile to use for fetching the Page nouns. Cannot be null or empty.
        dataLanguageIDs - The comma separated list of data language ids for which the SEO properties need to be returned.
        Returns:
        The list of Page nouns.
        Throws:
        PageException - If any exception occurs.
      • searchPagesByName

        public java.util.Map<java.lang.String,com.ibm.commerce.pagelayout.facade.datatypes.PageType> searchPagesByName(java.lang.String name,
                                                                                                                       java.lang.String accessProfile,
                                                                                                                       java.lang.String dataLanguageIDs)
                                                                                                                throws PageException
        This method returns a Map of Page nouns with the Page name as the key. It uses the search syntax, such that the queried name can contain wild cards(*).
        Parameters:
        name - The name of the Page to search for. It can contain wild cards(*). Cannot be null or empty.
        accessProfile - The Access Profile to use for fetching the Page nouns. Cannot be null or empty.
        dataLanguageIDs - The comma separated list of data language ids for which the SEO properties need to be returned. This parameter is required only for access profiles that return the SEO properties.
        Returns:
        A map of Page nouns that are found. Cannot be null. An empty map will be returned if no Page is found. Key is the Page name. Value is the Page noun.
        Throws:
        PageException - If any exception occurs.
      • createPages

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> createPages(java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.PageType> pages)
                                                                                          throws PageException
        This method creates a given list of Pages by invoking the ProcessPage service.
        Parameters:
        pages - the given list of Pages to create.
        Returns:
        the created list of Pages.
        Throws:
        PageException - If there are any errors while creating the Pages.
      • fetchAllLayouts

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> fetchAllLayouts(java.lang.String accessProfile,
                                                                                                       boolean isTemplate)
                                                                                                throws LayoutException
        This method returns either all Layouts or all Layout Templates for the current store path & site based on the given isTemplate flag.
        Parameters:
        accessProfile - The access profile.
        isTemplate - Flag that indicates whether to return all Layouts or all Layout Templates. false: Returns all Layouts for the current store path & site. true: Returns all Layout Templates for the current store path & site.
        Returns:
        A list of layout nouns.
        Throws:
        LayoutException
      • fetchLayoutsById

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> fetchLayoutsById(java.util.List<java.lang.String> uniqueIdList,
                                                                                                        java.lang.String accessProfile)
                                                                                                 throws LayoutException
        This method returns the layouts with given Unique Ids in the current store.
        Parameters:
        uniqueIdList - The list of Unique Ids for layouts.
        accessProfile - The access profile.
        Returns:
        A list of layout nouns.
        Throws:
        LayoutException
      • fetchLayoutsByPage

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> fetchLayoutsByPage(java.lang.String pageGroup,
                                                                                                          java.lang.String pageId,
                                                                                                          java.lang.String accessProfile)
                                                                                                   throws LayoutException
        This method returns all the applicable layouts for the given Page Group and Page Id in the current store.
        Parameters:
        pageGroup - The Page Group. Three Page Groups are supported: 1) Category 2) CatalogEntry 3) Content.
        pageId - The Page Id. 1) For Category Page, the Page Id is the Catalog Group Id that represents the Category; 2) For CatalogEntry Page, the Page Id is the Catalog Entry Id; 3) For Content Page, the Page Id is the Unique Id of the Content Page.
        accessProfile - The access profile.
        Returns:
        A list of layout nouns.
        Throws:
        LayoutException
      • fetchLayoutTemplatesByDeviceClass

        public java.util.List fetchLayoutTemplatesByDeviceClass(java.lang.String deviceClass,
                                                                java.lang.String accessProfile)
                                                         throws LayoutException
        This method returns the list of Layout templates by device type.
        Parameters:
        deviceClass - The device type of the template
        accessProfile - The access profile.
        Returns:
        The list of LayoutType object.
        Throws:
        LayoutException - if an error is encountered.
      • fetchLayoutsByNamesForStore

        public java.util.Map<java.lang.String,com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> fetchLayoutsByNamesForStore(java.util.Set<java.lang.String> names,
                                                                                                                                   java.lang.String storeId,
                                                                                                                                   java.lang.String accessProfile)
                                                                                                                            throws LayoutException
        This method fetches Layout nouns by names for a given Store ID. The returned Map of Layout nouns can contain Layouts as well as Layout Templates. It returns Layouts of any current state.
        Parameters:
        names - The given set of names.
        storeId - The given Store ID.
        accessProfile - The access profile to use to fetch the Layout nouns.
        Returns:
        The Map of Layout nouns with the Layout Name as the key.
        Throws:
        LayoutException - If any exception occurs.
      • fetchLayoutsByOwnerID

        public java.util.Map<java.lang.String,com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> fetchLayoutsByOwnerID(java.lang.String ownerId,
                                                                                                                             java.lang.String accessProfile)
                                                                                                                      throws LayoutException
        This method fetches Layout nouns by ownerID. The returned Map of Layout nouns can contain Layouts as well as Layout Templates. It returns Layouts which are active.
        Parameters:
        ownerId - The owner of the layout. FK to member table.
        accessProfile - The access profile to use to fetch the Layout nouns.
        Returns:
        The Map of Layout nouns with the Layout Name as the key.
        Throws:
        LayoutException - If any exception occurs.
      • fetchDefaultLayoutsByLayoutGroups

        public java.util.Map<java.lang.String,java.util.Map<java.lang.String,com.ibm.commerce.pagelayout.facade.datatypes.LayoutType>> fetchDefaultLayoutsByLayoutGroups(java.util.Set<java.lang.String> layoutGroups,
                                                                                                                                                                         java.util.Set<java.lang.String> deviceClasses,
                                                                                                                                                                         java.lang.String accessProfile)
                                                                                                                                                                  throws LayoutException
        This method fetches default Layouts by Layout Groups & Device Classes. Layout Templates are excluded in the resultant Layouts.
        Parameters:
        layoutGroups - The given set of Layout Groups.
        deviceClasses - The given set of Device Classes.
        accessProfile - The access profile to use to fetch the Layout nouns.
        Returns:
        The Map of Layout nouns. The key of this Map is the Layout Group. The value is another Map with the key as the Device Class & value as the Layout noun.
        Throws:
        LayoutException - If any exception occurs.
      • searchLayouts

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> searchLayouts(java.lang.String name,
                                                                                                     java.lang.String accessProfile,
                                                                                                     java.util.Map<java.lang.String,java.lang.String> controlParams)
                                                                                              throws LayoutException
        This method returns a list of Layout nouns that satisfies the search criteria. It uses the search syntax, such that the queried Layout Name can contain wildcards(*). Additional search criteria can be specified in the control parameters map.
        Parameters:
        name - The name of the Layout to search for. It can contain wildcards(*).
        accessProfile - The Access Profile to use for fetching the Layout nouns.
        controlParams - The the control parameters map. The following control parameters can be specified:

        • _pgl.deviceClass - The comma(,) separated list of device classes of Layouts, e.g. "Mobile,Web,Any". If device classes are not specified, then the device classes of the Layout are simply ignored while searching Layouts.
        • _pgl.startDate - The start date of the Layouts, e.g. "2009-01-01 00:00:00.0". If start date is specified, then Layouts created on or after this start date are searched. If start date is not specified, then start dates of the Layouts are simply ignored while searching Layouts.
        • _pgl.endDate - The end date of the Layouts, e.g. "2009-01-01 00:00:00.0". If end date is specified, then Layouts created on or before this end date are searched. If end date is not specified, then end dates of the Layouts are simply ignored while searching Layouts.
        • _pgl.isTemplate - Flag that indicates whether Layouts or Layout Templates need to be searched, e.g. "false". If this parameter is not specified then both Layouts & Layout Templates are searched.
        Returns:
        The List of Layout nouns that satisfy the search criteria.
        Throws:
        LayoutException - If any exception occurs.
      • createLayouts

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> createLayouts(java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.LayoutType> layouts)
                                                                                              throws LayoutException
        This method creates a given list of Layouts by invoking the ProcessLayout service.
        Parameters:
        layouts - the given list of Layouts to create.
        Returns:
        the created list of Layouts.
        Throws:
        LayoutException - If there are any errors while creating the Layouts.
      • getWidgetDefinitionByUniqueId

        public java.util.List getWidgetDefinitionByUniqueId(java.lang.String widgetId,
                                                            java.lang.String accessProfile)
                                                     throws WidgetDefinitionException
        This method returns the widget definition based on the widgets uniqueId.
        • XPath:/WidgetDefinition[WidgetDefinitionIdentifier[(UniqueID={0})]]
        • Access Profile - The profile passed as parameter or IBM_Store_Summary if null is passed
        Parameters:
        widgetId - - Unique ID of the widget.
        accessProfile - - Access profile to use while making service call.
        Returns:
        - List of WidgetDefinitionType
        Throws:
        WidgetDefinitionException
      • getWidgetDefinitionByIdentifier

        public java.util.List getWidgetDefinitionByIdentifier(java.lang.String widgetIdentifier,
                                                              java.lang.String accessProfile)
                                                       throws WidgetDefinitionException
        This method returns the widget definition based on the widgets external identifier. StoreId is injected into the XPath by the Fetch command, so that widgets subscribed by current store are returned.
        • XPath:/WidgetDefinition[WidgetDefinitionIdentifier[WidgetDefinitionExternalIdentifier[(Identifier=\"{0}\")]]]
        • Access Profile - The profile passed as parameter or IBM_Store_Summary if null is passed
        Parameters:
        widgetIdentifier - - External identifier of the widget.
        accessProfile - - Access profile to use while making service call.
        Returns:
        - List of WidgetDefinitionType
        Throws:
        WidgetDefinitionException
      • getWidgetDefinitionByUniqueIds

        public java.util.List<com.ibm.commerce.pagelayout.facade.datatypes.WidgetDefinitionType> getWidgetDefinitionByUniqueIds(java.util.List<java.lang.String> widgetId,
                                                                                                                                java.lang.String accessProfile)
                                                                                                                         throws WidgetDefinitionException
        This method returns the widget definition based on the widgets uniqueId.
        • XPath:/WidgetDefinition[WidgetDefinitionIdentifier[(UniqueID={0})]]
        • Access Profile - The profile passed as parameter or IBM_Store_Summary if null is passed
        Parameters:
        widgetId - - Unique ID of the widget.
        accessProfile - - Access profile to use while making service call.
        Returns:
        - List of WidgetDefinitionType
        Throws:
        WidgetDefinitionException
      • fetchPageDesign

        public com.ibm.commerce.pagelayout.facade.datatypes.PageDesignType fetchPageDesign(java.lang.String pageGroup,
                                                                                           java.lang.String objectIdentifier,
                                                                                           java.lang.String deviceClass,
                                                                                           java.lang.String accessProfile,
                                                                                           java.util.Map<java.lang.String,java.lang.String> controlParams)
                                                                                    throws PageDesignException
        This method fetches a Page Design for the given Page Group and the Object Identifier of the Object being rendered in the Store Page.
        Parameters:
        pageGroup - The Page Group of the Store Page, e.g. "Category".
        objectIdentifier - The Object Identifier of the Object being rendered in the Store Page, e.g. "10008".
        deviceClass - The Device Classes, e.g. "Mobile".
        accessProfile - The access profile to use.
        controlParams - (Optional) The Map of Control Parameters. Apart from parameters having the prefix _pgl., all other control parameters are sent as Trigger Parameters to the Marketing Engine while evaluating the Winning Layout.
        Returns:
        The Page Design Noun.
        Throws:
        PageDesignException - If any exception occurs.
      • buildGetWidgetDefinitionByWidgetTypesExpression

        public static ExpressionType buildGetWidgetDefinitionByWidgetTypesExpression(java.util.Map parameters)
        This method constructs the expression to retrieve widget definitions based on the widget types specified. The method looks for the following the keys in the input map.
        • WidgetType or widgetType - A string array of the widget types to use in the query.
        • includeInactiveWidgets - A boolean to indicate if inactive widget definitions need to be retrieved. By default the flag is false.
        • accessProfile - The access profile to use in the query.
        • dataLanguageIds - The language IDs to use in the query.
        The resulting XPath is {_wcf.ap=$accessProfile$}/WidgetDefinition[(WidgetType=) and @includeInactiveWidgets=].
        Parameters:
        parameters - The input parameters to build the expression.
        Returns:
        The ExpressionType object representing the query.