Develop > Presentation layer > Management Center framework > Customize the Management Center user interface > Create a new tool for the Management Center > Define OpenLaszlo classes instantiated in a tool definition class
Define 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
Before defining a primary object, ensure that you:
- 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 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.
- In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx.
- Create a directory to store the new 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 the new custom tool.
- Create an 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.
- Within the primary object library file:
- Create the new primary object 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.
- Open the file that contains the business object editor and instantiate the new primary object definition class as a child of the business object editor class. For example:
<class name="extMyTool" extends="wcfBusinessObjectEditor"> ... <!—- Primary object definitions --> <extMyPrimaryObjectDefinition/> ... </class>
- Add the new primary object library file to the application.
What to do next
After you complete the work:
- Right-click LOBTools Project; then click Build OpenLaszlo Project to produce an updated ManagementCenter.swf file under the WCDE_INSTALL\workspace\LOBTools\WebContent directory. This is the default environment setting.
- Test the work by viewing them in the Management Center, using this URL: https://hostname:8000/lobtools.
- Deploy your files to the production environment.
Related concepts
Management Center user interface
Related tasks
Create a new tool for the Management Center
Define OpenLaszlo classes instantiated in a tool definition class