Specialize props attribute and add to OxygenXML Profiling attributes

Post here questions and problems related to editing and publishing DITA content.
RichH
Posts: 14
Joined: Mon Jun 15, 2015 1:02 pm

Specialize props attribute and add to OxygenXML Profiling attributes

Post by RichH »

Hi all,

so just before Christmas I've decided to do something a little complicated and have come to a block. I want to specialize the props attribute and have it available in my OxygenXML profiling attributes.

The story so far:
* I've read the oxygenxml help on specialization https://www.oxygenxml.com/doc/versions/ ... pport.html
* I've read the moon phase examples and instructions http://dita4practitioners.github.io/dit ... ocess.html
* I've created an attribute specialization using the generator https://dita-generator-hrd.appspot.com/attribute/#p1

I want to create the following attribute specialization:
generation
- classic
- new generation

and I want this to appear in the profiling attributes menu when I select an item in DITA (e.g. a topicref in a map, a table row in a reference, etc etc)

I've added the attribute specialization files from the generator to a new plugin: com.example.specialization.generation and I've run the Dita OT integrator.

Just for info: I already have a subject scheme ditamap which I've included in my current ditamap. The attributes which are defined in my subject scheme are available for use in the profiling attributes menu as described in your tutorial videos https://www.oxygenxml.com/demo/DITA_Subject_Scheme.html

I've also tried copying the basemap.dtd into my plugin and modifying it and then running the integrator again. But this didn't make any difference.

Unfortunetely my new attribute isn't appearing in my profiling attributes. What do I have to do to make it appear there?

Thanks
Rich

p.s. Here is the boring part, the contents of my attribute specialization files:

com.example.specialization.generation / generationAttDomain.ent

Code: Select all


<!-- ================================================================================ -->
<!-- ATTRIBUTE EXTENSION ENTITY DECLARATIONS -->
<!-- ================================================================================ -->

<!ENTITY % generationAtt-d-attribute
"generation CDATA #IMPLIED">

<!-- ================================================================================ -->
<!-- DOMAIN ENTITY DECLARATION -->
<!-- ================================================================================ -->

<!ENTITY generationAtt-d-att
"a(props generation)">

<!-- ================================= End of file ================================== -->
com.example.specialization.generation / basemap.dtd

Code: Select all


....
<!-- ============================================================= -->
<!-- DOMAIN ATTRIBUTE DECLARATIONS -->
<!-- ============================================================= -->
<!ENTITY % generationAtt-d-dec
SYSTEM "generationAttDomain.ent"
>
%generationAtt-d-dec;
....

<!-- ============================================================= -->
<!-- DOMAIN ATTRIBUTE EXTENSIONS -->
<!-- ============================================================= -->
<!ENTITY % props-attribute-extensions
"%generationAtt-d-attribute;"
>
.....
<!-- ============================================================= -->
<!-- DOMAINS ATTRIBUTE OVERRIDE -->
<!-- ============================================================= -->
<!-- Must be declared ahead of the DTDs, which
puts @domains first in order -->

<!ENTITY included-domains
"&delay-d-att;
&mapgroup-d-att;
&indexing-d-att;
&hi-d-att;
&ut-d-att;
&hazard-d-att;
&generationAtt-d-att;">
com.example.specialization.generation / catalog-dita.xml

Code: Select all


<?xml version='1.0' encoding='UTF-8'?>
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public publicId="-//Example GmbH//ENTITIES DITA Generation Attribute Domain//EN" uri="dtd/generationAttDomain.ent" />
</catalog>
com.example.specialization.generation / integrator.xml

Code: Select all


<?xml version='1.0' encoding='UTF-8'?>
<project basedir="../.." default="all" name="com.example.specialization.generation">
<import file="${basedir}/integrator.xml" />
<target depends="integrate" name="all" />
</project>
com.example.specialization.generation / plugin.xml

Code: Select all


<?xml version='1.0' encoding='UTF-8'?>
<plugin id="org.dita.specialization.com.example.specialization.generation">
<feature extension="dita.specialization.catalog.relative" type="file" value="catalog-dita.xml" />
</plugin>
com.example.specialization.generation / subject_scheme.ditamap

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE subjectScheme PUBLIC "-//OASIS//DTD DITA Subject Scheme Map//EN" "subjectScheme.dtd">
<subjectScheme>
<subjectdef keys="generation.values">
<subjectdef keys="classic" />
<subjectdef keys="newgen" />
</subjectdef>
<enumerationdef>
<attributedef name="generation" />
<subjectdef keyref="generation.values" />
</enumerationdef>
</subjectScheme>
Radu
Posts: 9434
Joined: Fri Jul 09, 2004 5:18 pm

Re: Specialize props attribute and add to OxygenXML Profiling attributes

Post by Radu »

Hi Rich,

A couple of questions:

1) If you manually edit XML files which use that custom PUBLIC ID you have defined and use the Attributes view on a certain element, do you see that generation attribute you have added in the list of available attributes? If you insert that attribute on an element (you can also edit the XML in the Text editing mode) does Oxygen report validation problems?

2) I see you have a subject scheme map defined. Is it referenced in the main DITA Map? Is the main DITA Map opened in the main DITA Maps Manager view? How exactly is the subject scheme map referenced?

3) Are you using Oxygen with a specific CMS? If so, with which one?

4) What version of Oxygen are you using? Are you using the standalone Oxygen or the Eclipse plugin?

If you want you can also send us the plugin and some sample files (support@oxygenxml.com and we'll try to take a look at it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
RichH
Posts: 14
Joined: Mon Jun 15, 2015 1:02 pm

Re: Specialize props attribute and add to OxygenXML Profiling attributes

Post by RichH »

Hi Radu,

thanks for the quick reply. My answers are:

1. I can't see the new attribute anywhere. Niether in the profiling attributes dialogue in the map or on individual topic elements, nor in the list of attributes. There aren't any validation errors.

2. Yes, the LOCAL subject scheme is referenced in the dita map. The subject scheme from the plugin is not referenced. I am/was hoping that having the plugin would avoind referencing the plugin subject scheme. Yes, the MAP is open in the dita maps manager.

3. I use Oxygen with Git.

4. I am using the eclipse plugin : oXygen XML Editor and XSLT Debugger 17.1.0.v2015111718 com.oxygenxml.editor.feature.group Syncro Soft SRL

I'll send you some example files by email.

Thanks
Rich
Radu
Posts: 9434
Joined: Fri Jul 09, 2004 5:18 pm

Re: Specialize props attribute and add to OxygenXML Profiling attributes

Post by Radu »

Hi Rich,

Thanks for the samples.

So you used the "domain attribute specialization" generator from:

https://dita-generator-hrd.appspot.com/

to generate your DITA OT plugin.

That "domain attribute specialization" specialization in itself does nothing.
Let's focus on adding that profiling attribute for a DITA task type:

A DITA task usually has a DOCTYPE declaration like:

Code: Select all

<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
Once you start making changes to a DITA topic type, you need to create a shell and modify the public ID for it.

So the same online specialization generator has a shell DTD specialization builder. You should try to use that to generate a new shell for your task and at some point you'll be able to add a global attribute and you can add your "generation" attribute to it.
After the plugin is created, you can edit it's catalog-dita.xml and properly define a public ID for your task, something like:

Code: Select all

<public publicId="-//CUSTOM//DTD DITA CUSTOM DITA Task//EN" uri="dtd/taskShellName.dtd" />
Then modify all your DITA tasks to have the DOCTYPE declarations:

Code: Select all

<!DOCTYPE task PUBLIC "-//CUSTOM//DTD DITA CUSTOM DITA Task//EN" "task.dtd">
integrate the plugin in the DITA OT and validate the task. The "generation" attribute should appear in the attributes view for that specific type of edited tasks.
You should do something similar for your topics, maps and so on.
I will also send you separately the plugin I generated to test this via email.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
RichH
Posts: 14
Joined: Mon Jun 15, 2015 1:02 pm

Re: Specialize props attribute and add to OxygenXML Profiling attributes

Post by RichH »

Hi Radu,

thanks a lot for your time and detailed response. I'll give this a go and see how I get on.

best regards
Rich
Post Reply