rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IliXML Class Reference

A Model class. More...

#include <ilviews/dataccess/gadgets/htmlrep.h>

Inheritance diagram for IliXML:
IliDataGem IlvGadget IlvSimpleGraphic IlvGraphic

List of all members.

Public Member Functions

 IliXML (IlvDisplay *display, const IlvPoint &at, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 This constructor initializes an IliXML object.
void addErrorSink (IliErrorSink *sink)
 Forwards an error message to all the error sinks that have been added with the addErrorSink member function.
void exportDefinition ()
 Called to export a definition.
virtual IlvBitmapgetBitmap () const
 Returns the bitmap that is displayed during the design phase in Rogue Wave Views Data Access.
const char * getDataSourceName () const
 Returns the data source name.
IliErrorReportergetErrorReporter () const
 Returns the error reporter that is used by the reportErrors member functions.
IliXMLExportModelgetExportModel () const
 Returns the export model.
const char * getExportModelName () const
 Returns the export model name.
IliXMLImportModelgetImportModel () const
 Returns the import model.
const char * getImportModelName () const
 Returns the import model name.
IlInt getModelPropertyCount (IliXMLModelType type) const
 Returns the model property count.
IlInt getModelPropertyIndex (IliXMLModelType type, const char *name) const
 Returns a model property index.
const char * getModelPropertyName (IliXMLModelType type, IlInt index) const
 Returns a model property name.
const IliValuegetModelPropertyValue (IliXMLModelType type, IlInt index) const
 Returns a model property value.
const IliValuegetModelPropertyValue (IliXMLModelType type, const char *name) const
 Returns a model property value.
IliXMLStreamModelgetStreamModel () const
 Returns the stream model.
const char * getStreamModelName () const
 Returns the stream model name.
void importDefinition ()
 Called to import a definition.
void importNotification ()
 Called to import a notification.
IlBoolean isAutomaticExport () const
 Returns IlTrue if the automatic exportation of notifications is enabled.
void removeErrorSink (IliErrorSink *sink)
 Removes an error sink from this table gadget.
void reportErrors (const IliErrorList &) const
 Reports the errors that are contained in a error list.
void setAutomaticExport (IlBoolean flag)
 Enables/Disables the automatic exportation of notifications.
void setDataSourceName (const char *name)
 Sets data source name.
void setErrorReporter (IliErrorReporter *reporter)
 Sets the error reporter.
void setExportModelName (const char *)
 Sets export model name.
void setImportModelName (const char *name)
 Sets import model name.
void setModelPropertyValue (IliXMLModelType type, IlInt index, const IliValue &val)
 Sets a model property value.
void setModelPropertyValue (IliXMLModelType type, const char *name, const IliValue &val)
 Sets a model property value.
void setStreamModelName (const char *)
 Sets stream model name.

Static Public Member Functions

static IlvSymbol * NotificationExportedSymbol ()
 Returns the callback name which is called when a notification is exported.

Detailed Description

A Model class.

Library: dbgadget

The class defines a gadget which manages the communication between a data source and a XML stream. It manages the import and export of notification and of definition.

A notification, is used to indicate a modification of the data source contents.

Data Access provides some models with a DTD but you can define your model class to implement your DTD. The default DTD is:

 <!ELEMENT  dataSourceNotification (primaryColumn, row*)>
 <!ELEMENT  primaryColumn EMPTY>
 <!ELEMENT  row (column*)>
 <!ELEMENT  column (#PCDATA)>

 <!ATTLIST  dataSourceNotification
    name CDATA #REQUIRED
 >
 <!ATTLIST  primaryColumn 
    name CDATA #REQUIRED
 >
 <!ATTLIST  row
    oldId CDATA #REQUIRED
    status NOTATION(insert,change,delete) 'insert'
 >
 <!ATTLIST  column
      name CDATA #REQUIRED
 >

A Definition, is used to define the data source data and to change some data source column properties.

Data Access provides some models with a DTD but you can define your model class to implement your DTD. The default DTD is:

 <!ELEMENT  dataSource (tableDescriptor, tableContent)>
 <!ELEMENT  tableDescriptor (columnDescriptor*)>
 <!ELEMENT  columnDescriptor(columnType,columnLook?,columnMapping?)>
 <!ELEMENT  columnType EMPTY>
 <!ELEMENT  columnLook EMPTY>
 <!ELEMENT  columnMapping EMPTY>
 <!ELEMENT  tableContent (row*)>
 <!ELEMENT  row (column*)>
 <!ELEMENT  column (#PCDATA)>

 <!ATTLIST  dataSource
    name CDATA #REQUIRED
 >
 <!ATTLIST  columnDescriptor 
    name CDATA #REQUIRED
    title CDATA #IMPLIED
    label CDATA #IMPLIED
 >
 <!ATTLIST  columnType 
    type CDATA #REQUIRED
    length CDATA #IMPLIED
    key NOTATION (true,false) 'false'
    nullable NOTATION (true,false) 'false'
    default CDATA #IMPLIED
 >
 <!ATTLIST  columnLook 
    format CDATA #IMPLIED
    mask CDATA #IMPLIED
    align NOTATION (left,right,center) 'left'
    width CDATA #IMPLIED
    readonly NOTATION (true,false) 'false'
    visible NOTATION (true,false) 'true'
 >
 <!ATTLIST  columnMapping 
    ds CDATA #REQUIRED
    value CDATA #REQUIRED
    display CDATA #REQUIRED
    constrained NOTATION (true,false) 'false'
    completion NOTATION (true,false) 'false'
 >
See also:
IliXML, IliModel, IliXMLDocumentModel.

Constructor & Destructor Documentation

IliXML::IliXML ( IlvDisplay display,
const IlvPoint at,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

This constructor initializes an IliXML object.

Parameters:
display The display.
at The position.
thickness The border thickness.
palette The palette.

Member Function Documentation

void IliXML::addErrorSink ( IliErrorSink sink  ) 

Forwards an error message to all the error sinks that have been added with the addErrorSink member function.

Parameters:
msg The error message.
virtual IlvBitmap* IliXML::getBitmap (  )  const [virtual]

Returns the bitmap that is displayed during the design phase in Rogue Wave Views Data Access.

Returns:
The bitmap.

Reimplemented from IliDataGem.

const char * IliXML::getDataSourceName (  )  const

Returns the data source name.

Returns:
The name.
IliErrorReporter* IliXML::getErrorReporter (  )  const

Returns the error reporter that is used by the reportErrors member functions.

When this property is NULL a default error reporter is used. Initially this property is NULL.

Returns:
The error reporter.
IliXMLExportModel* IliXML::getExportModel (  )  const

Returns the export model.

Returns:
The model.
const char* IliXML::getExportModelName (  )  const

Returns the export model name.

Returns:
The name.
IliXMLImportModel* IliXML::getImportModel (  )  const

Returns the import model.

Returns:
The model.
const char* IliXML::getImportModelName (  )  const

Returns the import model name.

Returns:
The name.
IlInt IliXML::getModelPropertyCount ( IliXMLModelType  type  )  const

Returns the model property count.

Parameters:
type The model type.
Returns:
The count.
IlInt IliXML::getModelPropertyIndex ( IliXMLModelType  type,
const char *  name 
) const

Returns a model property index.

Parameters:
type The model type.
name The property name.
Returns:
The index if found, otherwise -1.
const char* IliXML::getModelPropertyName ( IliXMLModelType  type,
IlInt  index 
) const

Returns a model property name.

Parameters:
type The model type.
index The property index.
Returns:
The name if index valid, otherwise 0.
const IliValue& IliXML::getModelPropertyValue ( IliXMLModelType  type,
IlInt  index 
) const

Returns a model property value.

Parameters:
type The model type.
index The property index.
Returns:
The value if found otherwise a null value.
const IliValue& IliXML::getModelPropertyValue ( IliXMLModelType  type,
const char *  name 
) const

Returns a model property value.

Parameters:
type The model type.
name The property name.
Returns:
The value if found otherwise a null value.
IliXMLStreamModel* IliXML::getStreamModel (  )  const

Returns the stream model.

Returns:
The model.
const char* IliXML::getStreamModelName (  )  const

Returns the stream model name.

Returns:
The name.
IlBoolean IliXML::isAutomaticExport (  )  const

Returns IlTrue if the automatic exportation of notifications is enabled.

Returns:
IlTrue if the automatic exportation of notifications is enabled.
static IlvSymbol* IliXML::NotificationExportedSymbol (  )  [static]

Returns the callback name which is called when a notification is exported.

Returns:
The callback name.
void IliXML::removeErrorSink ( IliErrorSink sink  ) 

Removes an error sink from this table gadget.

Parameters:
sink The error sink.
void IliXML::reportErrors ( const IliErrorList  )  const

Reports the errors that are contained in a error list.

This member function makes use of the error reporter returned by getErrorReporter if any. Otherwise it uses a default error reporter.

Parameters:
errorlist The error list.
void IliXML::setAutomaticExport ( IlBoolean  flag  ) 

Enables/Disables the automatic exportation of notifications.

Parameters:
flag If IlTrue, the exportation is enabled.
void IliXML::setDataSourceName ( const char *  name  ) 

Sets data source name.

Parameters:
name The data source name.
void IliXML::setErrorReporter ( IliErrorReporter reporter  ) 

Sets the error reporter.

Note that the table gadget will not delete the error reporter at destruction time, so the same error reporter may be safely shared by many table gadgets.

Parameters:
reporter The new error reporter.
void IliXML::setExportModelName ( const char *   ) 

Sets export model name.

Parameters:
name The model name. The predefined models are:

  • IliXMLExportModelNothing, this model exports nothing.
  • IliXMLExportModelDefault, this model exports XML information formatted following the default DTD. The property is:
    • PrimaryColumn: The primary column name
  • IliXMLExportModelDynamic, this model exports XML information formatted following the default DTD, but you can change the tag name. This model has some properties, the properties which begin by Def are used to export a definition. The properties which begin by Not are use to export a notification. The properties are:
    • PrimaryColumn: The primary column name.
    • Def_align: The parameter name for column alignment.
    • Def_colname: The parameter name for column name.
    • Def_colOptName: The parameter name for column option name.
    • Def_colOptValue: The parameter name for column option value.
    • Def_column: The tag name for column.
    • Def_columnDescriptor: The tag name for column description.
    • Def_columnLook: The tag name for column look.
    • Def_columnMapping: The tag name for column mapping.
    • Def_columnOption: The tag name for column option.
    • Def_columnOptions: The tag name for column options.
    • Def_columnType: The parameter name for column type.
    • Def_completion: The parameter name for column completion tag.
    • Def_constrained: The parameter name for column constrain tag.
    • Def_dataSource: The tag name for data source.
    • Def_default: The parameter name for default value.
    • Def_display: The parameter for column foreign display column name.
    • Def_ds: The parameter name for column foreign data source name.
    • Def_dsname: The parameter name for data source name.
    • Def_format: The parameter name for column format.
    • Def_key: The parameter name for column primary key flag.
    • Def_label: The parameter name for column label.
    • Def_length: The parameter name for column length.
    • Def_mask: The parameter name for column mask.
    • Def_nullable: The parameter name for column nullable flag.
    • Def_readonly: The parameter name for column read only flag.
    • Def_row: The tag name for row.
    • Def_tableContent: The tag name for table content.
    • Def_tableDescriptor: The tag name for table description.
    • Def_tableOption: The tag name for table options.
    • Def_tableOptions: The tag name for table options.
    • Def_tableOptName: The tag name for table option name.
    • Def_tableOptValue: The tag name for table option value.
    • Def_title: The parameter name for column title.
    • Def_type: The parameter name for column type.
    • Def_value: The parameter name for column foreign column value name.
    • Def_visible: The parameter name for column visibility.
    • Def_width: The parameter name for column width.
    • Not_colname: The parameter name for column name.
    • Not_column: The parameter name for column.
    • Not_dataSourceNotification: The tag name for data source notification.
    • Not_dsnname: The parameter name for data source name.
    • Not_keyname: The parameter name for primary column name.
    • Not_oldId: The parameter name for previous identifier.
    • Not_primaryColumn: The tag name for primary column.
    • Not_row: The tag name for row.
    • Not_status: The parameter name for status.
void IliXML::setImportModelName ( const char *  name  ) 

Sets import model name.

Parameters:
name The model name. The predefined models are:

  • IliXMLImportModelNothing, this model imports nothing.
  • IliXMLImportModelDefault, this model imports XML information formatted following the default DTD.
  • IliXMLImportModelDynamic, this model imports XML information formatted following the default DTD, but you can change the tag name. This model has some properties, the properties which begin by Def are used to import a definition. The properties which begin by Not are use to import a notification. The properties are:
    • Def_align: The parameter name for column alignment.
    • Def_colname: The parameter name for column name.
    • Def_colOptName: The parameter name for column option name.
    • Def_colOptValue: The parameter name for column option value.
    • Def_column: The tag name for column.
    • Def_columnDescriptor: The tag name for column description.
    • Def_columnLook: The tag name for column look.
    • Def_columnMapping: The tag name for column mapping.
    • Def_columnOption: The tag name for column option.
    • Def_columnOptions: The tag name for column options.
    • Def_columnType: The parameter name for column type.
    • Def_completion: The parameter name for column completion tag.
    • Def_constrained: The parameter name for column constrain tag.
    • Def_dataSource: The tag name for data source.
    • Def_default: The parameter name for default value.
    • Def_display: The parameter for column foreign display column name.
    • Def_ds: The parameter name for column foreign data source name.
    • Def_dsname: The parameter name for data source name.
    • Def_format: The parameter name for column format.
    • Def_key: The parameter name for column primary key flag.
    • Def_label: The parameter name for column label.
    • Def_length: The parameter name for column length.
    • Def_mask: The parameter name for column mask.
    • Def_nullable: The parameter name for column nullable flag.
    • Def_readonly: The parameter name for column read only flag.
    • Def_row: The tag name for row.
    • Def_tableContent: The tag name for table content.
    • Def_tableDescriptor: The tag name for table description.
    • Def_tableOption: The tag name for table options.
    • Def_tableOptions: The tag name for table options.
    • Def_tableOptName: The tag name for table option name.
    • Def_tableOptValue: The tag name for table option value.
    • Def_title: The parameter name for column title.
    • Def_type: The parameter name for column type.
    • Def_value: The parameter name for column foreign column value name.
    • Def_visible: The parameter name for column visibility.
    • Def_width: The parameter name for column width.
    • Not_colname: The parameter name for column name.
    • Not_column: The parameter name for column.
    • Not_dataSourceNotification: The tag name for data source notification.
    • Not_dsnname: The parameter name for data source name.
    • Not_keyname: The parameter name for primary column name.
    • Not_oldId: The parameter name for previous identifier.
    • Not_primaryColumn: The tag name for primary column.
    • Not_row: The tag name for row.
    • Not_status: The parameter name for status.
void IliXML::setModelPropertyValue ( IliXMLModelType  type,
IlInt  index,
const IliValue val 
)

Sets a model property value.

Parameters:
type The model type.
index The property index.
val The value.
void IliXML::setModelPropertyValue ( IliXMLModelType  type,
const char *  name,
const IliValue val 
)

Sets a model property value.

Parameters:
type The model type.
name The property name.
val The value.
void IliXML::setStreamModelName ( const char *   ) 

Sets stream model name.

Parameters:
name The model name. The predefined models are:

  • IliXMLStreamModelNothing.
  • IliXMLStreamModelFile, the properties are:
    • OutFileDef: The definition export file name.
    • OutFileNotif: The notification export file name.
    • InFileDef: The definition import file name.
    • InFileNotif: The notification import file name.

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.