Creating a State Policy extension point
Creating a State Policy extension point
In order to Creating a State Policy Contribution, you must add a State Policy extension point to the plugin.
To create a State Policy extension point for a plugin, do the following:
- Open plugin.xml in Eclipse.
- In the Extension Points tab, click the Add button next to the All Extension Points list.
- In the New Extension Point dialog, enter the following:
Extension Point ID statePolicy Extension Point Name
State Policy
Extension Point Schema
Leave blank and make sure Edit extension point schema when done is selected
- In the Source tab of the statePolicy.exsd file, paste the following:
<?xml version='1.0' encoding='UTF-8'?> <!-- Schema file written by PDE --> <schema targetNamespace="com.elasticpath.cmclient.admin.gc" xmlns="http://www.w3.org/2001/XMLSchema"> <element name="extension"> <complexType> <sequence minOccurs="1" maxOccurs="unbounded"> <element ref="statePolicyContribution"/commerce-legacy/> </sequence> <attribute name="point" type="string" use="required"/commerce-legacy/> </complexType> </element> <element name="statePolicyContribution"> <complexType> <attribute name="targetId" type="string" use="required"> <annotation> <documentation>The target of the given policy</documentation> </annotation> </attribute> <attribute name="statePolicy" type="string" use="required"> <annotation> <documentation>The state policy that is being contributed</documentation> <appInfo><meta.attribute kind="java" basedOn=":com.elasticpath.cmclient.policy.StatePolicy"/commerce-legacy/></appInfo> </annotation> </attribute> <attribute name="priority" type="string" use="required"> <annotation> <documentation>The priority of the contributed policy. This is used by a policy resolver to combine contributed policies.</documentation> </annotation> </attribute> </complexType> </element> </schema>