How to provide complex dynamic map templates?

Post here questions and problems related to editing and publishing DITA content.
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

How to provide complex dynamic map templates?

Post by Frank Ralf »

Hi,

We want to provide complex dynamic map templates like the following for our authors. These map templates contain:

- pre-filled content via (custom) editor variables like ${author}
- references to topics which might be also pre-filled with some content

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<title>${cfn}</title>
<topicmeta>
<author>${author}</author>
</topicmeta>

<topicref href="revision_history.dita"/>
<topicref href="stakeholders.dita"/>

</map>
Usually, we rely on the "Create new file" mechanism of the Cannot open the specified file dialog dialog box.

What might be the best way to provide such templates? We have already thought about custom Author Actions and creating DITA files on the fly with XSLT but this seems to be quite complicated.

Any pointers welcome!
TIA
Frank
Frank Ralf
parson AG
www.parson-europe.com
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: How to provide complex dynamic map templates?

Post by alex_jitianu »

Hello Frank,

1. You can already use custom editor variables inside document templates. You can either define them in Preferences or you can resolve them through the API. One aspect that is worth mentioning is that variables that refer to the file locations (like ${cfn}) will be handled only when you create the new file directly at a location.

2. We don't currently support such a recursive template structure. I'll fill out a feature request but until we manage to implement it, what I suggest is using our API to create a custom NEW action on the toolbar.

To contribute an action on the toolbar/menu you will need an Workspace Access plugin. I recommend starting from our SDK sample project. After creating the sample project, please concentrate on oxygen-sample-plugin-workspace-access which is an Workspace Access plugin that among other things, it also contributes an action on the toolbar (using an ToolbarComponentsCustomizer).

What this action must do is copy a template files structure to an user given location and then pass the content of each file though the variables resolver.

Please let me know if I can help you with any other information about the API or anything else.

best regards,
Alex
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: How to provide complex dynamic map templates?

Post by Frank Ralf »

Hi Alex,

Thanks for your quick reply and your pointers! I will try your suggested solution and report back.

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: How to provide complex dynamic map templates?

Post by Frank Ralf »

Hi Alex,

JFYI, I've started to have a look at the sample plug-ins but stumbled across the following error:
You must create an OSGi bundle manifest to run this plug-in without the compatibility software 'Eclipse 2.0 Style Plugin Support'.
According to Tools for Eclipse 2.0 plugins upgrade, Eclipse Luna (4.4) does not support Eclipse 2.0 plugins.

The post also provides a solution: You can install support for 2.0 style plugins using Help > Install New Software. Select the 'Eclipse Project Updates' site (http://download.eclipse.org/eclipse/updates/4.4). You will find 'Eclipse 2.0 Style Plugin Support' in the 'Eclipse Tests, Examples and Extras' section.

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: How to provide complex dynamic map templates?

Post by alex_jitianu »

Hi Frank,

Oxygen is available both as Standalone version and as an Eclipse plugin. It looks like you are interested in the Eclipse plugin customization, right? The solution I've described works for both distributions but the API differs. For Eclipse you must create your own plugin that will contribute/alter the Oxygen one. I recommend to start by reading Eclipse IDE Integration. This topic will guide you on how to create a Maven based SDK based project. After you follow the procedure you should focus on project oxygen-sample-eclipse-plugin. If you are indeed interested in customizing the Eclipse plugin please let me know and I can give you more details.

Best regards,
Alex
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: How to provide complex dynamic map templates?

Post by Frank Ralf »

Hi Alex,

Actually, I'm interested in a standalone plug-in, I only used Eclipse for the Maven-related stuff. I don't know much about Java but IFAIU I also have to develop and compile a standalone plug-in with a Java-capable IDE?

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: How to provide complex dynamic map templates?

Post by alex_jitianu »

Hi Frank,

Yes, you've understood it correctly. I've misinterpreted your previous post... Sorry about that!

Best regards,
Alex
sorin_carbunaru
Posts: 402
Joined: Mon May 09, 2016 9:37 am

Re: How to provide complex dynamic map templates?

Post by sorin_carbunaru »

Hello,

Just wanted to update this old thread and say that Oxygen 23 supports project templates, although we don't have editor variable resolving support yet. More info at https://www.oxygenxml.com/doc/versions/ ... ect-2.html.

All the best wishes,
Sorin Carbunaru
Oxygen XML Editor
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: How to provide complex dynamic map templates?

Post by Frank Ralf »

Hi Sorin,

Many thanks for the follow-up. I've already read about this new feature in the release notes and will definitely give it a try.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Post Reply