2 Replies Latest reply on Oct 7, 2013 4:03 AM by darobb

    What’s the best way to call context sensitive help from java?


      I'm trying to use RoboHelp 10 to create some context sensitive help files for my Java App.


      I've included robohelp_csh.java in my project and am aware of the CSH API call:


           RoboHelp_CSH.RH_ShowHelp(0, "C:/my path to rbh output/index.htm", RoboHelp_CSH.HH_HELP_CONTEXT, 1002);


      I've become aware that this will work only with 'published' robohelp output and possibly only with Web Help or Flash Help output.


      RH_ShowHelp appears to just try and locate and load IEXPLORE.exe and pass a url. It loads internet explorer even though this is not my default browser. Annoyingly, this prompts me to enable scripting every time I load a help page. It also loads it into a new instance. Not something I want to inflict on my end users.

      I’ve also tried:

      Desktop.getDesktop().browse(uri) where uri is


      For Web Help:

      Uri = file:///C:/my path to rbh output/index.htm#<id=1002>>newwnd=false;


      or for HTML5 help:

           Uri = file:///C:/ my path to rbh output/index.htm?rhcsh=1&rhnewwnd=0&rhmapno=1002


      These do open in my preferred browser but only display the home page and not the CSH page. However, if I paste the link in directly it does go to the correct page. I don’t know why this is the case.


      I’ve tried using MS HTML Help and running :

           HH.EXE -mapid 1002 ms-its:C:/ my path to rbh output/MyHelp.chm


      This invokes the windows HH system and goes to the correct page, although a new instance is created for each help button press. I’m not sure how robust this solution is and how feature rich and capable HH is. Is HH always installed and available on the path?


      I’ve finally decided to just load the CSH pages directly using the default browser with

      Uri = file:///C:/my path to rbh output/desktop/my_csh_topic_name.htm

      and ignoring the MAP IDs completely.

      This works OK although a new tab is created for each help button press.


      Anyone got any better solutions?


      Am I doing anything wrong that prevents the MAP ID solution from working?

        • 1. Re: What’s the best way to call context sensitive help from java?
          Willam van Weelden Adobe Community Professional & MVP

          The scripting prompt is due to locally installed WebHelp. If you put it on a server, it should work fine. (Or try to enable Mark of the Web for your output.)


          The problem with CSH not working is probably because the CSH is not enabled in the output. In the single source layout settings, make sure that all your map files are selected:




          The easiest way I see it to create a simple API yourself. (We did it for Delphi and C# and it took about ten minutes.) You can just create a URL and feed it to the default browser. If you want to be able to load new help calls in the same tab, you will have to hook into the browser somehow.


          The URL's are really easy to create. See http://www.wvanweelden.eu/article-category/context-sensitivity for a complete overview of all your options in HTML and WebHelp. If you want to call a CHM context sensitive look at the following article: http://msdn.microsoft.com/en-us/library/2bk8zwb3(v=vs.90).aspx





          • 2. Re: What’s the best way to call context sensitive help from java?
            darobb Level 1

            Ahh. Thanks. Enabling Mark of the Web stopped the 'allow scripts to run' prompt from appearing.


            The RoboHelp_CSH.RH_ShowHelp(...) now goes to the correct CSH page in IE without prompting.


            Re. the CSH URLS. For testing, I have a very simple two page help project and have the sole BSSCDefault.h map file ticked and have tried creating URLs as suggested by your very helpful web pages. These work when pasted in to the browser address bar but for some unknown reason do not work when invoked from Java via Desktop.getDesktop().browse(uri); - My logging suggests I am setting the correct URL but all I get is the default index.htm


            Anyway, I've decided not to sprinkle 'magic number' MAP IDs in my Java anyway. I return an enumerated help context type, which I can map to the appropriate URL directly as easily as I can to a MAP id. Hence I'm using the direct URL instead and this works fine.


            Thanks again for taking the time to respond :-)