Change editing options for Dita in Oxygen web author
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 14
- Joined: Wed May 25, 2016 4:51 pm
Change editing options for Dita in Oxygen web author
Post by mitpatoliya »
Hi I am newbie to oxygenxml
I am using oxygen web author as dita editing platform.
I also have requirement where I want to customize options which are available when we right click on dita file during edit.
Now I am not sure what all steps I need to do. I understand I need to use Oxygen SDK to do that but I see many different things available there.
Will appreciate any help there.
I am using oxygen web author as dita editing platform.
I also have requirement where I want to customize options which are available when we right click on dita file during edit.
Now I am not sure what all steps I need to do. I understand I need to use Oxygen SDK to do that but I see many different things available there.
Will appreciate any help there.
-
- Posts: 496
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Change editing options for Dita in Oxygen web author
Post by cristi_talau »
Hello,
The documentation for integrations can be found in the user manual here [1]. Depending on the type of actions you want to add/remove in the context menu there are two approaches:
1. The actions are DITA-related. In this case you should edit the default DITA "framework". You can use an oXygen Desktop application to configure the DITA framework using its GUI. More details here [2].
2. Otherwise, you can write a JavaScript plugin to add/remove actions from the context menu. More details in the user manual [3] and in this tutorial [4].
If you provide more details about your goal, we can give you more specific advice.
Best,
Cristian
[1] https://www.oxygenxml.com/doc/versions/ ... rview.html
[2] https://www.oxygenxml.com/doc/versions/ ... works.html
[3] https://www.oxygenxml.com/doc/versions/ ... ng_js.html
[4] https://www.oxygenxml.com/maven/com/oxy ... ction.html
The documentation for integrations can be found in the user manual here [1]. Depending on the type of actions you want to add/remove in the context menu there are two approaches:
1. The actions are DITA-related. In this case you should edit the default DITA "framework". You can use an oXygen Desktop application to configure the DITA framework using its GUI. More details here [2].
2. Otherwise, you can write a JavaScript plugin to add/remove actions from the context menu. More details in the user manual [3] and in this tutorial [4].
If you provide more details about your goal, we can give you more specific advice.
Best,
Cristian
[1] https://www.oxygenxml.com/doc/versions/ ... rview.html
[2] https://www.oxygenxml.com/doc/versions/ ... works.html
[3] https://www.oxygenxml.com/doc/versions/ ... ng_js.html
[4] https://www.oxygenxml.com/maven/com/oxy ... ction.html
-
- Posts: 14
- Joined: Wed May 25, 2016 4:51 pm
Re: Change editing options for Dita in Oxygen web author
Post by mitpatoliya »
Thanks a lot for quick response.
I want to basically remove most of those options which are visible when you right click on dita xml file because those users will not have much idea on dita. For them important document will be pdf which will be generated as output from that xml.
Hope this gives more idea.
I want to basically remove most of those options which are visible when you right click on dita xml file because those users will not have much idea on dita. For them important document will be pdf which will be generated as output from that xml.
Hope this gives more idea.
-
- Posts: 496
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Change editing options for Dita in Oxygen web author
Post by cristi_talau »
Hello,
In order to remove DITA-related actions from the context, you can use the Contextual Menu editor in the Document Type Configuration dialog [1].
Regarding the PDF generation, you can setup a web service that generates the PDF from the DITA content. This web service will simply invoke the DITA-OT PDF transformation. Then you can add an action in the Web Author to simply download the PDF document.
Best,
Cristian
[1] http://oxygenxml.com/doc/versions/18.0/ ... b-tab.html
In order to remove DITA-related actions from the context, you can use the Contextual Menu editor in the Document Type Configuration dialog [1].
Regarding the PDF generation, you can setup a web service that generates the PDF from the DITA content. This web service will simply invoke the DITA-OT PDF transformation. Then you can add an action in the Web Author to simply download the PDF document.
Best,
Cristian
[1] http://oxygenxml.com/doc/versions/18.0/ ... b-tab.html
-
- Posts: 14
- Joined: Wed May 25, 2016 4:51 pm
Re: Change editing options for Dita in Oxygen web author
Post by mitpatoliya »
Thanks Cristian for you prompt response.
Could you please point me to proper API which I should use to remove editing options?
I have created new plugin.js and placed in my app folder. It is loaded correctly.
Now I need logic to remove those existing edit actions.I am checking this but now sure which to use.
https://www.oxygenxml.com/maven/com/oxy ... ditor.html
Could you please point me to proper API which I should use to remove editing options?
I have created new plugin.js and placed in my app folder. It is loaded correctly.
Now I need logic to remove those existing edit actions.I am checking this but now sure which to use.
https://www.oxygenxml.com/maven/com/oxy ... ditor.html
-
- Posts: 496
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Change editing options for Dita in Oxygen web author
Post by cristi_talau »
Hello,
You should listen for the ACTIONS_LOADED_EVENT on the editor. In the event handler you should remove the action from the ActionsManager:
Note that the ACTIONS_LOADED_EVENT is triggered multiple times as actions are loaded incrementally.
Best,
Cristian
You should listen for the ACTIONS_LOADED_EVENT on the editor. In the event handler you should remove the action from the ActionsManager:
Code: Select all
editor.getActionsManager().unregisterAction(actionId)
Best,
Cristian
-
- Posts: 14
- Joined: Wed May 25, 2016 4:51 pm
Re: Change editing options for Dita in Oxygen web author
Post by mitpatoliya »
Thanks a lot.
I was able to disable most of the actions using following code
Now facing only two major issue.
Few actions are still there.
I want to keep tracking option on for all document how do I do that? Trying with following code but no success.
var tc=am.getActionById("Author/TrackChanges");
tc.isTrackingChanges_=true;
I was able to disable most of the actions using following code
Code: Select all
//alert("hiiii");
goog.events.listen(workspace, sync.api.Workspace.EventType.EDITOR_LOADED, function(e) {
var editor = e.editor;
// Register the newly created action.
//editor.getActionsManager().registerAction('insert.link', new WebLinkAction(editor));
// alert("loadded");
var am=editor.getActionsManager();
am.unregisterAction("Author/InsertElement");
am.unregisterAction("Author/RenameElement");
am.unregisterAction("Author/Print");
am.unregisterAction("Author/Undo");
am.unregisterAction("Author/Redo");
am.unregisterAction("Author/Enter");
am.unregisterAction("Author/Copy");
am.unregisterAction("Author/Paste");
am.unregisterAction("Author/Cut");
am.unregisterAction("Author/Tab");
am.unregisterAction("Author/CopySpecial");
am.unregisterAction("Author/PasteSpecial");
am.unregisterAction("Author/DummyCut");
am.unregisterAction("Author/Download");
am.unregisterAction("Author/About");
am.unregisterAction("Author/ShowXML");
am.unregisterAction("Author/FindReplace");
am.unregisterAction("App/FocusAttributesPanel");
am.unregisterAction("Author/ReportProblem");
am.unregisterAction("Author/About");
am.unregisterAction("Author/Help");
am.unregisterAction("Author/ShiftTab");
am.unregisterAction("Author/ReportProblem");
am.unregisterAction("Author/SurroundWithElement");
am.unregisterAction("Author/ValidationResults");
var tc=am.getActionById("Author/TrackChanges");
tc.isTrackingChanges_=true;
});
Few actions are still there.
I want to keep tracking option on for all document how do I do that? Trying with following code but no success.
var tc=am.getActionById("Author/TrackChanges");
tc.isTrackingChanges_=true;
-
- Posts: 496
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Change editing options for Dita in Oxygen web author
Post by cristi_talau »
Hello,
Regarding the actions you disabled. I am not sure which actions are still there. I guess that they are DITA-related actions. The best way to edit those is to configure the DITA framework as I described in a previous post using the Context Menu editor [1].
A less robust approach is to remove them using the JS API but you will have to figure out their IDs. You can find them by dumping the actions manager to the browser console and look at all the registered actions.
Regarding the track changes enforcement. You can invoke the "TrackChanges" action client-side
Best,
Cristian
[1] http://oxygenxml.com/doc/versions/18.0/ ... b-tab.html
Regarding the actions you disabled. I am not sure which actions are still there. I guess that they are DITA-related actions. The best way to edit those is to configure the DITA framework as I described in a previous post using the Context Menu editor [1].
A less robust approach is to remove them using the JS API but you will have to figure out their IDs. You can find them by dumping the actions manager to the browser console and look at all the registered actions.
Regarding the track changes enforcement. You can invoke the "TrackChanges" action client-side
Code: Select all
tc.actionPerformed(function(){})
Cristian
[1] http://oxygenxml.com/doc/versions/18.0/ ... b-tab.html
-
- Posts: 14
- Joined: Wed May 25, 2016 4:51 pm
Re: Change editing options for Dita in Oxygen web author
Post by mitpatoliya »
Thanks again christian.
I was able to make tracking enabled by your solution.
Remaining actions are "Insert","Genrate ID","Link","Table".
I was able to make tracking enabled by your solution.
Remaining actions are "Insert","Genrate ID","Link","Table".
-
- Posts: 496
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Change editing options for Dita in Oxygen web author
Post by cristi_talau »
Hello,
Those actions are added by the default DITA framework. You can use the Document Type Preferences dialog to remove those actions. You may need to delete them from "Author" > "Actions" tab as well as from the "Author" > "Context Menu" tab.
Best,
Cristian
Those actions are added by the default DITA framework. You can use the Document Type Preferences dialog to remove those actions. You may need to delete them from "Author" > "Actions" tab as well as from the "Author" > "Context Menu" tab.
Best,
Cristian
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service