Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Platform - User Assistance (UA) » Welcome page with dynamic content (contentProducer?)(struggling to add dynamic content in rcp 3.4)
Welcome page with dynamic content (contentProducer?) [message #516070] Mon, 22 February 2010 16:33 Go to next message
Alec  is currently offline Alec Friend
Messages: 12
Registered: February 2010
Junior Member
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 #516119 is a reply to message #516070] Mon, 22 February 2010 19:27 Go to previous messageGo to next message
Chris Austin is currently offline Chris AustinFriend
Messages: 28
Registered: July 2009
Junior Member
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
Re: Welcome page with dynamic content (contentProducer?) [message #516247 is a reply to message #516119] Tue, 23 February 2010 11:11 Go to previous messageGo to next message
Alec  is currently offline Alec Friend
Messages: 12
Registered: February 2010
Junior Member
Hi Chris

*Edit - Thank you for your rapid response! =)

Its good to see an example and hear that I am along the right lines.

How can i reference the plugin in the intro page though?

At the moment I have a fullscreen.xhtml that i use as the root page. what tag should i use to make reference to the plugin (hence the producer) to create the dynamic content.

ie how do i actually use it, when i try to create a link to it such as <a href="a.b.c.d.e/test.html">test link</a> I get a search page provided by my dns provider. Meaning the page cant be found =(

[Updated on: Tue, 23 February 2010 11:18]

Report message to a moderator

Re: Welcome page with dynamic content (contentProducer?) [message #516325 is a reply to message #516247] Tue, 23 February 2010 15:40 Go to previous messageGo to next message
Chris Austin is currently offline Chris AustinFriend
Messages: 28
Registered: July 2009
Junior Member
Hi Alec,

You are probably looking for the showHelpTopic command, see the extension content example below:


<?xml version="1.0" encoding="utf-8" ?>
<introContent>
  	<extensionContent id="test-introExtension" style="css/sample.css" name="Sample Extension" path="overview/@">
		<group style-id="content-group" id="test-introLink-group">
       		<link label="Error Page" url="http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.help.webapp/NetworkHelpStatus.html" id="test-introLink" style-id="content-link">
          		<text>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</text>
       		</link>
       	</group>
  	</extensionContent>
</introContent>


The url=" http://org.eclipse.ui.intro/showHelpTopic?id=/org.eclipse.he lp.webapp/NetworkHelpStatus.html" directs the intro page right to the Content Producer.
Re: Welcome page with dynamic content (contentProducer?) [message #516326 is a reply to message #516247] Tue, 23 February 2010 15:41 Go to previous messageGo to next message
Chris Austin is currently offline Chris AustinFriend
Messages: 28
Registered: July 2009
Junior Member
EDIT - Sorry just a duplicate post.

[Updated on: Tue, 23 February 2010 15:43]

Report message to a moderator

Re: Welcome page with dynamic content (contentProducer?) [message #516327 is a reply to message #516326] Tue, 23 February 2010 15:43 Go to previous messageGo to next message
Alec  is currently offline Alec Friend
Messages: 12
Registered: February 2010
Junior Member
Hi Chris

Thanks for the example, I'll try that right away.

However this will only create custom content from pages that have been generated by clicking links, is there a way to create the main landing welcome page using a content producer?

Alec
Re: Welcome page with dynamic content (contentProducer?) [message #516344 is a reply to message #516327] Tue, 23 February 2010 16:07 Go to previous messageGo to next message
Chris Austin is currently offline Chris AustinFriend
Messages: 28
Registered: July 2009
Junior Member
Hmm - I don't know if you can replace the welcome entirely. If you are looking to just add some dynamic content to the existing welcome, you can do that using org.eclipse.ui.intro.config.IIntroContentProvider - there are a few examples of this in org.eclipse.ui.intro.contentproviders.
Re: Welcome page with dynamic content (contentProducer?) [message #516858 is a reply to message #516344] Thu, 25 February 2010 11:46 Go to previous message
Alec  is currently offline Alec Friend
Messages: 12
Registered: February 2010
Junior Member
Thank you for your help chris.

Contentproviders are a better approach.

for others viewing this an excellent example of contentproviders can be created using the eclipse example rcp product wizard.

Alec
Previous Topic:turn off infocenter banner validation?
Next Topic:Question about translated text in Eclipse Help UI
Goto Forum:
  


Current Time: Thu Apr 25 10:56:15 GMT 2024

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

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

Back to the top