Content Completion Assistant - Remove convert ol/ul to p option

dex.cook
Posts: 7

Content Completion Assistant - Remove convert ol/ul to p option

Tue May 16, 2017 5:09 pm

My team recently upgraded to Oxygen v19 and some of my teammates have mentioned that the new 'Convert ol/ul to p' option is confusing and interrupting the workflow they are used to. While I can understand the usefulness of the option, they are used to inserting multiple empty <li> elements and then filling them in with content. I have looked through the framework preferences related to Content Completion, but I didn't see this operation listed with the others.

Is there a simple way to remove this from the list of options or make it so it is not the default in the Content Completion Assistant?
sorin_carbunaru
Site Admin
Posts: 111

Re: Content Completion Assistant - Remove convert ol/ul to p option

Wed May 17, 2017 10:46 am

Hello,

Thank you for sending us feedback on this new action!

Unfortunately for you, the 'Convert li to p' action cannot be removed from the Content Completion framework preferences. I did think of a possible solution to remove it, but it implies using a little bit of our Java API, and it would also remove the list items promotion and demotion shortcuts (read more at https://www.oxygenxml.com/doc/versions/ ... item_nodes), and you might not want that. Let me know if you would be interested in such a solution...

On the other hand, I added an issue on our side to analyze your feedback (EXM-39489 - for reference purposes).

All the best,
Sorin Carbunaru
oXygen XML
dex.cook
Posts: 7

Re: Content Completion Assistant - Remove convert ol/ul to p option

Wed May 17, 2017 3:35 pm

Hi Sorin,

Thanks for looking into the issue. I am interested to see your possible fix even though it has side effects.
sorin_carbunaru
Site Admin
Posts: 111

Re: Content Completion Assistant - Remove convert ol/ul to p option

Wed May 17, 2017 5:04 pm

The possible fix is a custom AuthorActionEventHandler that returns a null list of content completions actions.

Code: Select all

public class EnterHandler extends AuthorActionEventHandlerBase {

  /**
   * @see ro.sync.ecss.extensions.api.AuthorActionEventHandler#handleEvent(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.AuthorActionEventHandler.AuthorActionEventType)
   */
  @Override
  public boolean handleEvent(AuthorAccess authorAccess, AuthorActionEventType eventType) {
    return false;
  }

  /**
   * @see ro.sync.ecss.extensions.api.AuthorActionEventHandler#canHandleEvent(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.AuthorActionEventHandler.AuthorActionEventType)
   */
  @Override
  public boolean canHandleEvent(AuthorAccess authorAccess, AuthorActionEventType eventType) {
    return false;
  }

  /**
   * @see ro.sync.ecss.extensions.api.Extension#getDescription()
   */
  @Override
  public String getDescription() {
    return null;
  }
 
  /**
   * @see ro.sync.ecss.extensions.api.AuthorActionEventHandlerBase#getContentCompletionActions(ro.sync.ecss.extensions.api.AuthorAccess, int)
   */
  @Override
  public List<IAuthorExtensionAction> getContentCompletionActions(AuthorAccess authorAccess,
      int caretOffset) {
    return null;
  }
}


I already implemented this and exported it as a JAR. You can find it at http://www.oxygenxml.com/userFiles/1417170517085722.zip. Add the JAR in the classpath of your framework (Options -> Preferences -> Document Type Associations -> [Your framework] -> Classpath tab), then choose your class as an individual extension point (Extensions tab -> Author action event handler -> Choose).
dex.cook
Posts: 7

Re: Content Completion Assistant - Remove convert ol/ul to p option

Thu May 18, 2017 4:44 pm

I wasn't able to get Oxygen to see the extension. Here are the steps I took:


1. Extracted the JAR to ${frameworks}\dita\resources.
2. Verified the resources directory is on the classpath (DITA Document Type window/Classpath tab).
3. On the Extensions tab, clicked the Author action event handler Choose button.
Zero classes are found.
sorin_carbunaru
Site Admin
Posts: 111

Re: Content Completion Assistant - Remove convert ol/ul to p option

Fri May 19, 2017 9:16 am

Hello,

You should reference the JAR directly, not the parent folder. Try it this way and it should work.
dex.cook
Posts: 7

Re: Content Completion Assistant - Remove convert ol/ul to p option

Fri May 19, 2017 3:18 pm

Thanks, Sorin. It's working now.
sorin_carbunaru
Site Admin
Posts: 111

Re: Content Completion Assistant - Remove convert ol/ul to p option

Thu Jun 08, 2017 11:06 am

Hello,

I don't remember what made me think that you cannot remove the list to paragraph conversion items from the content completion window, but actually you can do that. See image below.
Image

This would be the preferred way, as my last suggestion had some side-effects.

Best regards,
Sorin Carbunaru

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 1 guest