ilog.server.jsds.gantt
Class IlsGanttDataSource

java.lang.Object
  |
  +--ilog.server.jsds.IlsDataSource
        |
        +--ilog.server.jsds.gantt.IlsGanttDataSource
All Implemented Interfaces:
IlDataSource, IlDataSourceEditor, IlGanttDataSource, IlGanttDataSourceEditor, IlsDSConnection

public class IlsGanttDataSource
extends IlsDataSource
implements IlGanttDataSource, IlGanttDataSourceEditor

Gantt data source. How to define a dynamic view specification in order to open a gantt data source :

   view GanttView (any containerIndex=0, string containerClass=""):
           represent IlsDSRepresentation repres:
                   any    containerIndex = view.containerIndex;
                   string containerClass = view.containerClass;
                   string title          = "A gantt view";
   
   
   subscribe origin CompanyModel:
           represent IlsRpGanttModel gantt:
                   ref<IlsRpResource> rootResource = company->resource;
                   ref<IlsRpActivity> rootActivity = rootProject->activity;
   
                   collector constraints  = precedences->constraint;
                   collector reservations = assignations->reservation;
   
           # rootResource
           propagate company;
           # rootActivity
           propagate rootProject;
           # constraints
           propagate precedences;
           # reservations
           propagate assignations;
   
   
           # a company is assigned to a global project
           represent IlsRpReservation reservation:
                   mandatory ref<IlsRpResource> resource = company->resource;
                   mandatory ref<IlsRpActivity> activity = rootProject->activity;
   
   
   subscribe Company:
           # rootResource
           represent IlsRpResource resource:
                   mandatory ref<IlsRpGanttModel> gantt = view.origin->gantt;
                   # ref<IlsRpResource> parent = 0;
                   string  id          = identifier;
                   string  name        = name;
   
           # resources
           propagate departments;
   
   
   subscribe Department:
           represent IlsRpResource resource:
                   mandatory ref<IlsRpGanttModel> gantt = view.origin->gantt;
                   ref<IlsRpResource> parent = company->resource;
                   string  id          = identifier;
                   string  name        = name;
   
           # resources
           propagate employees;
   
   
   subscribe Employee:
           represent IlsRpResource resource:
                   mandatory ref<IlsRpGanttModel> gantt = view.origin->gantt;
                   ref<IlsRpResource> parent = department->resource;
                   string  id          = initials;
                   string  name        = name;
   
   
   subscribe Activity:
           represent IlsRpActivity activity:
           # virtual representation for polymorphism
   
   
   subscribe Project:
           represent IlsRpActivity activity:
                   mandatory ref<IlsRpGanttModel> gantt = view.origin->gantt;
                   ref<IlsRpActivity> parent = superProject->activity;
                   string  id          = ID;
                   string  name        = name;
                   # date are in seconds
                   int     startTime   = startTime;
                   int     endTime     = endTime;
   
           represent IlsRpReservation reservation:
                   mandatory ref<IlsRpResource> resource = department->resource;
                   mandatory ref<IlsRpActivity> activity = this->activity;
   
           # activities
           propagate subProjects;
           propagate tasks;
   
   
   subscribe Task:
           represent IlsRpActivity activity:
                   mandatory ref<IlsRpGanttModel> gantt = view.origin->gantt;
                   ref<IlsRpActivity> parent = project->activity;
                   string  id          = ID;
                   string  name        = name;
                   # date are in seconds
                   int     startTime   = startTime;
                   int     endTime     = endTime;
   
   
   subscribe Precedence:
           represent IlsRpConstraint constraint:
                   mandatory ref<IlsRpActivity> fromActivity = beforeActivity->activity;
                   mandatory ref<IlsRpActivity> toActivity   = afterActivity->activity;
                   boolean fromStart    = false;
                   boolean toStart      = true;
   
   
   subscribe Assignation:
           represent IlsRpReservation reservation:
                   mandatory ref<IlsRpResource> resource = employee->resource;
                   mandatory ref<IlsRpActivity> activity = activity->activity;
 


Fields inherited from class ilog.server.jsds.IlsDataSource
_properties, _propertyChangeListeners
 
Constructor Summary
IlsGanttDataSource()
          Instanciate a new IlsGanttDataSource
 
Method Summary
 void addGanttDSListener(GanttDSListener l)
          Adds a ganttener for all Graph events
 void dataSourceConnected(IlsDSMainObject dso)
          Implements DSConnectionListener.dataSourceConnected(ilog.server.jsds.DSConnectionEvent).
 void dataSourceDisconnected()
          Implements DSConnectionListener.dataSourceDisconnected(ilog.server.jsds.DSConnectionEvent).
 java.lang.Object dsAddActivity(java.lang.Object parent, java.util.Map properties)
          Creates a new activity in the Gantt
 java.lang.Object dsAddConstraint(java.lang.Object fromActivity, java.lang.Object toActivity, java.util.Map properties)
          Creates a new constraint in the Gantt
 java.lang.Object dsAddReservation(java.lang.Object resource, java.lang.Object activity, java.util.Map properties)
          Creates a new reservation in the Gantt
 java.lang.Object dsAddResource(java.lang.Object parent, java.util.Map properties)
          Creates a new resource in the Gantt
 void dsRemoveActivity(java.lang.Object activity)
          Removes an activity from the Gantt
 void dsRemoveConstraint(java.lang.Object constraint)
          Removes a constraint from the Gantt
 void dsRemoveReservation(java.lang.Object reservation)
          Removes a reservation from the Gantt
 void dsRemoveResource(java.lang.Object resource)
          Removes a resource from the Gantt
 void dsUpdateActivity(java.lang.Object activity, java.lang.String propertyName, java.lang.Object propertyValue)
          Updates a property of an activity
 void dsUpdateConstraint(java.lang.Object constraint, java.lang.String propertyName, java.lang.Object propertyValue)
          Updates a property of a constraint
 void dsUpdateGantt(java.lang.String propertyName, java.lang.Object propertyValue)
          Updates a property of the Gantt
 void dsUpdateReservation(java.lang.Object reservation, java.lang.String propertyName, java.lang.Object propertyValue)
          Updates a property of a reservation
 void dsUpdateResource(java.lang.Object resource, java.lang.String propertyName, java.lang.Object propertyValue)
          Updates a property of a resource
 IlsDSMainObject getDSMainObject()
           
 boolean isActivityEditable(java.lang.Object activity)
          Returns false if the activity is a read only.
 boolean isActivityPropertyEditable(java.lang.Object activity, java.lang.String propertyName)
           
 boolean isActivityPropertyHRef(java.lang.Object activity, java.lang.String propertyName)
           
 boolean isConstraintEditable(java.lang.Object constraint)
          Returns false if the constraint is a read only.
 boolean isConstraintPropertyEditable(java.lang.Object constraint, java.lang.String propertyName)
           
 boolean isConstraintPropertyHRef(java.lang.Object constraint, java.lang.String propertyName)
           
 boolean isReservationEditable(java.lang.Object reservation)
          Returns false if the reservation is a read only.
 boolean isReservationPropertyEditable(java.lang.Object reservation, java.lang.String propertyName)
           
 boolean isReservationPropertyHRef(java.lang.Object reservation, java.lang.String propertyName)
           
 boolean isResourceEditable(java.lang.Object resource)
          Returns false if the resource is a read only.
 boolean isResourcePropertyEditable(java.lang.Object resource, java.lang.String propertyName)
           
 boolean isResourcePropertyHRef(java.lang.Object resource, java.lang.String propertyName)
           
 void removeGanttDSListener(GanttDSListener l)
          Removes a ganttener for all Graph events
 
Methods inherited from class ilog.server.jsds.IlsDataSource
addBatchListener, addDataSourceListener, addDSConnectionListener, addPropertyChangeListener, addPropertyChangeListener, dataSourceChange, dsClose, dsDereference, dsDereference, dsEndBatch, dsExecCallback, dsExecDuplexCallback, dsExecDuplexCallback, dsExecDuplexCallback, dsStartBatch, dsUpdateProperty, endBatch, getDataSourceContainer, getDSBatchLevel, getDSComponent, getDSProperties, getDSProperty, getDSRepresentation, getLabel, getViewName, isDSObjectPropertyEditable, isDSObjectPropertyHRef, isEditable, isInEdition, removeBatchListener, removeDataSourceListener, removeDSConnectionListener, removePropertyChangeListener, removePropertyChangeListener, setDataSourceContainer, setLabel, setRpStatus, setViewName, startBatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.ds.IlDataSource
addBatchListener, addDataSourceListener, getDSProperties, getDSProperty, removeBatchListener, removeDataSourceListener
 
Methods inherited from interface ilog.ds.IlDataSourceEditor
dsEndBatch, dsStartBatch, dsUpdateProperty, getDSBatchLevel, isEditable
 

Constructor Detail

IlsGanttDataSource

public IlsGanttDataSource()
Instanciate a new IlsGanttDataSource
Method Detail

dataSourceConnected

public void dataSourceConnected(IlsDSMainObject dso)
Implements DSConnectionListener.dataSourceConnected(ilog.server.jsds.DSConnectionEvent).
Overrides:
dataSourceConnected in class IlsDataSource
Following copied from class: ilog.server.jsds.IlsDataSource
See Also:
DSConnectionListener

dataSourceDisconnected

public void dataSourceDisconnected()
Implements DSConnectionListener.dataSourceDisconnected(ilog.server.jsds.DSConnectionEvent).
Overrides:
dataSourceDisconnected in class IlsDataSource
Following copied from class: ilog.server.jsds.IlsDataSource
See Also:
DSConnectionListener

getDSMainObject

public IlsDSMainObject getDSMainObject()
Overrides:
getDSMainObject in class IlsDataSource
Following copied from class: ilog.server.jsds.IlsDataSource
Returns:
the origin representation object associated to the data source.

addGanttDSListener

public void addGanttDSListener(GanttDSListener l)
Adds a ganttener for all Graph events
Specified by:
addGanttDSListener in interface IlGanttDataSource
Parameters:
l - the ganttener

removeGanttDSListener

public void removeGanttDSListener(GanttDSListener l)
Removes a ganttener for all Graph events
Specified by:
removeGanttDSListener in interface IlGanttDataSource
Parameters:
l - the ganttener

dsUpdateGantt

public void dsUpdateGantt(java.lang.String propertyName,
                          java.lang.Object propertyValue)
Updates a property of the Gantt
Parameters:
propertyName - name of the property to be updated
propertyValue - new value of the property

isActivityEditable

public boolean isActivityEditable(java.lang.Object activity)
Returns false if the activity is a read only.
Specified by:
isActivityEditable in interface IlGanttDataSourceEditor
Parameters:
activity - - The activity to test.

dsAddActivity

public java.lang.Object dsAddActivity(java.lang.Object parent,
                                      java.util.Map properties)
Creates a new activity in the Gantt
Specified by:
dsAddActivity in interface IlGanttDataSourceEditor
Parameters:
properties - properties of the activity to create
Returns:
the created activity (to be used only as a key). Note that null may be returned if the activity takes a long time to be created.

dsUpdateActivity

public void dsUpdateActivity(java.lang.Object activity,
                             java.lang.String propertyName,
                             java.lang.Object propertyValue)
Updates a property of an activity
Specified by:
dsUpdateActivity in interface IlGanttDataSourceEditor
Parameters:
activity - the activity to update
propertyName - name of the property to be updated
propertyValue - new value of the property

dsRemoveActivity

public void dsRemoveActivity(java.lang.Object activity)
Removes an activity from the Gantt
Specified by:
dsRemoveActivity in interface IlGanttDataSourceEditor
Parameters:
activity - activity to be removed

isActivityPropertyEditable

public boolean isActivityPropertyEditable(java.lang.Object activity,
                                          java.lang.String propertyName)
Parameters:
activity - The activity representation.
propertyName - The property name.
Returns:
true if property activity is editable.

isActivityPropertyHRef

public boolean isActivityPropertyHRef(java.lang.Object activity,
                                      java.lang.String propertyName)
Parameters:
activity - The activity representation.
propertyName - The property name.
Returns:
true if property activity is a hyper reference.

isResourceEditable

public boolean isResourceEditable(java.lang.Object resource)
Returns false if the resource is a read only.
Specified by:
isResourceEditable in interface IlGanttDataSourceEditor
Parameters:
resource - - The resource to test.

dsAddResource

public java.lang.Object dsAddResource(java.lang.Object parent,
                                      java.util.Map properties)
Creates a new resource in the Gantt
Specified by:
dsAddResource in interface IlGanttDataSourceEditor
Parameters:
properties - properties of the resource to create
Returns:
the created resource (to be used only as a key). Note that null may be returned if the resource takes a long time to be created.

dsUpdateResource

public void dsUpdateResource(java.lang.Object resource,
                             java.lang.String propertyName,
                             java.lang.Object propertyValue)
Updates a property of a resource
Specified by:
dsUpdateResource in interface IlGanttDataSourceEditor
Parameters:
resource - the resource to update
propertyName - name of the property to be updated
propertyValue - new value of the property

dsRemoveResource

public void dsRemoveResource(java.lang.Object resource)
Removes a resource from the Gantt
Specified by:
dsRemoveResource in interface IlGanttDataSourceEditor
Parameters:
resource - resource to be removed

isResourcePropertyEditable

public boolean isResourcePropertyEditable(java.lang.Object resource,
                                          java.lang.String propertyName)
Parameters:
resource - The resource representation.
propertyName - The property name.
Returns:
true if property resource is editable.

isResourcePropertyHRef

public boolean isResourcePropertyHRef(java.lang.Object resource,
                                      java.lang.String propertyName)
Parameters:
resource - The resource representation.
propertyName - The property name.
Returns:
true if property resource is a hyper reference.

isConstraintEditable

public boolean isConstraintEditable(java.lang.Object constraint)
Returns false if the constraint is a read only.
Specified by:
isConstraintEditable in interface IlGanttDataSourceEditor
Parameters:
constraint - - The constraint to test.

dsAddConstraint

public java.lang.Object dsAddConstraint(java.lang.Object fromActivity,
                                        java.lang.Object toActivity,
                                        java.util.Map properties)
Creates a new constraint in the Gantt
Specified by:
dsAddConstraint in interface IlGanttDataSourceEditor
Parameters:
fromActivity - origin activity of the constraint
toActivity - target activity of the constraint
properties - properties of the constraint to create
Returns:
the created constraint (to be used only as a key). Note that null may be returned if the constraint takes a long time to be created.

dsUpdateConstraint

public void dsUpdateConstraint(java.lang.Object constraint,
                               java.lang.String propertyName,
                               java.lang.Object propertyValue)
Updates a property of a constraint
Specified by:
dsUpdateConstraint in interface IlGanttDataSourceEditor
Parameters:
constraint - the constraint to update
propertyName - name of the property to be updated
propertyValue - new value of the property

dsRemoveConstraint

public void dsRemoveConstraint(java.lang.Object constraint)
Removes a constraint from the Gantt
Specified by:
dsRemoveConstraint in interface IlGanttDataSourceEditor
Parameters:
constraint - constraint to be removed

isConstraintPropertyEditable

public boolean isConstraintPropertyEditable(java.lang.Object constraint,
                                            java.lang.String propertyName)
Parameters:
constraint - The constraint representation.
propertyName - The property name.
Returns:
true if property constraint is editable.

isConstraintPropertyHRef

public boolean isConstraintPropertyHRef(java.lang.Object constraint,
                                        java.lang.String propertyName)
Parameters:
constraint - The constraint representation.
propertyName - The property name.
Returns:
true if property constraint is a hyper reference.

isReservationEditable

public boolean isReservationEditable(java.lang.Object reservation)
Returns false if the reservation is a read only.
Specified by:
isReservationEditable in interface IlGanttDataSourceEditor
Parameters:
reservation - - The reservation to test.

dsAddReservation

public java.lang.Object dsAddReservation(java.lang.Object resource,
                                         java.lang.Object activity,
                                         java.util.Map properties)
Creates a new reservation in the Gantt
Specified by:
dsAddReservation in interface IlGanttDataSourceEditor
Parameters:
resource - resource of the reservation
activity - activity of the reservation
properties - properties of the reservation to create
Returns:
the created reservation (to be used only as a key). Note that null may be returned if the constraint takes a long time to be created.

dsUpdateReservation

public void dsUpdateReservation(java.lang.Object reservation,
                                java.lang.String propertyName,
                                java.lang.Object propertyValue)
Updates a property of a reservation
Specified by:
dsUpdateReservation in interface IlGanttDataSourceEditor
Parameters:
reservation - the reservation to update
propertyName - name of the property to be updated
propertyValue - new value of the property

dsRemoveReservation

public void dsRemoveReservation(java.lang.Object reservation)
Removes a reservation from the Gantt
Specified by:
dsRemoveReservation in interface IlGanttDataSourceEditor
Parameters:
reservation - reservation to be removed

isReservationPropertyEditable

public boolean isReservationPropertyEditable(java.lang.Object reservation,
                                             java.lang.String propertyName)
Parameters:
reservation - The reservation representation.
propertyName - The property name.
Returns:
true if property reservation is editable.

isReservationPropertyHRef

public boolean isReservationPropertyHRef(java.lang.Object reservation,
                                         java.lang.String propertyName)
Parameters:
reservation - The reservation representation.
propertyName - The property name.
Returns:
true if property reservation is a hyper reference.