Inserting a new Action

nagang
Posts: 34
Joined: Mon Jul 14, 2014 9:48 am

Inserting a new Action

Post by nagang » Mon Jul 28, 2014 12:31 pm

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: 770
Joined: Wed Nov 16, 2005 11:11 am

Re: Inserting a new Action

Post by alex_jitianu » Mon Jul 28, 2014 5:15 pm

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: 34
Joined: Mon Jul 14, 2014 9:48 am

Re: Inserting a new Action

Post by nagang » Mon Jan 05, 2015 10:11 am

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: 770
Joined: Wed Nov 16, 2005 11:11 am

Re: Inserting a new Action

Post by alex_jitianu » Mon Jan 05, 2015 4:15 pm

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