Inserting a new Action

Post here questions and problems related to editing and publishing DITA content.
nagang
Posts: 37
Joined: Mon Jul 14, 2014 9:48 am

Inserting a new Action

Post by nagang »

Hi,

I wanted to add an xref action which support users to enter the URN.
I have checked how to add a new action in the framework. I have few doubts related to this:

1) How this new action will be shown in the list of elements allowed at that cursor position
2) I want this action to open a dialog box which will ask for the document and title and form a URN when user clicks on OK. How to do program this?

Regards,
Navaneetha
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Inserting a new Action

Post by alex_jitianu »

Hello,

1) From what I understand, you want this action to appear inside the content completion window, which appears when you press ENTER. Once you've configured an author action, you add it inside this menu as described inside topic: Customize Content Completion. This action will be presented only when its activation XPaths are valid in a given context.

2) You must create a custom AuthorOperation, just like it's described in topic Simple Use of a Dialog from an Author Operation. After that, you must create an author action that uses this new operation.

Best regards,
Alex
nagang
Posts: 37
Joined: Mon Jul 14, 2014 9:48 am

Re: Inserting a new Action

Post by nagang »

Hi,

We would like to restrict some "contextual menu items" like "inserting links" in metadata.
Can you please help me out in achieving this.

Thanks & Regards,
Navaneetha
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Inserting a new Action

Post by alex_jitianu »

Hello,

From what I understand you want these actions to be disabled in the context of a metadata element, right? And we are talking about author actions, correct? If an author action is not available in a given context then it will not be present in the contextual menu. You have to open the Action configuration dialog. Go to When this XPath expression is true text area. This XPath expression controls the context in which the action is available. To disable the action when the user is somewhere inside a metadata element you could give an expression like this (if we are talking about DITA):

Code: Select all

not(ancestor-or-self::*[contains(@class," topic/metadata ")])
If more operation modes are defined you should edit the XPath expression for each one of them.

Best regards,
Alex
Post Reply