Defining a primary object
You can use primary object definitions to describe the business objects that are managed by a business object editor, such as products, campaigns, and promotions.
Before you begin
- Review the Management Center modeling guidelines.
- Create the Management Center services required to support the primary object, such as create, update, delete, or search services.
- Work with these services to develop client libraries, new commands, and business logic.
- Create new Management Center objects.
- Review the lzx/commerce/foundation/restricted/ObjectDefinition.lzx/wcfPrimaryObjectDefinition class for more information about primary object definitions.
Procedure
- Select a unique object type, such as Product.
- Define an image that the Management Center can use to display instances of this object type.
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
- Complete one of the following steps:
- In the Enterprise Explorer view, expand .
- In the Enterprise Explorer view, expand .
- Create a directory to store your new file.
Option Description OpenLaszlo library file Use a directory structure similar to the following example: LOBTools/WebContent/WEB-INF/src/lzx/your_company_name/Management_Center_component/objectDefinitions, where Management_Center_component is the name of your new custom tool. Definition file Use a directory structure similar to the following example: LOBTools/WebContent/config/your_company_name/Management_Center_component/objectDefinitions, where Management_Center_component is the name of your new custom tool. - Create your new primary object file:
Option Description OpenLaszlo primary object library file For example, ProductPrimaryObjectDefinition.lzx. Within this file, the class name must follow this syntax: three-character Management Center component code in lower caseManagement_Center_componentPrimaryObjectDefinition
. For example, catProductPrimaryObjectDefinition.Primary object definition file For example, ProductPrimaryObjectDefinition.def. Within this file, the definition name must follow this syntax: three-character Management Center component code in lower caseManagement_Center_componentPrimaryObjectDefinition
. For example, catProductPrimaryObjectDefinition. - Within the new primary object file:
Option Description OpenLaszlo primary object library file - Create the new primary object definition class. The following
code snippet shows a sample primary object definition class:
<class name="extMyPrimaryObjectDefinition" extends="wcfPrimaryObjectDefinition" objectType="MyPrimaryObject" icon="myPrimaryObjectIcon" headerIcon="myPrimaryObjectHeaderIcon" propertiesClass="myPrimaryObjectProperties" idProperty="myIdProperty" displayNameProperty="myDisplayNameProperty" displayName="${myResources.myPrimaryObject_DisplayName.string}" newDisplayName="${myResources.myPrimaryObject_NewDisplayName.string}"> ... </class>
- Specify the create, update, or delete services for the primary object.
- Specify any custom services to be used by the primary object.
- Declare the property definitions for this primary object.
- Declare the child objects for this primary object.
- Declare the reference objects for this primary object.
Primary object definition file - Create the new primary object definition. The following code snippet
shows a sample primary object definition:
<PrimaryObjectDefinition definitionName="extMyPrimaryObjectDefinition" objectType="MyPrimaryObject" icon="myPrimaryObjectIcon" headerIcon="myPrimaryObjectHeaderIcon" propertiesDefinitionName="myPrimaryObjectProperties" idProperty="myIdProperty" displayNameProperty="myDisplayNameProperty" displayName="${myResources.myPrimaryObject_DisplayName}" newDisplayName="${myResources.myPrimaryObject_NewDisplayName}"> ... </PrimaryObjectDefinition>
- Specify the create, update, or delete services for the primary object.
- Specify any custom services to be used by the primary object.
- Declare the property definitions for this primary object.
- Declare the child objects for this primary object.
- Declare the reference objects for this primary object.
- Create the new primary object definition class. The following
code snippet shows a sample primary object definition class:
- Open the file that contains the business object editor
and complete one of the following steps:
Option Description Instantiate the new primary object definition class as a child of the business object editor class <class name="extMyTool" extends="wcfBusinessObjectEditor"> ... <!—- Primary object definitions --> <extMyPrimaryObjectDefinition/> ... </class>
Add the new primary object definition as a child element of the business object editor definition <BusinessObjectEditor definitionName="extMyTool"> ... <!-- Primary object definitions --> <PrimaryObjectDefinition definitionName="extMyPrimaryObjectDefinition"/> ... </BusinessObjectEditor>
- Add the new primary object library file to the application.
What to do next
Version | Steps |
---|---|
|
|
|