Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341350 - How to include dependencies of header and footer commands in each page
Summary: How to include dependencies of header and footer commands in each page
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Simon Kaegi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-30 09:10 EDT by John Arthorne CLA
Modified: 2011-09-01 11:42 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2011-03-30 09:10:47 EDT
Commands and widgets in the header and footer regions have various prerequisites (both scripts and dojo requires). This means that each HTML page containing the headers and footers needs to express those dependencies. This isn't modular or scalable. We need some way to inject the dependencies along with the header and footer, so each page doesn't need to know implementation details of the header/footer content.

The concrete example in bug 339509, is that each page needs to add a dojo require on dijit.form.TextBox in order for the "Open Resource" command to work.
Comment 1 John Arthorne CLA 2011-03-30 09:42:53 EDT
Just to document here, to fix the "Open Resource" problem I had to add a couple of dojo requires on each page, and ensure the dojo module page had the scripts required by the header:

	var djConfig = {
		isDebug : true,
		modulePaths : {'widgets': '/js/widgets'},
		parseOnLoad : true
	};

Multiply by about ten pages...
Comment 2 Susan McCourt CLA 2011-03-30 17:30:17 EDT
For this specific case, I consider this bug to be a symptom of the bigger problem described in bug 340019.

Rather than have us focus on dependency management to solve this problem, I'd like to see us come up with a real story for including one set of html/js in all the pages.
Comment 3 Susan McCourt CLA 2011-06-01 11:50:09 EDT
This is fixed by Simon's changes for require js.
The js files for the global header and footer now explicitly state their dependencies, so the dependency on Open Resource Dialog is stated in globalCommands.js

(Just now OpenResource was broken when invoked from the editor because dijit.form.TextBox was missing as a requirement.  Added it as a requirement of open resource dialog.  Now it works.  Cool.)