ilog.views.diagrammer.datasource
Class IlvXMLDataSource

java.lang.Object
  extended by ilog.views.diagrammer.datasource.IlvDiagrammerDataSource
      extended by ilog.views.diagrammer.datasource.IlvXMLDataSource

public class IlvXMLDataSource
extends IlvDiagrammerDataSource

An XML data source for the diagram component.

An XML data source implements the reading of data from an XML data file into a diagram component and the writing of data from a diagram component to an XML data file in conformance with the SDM XML format. The XML data source can also read and write custom XML formats. To do this, two XSL files must be provided: one for input (which transforms the custom XML format into the SDM format) and one for output (which transforms the SDM format into the custom format).

See IlvXMLConnector for a description of the data file format.

See Also:
IlvXSLConnector

Constructor Summary
IlvXMLDataSource()
           
 
Method Summary
 void clearInputParameters()
          Clears the parameters to pass to the input XSL transform.
 void clearOutputParameters()
          Clears the parameters to pass to the output XSL transform.
protected  void deserializeImpl(Element element)
          Deserializes the parameters of this data source from the specified DOM element.
protected  IlvXMLConnector getConnector()
          Returns the XML connector.
 URL getDataURL()
          Returns the URL of the XML data file.
 String getDescription()
          Returns the URL of the XML data file to which this XML data source points.
 URL getInputXSL()
          Returns the URL of the input XSL file.
 URL getOutputXSL()
          Returns the URL of the output XSL file.
 void read(IlvDiagrammer diagrammer)
          Reads the XML data file and sends it to the diagram component for rendering.
protected  void serializeImpl(Element element)
          Serializes the parameters of this data source to the specified DOM element.
 void setDataURL(URL dataURL)
          Sets the URL of the XML data file.
 void setInputParameter(String name, Object value)
          Adds a parameter to pass to the input XSL transform.
 void setInputXSL(URL inputXSL)
          Sets the URL of the input XSL file.
 void setOutputParameter(String name, Object value)
          Adds a parameter to pass to the output XSL transform.
 void setOutputXSL(URL outputXSL)
          Sets the URL of the output XSL file.
 boolean supportsWrite()
          Returns true: XML data sources do support writing.
 void write(IlvDiagrammer diagrammer)
          Writes the data from the diagram component to the XML data file.
 
Methods inherited from class ilog.views.diagrammer.datasource.IlvDiagrammerDataSource
deserialize, getBaseURL, serialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvXMLDataSource

public IlvXMLDataSource()
Method Detail

getDataURL

public URL getDataURL()
Returns the URL of the XML data file.

Returns:
URL of the data file

setDataURL

public void setDataURL(URL dataURL)
Sets the URL of the XML data file.

Parameters:
dataURL - URL of the data file

getInputXSL

public URL getInputXSL()
Returns the URL of the input XSL file.

Returns:
URL of the input XSL file

setInputXSL

public void setInputXSL(URL inputXSL)
Sets the URL of the input XSL file. The XSL input file must be null to read XML in the SDM format.

Parameters:
inputXSL - URL of the input XSL file

getOutputXSL

public URL getOutputXSL()
Returns the URL of the output XSL file.

Returns:
URL of the output XSL file

setInputParameter

public void setInputParameter(String name,
                              Object value)
Adds a parameter to pass to the input XSL transform.

Parameters:
name - The name of the parameter.
value - The value of the parameter.
See Also:
IlvXSLConnector.setInputParameter(java.lang.String, java.lang.Object)

clearInputParameters

public void clearInputParameters()
Clears the parameters to pass to the input XSL transform.

See Also:
IlvXSLConnector.clearInputParameters()

setOutputParameter

public void setOutputParameter(String name,
                               Object value)
Adds a parameter to pass to the output XSL transform.

Parameters:
name - The name of the parameter.
value - The value of the parameter.
See Also:
IlvXSLConnector.setOutputParameter(java.lang.String, java.lang.Object)

clearOutputParameters

public void clearOutputParameters()
Clears the parameters to pass to the output XSL transform.

See Also:
IlvXSLConnector.clearOutputParameters()

setOutputXSL

public void setOutputXSL(URL outputXSL)
Sets the URL of the output XSL file. The XSL output file must be null to write XML in the SDM format.

Parameters:
outputXSL - URL of the output XSL file

getConnector

protected IlvXMLConnector getConnector()
Returns the XML connector.

Returns:
The XML connector.
Since:
JViews 8.0

read

public void read(IlvDiagrammer diagrammer)
          throws IlvDiagrammerException
Reads the XML data file and sends it to the diagram component for rendering.

Specified by:
read in class IlvDiagrammerDataSource
Parameters:
diagrammer - The diagram component that will display the data read from this data source.
Throws:
IlvDiagrammerException - If an exception occurs while reading data. This exception will usually contain a "cause", that is, the original low-level exception that caused the data source to fail to complete the operation.

supportsWrite

public boolean supportsWrite()
Returns true: XML data sources do support writing.

Overrides:
supportsWrite in class IlvDiagrammerDataSource

write

public void write(IlvDiagrammer diagrammer)
           throws IlvDiagrammerException
Writes the data from the diagram component to the XML data file.

Specified by:
write in class IlvDiagrammerDataSource
Parameters:
diagrammer - The diagram component that contains the data to be saved to the data source.
Throws:
IlvDiagrammerException - If an exception occurs while writing data. This exception will usually contain a "cause", that is to say the original low-level exception that caused the data source to fail to complete the operation.

getDescription

public String getDescription()
Returns the URL of the XML data file to which this XML data source points.

Overrides:
getDescription in class IlvDiagrammerDataSource

serializeImpl

protected void serializeImpl(Element element)
                      throws IlvDiagrammerException
Serializes the parameters of this data source to the specified DOM element.

Specified by:
serializeImpl in class IlvDiagrammerDataSource
Parameters:
element - The DOM element to which the data source parameters are written.
Throws:
IlvDiagrammerException - If an exception occurs while serializing the data source.

deserializeImpl

protected void deserializeImpl(Element element)
                        throws IlvDiagrammerException
Deserializes the parameters of this data source from the specified DOM element.

Specified by:
deserializeImpl in class IlvDiagrammerDataSource
Parameters:
element - The DOM element to which the data source parameters are written.
Throws:
IlvDiagrammerException - If an exception occurs while deserializing the data source.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.