Page Type API

The Page Type API provides information about which page types are supported in SmartEdit. SmartEdit users can only create pages of supported page types.

Facade

The Page Type API exposes the PageFacade to retrieve a list of page types supported within SmartEdit, as shown in the following code excerpt:

public interface PageFacade
{
	List<PageTypeData> findAllPageTypes();
}

Implementation

The DefaultPageFacade uses a set of page type classes defined by the cmsSupportedPages bean to determine which page types are supported and should be returned when calling the findAllPageTypes() method in the facade.

Beans

The Page Type API relies on the following DTO as shown in the following code excerpt from the cmswebservices-beans.xml file:

<bean class="de.hybris.platform.cmswebservices.data.PageTypeData" extends="de.hybris.platform.cmswebservices.data.ComposedTypeData">
    <property name="type" type="String" />
</bean>
 
<bean class="de.hybris.platform.cmswebservices.data.ComposedTypeData">
    <property name="code" type="String" />
    <property name="name" type="java.util.Map<String,String>" />
    <property name="description" type="java.util.Map<String,String>" />
</bean>

Spring Configuration

The Page Type API declares the following Spring beans in the cmsfacades-page-spring.xml file:

<alias name="defaultCmsPageFacade" alias="cmsPageFacade" />
<bean id="defaultCmsPageFacade" class="de.hybris.platform.cmsfacades.pages.impl.DefaultPageFacade">
   <property name="adminPageService" ref="cmsAdminPageService" />
   <property name="pageDataPopulatorFactory" ref="pageDataPopulatorFactory" />
   <property name="pageModelConverterFactory" ref="pageModelConverterFactory" />
   <property name="facadeValidationService" ref="facadeValidationService" />
   <property name="cmsFindVariationPageValidator" ref="cmsFindVariationPageValidator" />
   <property name="pageTypeModelConverter" ref="pageTypeModelConverter" />
   <property name="pageVariationResolverTypeRegistry" ref="cmsPageVariationResolverTypeRegistry" />
   <property name="cmsPageComparator" ref="cmsPageComparator" />
   <property name="uniqueItemIdentifierService" ref="cmsUniqueItemIdentifierService" />
   <property name="cmsItemSearchTypeBlacklistMap" ref="cmsItemSearchTypeBlacklistMap" />
   <property name="pageRenderingService" ref="cmsPageRenderingService" />
   <property name="catalogVersionService" ref="catalogVersionService"/>
   <property name="permissionCachedCRUDService" ref="cmsPermissionCachedCRUDService" />
   <property name="cmsVersionSessionContextProvider" ref="cmsVersionSessionContextProvider" />
</bean>

<!-- Converter -->
<alias name="defaultPageTypeModelConverter" alias="pageTypeModelConverter" />
<bean id="defaultPageTypeModelConverter" parent="abstractPopulatingConverter">
   <property name="targetClass" value="de.hybris.platform.cmsfacades.data.PageTypeData" />
   <property name="populators">
      <list merge="true">
         <ref bean="composedTypeModelPopulator" />
         <ref bean="pageTypeModelPopulator" />
      </list>
   </property>
</bean>
 
<bean id="pageTypeModelPopulator" class="de.hybris.platform.cmsfacades.pages.populator.model.PageTypeModelPopulator">
   <property name="pageTypeMappingRegistry" ref="pageTypeMappingRegistry" />
</bean>

Page Type Mapping Registry Spring Beans

The PageTypeMapping registry injects all PageTypeMapping objects when starting up the Spring application context. This is defined in the cmsfacades-page-spring.xml file as shown in the following code excerpt:

<!-- Registry -->
<alias name="defaultPageTypeMappingRegistry" alias="pageTypeMappingRegistry" />
<bean id="defaultPageTypeMappingRegistry" class="de.hybris.platform.cmsfacades.pages.service.impl.DefaultPageTypeMappingRegistry" />

<!-- PageTypeMapping beans -->
<bean class="de.hybris.platform.cmsfacades.pages.service.impl.DefaultPageTypeMapping"
   p:typecode="CategoryPage"
   p:typedata="de.hybris.platform.cmsfacades.data.CategoryPageData" />
<bean class="de.hybris.platform.cmsfacades.pages.service.impl.DefaultPageTypeMapping" 
   p:typecode="ContentPage"
   p:typedata="de.hybris.platform.cmsfacades.data.ContentPageData" />
<bean class="de.hybris.platform.cmsfacades.pages.service.impl.DefaultPageTypeMapping" 
   p:typecode="ProductPage"
   p:typedata="de.hybris.platform.cmsfacades.data.ProductPageData" />

Each PageTypeMapping implementation instance holds information about a page type typecode and the class type that the given page type should be converted into. For example, a content page will have a typecode of ContentPage and a typedata set to de.hybris.platform.cmsfacades.data.ContentPageData. This is the data type that the page controller expects to receive.