Profiling attributes definitions and completion assistant

Post here questions and problems related to editing and publishing DITA content.
cg.tw75
Posts: 14
Joined: Tue Jun 30, 2015 3:43 pm

Profiling attributes definitions and completion assistant

Post by cg.tw75 »

Hello,
Working on profiling attributes definitions, I am a bit confused about the interaction between the completion assistant (in Text mode), subject scheme maps and the Preferences dialog box. I am using Oxygen 17.1.

On this page, the user manual for Oxygen 17.1 says:
The displayed dialog box shows all profiling attributes and their values, as defined in the framework (document type) of the edited content.
This sentence is not clear to me.

On this page, the user manual for Oxygen 18 says:
  • If your root DITA map references a DITA subject scheme map that defines values for the profiling attributes, those values are used. [...]
  • If your project defines project-level configuration values for the profiling attributes, those values are used.
  • If Oxygen XML Author defines global-level configuration values for the profiling attributes, they are used.
  • Otherwise, a basic default set of profiling attributes and values are available.
Both quotes refer to the Edit Profiling Attributes dialog box in Author mode, but I assume that the completion assistant in Text mode works in the same way.
  • In my project, if I have no subject scheme map and define the values for the product attribute in the Preferences dialog box (locally, i.e. in the project's xpr), the completion assistant works.
  • In the Oxygen user manual project, the values for product are defined in a file called productSbjSchemeVals.ditamap, and this file is referenced in UserManual.ditamap by <mapref href="productSbjSchemeVals.ditamap" type="subjectScheme" toc="no"/>, which is a child of the <frontmatter> element. I also see that these definitions have been imported into the Preferences dialog box.
    • When I try to insert the product attribute in a file of the Oxygen project, the completion assistant proposes the correct values, and it looks to me like the values come from the subject scheme map (because productSbjKey is displayed next to the values).
    • If I remove the definitions in the Preferences dialog box, the completion assistant still works.
  • In the mobile phone sample project, the ditamap calls the attribute values via <topicref href="productSbjSchemeVals.ditamap" format="ditamap" type="subjectScheme"/>. The attributes values have also been imported into the Preferences dialog box. If I delete them, the completion assistant no longer works, even if the map still references the subject scheme map.
  • In the sample it-book project, if I try to do the same as in the Oxygen user manual project I get something else.
    1. I made a copy of the sample it-book project.
    2. In the Preferences dialog box, I made the profiling attributes local to the project and deleted all of them (so that the project knows no profiling attribute definitions at all).
    3. I copied the productSbjSchemeVals.ditamap file in the same folder as the taskbook ditamap.
    4. I inserted <mapref href="productSbjSchemeVals.ditamap" type="subjectScheme" toc="no"/> in the taskbook ditamap, just after <frontmatter>, exactly as it is done in the Oxygen user manual project. The completion assistant didn't work.
    5. I added a ditaval file to the project that contained <prop action="exclude" att="product" val="developer" /> and imported it into the Preferences dialog box. The completion assistant proposed the value developer.
    6. I removed the definition from the Preferences dialog box: the completion assistant no longer worked.
Can you clarify how the completion assistant works? Is the behaviour the same in Oxygen 17.1 and Oxygen 18?
Thank you for your help,
C.
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Profiling attributes definitions and completion assistant

Post by Radu »

Hi,

Please see some answers below:
On this page, the user manual for Oxygen 17.1 says:
...........
On this page, the user manual for Oxygen 18 says:
............
The second link explains better the order in which Oxygen looks in order to compute displayed possible attribute values.
This order is identical in 17.1 and 18.0
Both quotes refer to the Edit Profiling Attributes dialog box in Author mode, but I assume that the completion assistant in Text mode works in the same way.
Yes, the same should apply when editing attributes either in the Attributes view (Text/Author) or when directly editing attribute values in the Text editing mode.
In my project, if I have no subject scheme map and define the values for the product attribute in the Preferences dialog box (locally, i.e. in the project's xpr), the completion assistant works.
Ok.
In the Oxygen user manual project, the values for product are defined in a file called productSbjSchemeVals.ditamap, and this file is referenced in UserManual.ditamap by <mapref href="productSbjSchemeVals.ditamap" type="subjectScheme" toc="no"/>, which is a child of the <frontmatter> element. I also see that these definitions have been imported into the Preferences dialog box.
Yes. The values are specified both in the Subject Scheme map and in the Preferences page (which is saved at project level options). In this case the Subject Scheme map always wins. I forgot why we specified the values also in the Profiling preferences page, it was done probably before Subject Scheme maps started to be also used by Oxygen.
When I try to insert the product attribute in a file of the Oxygen project, the completion assistant proposes the correct values, and it looks to me like the values come from the subject scheme map (because productSbjKey is displayed next to the values).
If I remove the definitions in the Preferences dialog box, the completion assistant still works.
Right, Subject Scheme map assigned values are the most important ones and they take precedence over preferences.
In the mobile phone sample project, the ditamap calls the attribute values via <topicref href="productSbjSchemeVals.ditamap" format="ditamap" type="subjectScheme"/>. The attributes values have also been imported into the Preferences dialog box. If I delete them, the completion assistant no longer works, even if the map still references the subject scheme map.
The behavior should be the same like in the case of the user manual. One thing you should note, in order for Oxygen to obtain values from the Subject Scheme map, in the DITA Maps Manager view the "Root Map" setting must point to the DITA Map which is the main DITA Map of the project. by default the Root Map points to the current selected DITA Map in the DITA Maps Manager view. So this is something you should double check.
In the sample it-book project, if I try to do the same as in the Oxygen user manual project I get something else.
.............
Again, you need to double check that you have opened in the DITA Maps Manager the main DITA Map (the one which includes the subject scheme map).

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
cg.tw75
Posts: 14
Joined: Tue Jun 30, 2015 3:43 pm

Re: Profiling attributes definitions and completion assistant

Post by cg.tw75 »

Hi Radu,
Thank you so much for your quick reply! Indeed it works when I open the ditamap in the DITA Maps Manager (or define it as the root map).
I don't know whether the user manual mentions this somewhere, but I think it would be useful if you added the information to the topic I quoted.

Having no completion assistant made me think that maybe my subject scheme map was wrong.

So, if I use a subject scheme map, is there any point at all in using the Preferences dialog box?
The same question applies to ditaval files. Is there any point in defining condition sets in Oxygen if you use ditaval files?

C.
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Profiling attributes definitions and completion assistant

Post by Radu »

Hi,

So:
Thank you so much for your quick reply! Indeed it works when I open the ditamap in the DITA Maps Manager (or define it as the root map).
I don't know whether the user manual mentions this somewhere, but I think it would be useful if you added the information to the topic I quoted.
I already added a documentation task with your suggestions on it.
So, if I use a subject scheme map, is there any point at all in using the Preferences dialog box?
The same question applies to ditaval files. Is there any point in defining condition sets in Oxygen if you use ditaval files
The utility of the Editor / Edit Modes / Author / Profiling/Conditional Text/b] preferences page still resides in the second table, the one which can be used to define profiling condition sets. A profiling condition set can be defined over an existing DITAVAL. Once you define the profiling condition sets and you have DITA Maps and topics opened, there is a funnel-shaped toolbar button which can be used to apply a certain profiling condition set which will fade out the elements which are filtered out by the profiling condition set.

https://www.oxygenxml.com/xml_author/di ... _text.html

Otherwise, a specified Subject Scheme map completely covers the need for the first table in the same preferences page, the table which defines profiling attributes and possible values.
Also the Subject Scheme map is better because:

1) Oxygen will automatically show validation errors when you set on an element by mistake a value not covered by the subject scheme enumeration.
2) Using the Subject Scheme Map you can also say that for a certain attribute no values are allowed, thus prohibiting completely setting values to certain attributes.
3) The Subject Scheme map can define an enumeration of values for a specific attribute which appears on a specific element. So for example for the @outputclass attribute set on a <codeblock> it can define a set of values but if @outputclass appears on a <p> element it can have another set of allowed values.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
cg.tw75
Posts: 14
Joined: Tue Jun 30, 2015 3:43 pm

Re: Profiling attributes definitions and completion assistant

Post by cg.tw75 »

Hello again,
Radu wrote:I already added a documentation task with your suggestions on it.
Thank you for this!

I realise that this is a bit off-topic as it concerns the OT rather than Oxygen, but I've discovered something strange. If my subject scheme map is not in the same directory as my ditamap, my output is all messed up (the series of folders that contains my images is created on the wrong level and all the links to my images are broken). Maybe I am wrong, but I think it's a bug: I should be able to store my subject scheme map where I want (e.g. in a Profiling folder that also contains my ditaval files, so that my project is clean).

This concerns the OT rather than Oxygen as the behaviour is the same when I run the transformation in command line using a 2.0.1 OT I downloaded from the internet.
I did a quick google search and found nothing about this, only an old topic on this forum concerning the PDF transformation - apparently the bug has been fixed. I saw no bug referenced on github either. I don't recall seeing any info in Oxygen's documentation about the subject scheme map needing to be in the same folder as the ditamap.

So, is this a known issue? Is it me misunderstanding something again? Is there a workaround?
C.
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Profiling attributes definitions and completion assistant

Post by Radu »

Hi,

The DITA OT has always had publishing problems when there are references to resources outside of the folder where the main DITA Map is located:

https://www.oxygenxml.com/doc/versions/ ... -refs.html

I think this is your case as well.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
cg.tw75
Posts: 14
Joined: Tue Jun 30, 2015 3:43 pm

Re: Profiling attributes definitions and completion assistant

Post by cg.tw75 »

Great, it works! I knew this option existed but for some reason I didn't realise it would solve my problem.
Like someone said in the comments of the help topic, thank you Oxygen for providing a fix! (I still hope the OT improves on that point, though.)
And thank you again for all your help, Radu.
Regards,
C.
Post Reply