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

Bug 369961

Summary: break up functionality in globalCommands.js
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.4   
Target Milestone: 0.4 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2012-01-27 11:13:42 EST
globalCommands has a bunch of functionality associated with common page code:

1.  HTML fragments for header, footer, toolbar content
2.  Code for inserting said fragments and hooking up their behaviors
3.  Implementation of command parameter collection (slideout)
4.  Walking the extension registry for primary nav links
5.  Authentication related functions
6.  Generation of common commands (globalCommands!)

The original idea was that this file (and page glue code) was the only place where you needed to understand page structure, dom id's, etc.  But it's getting unwieldy.  We might want to do something like:

- globalCommands.js - the global commands and extension registry commands
- commonPage.js - the html fragments, hooking them up, command parameter collection that understands these fragments
- we might even want the fragments themselves in their own file as exports so that tweaks to the page don't interfere with the rest.  Not sure about that part.
Comment 1 Susan McCourt CLA 2012-01-27 11:16:22 EST
I expect bug 369555 to shed light here.  Once we implement the "related links" stuff there will be more "common page" stuff.
Comment 2 Susan McCourt CLA 2012-01-30 16:11:33 EST
For now, I've split globalCommands into three parts.
commonHTMLFragments - just the HTML fragments for header, footer, toolbars.  This would be an HTML file if we were doing server side include, but for now it's a js file that defines HTML.

parameterCollectors - all the stuff dealing with parameter collection in a slideout

globalCommands - defines global commands, inserts the fragments, ties in the parameterCollectors, generates logic for all banner parts (authentication, searchbox, related links, etc.)  You can now think of globalCommands as "global commands and common glue code for the common page elements"

It's possible we would further divide up globalCommands to be just commands and then just glue, but I didn't want to go crazy.  We can see if either evolves to warrant its own module.