Connector XML file format

Configuration Markup

<!ELEMENT connectors (modelReader | modelWriter)*>

<!ELEMENT modelReader (property* , fileExtension*)>

<!ATTLIST modelReader

metamodel   CDATA #REQUIRED

name        CDATA #REQUIRED

class       CDATA #REQUIRED

uriType     (file | directory | noURI | unspecified) #REQUIRED>

<!ELEMENT modelWriter (property* , fileExtension*)>

<!ATTLIST modelWriter

metamodel   CDATA #REQUIRED

name        CDATA #REQUIRED

class       CDATA #REQUIRED

uriType     (file | directory | noURI | unspecified) #REQUIRED>

<!ELEMENT property EMPTY>

<!ATTLIST property

name        CDATA #REQUIRED

value       CDATA #REQUIRED>

Here are the property names interpreted by MDWorkbench:

<!ELEMENT fileExtension EMPTY>

<!ATTLIST fileExtension

extension   CDATA #REQUIRED

description CDATA #REQUIRED

default     (true | false) "false">


File extensions are used by MDWorkbench when the user opens a dialog box to select a file to read/write. They are used to restrict the type of files that shows up in this dialog. Extensions "All files" and "All suppported files" are automatically added by MDWorkbench in this dialog. File extension elements should only be defined for file connectors.

URI type enumeration

Here are the available URI types:

Examples

An external connector (connectors.xml file) that defines a model reader and writer for the UML 2.1 metamodel:

<?xml version=

"1.0"

?>

<connectors> <modelReader metamodel=

"uml21"

name=

"My File Reader"

uriType=

"file"

class=

"com.mycompany.model.io.MyFileReader"

> <property name=

"onDemand"

value=

"true"

/> <property name=

"details"

value=

"full"

/> <fileExtension description=

"XML files"

extension=

"xml"

/> </modelReader> <modelWriter metamodel=

"uml21"

name=

"My COM Writer"

uriType=

"noURI"

class=

"com.mycompany.model.io.MyCOMWRiter"

/> </connectors>

A connector embedded in a metamodel declaration (metamodels.xml file):

<?xml version=

"1.0"

?>

<metamodels>

<metamodel> TODO <modelReader metamodel=

"uml21"

name=

"My File Reader"

uriType=

"file"

class=

"com.mycompany.model.io.MyFileReader"

> <property name=

"onDemand"

value=

"true"

/> <property name=

"details"

value=

"full"

/> <fileExtension description=

"XML files"

extension=

"xml"

/> </modelReader> <modelWriter metamodel=

"uml21"

name=

"My COM Writer"

uriType=

"noURI"

class=

"com.mycompany.model.io.MyCOMWRiter"

/> </connectors>

Related tasks
Adding a model connector