assistedservicefacades Extension

The assistedservicefacades extension provides a data model and extension exposes all ASM-related functionality to higher-level layers.

About the Extension

Name Directory Related Module
assistedservicefacades hybris/bin/assisted-services Assisted Service Module

Dependencies

Facades and Populators

The DefaultAssistedServiceFacade is the default implementation of the AssistedServiceFacade interface. The AssistedServiceFacade uses the following methods:

Method Signature Description
launchAssistedServiceMode() Launches the Assisted Service Module for the current session.
quitAssistedServiceMode() Quits the Assisted Service Module (after logging out the CSA if they are logged into the ASM).
isAssistedServiceModeLaunched()  
loginAssistedServiceAgent(final String username, final String password) Logs a CSA into the ASM using the given credentials.
public void loginAssistedServiceAgentSAML(final String username, final String password) Logs a CSA into the ASM using provided SAML credentials.
logoutAssistedServiceAgent() Checks whether the Assisted Service Module has been launched and logs the CSA out of the ASM.
emulateCustomer(final String customerId, final String cartId)

Emulates the given customer or cart by attaching them to the current session. The method first checks if, for the current session, either the customerId or cartId are blank and checks if the customerId argument corresponds to a valid CustomerModel.

stopEmulateCustomer() Stops customer and/or cart emulation for the current session.
getAssistedServiceSessionTimeout() Returns the backend session timeout for the CSAs ASM session in seconds. If you want to know how to configure this value, see the Assisted Service Session Timer section below.
getAssistedServiceSessionTimerValue() Returns the ASM session timer that is displayed in the storefront in seconds. If you want to know how to configure this value, see the Assisted Service Session Timer section below.
getAssistedServiceSessionAttributes() Returns a map of Assisted Service Module's related session attributes.
getSuggestedCustomerList(final String username)

Returns a list of customers whose ids start with the given input string or whose names contain the given input string. The search is performed using a FlexibleSearch query with wildcards.

DefaultAssistedServiceFacade

@Override
	public List<CustomerData> getSuggestedCustomerList(final String username) throws AssistedServiceException
	{
		validateSession();
		final PageableData pageableData = new PageableData();
		pageableData.setCurrentPage(0);
		pageableData.setPageSize(Config.getInt(AssistedserviceservicesConstants.DEFAULT_SUGGESTED_CUSTOMERS_LIMIT, 20));
		return this.getCustomers(username, pageableData);
	}

For more information, see the FlexibleSearch document.

emulateAfterLogin() Emulates the currently logged in customer's session when the ASM logs into the ASM.
bindCustomerToCart(final String customerId)

Binds the customer with the given id to a currently emulated Assisted Service anonymous session cart.

getCartListForCustomer(final CustomerModel customer)

Returns a collection of customer's carts using a CommerceCartService method.

DefaultAssistedServiceFacade

@Override
                        public Collection<CartModel> getCartsForCustomer(final CustomerModel customer)
                        {
                        final BaseSiteModel paramBaseSiteModel = this.baseSiteService.getCurrentBaseSite();
                        return this.commerceCartService.getCartsForSiteAndUser(paramBaseSiteModel, customer);
                        }

Configuration

To support the ASM Additional Information Framework, the assistedservicefacades extension has been modified.

ASM Additional Information Framework (ASM-AIF) is a feature within Assisted Service Module, which supports displaying personalized customer-related information to customer support agents.

To fully understand how the data is displayed and where it is taken from, we have to first introduce 2 terms: Fragment and Section.

A Fragment is a component responsible for obtaining the data using a proper data provider and displaying the data using a JSP or a CMS component. You can have an unlimited number of Fragments.

A Section is a code representation of an ASM-AIF tab and holds a list of Fragments to be displayed. You can have an unlimited number of Sections.

Bean Configuration

The Section and Fragment beans were added to the /assistedservicefacades/resources/assistedservicefacades-beans.xml file:
	<bean class="de.hybris.platform.assistedservicefacades.customer360.Section">
		<property name="title" type="java.lang.String"/>
		<property name="id" type="java.lang.String"/>
		<property name="fragments" type="java.util.List&lt;de.hybris.platform.assistedservicefacades.customer360.Fragment&gt;"/>
		<property name="priority" type="java.lang.Integer"/>
	</bean>

	<bean class="de.hybris.platform.assistedservicefacades.customer360.Fragment">
		<property name="title" type="java.lang.String"/>
		<property name="id" type="java.lang.String"/>
		<property name="jspPath" type="java.lang.String"/>
		<property name="data" type="java.lang.Object"/>
		<property name="priority" type="java.lang.Integer"/>
		<property name="properties" type="java.util.Map&lt;String,String>"/>
	</bean>

Spring Configuration

The /assistedservicefacades/resources/assistedservicefacades-spring.xml file has been extended with the definitions of the following beans:
	<alias name="defaultAdditionalInformationFrameworkFacade" alias="additionalInformationFrameworkFacade"/>
	<bean id="defaultAdditionalInformationFrameworkFacade" class="de.hybris.platform.assistedservicefacades.customer360.impl.DefaultAdditionalInformationFrameworkFacade">
		<property name="sections" ref="customer360Sections"/>
		<property name="modelProvidersMap" ref="customer360ModelProvidersMap"/>
		<property name="jspProvidersMap" ref="customer360JspProvidersMap"/>
	</bean>
	
	<alias name="defaultCustomer360Sections" alias="customer360Sections"/>
	<util:list id="defaultCustomer360Sections" value-type="de.hybris.platform.assistedservicefacades.customer360.Section"/>
	
	<alias name="defaultCustomer360ModelProvidersMap" alias="customer360ModelProvidersMap"/>
	<util:map id="defaultCustomer360ModelProvidersMap" key-type="java.lang.String" value-type="de.hybris.platform.assistedservicefacades.customer360.FragmentModelProvider"/>
	
	<alias name="defaultCustomer360JspProvidersMap" alias="customer360JspProvidersMap"/>
	<util:map id="defaultCustomer360JspProvidersMap" key-type="java.lang.String" value-type="java.lang.String"/>

Priority

Every Section and Fragment bean has a priority property, which is used to provide the correct order or Sections and the Fragments inside them. The items are ordered from 1 down, meaning the Section or Fragment with the lowest priority attribute comes before ones having a higher value of the priority attribute. To determine how Sections and Fragments should be ordered, two comparator classes have been introduced:

Class Name

Description

FragmentPriorityComparator

These comparator classes compare the values of the priority attributes of Fragments and Sections.

SectionPriorityComparator

By default, the value of the priority attribute is set to 10 and its multiples, meaning the Fragment/Section, which is meant to be the first has the priority value of 10, the second has the value of 20, the third 30, and so on.

Java Configuration

The following classes have been introduced:

Class Name

Description

AdditionalInformationFrameworkFacade

Interface responsible for orchestrating:
  • returning sections
  • returning sections by ID
  • returning fragments by ID
The DefaultAdditionalInfromationFrameworkFacade class is the default implementation of this interface.

FragmentModelProvider

Interface returning the fragment model, implemented by the CustomerProfileDataProvider, CustomerSummaryModelProvider, and TicketsModelProvider classes.