Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Error 404 in custom help browser tab
Error 404 in custom help browser tab [message #1079926] Mon, 05 August 2013 04:44 Go to next message
Wojciech Pisarski is currently offline Wojciech Pisarski
Messages: 3
Registered: August 2013
Junior Member
Hi,

I want to add some functionality to Eclipse's help browser. I've created a new plugin, found an extension point org.eclipse.help.webapp.view and declared an extension in plugin.xml with this class:
import java.util.Locale;

import org.eclipse.help.webapp.AbstractView;

public class CustomView extends AbstractView {

    @Override
    public String getImageURL() {
        return "";
    }

    @Override
    public char getKey() {
        return 0;
    }

    @Override
    public String getName() {
        return "Custom";
    }

    @Override
    public String getTitle(Locale arg0) {
        return "Test Title";
    }

    @Override
    public String getURL() {
        return "/";
    }
    
    @Override
    public String getBasicURL() {
        return getURL();
    }
}


In my plugin's help/ subdirectoryI have files CustomView.jsp and CustomToolbar.jsp both containing just this test HTML:
<html>
<head>

<title>Custom help view test</title>

</head>

<body>
<p>Test</p>
</body>

</html>


Help folder is added to build.properties. Problem is that the tab displays in help browser as expected, but inside I only get error messages in "header subframe" and main area, respectively:
HTTP ERROR 404
Problem accessing /help/CustomToolbar.jsp. Reason: 

    /CustomToolbar.jsp


--------------------------------------------------------------------------------
Powered by Jetty://

HTTP ERROR 404
Problem accessing /help/CustomView.jsp. Reason: 

    /CustomView.jsp


--------------------------------------------------------------------------------
Powered by Jetty://



Could you please tell me what is wrong here? I'm running this on Eclipse platform version 3.7.0 and Java SDK 1.6.
Re: Error 404 in custom help browser tab [message #1082256 is a reply to message #1079926] Thu, 08 August 2013 05:55 Go to previous message
Wojciech Pisarski is currently offline Wojciech Pisarski
Messages: 3
Registered: August 2013
Junior Member
I've found the reason this failed. After dissecting the help plugin I've found additional extensions defined that allowed Equinox to use help files supplied in the plugin project as accessible resources. This is what I put in plugin.xml in extensions' section:

<extension point="org.eclipse.help.webapp.view">
      <view class="plugin.CustomView"></view>
</extension>

<extension point="org.eclipse.equinox.http.registry.httpcontexts">
      <httpcontext id="help">
         <resource-mapping path="/"> </resource-mapping>
      </httpcontext>
</extension>

<extension point="org.eclipse.equinox.http.registry.resources">
      <resource alias="/help" base-name="/help" httpcontextId="help"> </resource>
</extension>


The firs one is the actual view definition class. Next is the help context pointing on the plugin's root and the last is actual folder containing JSP files, it's position relative to the plugin's root and alias as available for the browser. After adding those Information Center in my application displays my test HTML code in the new tab. The same goes for other extension points in help plugin that add new JSP-based views in Information Center.

[Updated on: Thu, 08 August 2013 06:50]

Report message to a moderator

Previous Topic:Widget disposed too early exception
Next Topic:SWT Browser - 64bit windows - still IE only?
Goto Forum:
  


Current Time: Thu Aug 21 00:21:09 EDT 2014

Powered by FUDForum. Page generated in 0.11748 seconds