Page 1 of 1

an inheritance mechanism for document types

Posted: Wed Mar 25, 2015 1:40 pm
by Ron Van den Branden
Hi,

Document association rules are now exclusive, meaning that when two document types are associated with the same criteria, only the one with highest priority is applied.

Yet, in some cases it would be nice to have some inheritance mechanism, where default rules from document type 1 are applied, and extended with specific rules of document type 2. For instance, when developing an extension to a TEI document type in a separate Oxygen project .xpr file, it could be handy to inherit all default TEI document type properties (document type association rules, validation and transformation scenarios), while at the same time associating more specific properties.

I'll try to illustrate an inheritance scenario with a hypothetical TEIextension.xpr file that just specifies an extra rule matching all standard TEI documents that have a /TEI/@rend[.='TEIextension'] attribute. Due to the fact that such a document matches the default TEI association rules, all properties of the default TEI document type are associated with this document. Additionally, the TEIextension.xpr file adds some dedicated Schematron validation rules, and a couple of XSLT transformations to other output formats.

If I want to achieve this currently, I have to copy all properties from the TEI document type into the specific TEIextension document type. This means that the default TEI properties have to be kept in sync with possible changes to the default TEI document type (when the TEI framework is updated, for example).

Of course, such inheritance is not always desirable. Would a configurable 'inheritance' setting be worth considering for a future Oxygen version?

Best,

Ron

Re: an inheritance mechanism for document types

Posted: Wed Mar 25, 2015 3:33 pm
by Radu
Hi Ron,

If you are using Oxygen 16.0 or newer the Oxygen Preferences->Document Type Association page should have an Extend button.
As the base framework evolves from one version to another an extended document type should automatically obtain all new additions.

Regards,
Radu

Re: an inheritance mechanism for document types

Posted: Wed Mar 25, 2015 4:14 pm
by Ron Van den Branden
Hi Radu,

Thanks, but for some reason or other I can't store such an extension externally. The default location (under c:\programs) requires administrator privileges, while whatever other location I try is rejected as not defined in the 'locations' tab of the preferences. Even if I had done so (and restarted Oxygen).

However, it seems it is only possible to store an extension as a .framework file, meaning that it at least requires some degree of configuration if users want to work with that file. An xpr file would be more portable, but that isn't supported, is it?

Best,

Ron

Re: an inheritance mechanism for document types

Posted: Wed Mar 25, 2015 4:38 pm
by Radu
Hi Ron,

Please see some answers below:
Thanks, but for some reason or other I can't store such an extension externally. The default location (under c:\programs) requires administrator privileges, while whatever other location I try is rejected as not defined in the 'locations' tab of the preferences. Even if I had done so (and restarted Oxygen).
You should create a folder somewhere called something like additionalFrameworks (you can create it in your Project folder for example). In that folder you create a new folder called something like tei-extension.
In the Oxygen Preferences->Document Type Association / Locations page you switch the page to Project options and add an extra frameworks directory like ${pd}/additionalFrameworks.
So an additional frameworks directory is the directory will contain inside subdirectories, each belonging to a framework.

Then pass the Document Type Association page to Project options, extend the TEI framework, choose to save it externally to ${pd}/additionalFrameworks/tei-extensions
However, it seems it is only possible to store an extension as a .framework file, meaning that it at least requires some degree of configuration if users want to work with that file. An xpr file would be more portable, but that isn't supported, is it?
Actually after you switch Document Type Association page to Project options and extend the framework you have the option to save it internally.

Regards,
Radu