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

  1. Create a new class which should extend ModelObject class defined in com.ibm.commerce.telesales.core plug-in.

  2. Register the newly created model object using the model object extension point.

  3. 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>
    

  4. 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

Data model


Related tasks

Add properties to a model object

Add change notification to the data model


+

Search Tips   |   Advanced Search