Add items to outputclass list

Oxygen general issues.
pault
Posts: 70
Joined: Thu Mar 21, 2013 12:55 am

Add items to outputclass list

Post by pault »

In the values for the outputclass attribute, there are list of languages for syntax highlighting, like language-java. I would like replace them with our values (as we implemented syntax highlighting awhile back). Additionally, I'd like to add a couple of others for other element types, such as <p> and <row>. What's the best way to go about this? I am using XML Editor 15.2.

Thanks,

Paul
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Add items to outputclass list

Post by Radu »

Hi Paul,

My suggestion for you is to create a Subject Scheme Map with content like:

Code: Select all

<!DOCTYPE subjectScheme PUBLIC "-//OASIS//DTD DITA Subject Scheme Map//EN" "map.dtd"> 
<subjectScheme>
<subjectHead>
<subjectHeadMeta>
<navtitle></navtitle>
</subjectHeadMeta>
</subjectHead>
<hasInstance>
<subjectdef keys="outputClassSbjKey">
<subjectdef keys="JAVA">
<topicmeta>
<navtitle>JAVA LANGUAGE</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keys="XML">
<topicmeta>
<navtitle>XML LANGUAGE</navtitle>
</topicmeta>
</subjectdef>
</subjectdef>
</hasInstance>
<enumerationdef>
<attributedef name="outputclass"/>
<subjectdef keyref="outputClassSbjKey"/>
</enumerationdef>
</subjectScheme>
and to link to it from the DITA Map like:

Code: Select all

<topicref href="productSbjSchemeVals.ditamap" format="ditamap" type="subjectScheme"/>
Basically you can use the Subject Scheme Map to impose allowed sets of values for any attribute name or to reject completely a certain attribute from being used:

http://www.oxygenxml.com/demo/DITA_Subject_Scheme.html

http://www.oxygenxml.com/doc/ug-oxygen/ ... e-map.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
pault
Posts: 70
Joined: Thu Mar 21, 2013 12:55 am

Re: Add items to outputclass list

Post by pault »

Thanks Radu!
pault
Posts: 70
Joined: Thu Mar 21, 2013 12:55 am

Re: Add items to outputclass list

Post by pault »

Hi Radu,

Is there a way to remove some of the existing outputclass values from being displayed? For example, I'd like to remove language-bourne, language-xml, and language-ini.

Thanks,

Paul
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Add items to outputclass list

Post by Radu »

Hi Paul,

That list of default values Oxygen proposes for the @outputclass attribute of a DITA codeblock is given by a special Java extension we have for DITA called ro.sync.ecss.extensions.dita.DITASchemaManagerFilter.
I think that the easiest thing to do for you would be to take control over the displayed list of values by defining values for @outputclass in the Subject Scheme Map.
Or if you are comfortable with Java you could try to overwrite that Java extension and make changes to it, I could give you more details if you are interested in this approach.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
pault
Posts: 70
Joined: Thu Mar 21, 2013 12:55 am

Re: Add items to outputclass list

Post by pault »

Hi Radu,

I tried using the Subject Scheme Map from what I saw in the demo, but I just got errors. For example:

Code: Select all


<enumerationdef>
<attributedef name="language-bourne"/>
<subjectdef/>
</enumerationdef>
Paul
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Add items to outputclass list

Post by Radu »

Hi Paul,

The @name attribute of an <attributedef> element states the name of the DITA attribute for which a set of values will be provided. So you cannot remove specific existing allowed values for an attribute but you can specify the entire set of allowed attributes like:

Code: Select all

<!DOCTYPE subjectScheme PUBLIC "-//OASIS//DTD DITA Subject Scheme Map//EN" "map.dtd"> 
<subjectScheme>
<subjectHead>
<subjectHeadMeta>
<navtitle>Controlled Values list</navtitle>
</subjectHeadMeta>
</subjectHead>
<hasInstance>
<!-- ALLOWED VALUES FOR CODEBLOCK -->
<subjectdef keys="outputSbjKey">
<subjectdef keys="language-php">
<topicmeta>
<navtitle>PHP</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keys="language-css">
<topicmeta>
<navtitle>CSS</navtitle>
</topicmeta>
</subjectdef>
<subjectdef keys="language-ruby">
<topicmeta>
<navtitle>Ruby</navtitle>
</topicmeta>
</subjectdef>
</subjectdef>
</hasInstance>
<enumerationdef>
<elementdef name="codeblock"/>
<attributedef name="outputclass"/>
<subjectdef keyref="outputSbjKey"/>
</enumerationdef>
</subjectScheme>
Unfortunately the Java extension which gives those hard coded imposed values for codeblock does not seem to be overwritten by the subject scheme imposed values, so when editing the attribute values you will still received the hard coded values. I will add an issue on our side and we'll look into it.

But at least if you use the subject scheme map users will receive errors if in the edited DITA topics they try to use a value for @outputclass which is not allowed by the subject scheme map.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
pault
Posts: 70
Joined: Thu Mar 21, 2013 12:55 am

Re: Add items to outputclass list

Post by pault »

Thanks Radu.
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Add items to outputclass list

Post by Radu »

Hi,

Just to update the thread, this issue is fixed in Oxygen 16.1:
Unfortunately the Java extension which gives those hard coded imposed values for codeblock does not seem to be overwritten by the subject scheme imposed values, so when editing the attribute values you will still received the hard coded values. I will add an issue on our side and we'll look into it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
im_rem
Posts: 20
Joined: Tue Jun 14, 2022 1:08 pm

Re: Add items to outputclass list

Post by im_rem »

Hello,

I must add different outputclasses for tables but also need to keep the code highlighting outputclasses for the codeblocks. Is there a switch to include outputclasses from both subjectscheme and ro.sync.ecss.extensions.dita.DITASchemaManagerFilter? This would be very useful, because otherwise our authors do not know that those table outputclasses and corresponding css stylings exist. Or they forget the outputclass names later. So they do not use it at all.
If there is no switch, where do I find the files for ro.sync.ecss.extensions.dita.DITASchemaManagerFilter? Windows Explorer returned no search results in the Oxygen installation folder. An online search only returned the code documentation:
https://www.oxygenxml.com/InstData/Edit ... od.summary

Kind regards
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Add items to outputclass list

Post by Radu »

Hi,

The Subject scheme map has a feature which allows you to control for a certain DITA element the set of proposed values:
https://www.oxygenxml.com/doc/ug-editor ... e-map.html
something like:

Code: Select all

<enumerationdef>
    <elementdef name="table"/>
    <attributedef name="outputclass"/>
    <subjectdef keyref="tableOutputClassValuesKey"/>
  </enumerationdef>
so that you can focus exactly on the element name for which you want to propose the values.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
im_rem
Posts: 20
Joined: Tue Jun 14, 2022 1:08 pm

Re: Add items to outputclass list

Post by im_rem »

Oh, sorry. I completely missed that option. Thank you.
horisonten
Posts: 16
Joined: Thu Nov 30, 2023 12:45 pm

Re: Add items to outputclass list

Post by horisonten »

What if I would like to also allow "undefined" outputclasses? For example if I add a video it gets "video" as its outputclass. But if I don't have any special styling needs for it in my CSS I also wouldn't need to specify it in my custom outputclass dropdown as an alternative. But if I don't specify "video" in my subject scheme the validation complains.

It seems as if setting defaultSubject to none works. But is this best practice or how would I accheive it correctly?

<enumerationdef>
<elementdef name="image"></elementdef>
<attributedef name="outputclass"/>
<subjectdef keyref="outputClassImageKeys"/>
<defaultSubject keyref=""/>
</enumerationdef>
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: Add items to outputclass list

Post by Radu »

Hi,
Oxygen uses the specified controlled values specified in the Subject Scheme map to also validate the attribute values in the XML document.
I tested working with a subject scheme map which looks like this:

Code: Select all

<!DOCTYPE subjectScheme PUBLIC "-//OASIS//DTD DITA Subject Scheme Map//EN" "map.dtd"> 
<subjectScheme>
    <hasInstance>
        <subjectdef keys="audienceSbjKey">
            <subjectdef keys="Technician">
                <topicmeta>
                    <navtitle>Technician</navtitle>
                </topicmeta>
            </subjectdef>
            <subjectdef keys="BasicUser">
                <topicmeta>
                    <navtitle>Basic User</navtitle>
                </topicmeta>
            </subjectdef>
        </subjectdef>
    </hasInstance>
    <enumerationdef>
        <elementdef name="table"/>
        <attributedef name="outputclass"/>
        <subjectdef keyref="audienceSbjKey"/>
        <defaultSubject keyref=""/>
    </enumerationdef>
</subjectScheme>
and for me Oxygen still seems to validate the @outputclass attribute for the <table> element and report an error if it's value is something different than Technician or Basic User.
That's the entire point of Subject Scheme maps, to impose a certain set of allowed values for an attribute, and Oxygen uses this information to propose these values when editing and it also validates the document based on these imposed values.
If you are only interested in proposing attribute values when editing maybe you can do this with a framework customization instead:
https://www.oxygenxml.com/doc/versions/ ... osals.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
horisonten
Posts: 16
Joined: Thu Nov 30, 2023 12:45 pm

Re: Add items to outputclass list

Post by horisonten »

Radu wrote: Mon Mar 04, 2024 12:41 pm If you are only interested in proposing attribute values when editing maybe you can do this with a framework customization instead:
https://www.oxygenxml.com/doc/versions/ ... osals.html
Regards,
Radu
This was what I was after! Thanks for pointing me in the right direction.
Post Reply