Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Serving external files as online help
Serving external files as online help [message #306195] Tue, 25 July 2006 06:03
Eclipse UserFriend
Hi,

I'm writing a plugin that incorporates a programming language and it's
runtime system ('myVM') into eclipse. There may be multiple
installations of 'myVM' installed on the system. Instances of 'myVM'
are made known to eclipse in the same way JRE's are installed. The
installation information is stored in a preference store.

An example of a path to the installation is:

/homes/andyc/myVM-7.0 (but they could be anywhere on the local file system).

Under this location is a 'doc' directory containing paths to html and
pdf files. I have attempted to integrate the documentation for myVM into
the eclipse online help system by:

Creating extensions to 'org.eclipse.help.contentProvider' and
'org.eclipse.help.toc'. A toc.xml file presents generic topics for all
installations of myVM, with entries for 'html' and 'pdf' documentation
and nested topics for 'user manual, 'reference manual', etc.

I then implement an IHelpContentProducer who's getInputStream() method
returns a new ByteArrayInputStream retrieving string bytes froms strings
for each manual - I trap the href request for the html user manual and
then generate a page listing the installations and referenceing the
_local_ documentation, for example:

private String generateHtmlUserman() {
String[] installationNames = PreferenceInitializer
.getInstallationNames();
String[] installationPaths = PreferenceInitializer
.getInstallationPaths();
if (installationNames.length == 0) {
return null;
}
String generatedHtml = "<HTML><HEAD><TITLE>myVM</TITLE></HEAD>"
+ "<BODY><H2>User Manual for
installation:</H2><BR><H3><UL>";

for (int engine = 0; engine < installationNames.length;
engine++) {
File path = new File(installationPaths[engine],
"doc/usermanual/manual.html");
try {
generatedHtml =
generatedHtml.concat("<LI><A HREF=\""
+ path.toURL() + "\">" +
installationNames[engine] + "</A>");
} catch (MalformedURLException mue) {
System.err.println(mue.getMessage());
}
}

generatedHtml =
generatedHtml.concat("</UL></H3></BODY></HTML>");
return generatedHtml;
}

It should be apparent that I'm generating html pages with references to
the local html/pdf files. Herein lies my problem - it's a long time
since I've worked with web content, so please excuse my ignorance :-D


The most common external broswers (IE & Firefox) prevent display of my
locally href'd file - I gather this is a hot security topic... However
the Windows 'internal browser' displays the links fine, so I assumed
that maybe 'internal browsers' would (but I now suspect this to be
perhaps a bug / security flaw). However having installed firefox as per
the SWT FAQ to enable the internal browser on Linux, it still fails to
render my local pages. I had found people discussing the use of the
following for firefox:

http://kb.mozillazine.org/Links_to_local_pages_don't_work

user_pref("capability.policy.policynames", "localfilelinks");
user_pref("capability.policy.localfilelinks.sites",
"http://www.example.com");
user_pref("capability.policy.localfilelinks.checkloaduri.enabled ",
"allAccess");

but replacing example.com with '127.0.0.1' doesn't work and neither does
setting the checkloaduri setting to false.

Regardless, the above is not a user-friendly solution anyway (and
doesn't work for an external IE browser).

So i am left frustrated, wondering how I'm meant to integrate the
documentation of myVM installations into eclipse.

This must be something that language integrators need to do, so there
must be a simple solution.

Please please can anyone help - comments, suggestions greatly appreciated?

Many thanks

Andy
Previous Topic:Headless PDE Build bug - cycle was detected?
Next Topic:How to add the "error icon" into a tree viewer
Goto Forum:
  


Current Time: Sat Sep 13 12:58:10 EDT 2025

Powered by FUDForum. Page generated in 0.02373 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top