Perforce JViews Gantt Sample: Resource Chart and XML
Description
JViews Gantt provides the ilog.views.gantt.xml
package.
It is designed to serialize scheduling data contained in Gantt models into
SDXL (Schedule Data eXchange Language) files. This sample shows how to use
this package to serialize Gantt models associated with a Schedule Chart into
SDXL files.
How to Use the Sample
-
To save the current Gantt data model to XML:
- Select Save As in the File menu. The Save dialog box opens automatically in a directory containing sdxl.dtd.
- Type the name of the file in the File Name text box.
- clickSave.
-
To open an XML file and display its Gantt data model.
- Select Open in the File menu.
- Select a .sdxl file.
- ClickOpen.
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
xml-schedule.jar
,
that allows you to execute the sample with a double click from a
file browser. Note that if you are using Internet Explorer, you can
open the installation directory
and execute the JAR file from the browser. This
technique may not work in other Web browsers.
Alternatively, you
can run the sample application from the command line.
First check that the Ant utility is properly configured. If not, see the
instructions on how to configure Ant for Perforce JViews.
Then, go to the installation directory
of the sample and type:
ant run
Topics Covered
- Using the Gantt model XML readers and writers
Detailed Description
This sample shows how to use the default Gantt model readers and writers in
the ilog.views.gantt.xml
package. It uses the
IlvGanttDocumentReader
, IlvGanttDocumentWriter
,
and IlvGanttStreamWriter
classes. All three classes are
high-level, ready-to-use readers or writers.
This sample extends the ScheduleExample
, found in the
<installdir>/samples/scheduleChart
directory. This
sample adds a File menu that allows you to:
- Save the current Gantt model in an XML file.
- Open an existing XML file and load the serialized Gantt model into memory.
Installation Directory
The Resource Chart and XML sample is installed here.
Classes Involved
- ilog.views.gantt.IlvScheduleChart
- ilog.views.gantt.xml.IlvGanttDocumentReader
- ilog.views.gantt.xml.IlvGanttDocumentWriter
- ilog.views.gantt.xml.IlvGanttStreamWriter
Source Files
-
xml.XMLScheduleExample
The main class of the sample. It extends the
ScheduleExample
class. -
xml.XMLFileChooser
The file chooser allowing you to choose an XML file.
-
xml.XMLGanttActions
This file defines the actions to open existing SDXL files and to save the current Gantt models to SDXL files.
-
scheduleChart.ScheduleExample
The Schedule Chart sample superclass.
-
shared.AbstractExample
The superclass of all Gantt samples.