backwardCompatibility
Identifier:
com.ibm.xtools.emf.core.backwardCompatibility
Since:
7.0
Description:
This extension point provides hooks for clients to participate in the loading of older resources into the newest environment.
Configuration Markup:
<!ELEMENT extension (Ecore2XML* , ResourceHandler* , URIHandler* , XSISchemaLocationMapping*)>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT Ecore2XML (schema , XMIMapping*)>
<!ATTLIST Ecore2XML
file CDATA #IMPLIED
plugin CDATA #IMPLIED
destinationSchemaAlias CDATA #IMPLIED>
Declares an Ecore2XML document that should be used to map XML tags to their counterpart meta-objects in the current version of the application. The document is declared against one schema namespace URI (the first schema element) for which it contains mappings and a destination schema namespace URI (the second schema element).
- file - The Ecore2XML file located in this plugin. If the file is located in another plugin then the plugin id must be provided.
- plugin -
- destinationSchemaAlias - This optional attribute provides a single alias for the destination schema namespace URI to be used while loading the ecore2xml document. This alias is useful because the ecore2xml authoring editor will often store HREF's in the ecore2xml document as relative URI's to an ecore file in the workspace instead of qualifying them with the full absolute namespace URI of the ecore document being referenced. The latter encoding of the HREF's is required normally to load these documents properly in a runtime.
<!ELEMENT ResourceHandler (schema | signature)>
<!ATTLIST ResourceHandler
class CDATA #REQUIRED>
Declares a ResourceHandler to perform post-load and pre-save modifications to a resource in order to convert it to the newest version and potentially save it back to the original version. The resource handler can be declared against a particular schema namespace URI or a signature version.
- class - The resource handler class
<!ELEMENT URIHandler (scheme | signature | (scheme , signature))>
<!ATTLIST URIHandler
class CDATA #REQUIRED>
Declares a URI handler to convert URIs to the newest version. A URI handler can be declared against a specific signature version or a URI scheme or both. In the case of both, the URI handler will not be called to handle URIs of other schemes.
- class - The URIHandler class
<!ELEMENT schema EMPTY>
<!ATTLIST schema
nsURI CDATA #REQUIRED>
Identifies a particular schema with its namespace URI.
- nsURI - The namespace URI of the schema that is being referenced
<!ELEMENT signature EMPTY>
<!ATTLIST signature
id CDATA #REQUIRED
version CDATA #REQUIRED>
Identifies a particular signature with its unique id and version.
- id - The unique identifier for the signature.
- version - The version of the signature being referenced (e.g. 1.0.0, 1.0, 0.0.0)
<!ELEMENT scheme EMPTY>
<!ATTLIST scheme
name CDATA #REQUIRED>
Identifies a particular scheme of a URI.
- name - The name of the URI scheme.
<!ELEMENT XSISchemaLocationMapping EMPTY>
<!ATTLIST XSISchemaLocationMapping
fromLocation CDATA #IMPLIED
fromLocationRegularExpression CDATA #IMPLIED
toLocation CDATA #REQUIRED>
Provides a simple one-to-one mapping for the XSI schema location of an EPackage. The XSI schema location is stored in EMF's XMI files whenever the EPackage's nsURI does not match the URI location where it can actually be loaded into EMF's package registry.
Note: clients must provide a value for either the fromLocation attribute or the fromLocationRegularExpression.
- fromLocation - The older schema location that could be found in artifacts from previous versions of the runtime. This attribute or the fromLocationRegularExpression attribute must contain a value.
- fromLocationRegularExpression - This attribute provides a regular expression that will be used to match against XSI schema location replacements in order to provide some destination location that should replace the original. This attribute should be used sparingly because it will slow down the process of evaluating XSI schema locations to determine if they are candidates for migration.
Note: The regular expression provided will be adorned with an implied beginning of line and end of line matchers(ie. '^' and '$').
- toLocation - The new schema location used in the current runtime
<!ELEMENT XMIMapping EMPTY>
<!ATTLIST XMIMapping
xmlTagName CDATA #REQUIRED
xmiType CDATA #REQUIRED
classifier CDATA #REQUIRED
sourceXMIType CDATA #IMPLIED>
This element represents a mapping from an XML tag name to an XMI type in the event that the xmi:type attribute is missing from the XML tag. This allows an ecore2xml document to map a containment EReference to null but still have contained EObjects being created as the appropriate EClass (not AnyTypes) in the absence of the xmi:type attribute as long as there is an ecore2xml mapping for that type.
- xmlTagName - The tag name encountered in the file that corresponds to an EReference in the old version of the metamodel.
- xmiType - The XMI type that should be given to an EObject found with the given tag name in the absence of an xmi:type attribute. Normally, without this information, the EObject would be an AnyType. Note that this scenario occurs because the EReference in the old metamodel had a type that was a concrete EClass (non abstract). EMF would optimize the serialization of the xmi:type because it was known that the type was trivially the type of the EReference.
- classifier - This classifier contrains the mapping to be a feature that is inside the provided EClass. If it is not contained in this EClass then this mapping is ignored. Note that this EClass is an EClass from the destination EPackage so the container object cannot be an AnyType, it will have to have been successfully mapped.
- sourceXMIType - This is an optional source XMI type in the same form as is found in the XMI file's xmi:type attribute. If a value is given for this attribute is given then this mapping will only come into effect if there is already a XMI type given in the file for the element we are trying to process.
Conversely, if no value is given to this attribute then only the cases where there is no XMI type in the file will be processed.
Examples:
API Information:
See IRMPResource for more information about how clients will be interacting with resources that are using backward compatibility.
Copyright (c) 2004, 2018 Model RealTime, HCL and others. All Rights Reserved.