Extending the Page Type API

The Page Type API provides information about the page types supported by SmartEdit. You extend the Page Type API so SmartEdit can support any page types you add.

Adding Support in SmartEdit for Custom Page Types

You can extend the Page Type API by creating a new item type to support your new custom page type.

In order for SmartEdit to support a new page type, you must do the following:

  1. Add the page type to the customextension-items.xml file.
  2. Add it to your project's Spring configuration.

Create a New Page Type

You must add the page type to your customextension-items.xml file. You must add it as a sub-class of the AbstractPage, as shown in the following code example:

<itemtype code="MyCustomPage" jaloclass="de.hybris.platform.customextension.jalo.pages.MyCustomPage" extends="AbstractPage"
   autocreate="true" generate="true">
	<attributes>
		<attribute qualifier="seo" generate="true" autocreate="true" type="java.lang.String">
		   <persistence type="property" />
		</attribute>
	</attributes>
</itemtype>

Add the Page Type to Your Spring Configuration

In your customextension-spring.xml file, create a new bean that includes all of the currently-supported page types and add the new page type to it, as shown in the following code example:

<alias name="extendedCmsSupportedPages" alias="cmsSupportedPages" />
<util:set id="extendedCmsSupportedPages">
   <value type="java.lang.Class">de.hybris.platform.customextension.model.pages.MyCustomPageModel</value>
   <value type="java.lang.Class">de.hybris.platform.cms2.model.pages.ContentPageModel</value>
   <value type="java.lang.Class">de.hybris.platform.cms2.model.pages.ProductPageModel</value>
   <value type="java.lang.Class">de.hybris.platform.cms2.model.pages.CategoryPageModel</value>
</util:set>