Skip to main content

dynamically merged help sets

3 replies [Last post]
coshx
Offline
Joined: 2004-04-14

I'm using the UniteAppendMerge to merge in the TOC's from the plugins for my application and I have a few questions:

1) The only way I've found to allow the use of a target in a topic is, as the documentation says, to use the exact same target in the plugin's TOC as well. This only works, however, if I create an entry in the map file for this target. It works fine if I use a bogus url (I've been using Foo.html) but is there a better way?

2) In the html, is there a way to add a link to a target rather than a url? For example, I know that if plugin X is installed properly, it will have a target called X.about, and since X is a standard plugin, I'd like to link to it's about page from another page. How can I do this?

3) like 2, but in reverse. In an html file for a plugin, how would I go about linking to a file provided by the main help set?

I know that it may not be a good design decision to have the help files of plugins and the application interact, since plugins are supposed to be modular, but it would be really nice if, when mentioning a concept in one file, I could add something like X that would only appear as a link if the given target was found.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Roger Brinkley

> I'm using the UniteAppendMerge to merge in the TOC's from the plugins
> for my application and I have a few questions:
>
> 1) The only way I've found to allow the use of a target in a topic
> is, as the documentation says, to use the exact same target in the
> plugin's TOC as well. This only works, however, if I create an entry
> in the map file for this target. It works fine if I use a bogus url
> (I've been using Foo.html) but is there a better way?

I'm sorry I don't understand the question. Can you provide more information?

> 2) In the html, is there a way to add a link to a target rather than
> a url? For example, I know that if plugin X is installed properly, it
> will have a target called X.about, and since X is a standard plugin,
> I'd like to link to it's about page from another page. How can I do
> this?

Unfortunate but you can't. Well not easily anyway. You'd have to write a
lightweight component that crossed helpset boundries to see if the topic
was available.

> 3) like 2, but in reverse. In an html file for a plugin, how would I
> go about linking to a file provided by the main help set?

Same as a above. Generally can't be done but there are workarounds if
you code them.

> I know that it may not be a good design decision to have the help
> files of plugins and the application interact, since plugins are
> supposed to be modular, but it would be really nice if, when
> mentioning a concept in one file, I could add something like > target="X.x">X that would only appear as a link if the given
> target was found.

Then write a light-weight component to handle that.

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

coshx
Offline
Joined: 2004-04-14

> I'm sorry I don't understand the question. Can you
> provide more information?

Okay, let's say that in my master helpset i define a TOC view that uses UniteAppendMerge, and the following line is in the TOC:

[code]



[/code]

Now at runtime, I load my plugins by looking for all .jar files in specified directories, and for the ones that provide a getHelpSet function, I do something like mainHelpSet.add(somePlugin.getHelpSet()).

This plugin happens to offer help that's relevant to "My subtopic", and wants to put a page under the "My subtopic" heading in the main helpset's TOC (after the merge, of course).

In order to do this, I've found I need to use the following for the TOC in the helpset provided by the plugin:

[code]





[/code]
This only works, however, if I redefine the targets "sometopic" and "sometopic.subtopic" in the map file specified by the plugin's helpset. While this appears to be safe (since the targets specified by the main helpset's TOC are the ones being used), it does not seem like an ideal solution. Is there a better way to go about doing this?

Thanks,
Ben

Roger Brinkley

> Okay, let's say that in my master helpset i define a TOC view that
> uses UniteAppendMerge, and the following line is in the TOC:
>
> [code]
>
>
>

> [/code]
>
> ...
>
> This plugin happens to offer help that's relevant to "My subtopic",
> and wants to put a page under the "My subtopic" heading in the main
> helpset's TOC (after the merge, of course).
>
> In order to do this, I've found I need to use the following for the
> TOC in the helpset provided by the plugin:
>
> [code]
>
>
>
>

>

> [/code]
>
> This only works, however, if I redefine the targets "sometopic" and
> "sometopic.subtopic" in the map file specified by the plugin's
> helpset. While this appears to be safe (since the targets specified
> by the main helpset's TOC are the ones being used), it does not seem
> like an ideal solution. Is there a better way to go about doing this?

An unfortunate side affect of an otherwise good design.

The problem is that if you specify a target it has to be a valid a
target or it will become null. Since the parsing of the TOC file occurs
at a time prior to merging there is not a way to determine if a target
is in the master helpset and thus the targets have to be duplicated,
though virtually non-existent.

There are two workarounds to the problem. One is to not use targets for
bucket items. The other is if targets are used you'll have to duplicate
the target entry in the map file.

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.