skip to main content
Programmer's documentation > Developing with the JViews Gantt SDK > Connecting to data > Implementing custom data models
 
Implementing custom data models
If you need to connect specialized business data to your Gantt, Schedule, or Resource Data chart, it is always best to determine whether there is a way to translate or adapt the data to one of the standard formats supported by JViews Gantt.
The arguments after the table model are:
*Perhaps the business data can be exported to some JDBC data source and you can then use the corresponding JDBC™ bridge to load the data using the JViews Gantt JDBC connection (see Connecting to data through JDBC).
*Perhaps the data can be exported to a custom XML format that can then be translated into SDXL format using XSLT (see Connecting to XML data).
*However, you may have a special case where implementing a custom data model implementation is the best and most efficient way to connect to your business data. An example of this might be a live connection to business data that must be selectively filtered or modified before it is displayed in a Gantt chart.
JViews Gantt supports the ability for you to design a custom data model implementation and display your custom data in the standard charts. This is possible because of the model-view separation and the loose coupling between the Gantt data model interfaces and the charts. The data model interfaces and classes provided with JViews Gantt are described in Data model classes. Although you can implement your custom data model in its entirety, you are recommend to use at least the abstract classes as your starting point. You can also subclass any of the concrete data model implementation classes if this suits your purposes better.
Examples
The database examples illustrate how to implement a custom data model by subclassing the abstract classes. These examples are available in:
*<installdir>/jviews-gantt/samples/databaseGantt
*<installdir>/jviews-gantt/samples/databaseSchedule
In these examples, the DBROGanttModel class implements a Gantt data model that connects to a read-only custom database. The database implements the GanttDBRO interface instead of the standard JDBC interface.
The Filter example illustrates how to implement a custom data model by subclassing the IlvFilterGanttModel base class. The BasicFilterGanttModel implementation wrappers another Gantt data model and filters activities for display. This example is available in:
<installdir>/jviews-gantt/samples/filter.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.