Develop > Presentation layer > Customize IBM Sales Center > Data model
Add a model object
The data model is used to cache business objects on the client.
To add a model object to the model:
Procedure
- Create a new class which should extend ModelObject class defined in com.ibm.commerce.telesales.core plug-in.
- Register the newly created model object using the model object extension point.
- Use the TelesalesModelObjectFactory.createModelObject method to construct new instances of this model class wherever required. For example: CustomModelObject modelObject = (CustomModelObject) TelesalesModelObjectFactory.createModelObject( "ID_OF_CustomModelObject" ); Note: The ID of CustomModelObject used above is defined while registering this class in the extension point.
<extension point="com.ibm.commerce.telesales.core.modelObjects"> <modelObject id="ID_Of_CustomModelObject" class="package.CustomModelObject"/> </extension>
- Add instances of the new class to the model as properties of other model objects. If the model object will be at the root level, then add it as a property of ModelRoot. If the model objects are actually a list of model objects, then you can use the ModelObjectList to group the model objects into a list. Add ModelObjectList as a property of the parent object ModelObject.
Related concepts
Related tasks
Add properties to a model object
Add change notification to the data model