Page 1 of 1

Inserting a new Action

Posted: Mon Jul 28, 2014 12:31 pm
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

Re: Inserting a new Action

Posted: Mon Jul 28, 2014 5:15 pm
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

Re: Inserting a new Action

Posted: Mon Jan 05, 2015 10:11 am
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

Re: Inserting a new Action

Posted: Mon Jan 05, 2015 4:15 pm
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