Rogue Wave Views
Data Access Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IliXML Class Reference

A Model class. More...

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

Inheritance diagram for IliXML:
IliDataGem IlvGadget IlvSimpleGraphic IlvStylable IlvGraphic IlvValueInterface

Public Member Functions

 IliXML (IlvDisplay *display, const IlvPoint &at, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 This constructor initializes an IliXML object. More...
 
void addErrorSink (IliErrorSink *sink)
 Adds an error sink to this table gadget. More...
 
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. More...
 
const char * getDataSourceName () const
 Returns the data source name. More...
 
IliErrorReportergetErrorReporter () const
 Returns the error reporter that is used by the reportErrors member functions. More...
 
IliXMLExportModelgetExportModel () const
 Returns the export model. More...
 
const char * getExportModelName () const
 Returns the export model name. More...
 
IliXMLImportModelgetImportModel () const
 Returns the import model. More...
 
const char * getImportModelName () const
 Returns the import model name. More...
 
IlInt getModelPropertyCount (IliXMLModelType type) const
 Returns the model property count. More...
 
IlInt getModelPropertyIndex (IliXMLModelType type, const char *name) const
 Returns a model property index. More...
 
const char * getModelPropertyName (IliXMLModelType type, IlInt index) const
 Returns a model property name. More...
 
const IliValuegetModelPropertyValue (IliXMLModelType type, const char *name) const
 Returns a model property value. More...
 
const IliValuegetModelPropertyValue (IliXMLModelType type, IlInt index) const
 Returns a model property value. More...
 
IliXMLStreamModelgetStreamModel () const
 Returns the stream model. More...
 
const char * getStreamModelName () const
 Returns the stream model name. More...
 
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. More...
 
void removeErrorSink (IliErrorSink *sink)
 Removes an error sink from this table gadget. More...
 
void reportErrors (const IliErrorList &errorList) const
 Reports the errors that are contained in a error list. More...
 
void setAutomaticExport (IlBoolean flag)
 Enables/Disables the automatic exportation of notifications. More...
 
void setDataSourceName (const char *name)
 Sets data source name. More...
 
void setErrorReporter (IliErrorReporter *reporter)
 Sets the error reporter. More...
 
void setExportModelName (const char *name)
 Sets export model name. More...
 
void setImportModelName (const char *name)
 Sets import model name. More...
 
void setModelPropertyValue (IliXMLModelType type, const char *name, const IliValue &val)
 Sets a model property value. More...
 
void setModelPropertyValue (IliXMLModelType type, IlInt index, const IliValue &val)
 Sets a model property value. More...
 
void setStreamModelName (const char *name)
 Sets stream model name. More...
 
- Public Member Functions inherited from IliDataGem
IlBoolean hasGlobalScope () const
 Indicates the data source scope. More...
 
IlBoolean isSystemUsage () const
 Indicates the system usage flag. More...
 
virtual void setGlobalScope (IlBoolean global)
 Specifies whether the scope of the name of the data gem is local to the container in which it is located or globally visible. More...
 
virtual void usedBySystem (IlBoolean usage)
 Specifies if the object is a system object. More...
 

Static Public Member Functions

static IlvSymbolNotificationExportedSymbol ()
 Returns the callback name which is called when a notification is exported. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IliDataGem
 IliDataGem (IlvDisplay *display, const IlvPoint &at, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Initializes a new data gem. More...
 

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::IliXML ( IlvDisplay display,
const IlvPoint at,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

This constructor initializes an IliXML object.

Parameters
displayThe display.
atThe position.
thicknessThe border thickness.
paletteThe palette.

Member Function Documentation

§ addErrorSink()

void IliXML::addErrorSink ( IliErrorSink sink)

Adds an error sink to this table gadget.

Parameters
sinkThe error sink to be added.

§ getBitmap()

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.

§ getDataSourceName()

const char* IliXML::getDataSourceName ( ) const

Returns the data source name.

Returns
The name.

§ getErrorReporter()

IliErrorReporter* IliXML::getErrorReporter ( ) const

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

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

Returns
The error reporter.

§ getExportModel()

IliXMLExportModel* IliXML::getExportModel ( ) const

Returns the export model.

Returns
The model.

§ getExportModelName()

const char* IliXML::getExportModelName ( ) const

Returns the export model name.

Returns
The name.

§ getImportModel()

IliXMLImportModel* IliXML::getImportModel ( ) const

Returns the import model.

Returns
The model.

§ getImportModelName()

const char* IliXML::getImportModelName ( ) const

Returns the import model name.

Returns
The name.

§ getModelPropertyCount()

IlInt IliXML::getModelPropertyCount ( IliXMLModelType  type) const

Returns the model property count.

Parameters
typeThe model type.
Returns
The count.

§ getModelPropertyIndex()

IlInt IliXML::getModelPropertyIndex ( IliXMLModelType  type,
const char *  name 
) const

Returns a model property index.

Parameters
typeThe model type.
nameThe property name.
Returns
The index if found, otherwise -1.

§ getModelPropertyName()

const char* IliXML::getModelPropertyName ( IliXMLModelType  type,
IlInt  index 
) const

Returns a model property name.

Parameters
typeThe model type.
indexThe property index.
Returns
The name if index valid, otherwise 0.

§ getModelPropertyValue() [1/2]

const IliValue& IliXML::getModelPropertyValue ( IliXMLModelType  type,
const char *  name 
) const

Returns a model property value.

Parameters
typeThe model type.
nameThe property name.
Returns
The value if found otherwise a 0 value.

§ getModelPropertyValue() [2/2]

const IliValue& IliXML::getModelPropertyValue ( IliXMLModelType  type,
IlInt  index 
) const

Returns a model property value.

Parameters
typeThe model type.
indexThe property index.
Returns
The value if found otherwise a 0 value.

§ getStreamModel()

IliXMLStreamModel* IliXML::getStreamModel ( ) const

Returns the stream model.

Returns
The model.

§ getStreamModelName()

const char* IliXML::getStreamModelName ( ) const

Returns the stream model name.

Returns
The name.

§ isAutomaticExport()

IlBoolean IliXML::isAutomaticExport ( ) const

Returns IlTrue if the automatic exportation of notifications is enabled.

Returns
IlTrue if the automatic exportation of notifications is enabled.

§ NotificationExportedSymbol()

static IlvSymbol* IliXML::NotificationExportedSymbol ( )
static

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

Returns
The callback name.

§ removeErrorSink()

void IliXML::removeErrorSink ( IliErrorSink sink)

Removes an error sink from this table gadget.

Parameters
sinkThe error sink to be removed.

§ reportErrors()

void IliXML::reportErrors ( const IliErrorList errorList) 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
errorListThe error list.

§ setAutomaticExport()

void IliXML::setAutomaticExport ( IlBoolean  flag)

Enables/Disables the automatic exportation of notifications.

Parameters
flagIf IlTrue, the exportation is enabled.

§ setDataSourceName()

void IliXML::setDataSourceName ( const char *  name)

Sets data source name.

Parameters
nameThe data source name.

§ setErrorReporter()

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
reporterThe new error reporter.

§ setExportModelName()

void IliXML::setExportModelName ( const char *  name)

Sets export model name.

Parameters
nameThe 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.

§ setImportModelName()

void IliXML::setImportModelName ( const char *  name)

Sets import model name.

Parameters
nameThe 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.

§ setModelPropertyValue() [1/2]

void IliXML::setModelPropertyValue ( IliXMLModelType  type,
const char *  name,
const IliValue val 
)

Sets a model property value.

Parameters
typeThe model type.
nameThe property name.
valThe value.

§ setModelPropertyValue() [2/2]

void IliXML::setModelPropertyValue ( IliXMLModelType  type,
IlInt  index,
const IliValue val 
)

Sets a model property value.

Parameters
typeThe model type.
indexThe property index.
valThe value.

§ setStreamModelName()

void IliXML::setStreamModelName ( const char *  name)

Sets stream model name.

Parameters
nameThe 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 2018, 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.