Welcome page with dynamic content (contentProducer?) [message #623873] |
Mon, 22 February 2010 11:33  |
Eclipse User |
|
|
|
Hi
I am attempting to write a contentProducer in order to forfill the following usecase:
I would like to be able to contribute content to my intro page determined by java logic.
I thought that using a contentProducer would be the way to go however I cant seem to get the contentProducer code to be executed.
This is my plugin xml for the plugin containing the intro
http://pastebin.com/m56ab9798
But I am unsure of how to reference the contentProducer so that it is invoked to create the content.
Any help would be greatly appreciated as I am struggling to find resources on the subject.
Alec
|
|
|
Re: Welcome page with dynamic content (contentProducer?) [message #623876 is a reply to message #623873] |
Mon, 22 February 2010 14:27   |
Eclipse User |
|
|
|
Hi Alec,
Your plugin.xml looks fine to me.
There is an example of this in the eclipse code for 3.6. Any recent build of Eclipse 3.6 should have the Network Error Page which is supplied by a Content Producer in the org.eclipse.help.webapp plugin, see /org.eclipse.help.webapp/src/org/eclipse/help/internal/webap p/StatusProducer.java
In order to reference the Content Producer, you need to use a URL that includes the plugin which contains the extension point for your Content Producer. In other words, for the example above , something like this:
help/topic/org.eclipse.help.webapp/NetworkHelpStatus.html
The getInputStream(String pluginID, String href, Locale locale) method of your Content Producer will be called anytime a reference is made to a topic inside of its parent plugin. At that time, it is best to check the request and see if it is a request for your dynamic content. If so, return an InputStream containing the dynamic content. If not, return null so that Eclipse can send the help request to any static content that may be available in the plugin.
- Chris Austin
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02821 seconds