Skip to main content

Dilemma for cross-helpset links

2 replies [Last post]
Anonymous

Good day everyone! I'm hoping someone will have a simple solution or
another idea about our dilemma.

With our new release of products we are hoping to package our JavaHelp into
Jar files on a helpset by helpset basis. This makes it simple since we have
plugins and translated files which can be installed at a later date.
Previous versions of help are installed as loose files. The
problem we are running into is that we may have instances where the Jar
files coexist with the loose html files.

We would like to update all the cross-helpset links to use a Jar format...
Link
But obviously we can't do that because the target could be a loose file.

So I started looking at the Lightweight Components described in the JHUG.
The JHSecondaryViewer looks promising but I don't think we can use it
straight out of the box. For one thing, the 'content' parameter says it
has to be relative from the base address of the containing topic. And, the
id parameter looks like it has to be in the Map file for that helpset.

So I have some simple questions about the JHSecondaryViewer...
- Can it be extended to override the content parameter so it can look for
a loose file or a file within a Jar file?
- Is it possible to have the Jar syntax in the map file for an id which
points to an id in another helpset?

Something else that crossed my mind was maybe I could write a lightweight
component which implements the current behavior now of when I click a link
it displays the topic. But my component would search for a file within a
Jar file first and then fall back onto a loose file. But, I don't know
where to start on this one.

Any help would be greatly appreciated, thanks for your time!

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

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.

Reply viewing options

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

Binky,

I was able to solve this rather easily which kindof has me worried :)

I created a new object which was essentially a copy of the JHSecondaryViewer
and changed the code so it would not create a SecondaryWindow or Popup
object. Instead it takes the 'TextHelpModel thm' variable in 'setViewData'
and makes it a private class variable. Then in 'actionPerformed' instead
of creating the SecondaryWindow and Popup objects, I just do a
'thm.setCurrentURL'. It seems to work just fine, the history is updated
correctly and the content pane loads the new URL.

So sorry for the run-around and thanks for the help.

David

On Tue, 21 Feb 2006 12:50:09 -0500, David Cagle wrote:

>I would like for the cross-helpset links within our html pages to be able
to be resolved whether the target file is in a Jar file or a loose file.
By cross-helpset links I mean, a link from one topic to another topic in
another helpset. Right now, we have to either specify a relative path ( href="../../helpsetB/html/topicb.htm">) for the link or a jar file ( href="jar:file:....">) depending on how the file is installed. I would
like to come up with a cross-helpset link which figured out which format it
needed or something to that effect. The easiest way I thought of was with
a lightweight component like the JHSecondaryViewer. But the problem I have
with the JHSecondaryViewer is that it either opens a secondary window or a
popup. There is nothing wrong with that in my eyes but others have asked
why can't you just refresh the content pane and display the new topic.
This is the way the JavaHelp browser behaves now, you click on a link
within the JEditorPane and the new
>topic is displayed. That is what I'm after, a way to link to another
helpset without bringing up a secondary window or a popup and the format of
the link is not an issue. My guess is that it would have to be something
like the JHSecondaryViewer but it just doesn't open a secondary window or
popup, it just refreshes the content pane. A new OBJECT is the only way I
can see doing that.
>
>-----Original Message-----
>From: Discussion list of JavaHelp [mailto:JAVAHELP-INTEREST@JAVA.SUN.COM]
On Behalf Of Roger Brinkley
>Sent: Tuesday, February 21, 2006 11:54 AM
>To: JAVAHELP-INTEREST@JAVA.SUN.COM
>Subject: Re: [JAVAHELP] Dilemma for cross-helpset links
>
>David Cagle wrote:
>> Binky, one more question that might make your head hurt a little more!
>> Do you know which code gets executed when a user clicks on a link in
>> the JEditorPane? One that either takes them to another topic within
>> the same helpset or to another topic in another helpset. I'm guessing
>> that is all code in the 'javax.swing.text.html' package and nothing
>> JavaHelp specific. Thanks!
>
>Not entirely. There is a hyperlinkUpdate in BasicContentViewerUI.java that
gets called when the link is updated.
>
>What are you trying to do?
>
>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.

Roger Brinkley

David Cagle wrote:
> So I started looking at the Lightweight Components described in the JHUG.
> The JHSecondaryViewer looks promising but I don't think we can use it
> straight out of the box. For one thing, the 'content' parameter says it
> has to be relative from the base address of the containing topic. And, the
> id parameter looks like it has to be in the Map file for that helpset.

The id would have to be in the map file for the master helpset. First
come first serve though so don't use the same id.

> So I have some simple questions about the JHSecondaryViewer...
> - Can it be extended to override the content parameter so it can look for
> a loose file or a file within a Jar file?

Yes that is possible.

> - Is it possible to have the Jar syntax in the map file for an id which
> points to an id in another helpset?

An id in another helpset no; a file in another helpset yes. Of course
you have to know where the jar is going to reside which can be a little
tricky.

> Something else that crossed my mind was maybe I could write a lightweight
> component which implements the current behavior now of when I click a link
> it displays the topic. But my component would search for a file within a
> Jar file first and then fall back onto a loose file. But, I don't know
> where to start on this one.
>

Ouch my head is hurting thinking about this one.

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.