Skip to main content

dynamic content

8 replies [Last post]
Anonymous

Hi,

I was wondering if it is possible to dynamically generate the content of
the html / xml files for JavaHelp at run time. The reason for this is that
as part of our application we have a jython scripting environment, which
users will use to generate new java classes based on a template. As part
of this template, the users will need to provide basic information such as
the signature of the class, its purpose, category etc. If possible, it
would be nice to pull this information in as part of the JavaHelp manaul,
without having to double up the documentation.

If anyone has any experience with this, some advice would be appreciated.

Thanks,
Helen

--
Helen Bright
Assistant IT Manager
Astrophysics
Imperial College
020 75947532

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

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.
Chimshaw

javahelp uses classpath to search for files.
So in our case our dir structure was like yours:
MAIN-HELP
|
+-- generated_files
|
+-- gfile1.html
|
+-- gfile2.html
|
+-- precreated_files
|
+-- pfile1.html
|
+-- pfile2.html

and the map file had entries like:

to refer to generated files. This worked fine for us.

Regards,
Chimshaw

> Could you explain what you mean by "javahelp found these files"? Did you put the
> generated files into jars? If I have a directory structure like:
>
> MAIN-HELP
> |
> +-- SUB-HELP
> |
> +-- generated files... *.html
>
> what Javahelp APIs can we use to find the generated files?
>
> --martin
>
> ********************************************************************************
>
> 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.

=====
Chimshaw
------------------------------------------------------------
JHelpBuilder - WYSWYG Editor for JavaHelp helpsets.
---------------------------------------------------------------
Free download at:
http://www.javio.com/jhelpbuilder/jhelpbuilder

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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

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

Helen Bright wrote:
> Hi,
>
> thanks for your response: I'm glad its easy to do. One question: did
> you manage to generate the search files at run time, or did they just not
> include the dynamically generated files?
>

The search database can be generated at runtime. The API is not obvious
but it is possible to do this on the fly.

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.

Chimshaw

Hi Binky,
Could you give me some hints as to how to use the API properly?
The problem we have is that if we create the search index twice in the same vm instance, it
causes errors. We have to launch the Indexer as a separate process everytime.
Regards,
Chimshaw.

>
> The search database can be generated at runtime. The API is not obvious
> but it is possible to do this on the fly.
>
> Binky
>

=====
Chimshaw
------------------------------------------------------------
JHelpBuilder - WYSWYG Editor for JavaHelp helpsets.
---------------------------------------------------------------
Free download at:
http://www.javio.com/jhelpbuilder/jhelpbuilder

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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

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.

Martin Jakubik

At my company, we are very interested in this behaviour as well.

> * As long as the file names did not clash with other javahelp
> files, javahelp was able to find and display these files.

Could you explain what you mean by "javahelp found these files"? Did you put the
generated files into jars? If I have a directory structure like:

MAIN-HELP
|
+-- SUB-HELP
|
+-- generated files... *.html

what Javahelp APIs can we use to find the generated files?

--martin

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

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

Martin Jakubik wrote:
> At my company, we are very interested in this behaviour as well.
>
>
>>* As long as the file names did not clash with other javahelp
>>files, javahelp was able to find and display these files.
>
>
> Could you explain what you mean by "javahelp found these files"? Did you put the
> generated files into jars? If I have a directory structure like:

JavaHelp automatically finds files based on a classpath construction.
There are a number of ways of constructing the classpath including doing
it on the fly with a URLClassLoader as is done in the hsviewer (jhdemo).
In most cases, the automatic finding is something that is planned by the
application by either setting the CLASSPATH environment variable or by
constructing a URLClassLoader on the fly within the application.
Finally, the finding of the helpset file (.hs) is all that is important
and if you already know where the file is you can construct the URL on
the fly and feed it to the javax.help.HelpSet constructor.

> MAIN-HELP
> |
> +-- SUB-HELP
> |
> +-- generated files... *.html
>
> what Javahelp APIs can we use to find the generated files?

None. JavaHelp APIs don't create files other than the search database
files. These files were created by the applications generation process.

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.

Chimshaw

Yes its very easy to do.
This is how we did it. (There could be better ways)
* We generated new help files at runtime depending on user input.
* These helpfiles were generated in a specific directory which was a child dir of the dir
containing javahelp helpset.
* As long as the file names did not clash with other javahelp files, javahelp was able to find and
display these files.

In our case, the helpset already referred to the files that were generated at runtime, but you
can easily append information to the javahelp TOC/Index/Map files at runtime depending on your
needs.
Regards,
Chimshaw

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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

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.

Helen Bright

Hi,

thanks for your response: I'm glad its easy to do. One question: did
you manage to generate the search files at run time, or did they just not
include the dynamically generated files?

Thanks,
Helen

On Thu, 29 Jan 2004, Chimshaw wrote:

> Yes its very easy to do.
> This is how we did it. (There could be better ways)
> * We generated new help files at runtime depending on user input.
> * These helpfiles were generated in a specific directory which was a child dir of the dir
> containing javahelp helpset.
> * As long as the file names did not clash with other javahelp files, javahelp was able to find and
> display these files.
>
> In our case, the helpset already referred to the files that were generated at runtime, but you
> can easily append information to the javahelp TOC/Index/Map files at runtime depending on your
> needs.
> Regards,
> Chimshaw
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!
> http://webhosting.yahoo.com/ps/sb/
>
> ********************************************************************************
>
> 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.
>

--
Helen Bright
Assistant IT Manager
Astrophysics
Imperial College
020 75947532

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

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.

Chimshaw

We did not generate search files at runtime, but it should be easy to do.
JHelpBuilder, our helpset editing software, runs the Indexer to generate the search db
programatically.

Regards,
Chimshaw.

=====
Chimshaw
------------------------------------------------------------
JHelpBuilder - WYSWYG Editor for JavaHelp helpsets.
---------------------------------------------------------------
Free download at:
http://www.javio.com/jhelpbuilder/jhelpbuilder

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

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

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.