ilog.server.jsds.sdm
Class IlsSDMDataSource

java.lang.Object
  |
  +--ilog.server.jsds.IlsDataSource
        |
        +--ilog.server.jsds.sdm.IlsSDMDataSource
All Implemented Interfaces:
IlDataSource, IlDataSourceEditor, IlSDMDataSource, IlSDMDataSourceEditor, IlsDSConnection

public class IlsSDMDataSource
extends IlsDataSource
implements IlSDMDataSource, IlSDMDataSourceEditor

SDM data source. How to define a dynamic view specification in order to open a sdm data source :

  view SDMView (any containerIndex= 0, string containerClass= ""):
  	represent IlsDSRepresentation repres:
  		any    containerIndex = view.containerIndex;
  		string containerClass = view.containerClass;
  		string title          = "a sdm view";
  
  
  subscribe origin Network:
  	represent IlsRpSDMModel sdm:
  		string identifier = identifier;
  
  		# SDMView properties
  		string  styleSheets = "data/expandWithLayout.css";
  		boolean dragEnabled = false;
  		boolean dropEnabled = false;
  		boolean isLinkReconnectionEnabled = false;
  
  		# IlvManagerView properties
  		boolean antialiasing = true;
  		boolean autoFitToContents = false;
  		boolean doubleBuffering = true;
  
  		string  background = "white";
  		boolean tooltips = true;
  
  		# SDMEngine properties
  		boolean linkLayoutEnabled = true;
  		boolean nodeLayoutEnabled = false;
  
  		string interactor = "ilog.views.interactor.IlvSelectInteractor";
  
  	# nodes and links
  	propagate nodes;
  	propagate links;
  
  
  subscribe Node:
  	# parent
  	propagate parent;
  
  	represent IlsRpSDMNode node:
  		mandatory ref<IlsRpSDMModel> SDM = view.origin->sdm;
  		mandatory string  tag       = "node";
  		string            ID        = ID;
  		ref<IlsRpSDMNode> parent    = parent->node;
  
  		# additional properties
  		string label = label;
  		double x = x;
  		double y = y;
  
  
  subscribe Link:
  	# parent, from and to
  	propagate parent;
  	propagate from;
  	propagate to;
  
  	represent IlsRpSDMLink link:
  		mandatory ref<IlsRpSDMModel> SDM = view.origin->sdm;
  		mandatory string  tag       = "link";
  		string            ID        = ID;
  		ref<IlsRpSDMNode> parent    = parent->node;
  
  		ref<IlsRpSDMNode> from   = from->node;
  		ref<IlsRpSDMNode> to     = to->node;
  		#boolean           isLink = true;
  
 


Fields inherited from class ilog.server.jsds.IlsDataSource
_properties, _propertyChangeListeners
 
Constructor Summary
IlsSDMDataSource()
          Instanciate a new IlsSDMDataSource
 
Method Summary
 void addSDMDSListener(SDMDSListener l)
          Adds a listener for all sdm events
 void dataSourceConnected(IlsDSMainObject dso)
          Implements DSConnectionListener.dataSourceConnected(ilog.server.jsds.DSConnectionEvent).
 void dataSourceDisconnected()
          Implements DSConnectionListener.dataSourceDisconnected(ilog.server.jsds.DSConnectionEvent).
 java.lang.Object dsAddLink(java.lang.String tag, java.lang.Object parent, java.lang.Object from, java.lang.Object to, java.util.Map properties)
          Creates a new link in the sdm
 java.lang.Object dsAddNode(java.lang.String tag, java.lang.Object parent, java.util.Map properties)
          Creates a new node in the sdm
 void dsRemoveLink(java.lang.Object link)
          Removes a link from the sdm
 void dsRemoveNode(java.lang.Object node)
          Removes a node from the sdm
 void dsUpdateLink(java.lang.Object link, java.lang.String propertyName, java.lang.Object propertyValue)
          Updates a property of a link
 void dsUpdateNode(java.lang.Object node, java.lang.String propertyName, java.lang.Object propertyValue)
          Updates a property of a node
 IlsDSMainObject getDSMainObject()
           
 boolean isLinkEditable(java.lang.Object link)
          Returns false if the link is a read only.
 boolean isLinkPropertyEditable(java.lang.Object link, java.lang.String propertyName)
           
 boolean isLinkPropertyHRef(java.lang.Object link, java.lang.String propertyName)
           
 boolean isNodeEditable(java.lang.Object node)
          Returns false if the node is a read only.
 boolean isNodePropertyEditable(java.lang.Object node, java.lang.String propertyName)
           
 boolean isNodePropertyHRef(java.lang.Object node, java.lang.String propertyName)
           
 void removeSDMDSListener(SDMDSListener l)
          Removes a listener for all sdm 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

IlsSDMDataSource

public IlsSDMDataSource()
Instanciate a new IlsSDMDataSource
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.

addSDMDSListener

public void addSDMDSListener(SDMDSListener l)
Adds a listener for all sdm events
Specified by:
addSDMDSListener in interface IlSDMDataSource
Parameters:
l - the listener

removeSDMDSListener

public void removeSDMDSListener(SDMDSListener l)
Removes a listener for all sdm events
Specified by:
removeSDMDSListener in interface IlSDMDataSource
Parameters:
l - the listener

isNodeEditable

public boolean isNodeEditable(java.lang.Object node)
Returns false if the node is a read only.
Specified by:
isNodeEditable in interface IlSDMDataSourceEditor
Parameters:
node - - The object to test.

dsAddNode

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

dsUpdateNode

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

dsRemoveNode

public void dsRemoveNode(java.lang.Object node)
Removes a node from the sdm
Specified by:
dsRemoveNode in interface IlSDMDataSourceEditor
Parameters:
node - node to be removed

isLinkEditable

public boolean isLinkEditable(java.lang.Object link)
Returns false if the link is a read only.
Specified by:
isLinkEditable in interface IlSDMDataSourceEditor
Parameters:
link - - The object to test.

dsAddLink

public java.lang.Object dsAddLink(java.lang.String tag,
                                  java.lang.Object parent,
                                  java.lang.Object from,
                                  java.lang.Object to,
                                  java.util.Map properties)
Creates a new link in the sdm
Specified by:
dsAddLink in interface IlSDMDataSourceEditor
Parameters:
from - origin node of the link
to - destination node of the link
properties - properties of the link to create
Returns:
the created link (to be used only as a key). Note that null may be returned if the link takes a long time to be created.

dsUpdateLink

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

dsRemoveLink

public void dsRemoveLink(java.lang.Object link)
Removes a link from the sdm
Specified by:
dsRemoveLink in interface IlSDMDataSourceEditor
Parameters:
link - link to be removed

isNodePropertyEditable

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

isNodePropertyHRef

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

isLinkPropertyEditable

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

isLinkPropertyHRef

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