Page 1 of 1

Status attribute specialization

Posted: Thu Oct 22, 2020 4:28 pm
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.

Re: Status attribute specialization

Posted: Fri Oct 23, 2020 9:39 am
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

Re: Status attribute specialization

Posted: Thu Nov 26, 2020 5:20 pm
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

Re: Status attribute specialization

Posted: Thu Nov 26, 2020 5:50 pm
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