Style filter on dita maps manager
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 124
- Joined: Tue May 29, 2012 5:42 pm
Style filter on dita maps manager
Post by sebastienlavandier »
Hello,
Is it possible to make an style filter plugin to customized DitaMaps Manager node.
Thanks in advance for your help.
Sébastien.L
Is it possible to make an style filter plugin to customized DitaMaps Manager node.
Thanks in advance for your help.
Sébastien.L
Re: Style filter on dita maps manager
Hi Sébastien,
The DITA Maps Manager does not use the styles filter API to render the nodes in the tree.
It uses a Swing JTree with our custom javax.swing.tree.TreeCellRenderer set to it.
One possibility for you would be to gain access to the custom JTree by using the API ro.sync.exml.workspace.api.editor.page.ditamap.WSDITAMapEditorPage.getDITAMapTreeComponent().
Then you can obtain the custom renderer from the JTree and create your own renderer which wraps it.
Your custom cell renderer would delegate to ours which returns a JPanel with labels inside, would modify that content and return it.
Regards,
Radu
The DITA Maps Manager does not use the styles filter API to render the nodes in the tree.
It uses a Swing JTree with our custom javax.swing.tree.TreeCellRenderer set to it.
One possibility for you would be to gain access to the custom JTree by using the API ro.sync.exml.workspace.api.editor.page.ditamap.WSDITAMapEditorPage.getDITAMapTreeComponent().
Then you can obtain the custom renderer from the JTree and create your own renderer which wraps it.
Your custom cell renderer would delegate to ours which returns a JPanel with labels inside, would modify that content and return it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 124
- Joined: Tue May 29, 2012 5:42 pm
Re: Style filter on dita maps manager
Post by sebastienlavandier »
Hello,
I think I must to be more explicit...
So, by default each topic title appear on dita maps manager.
Just I want to add an information (linked to the topic content) after each topic title on the ditamaps manager.
Maybe I find a better solution... but I need help to finalize.
I'm implementing a CMS Plugin, and I have found this in the Oxygen plugin extensions samples :
Unfortunately, when I use this solution, topic title don't appear on the dita maps manager like it's made by default.
How I can execute the standard process and add an information on each topic's title on ditamaps manager ?
Thanks in advance for your help.
Sébastien.L
I think I must to be more explicit...
So, by default each topic title appear on dita maps manager.
Just I want to add an information (linked to the topic content) after each topic title on the ditamaps manager.
Maybe I find a better solution... but I need help to finalize.
I'm implementing a CMS Plugin, and I have found this in the Oxygen plugin extensions samples :
Code: Select all
//Add a DITA Map Topic Ref resolver.
pluginWorkspaceAccess.addTopicRefTargetInfoProvider("cms", new TopicRefTargetInfoProvider() {
@Override
public void computeTopicRefTargetInfo(
Map<TopicRefInfo, TopicRefTargetInfo> ditaMapTargetReferences) {
Iterator<TopicRefInfo> keys = ditaMapTargetReferences.keySet().iterator();
while(keys.hasNext()) {
//Here you can see for what "href" the target information should be resolved
TopicRefInfo ti = keys.next();
TopicRefTargetInfo target = ditaMapTargetReferences.get(ti);
String href = (String) ti.getProperty(TopicRefInfo.HREF_VALUE);
//The plugin will handle this reference
target.setProperty(TopicRefTargetInfo.RESOLVED, "true");
//And then resolve the different properties from the CMS Metadata
//The title from the target topic
target.setProperty(TopicRefTargetInfo.TITLE, href + " TEST");
//The class attribute of the target element name
target.setProperty(TopicRefTargetInfo.CLASS_VALUE, " topic/topic ");
//The target element name
target.setProperty(TopicRefTargetInfo.ELEMENT_NAME, "topic");
//A parse error if something happened retrieving the data (maybe the target does not exist).
target.setProperty(TopicRefTargetInfo.PARSE_ERROR, null);
}
}
});
How I can execute the standard process and add an information on each topic's title on ditamaps manager ?
Thanks in advance for your help.
Sébastien.L
Re: Style filter on dita maps manager
Hi Sébastien,
So you are using the Author Component SDK, right?
If so, have you added some logging to see that you receive the callback?
Did you use the singleton access to the plugin workspace provider? That singleton access in the author component might not have all its API functional.
In the AuthorComponentFactory there is a special API:
which you should try to use instead.
I made a test like:
and it seemed to work for me.
Regards,
Radu
So you are using the Author Component SDK, right?
If so, have you added some logging to see that you receive the callback?
Did you use the singleton access to the plugin workspace provider? That singleton access in the author component might not have all its API functional.
In the AuthorComponentFactory there is a special API:
Code: Select all
ro.sync.ecss.extensions.api.component.AuthorComponentFactory.addDITAMapTreeTargetInformationProvider(String, TopicRefTargetInfoProvider)
I made a test like:
Code: Select all
AuthorComponentFactory.getInstance().addDITAMapTreeTargetInformationProvider("file", new TopicRefTargetInfoProvider() {
@Override
public void computeTopicRefTargetInfo(
Map<TopicRefInfo, TopicRefTargetInfo> ditaMapTargetReferences) {
Iterator<TopicRefInfo> iterator = ditaMapTargetReferences.keySet().iterator();
if(iterator.hasNext()) {
TopicRefInfo topicRef = iterator.next();
TopicRefTargetInfo target = ditaMapTargetReferences.get(topicRef);
target.setProperty(TopicRefTargetInfo.RESOLVED, "true");
target.setProperty(TopicRefTargetInfo.TITLE, "TEST");
target.setProperty(TopicRefTargetInfo.CLASS_VALUE, " topic/topic ");
target.setProperty(TopicRefTargetInfo.ELEMENT_NAME, "topic");
target.setProperty(TopicRefTargetInfo.PARSE_ERROR, null);
}
}
});
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 124
- Joined: Tue May 29, 2012 5:42 pm
Re: Style filter on dita maps manager
Post by sebastienlavandier »
Hi Radu,
No I don't use Author Component SDK on this project.
Just I extending Oxygen XML Author to build a Custom CMS Plugins.
So I use PluginWorkspaceProvider.getPluginWorkspace() to access to the plugin workspace provider.
When I use PluginWorkspaceProvider.getPluginWorkspace().addTopicRefTargetInfoProvider() like in the previous post, I can add an information on TITLE property, but
if I set target.setProperty(TopicRefTargetInfo.RESOLVED, "true"); => title don't appear in ditamaps manager (like in standard process),
else if target.setProperty(TopicRefTargetInfo.RESOLVED, "false"); => title appear in diatamaos manager but added information is removed.
How I can use the standard process and add a information to the resolved title ?
Thanks in advance for your help.
Sébastien.L
No I don't use Author Component SDK on this project.
Just I extending Oxygen XML Author to build a Custom CMS Plugins.
So I use PluginWorkspaceProvider.getPluginWorkspace() to access to the plugin workspace provider.
When I use PluginWorkspaceProvider.getPluginWorkspace().addTopicRefTargetInfoProvider() like in the previous post, I can add an information on TITLE property, but
if I set target.setProperty(TopicRefTargetInfo.RESOLVED, "true"); => title don't appear in ditamaps manager (like in standard process),
else if target.setProperty(TopicRefTargetInfo.RESOLVED, "false"); => title appear in diatamaos manager but added information is removed.
How I can use the standard process and add a information to the resolved title ?
Thanks in advance for your help.
Sébastien.L
Re: Style filter on dita maps manager
Hi Sébastien,
This API was developed specific for CMSs which could obtain titles my querying the server faster than Oxygen would by individually parsing referenced topics.
The problem is that once you set the resolved property on the topicref:
you will be responsible by your own means to compute a complete title for the topic (possibly using its @href to parse the referenced topic yourself).
So you cannot append content to an existing title this way, you need to return the entire title.
So if you want to just let Oxygen compute the title itself and append to it, you will probably need to use the tree cell renderer approach I initially gave you.
Regards,
Radu
This API was developed specific for CMSs which could obtain titles my querying the server faster than Oxygen would by individually parsing referenced topics.
The problem is that once you set the resolved property on the topicref:
Code: Select all
target.setProperty(TopicRefTargetInfo.RESOLVED, "true");
So you cannot append content to an existing title this way, you need to return the entire title.
So if you want to just let Oxygen compute the title itself and append to it, you will probably need to use the tree cell renderer approach I initially gave you.
Regards,
Radu
Radu Coravu
<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