Support multiple profiling attribute values

Post here questions and problems related to editing and publishing DITA content.
FrankDLT
Posts: 17
Joined: Tue Jul 12, 2022 10:17 pm

Support multiple profiling attribute values

Post by FrankDLT »

Hi All,
As per my project requirement we need to support multiple profiling attribute values,like below "condition-audience"
etc.... but it will giving below error,
Attribute "condition-audience" with value "administrator User" must have a value from the list
"administrator api_manager application_developer external gateway_manager internal metadata_admin report_builder user ".
<p condition-audience="administrator User" audience="expert novice"></p>
but same is working for "audience" i believe it is default attribute values
please help me how to solve this issue.
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Support multiple profiling attribute values

Post by Radu »

Hi,

Someone else probably from the same company as yours sent us this same request a couple of days ago.
Attaching below the reply I gave them:

The "condition-audience" attribute does not exist in the base DITA standard. So I assume someone customized the DITA DTDs or schemas and added an extra profiling attribute specific for your project. I think you should get in touch with that person because they might have specified in the DTDs that the attribute allows a choice between a fixed set of values instead of specifying that the attribute can have multiple values set to it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Re: Support multiple profiling attribute values

Post by vishwavaranasi »

Thanks Radu ,
we really wanted to know how can we define the multiple values
We have our .ditval
<!-- Audience -->
<prop action="include" att="condition-audience" val="administrator"/>
<prop action="include" att="condition-audience" val="api_manager"/>
<prop action="include" att="condition-audience" val="application_developer"/>
<prop action="include" att="condition-audience" val="external"/>
<prop action="include" att="condition-audience" val="gateway_manager"/>
<prop action="include" att="condition-audience" val="internal"/>
<prop action="include" att="condition-audience" val="metadata_admin"/>
<prop action="include" att="condition-audience" val="report_builder"/>
<prop action="include" att="condition-audience" val="user"/>

and .mod file defined for this profile attribute as
condition-audience
(administrator | api_manager | application_developer | external | gateway_manager | internal | metadata_admin | report_builder | user)
#IMPLIED

and .ent file defined as
<!ENTITY % condition-audience-d-attribute
"condition-audience
CDATA
#IMPLIED
"
>

<!ENTITY condition-audience-d-att
"a(props condition-audience)"
>

we were try defining the multiple values in .ditval as below , where the multiple values given with a space
<prop action="include" att="condition-audience" val="administrator user"/>

but this didn't worked.

would you please help us here how and where to define the multiple values for the profiling attributes?

Thanks,
Vishwa
Thanks,
vishwa
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Support multiple profiling attribute values

Post by Radu »

Hi Vishwa,

If you want an XML element like this to be valid when editing:

Code: Select all

<p condition-audience="administrator user">some text </p>
you will probably need to modify the .mod file from this:

Code: Select all

condition-audience
(administrator | api_manager | application_developer | external | gateway_manager | internal | metadata_admin | report_builder | user)
#IMPLIED
to this:

Code: Select all

condition-audience
CDATA
#IMPLIED
so that the DTDs allow any value of the condition-audience value instead of allowing only a choice from a list of values.

About the DITAVAL filter file, it is illegal to place two values in the @val attribute.
https://www.oxygenxml.com/dita/1.3/spec ... attributes

So this:

Code: Select all

<prop action="include" att="condition-audience" val="administrator user"/>
would probably need to be replaced with this:

Code: Select all

<prop action="include" att="condition-audience" val="administrator"/>

Code: Select all

<prop action="include" att="condition-audience" val="user"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Re: Support multiple profiling attribute values

Post by vishwavaranasi »

Thanks Radu , we did changed the .mod file , but inside a topic when i try to add profiling attributes , the value drop down is empty
image.png
image.png (16.55 KiB) Viewed 1228 times
manually when we write like this , it's not giving errors so far
<p condition-audience="administrator user"></p>
Thanks,
vishwa
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Re: Support multiple profiling attribute values

Post by vishwavaranasi »

We are expecting something that from standard DITA as below
image.png
image.png (5.38 KiB) Viewed 1226 times
should work for our custom profile attributes.
Thanks,
vishwa
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Support multiple profiling attribute values

Post by Radu »

Hi,
Once you make the DTD more flexible by allowing any value in the attribute, you need to start defining the profiling attribute values somewhere else, either in the Oxygen Preferences:
https://www.oxygenxml.com/doc/versions/ ... ement.html
or in a Subject Scheme map if you have one referenced in your main DITA Map:
https://www.oxygenxml.com/doc/versions/ ... e-map.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Re: Support multiple profiling attribute values

Post by vishwavaranasi »

Thanks Radu ,
We have tried defining Creating and Editing Profiling Attributes using Windows -preferences by selecting our custom DITA framework.
image.png
image.png (45.77 KiB) Viewed 1177 times
we were looking our .framework file whether this new Profiling Attributes got saved or not , but it looks these newly added ones are not saved there?

any idea like where this will go and save?

Thanks,
vishwa
Thanks,
vishwa
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Support multiple profiling attribute values

Post by Radu »

Hi,

Oxygen Preference pages like "Profiling/Conditional Text > Attributes and Condition Sets" cannot be saved at framework level. They can be saved and shared at project level if for example you want to create an Oxygen project and have all your users share it:
https://www.oxygenxml.com/doc/versions/ ... g-projects
What type of version control system are you using?

Have you considered the alternative I gave you of declaring the attribute values in a subject scheme map? Can you tell me why this would not work for your project?

About saving a fixed set of proposed values for an attribute at framework level:
Have you customized the DITA framework configuration in any way?
There is a content completion configuration file in the DITA framework which can be used to define specific values for certain attributes:
https://www.oxygenxml.com/doc/ug-editor ... osals.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Re: Support multiple profiling attribute values

Post by vishwavaranasi »

Hi Radu ,
for considering subject scheme map option , since we have lot of pubs already , all those pub root maps has to be edited to include the
<topicref href="test.ditamap" format="ditamap" type="subjectScheme"/> so we are thinking instead of the change for everyone ,
we wanted to consider the below option , since we have already our custom DITA and DITA map frameworks.
There is a content completion configuration file in the DITA framework which can be used to define specific values for certain attributes:
https://www.oxygenxml.com/doc/ug-editor ... osals.html

or else
if we wanted to consider the creating .xpr oxygen project , we were thinking how can we deliver this ? can we deliver this using updatesite.xml as we do install plugins and farmeworks?
Thanks,
vishwa
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Support multiple profiling attribute values

Post by Radu »

Hi,

Out of curiosity I have a question, why did you define this extra DITA profiling attribute? Why not rely directly on the DITA audience attribute for example?

Your initial approach of defining the profiling values directly in the DTD had the additional benefit of providing validation for values, for example using the DTDs for validation Oxygen would report cases like this "<p condition-audience="some-invalid-value"" as invalid.
If you would use a Subject Scheme map to define the values, Oxygen would use it also for validation, so you would get an equivalent behavior when validating the content.
But for all other alternatives to define possible values for the attribute (cc_config.xml, preferences page), you do not get such validation out of the box, you would need to create additional Schematron validation rules in your framework.

Coming back to your remarks:
we wanted to consider the below option , since we have already our custom DITA and DITA map frameworks.
There is a content completion configuration file in the DITA framework which can be used to define specific values for certain attributes:
https://www.oxygenxml.com/doc/ug-editor ... osals.html
Yes, this setting can be delivered with a DITA framework customization so it would seem to fit better with your current editing environment.
or else
if we wanted to consider the creating .xpr oxygen project , we were thinking how can we deliver this ? can we deliver this using updatesite.xml as we do install plugins and farmeworks?
Two possibilities:
1) We are using for example Git projects to collaborate on our DITA content, we have the userguide.xpr project file directly in the Git repository:
https://github.com/oxygenxml/userguide/ ... rguide.xpr
and all users need to open it in their Oxygen Project view. The userguide.xpr contains various settings saved at project level.
How do you store your documents? Are you using a content management system of sorts? Or are you also using Git or Subversion repositories?
2) It's possible for an Oxygen plugin to impose a fixed set of options when Oxygen starts. In this sample plugin for example:
https://github.com/oxygenxml/wsaccess-j ... se-options
The plugin has an "options.xml" which is imposed to Oxygen when it starts.
You can create such an "options.xml" from Oxygen by going for example to the main menu "Options->Export Global Options".
Once you have such a plugin, you can create an Oxygen add-on for it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
vishwavaranasi
Posts: 144
Joined: Fri Feb 28, 2020 4:02 pm

Re: Support multiple profiling attribute values

Post by vishwavaranasi »

Thanks a ton Radu.
We are evaluating the options you have provided us , we will get back as soon as if we have any more questions.
Thanks,
vishwa
Post Reply