Status attribute specialization

Post here questions and problems related to editing and publishing DITA content.
NicoAMP
Posts: 97
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Status attribute specialization

Post by NicoAMP »

Hi,

I would like to manage a "draft" status on topics to have the possibility to filter its.

So, I would like to add a new enumeration value to the @status attribute: "draft".
I tried to do that with a subject scheme map, but I have the following message (with or without subject scheme map):
Attribute "status" with value "draft" must have a value from the list "changed deleted new unchanged -dita-use-conref-target ".

Code: Select all

<subjectScheme>
    <subjectdef keys="status.values">
        <subjectdef keys="draft" />
        <subjectdef keys="new" />
        <subjectdef keys="test" />
    </subjectdef>
    <enumerationdef>
        <attributedef name="status"/>
        <subjectdef keyref="status.values"/>
    </enumerationdef>
</subjectScheme>

How can I add a new value allowed in @status attribute?
Is it possible to do that with a specialization? If yes, how can I do that?

Thanks.
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Status attribute specialization

Post by Radu »

Hi,

This seems to be working for me.
So in the main DITA Map I add a reference to the subject scheme map:

Code: Select all

<topicref href="productSbjSchemeVals.ditamap" format="ditamap" type="subjectScheme"/>
The "productSbjSchemeVals.ditamap" contains your sample content:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE subjectScheme PUBLIC "-//OASIS//DTD DITA Subject Scheme Map//EN" "map.dtd"> 
<subjectScheme>
    <subjectdef keys="status.values">
        <subjectdef keys="draft" />
        <subjectdef keys="new" />
        <subjectdef keys="test" />
    </subjectdef>
    <enumerationdef>
        <attributedef name="status"/>
        <subjectdef keyref="status.values"/>
    </enumerationdef>
</subjectScheme>[code]

Then I open the main DITA Map in the Oxygen DITA Maps Manager view and I set the "Root map/Context" combo box to "Current Map".
Then I open a DITA topic, insert a paragraph and in the Attributes view look at the values for the "status" attribute. They are the ones you have set in the subject scheme map.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
NicoAMP
Posts: 97
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Re: Status attribute specialization

Post by NicoAMP »

Hi Radu,

Thanks for your answer.

It seems that @status attribute is not designed for filtering or flagging (https://www.oxygenxml.com/dita/1.3/spec ... attributes) .
So I specialized @props to create a @draft attribute. All is OK now.

I have another question.
I use this @draft attribute on topics root element. In CSS I test if @draft=yes to display a banner "DRAFT" at the top of the document.
But I would like to highlight topics that have @draft=yes in Dita map manager. For the moment Ditamap manger only reflect filtering attributes present on topicref, not those on topics referenced by a topicref.

Is it possible in the Dita map manager to highlight topicref that referenced topic with my @draft attribute?

Thanks.

Regards,
Nicolas
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Status attribute specialization

Post by Radu »

Hi Nicolas,

We do not have a setting to show the value of the "draft" attribute in the DITA Maps Manager.
An Oxygen plugin has API which allows it to control what's displayed in the DITA Maps Manager view, there is a sample javascript-based plugin which does something similar here:
https://github.com/oxygenxml/wsaccess-j ... esAndIcons

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply