Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341350

Summary: How to include dependencies of header and footer commands in each page
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: ClientAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: simon_kaegi, susan
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

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.)