Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 283136 - [Intro] AlwaysWelcomeCheckbox - incorrect URL when creating HTML content
Summary: [Intro] AlwaysWelcomeCheckbox - incorrect URL when creating HTML content
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5.1   Edit
Assignee: platform-ua-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-10 09:29 EDT by Mike Evans CLA
Modified: 2009-07-15 18:49 EDT (History)
3 users (show)

See Also:


Attachments
patch for AlwaysWelcomeCheckbox java file (1.03 KB, patch)
2009-07-10 09:29 EDT, Mike Evans CLA
cgold: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Evans CLA 2009-07-10 09:29:23 EDT
Created attachment 141294 [details]
patch for AlwaysWelcomeCheckbox java file

Build ID: 20090619-0625

Steps To Reproduce:
1. Create RCP app with customised intro
2. Add the AlwaysWelcomeCheckbox
3. Run app - error message when click checkbox.


More information:
Incorrect plug-in in HTML of createContent(...).

Currently:
		out.print("<div id=\""+id+"\"><input type=\"checkbox\" "+  	//$NON-NLS-1$//$NON-NLS-2$
				"onClick=window.location="+ 						//$NON-NLS-1$
				"\"http://org.eclipse.ui.intro/runAction?"+ 		//$NON-NLS-1$
				"pluginId=org.eclipse.platform&"+ 					//$NON-NLS-1$
				"class="+this.getClass().getName()+"\" ");			//$NON-NLS-1$ //$NON-NLS-2$


Should be:

		out.print("<div id=\""+id+"\"><input type=\"checkbox\" "+  	//$NON-NLS-1$//$NON-NLS-2$
				"onClick=window.location="+ 						//$NON-NLS-1$
				"\"http://org.eclipse.ui.intro/runAction?"+ 		//$NON-NLS-1$
				"pluginId=org.eclipse.ui.intro&"+ 					//$NON-NLS-1$
				"class="+this.getClass().getName()+"\" ");			//$NON-NLS-1$ //$NON-NLS-2$

Patch to fix attached.
Comment 1 Chris Goldthorpe CLA 2009-07-15 13:17:54 EDT
Chris A - can you take a look at this?
Comment 2 Chris Austin CLA 2009-07-15 15:05:10 EDT
(In reply to comment #1)
> Chris A - can you take a look at this?
> 

I don't get an error when I use the Checkbox as it currently is (Although I did not create an RCP app).  That being said, IIntroAction does outline a sample URL as:
---
http://org.eclipse.ui.intro/runAction?pluginId=x.y.z&class=x.y.z.someClass 
---
which is a convention I did not use when coding this (I must have left the 'org.eclipse.platform' id from before moving the AlwaysWelcomeCheckbox class).  So regardless of my repro case, I think this would be an appropriate change to make.
Comment 3 Chris Goldthorpe CLA 2009-07-15 18:38:21 EDT
This does need to get fixed. The code as is seems to work OK as long as org.eclipse.platform is part of the application, it uses the class loader from that bundle to load the class from org.eclipse.ui.intro. I don't know enough about class loaders to know exactly what circumstances this will work in but the code is incorrect and I would expect it to fail in an RCP app that did not include org.eclipse.platform. Fixed in HEAD.
Comment 4 Chris Goldthorpe CLA 2009-07-15 18:49:18 EDT
Fixed in 3.5 maintenance stream