Page 1 of 1

How to

Posted: Tue Apr 12, 2022 12:08 pm
by Vince
Hi,

I'm looking for a method to force my DITA extension additional framework as the highest priority (over DITA framework)

In my "dita_extension.framework", I already have highest priority.

Is it possible to prevent the user from changing the priority in "Options -> Preferences -> Document Type Association" page ?

Code: Select all

<field name="extensionPatch">
  <documentTypeDescriptorPatch>
    ...
    <poPatch>
      <field name="fieldPath">
	  <String>priority</String>
      </field>
      <field name="value">
         <Integer>5</Integer>
      </field>
      ...
    </poPatch>
    ...
    <field name="extendedPersistentObjectKey">
      <String>DITA</String>
    </field>
  </documentTypeDescriptorPatch>
</field>
Thx

Vince

Re: How to

Posted: Tue Apr 12, 2022 12:24 pm
by Vince
To clarify my needs

My framework is installed as an add-on.
User can't change priority of this kind of framework.
But, as he can change the DITA framework priority to the highest, my custom framework is no longer a priority.

I see that because my custom handler that extends "DITAExternalObjectInsertionHandler" is not use any more.

Thx

Re: How to

Posted: Tue Apr 12, 2022 12:38 pm
by Radu
Hi,
I understand, we do not have a specific setting to prohibit this. Then end user is in full control in the end, they can also disable your add-on for example as it's their Oxygen installation and they can override the settings your add-on contributed.

Regards,
Radu

Re: How to

Posted: Tue Apr 12, 2022 9:31 pm
by Vince
Ok, thank you for that answer.

And can we access frameworks priority from a plugin ? for example to display a warn to user if priority is not good

Regards,
Vincent

Re: How to

Posted: Wed Apr 13, 2022 7:18 am
by Radu
Hi Vince,

If for example you add an editor changed listener:

Code: Select all

 pluginWorkspaceAccess.addEditorChangeListener(new WSEditorChangeListener() {
        @Override
        public void editorOpened(URL editorLocation) {
          WSEditor editor = pluginWorkspaceAccess.getEditorAccess(editorLocation, StandalonePluginWorkspace.MAIN_EDITING_AREA);
you have API to access the document type info "editor.getDocumentTypeInformation()".

Regards,
Radu