How to apply a profiling condition set in DITA map manager programmatically ?
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 64
- Joined: Wed Dec 03, 2014 11:25 am
How to apply a profiling condition set in DITA map manager programmatically ?
Hello,
Is there any way to apply a profiling condition set in DITA map manager programmatically ?
I'm able to define available profiling condition sets with :
After doing it, I'm looking for a method to select the first profile condition as we can do with UI dropdown menu
Vince
Is there any way to apply a profiling condition set in DITA map manager programmatically ?
I'm able to define available profiling condition sets with :
Code: Select all
ProfileConditionsSetInfoPO[] array = ...
PluginWorkspaceProvider.getPluginWorkspace().setGlobalObjectProperty(APIAccessibleOptionTags.PROFILING_CONDITIONS_SET_LIST, array);
conditions.set.png
Thank in advance for your help.Vince
You do not have the required permissions to view the files attached to this post.
-
- Posts: 78
- Joined: Wed Jun 22, 2016 2:48 pm
Re: How to apply a profiling condition set in DITA map manager programmatically ?
Post by adrian_sorop »
Hi Vince!
That drop-down menu can't be accessed in a direct manner, but the actions from that menu could be retrieved and called.
Using the WSAuthorEditorPageBase.getActionsProvider() get getAuthorCommonActions.
In the resulted map, you can find the action that applies that condition set; the id is something like
Now, call the corresponding action for that id and the condition set will apply.
The snippet
Let me know if this is helpful.
Adrian S.
That drop-down menu can't be accessed in a direct manner, but the actions from that menu could be retrieved and called.
Using the WSAuthorEditorPageBase.getActionsProvider() get getAuthorCommonActions.
In the resulted map, you can find the action that applies that condition set; the id is something like
Code: Select all
Profiling_Condition_Sets/Condition_Set_Apply theNameYouSetForThatConditionSet
The snippet
Code: Select all
// define the condtion set
SerializableLinkedHashMap<String, String[]> conditions = new SerializableLinkedHashMap<String, String[]>();
ProfileConditionsSetInfoPO condSet1 = new ProfileConditionsSetInfoPO(conditions, "DITA*", "apiCondSet1");
SerializableLinkedHashMap<String, String[]> conditions2 = new SerializableLinkedHashMap<String, String[]>();
ProfileConditionsSetInfoPO condSet2 = new ProfileConditionsSetInfoPO(conditions2, "DITA*", "apiCondSet2");
ProfileConditionsSetInfoPO[] array = new ProfileConditionsSetInfoPO[] {condSet1, condSet2};
pluginWSAccess.setGlobalObjectProperty(APIAccessibleOptionTags.PROFILING_CONDITIONS_SET_LIST, array);
.................................
// get all the author actions
WSAuthorEditorPage authorEditorPage = ....
Map<String, Object> authorCommonActions = authorEditorPage.getActionsProvider().getAuthorCommonActions();
Set<Entry<String, Object>> entrySet = authorCommonActions.entrySet();
for (Entry<String, Object> entry : entrySet) {
// find the action created for that condition set
String key = entry.getKey();
if (key.contains("apiCondSet1")) {
SwingUtilities.invokeLater(() -> {
// call the action
javax.swing.Action action = (javax.swing.Action)entry.getValue();
action.actionPerformed(null);
});
break;
}
}
Adrian S.
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 64
- Joined: Wed Dec 03, 2014 11:25 am
Re: How to apply a profiling condition set in DITA map manager programmatically ?
Thanks a lot
It's help me.
But what about the case user only open map in Dita map manager ?
In this case, I have no access to an WSAuthorEditorPage.
And I did not find how to access to common actions from the WSDITAMapEditorPage.
Conditions sets actions are not provided by DITAMapActionsProvider.
I use
Thanks
It's help me.
But what about the case user only open map in Dita map manager ?
In this case, I have no access to an WSAuthorEditorPage.
And I did not find how to access to common actions from the WSDITAMapEditorPage.
Conditions sets actions are not provided by DITAMapActionsProvider.
I use
Code: Select all
var editor = PluginWorkspaceProvider.getPluginWorkspace().getEditorAccess(url, PluginWorkspace.DITA_MAPS_EDITING_AREA);
var ditaMapEditorPage= (WSDITAMapEditorPage) editor.getCurrentPage();
var actions = authorPage.getActionsProvider().getActions();
-
- Posts: 78
- Joined: Wed Jun 22, 2016 2:48 pm
Re: How to apply a profiling condition set in DITA map manager programmatically ?
Post by adrian_sorop »
Hi Vince,
Sorry for the late response. I didn't receive the notification you posted.
Anyway, I don't bring good news. It seems like you can't access the actions from DITA Maps Manager.
I've added an internal issue to allow dirrect API access for profiling condtion sets.
Regards,
Adrian S.
Sorry for the late response. I didn't receive the notification you posted.
Anyway, I don't bring good news. It seems like you can't access the actions from DITA Maps Manager.
I've added an internal issue to allow dirrect API access for profiling condtion sets.
Regards,
Adrian S.
Adrian Sorop
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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