XML structure of a Designer project file

Describes the properties of a Designer project file.

Describes the different files used to store your Gantt project.

Describes the properties and uses of a ganttConfiguration element.

Describes the properties and uses of a style element.

Describes the properties and uses of a dataSource element.

Lists the contents of an example project file.

Describes the information needed to connecting to and query a database.

Overview

The Designer lets you save your work in three files:

  • Project file

  • Style sheet

  • Data file

The project file defines the Gantt project configuration by specifying the type of the Gantt chart, the reference to the style sheet, and the type of data source. The project file has an .igpr extension.

The following sections describe the XML elements used in the project file.

The ganttConfiguration element

The ganttConfiguration element is the root element that contains all the other elements in the XML document.

Example   Usage of the ganttConfiguration element

<ganttConfiguration type="...">

  <style url="..." />

  <dataSource class="..." />

</ganttConfiguration>

The following table shows the ganttConfiguration element.

Element

Attribute and Type

Required

Description

ganttConfiguration

   

Describes the content of a specific Gantt project. It therefore contains a style element and a dataSource element.

 

type %Text

Yes

The type of Gantt chart. The only values accepted are activity for a Gantt chart or resource for a Schedule chart.

The style element

The following table shows how the style element provides a reference to the style sheet associated with the project.

Element

Attribute and Type

Required

Description

style

   

Provides a reference to the style sheet associated with the project.

 

url %Text

Yes

The URL of the style sheet.

The dataSource element

The following table shows how the dataSource element defines the type of data referenced by the project. This is done through the class attribute, which specifies the kind of data source to load.

Element

Attribute and Type

Required

Description

dataSource

   

Defines the type of data referenced by the project.

 

class %Text

Yes

The class that defines the data source to load. The only values accepted are:

ilog.views.gantt.project.

IlvGanttXMLDataSource that reads from an XML file.

IlvGanttJDBCDataSourceilog.views.gantt.project.

IlvGanttJDBCDataSource that reads data from a database through the JDBC API.

 

url %Text

Yes for IlvGanttXMLDataSource

Used for data sources of type IlvGanttXMLDataSource only to give the URL of the XML file.

When the data source is an IlvGanttJDBCDataSource, the data source contains different elements for the connection and for the queries. See The connection element and The query element.

Example of a basic project file

There are examples of project files in the directory:

<installdir>/jviews-gantt/bin/designer/data/examples

The following code example shows the typical content of a project file.

Example   Project file projectTasks.igpr

<?xml version="1.0" encoding="UTF-8"?>

<ganttConfiguration type="activity">

  <style url="projectTasks.css"/>

  <dataSource

    class="ilog.views.gantt.project.IlvGanttXMLDataSource"

    url="simpleProject.xml"/>

</ganttConfiguration>

The result of setting this project file on a Gantt chart creates a data model by loading the XML from the file simpleProject.xml and applies the style sheet projectTasks.css to it.

Elements for connecting to and querying a database

The elements described in this section define in the project file the information needed for connecting to and querying a database. The data obtained by the query is mapped to the Gantt data model.

The connection element

The following table shows how the connection element specifies a connection to a database. It can be used by query elements.

Element

Attribute and Type

Required

Description

connection

   

Specifies a connection to a database.

 

id %Text

Yes

Provides a reference to the connection subsequently in the XML file.

 

url %Text

Yes

Specifies the URL of the database.

 

user %Text

No

Specifies the user for connecting to the database.

 

passwd %Text

No

Specifies the password used for connecting to the database.

 

driver %Text

Yes

Specifies the name of the JDBC driver class used for connecting to the database.

 

driverURL %Text

No

Specifies the URL that points to a JAR file where the driver archive can be found. This attribute is required if the driver is not loaded directly by the application code.

The query element

The various query elements (on activities, resources, reservations, and constraints ) define the queries needed to obtain the Gantt data model. SeeAccessing the data and also Connecting to data through JDBC in Developing with the SDK.

The following table shows the attributes of the query element.

Element

Attribute and Type

Required

Description

query

   

Defines a query needed to obtain the Gantt data model.

 

connection %Text

Yes

Holds a reference to the ID of the connection as defined by the connection element illustrated in The connection element.

 

value %Text

Yes

Defines an SQL query for obtaining results from the database.

 

model %Text

Yes

Can be activities, resources, constraints, or reservations, depending on which table model the query is meant to fill.

The map element

The query elements accept map elements as child elements. The map elements provide the means of mapping the result of the SQL query to the Gantt data model properties. The map element itself is optional. When it is present, the query element recognizes the attributes of the map element and thus the result of the query can be mapped to the Gantt data model.

The following table shows the attributes of the map element.

Element

Attribute and Type

Required

Description

map

   

Maps the result of the SQL query to the Gantt data model.

 

columns %Text

Yes

Provides the comma-separated list of columns in the SQL query from which the mapping is made.

 

property %Text

Yes

Specifies the name of the property in the Gantt data model for the given activity, reservation, resource, or constraint to which the columns will be mapped.

 

requiredType %Text

No

Specifies the Java type required by the property in the Gantt data model.

The value element

Optionally, the map element can accept child elements of type value for the constraintType property of the constraint object. This element specifies the type of constraint, which may be:

  • START-START

  • START-END

  • END-START

  • END-END

The following table shows the attributes of the value element.

Element

Attribute and Type

Required

Description

value

   

Specifies the type of constraint.

 

model %Text

Yes

Specifies a value in the model for the type of constraint. For example:

ilog.views.gantt.IlvConstraintType.END_END

 

table %Text

Yes

A value in the result of the SQL query that should map to the value given by the model attribute.