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

Bug 334211

Summary: [client] Clean up client-facing URL's
Product: [ECD] Orion Reporter: Susan McCourt <susan>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: mamacdon, simon_kaegi
Version: 0.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2011-01-12 23:52:15 EST
Our client-side URLs could use some cleanup:

- use relative paths for data URL where possible
- Rather than exposing specific HTML file names, hide behind cleaner directory names for different tasks
- Consider the implications of using the hash as the separator between tooling and data.

1.William P. Higgins Nov 20, 2010 11:13 A.M.
Might want to see how you can take advantage of window.history.pushState in newer browsers.

References:
http://www.spoiledmilk.dk/blog/?p=1922
https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history
Comment 1 Susan McCourt CLA 2011-03-10 17:55:12 EST
This seems like the right bug for continuing the discussion about use of hash bang and our overall client/server split.

It's bothered me that in the editor we use the hash to get the most important content.   I realize an ajax app is necessarily going to GET all kinds of info, but when it's the central data that it's getting, that feels weird to me.

Now, if we were to fetch only the visible part of the data (vs. the whole file) that would feel better.

The situation feels worse to me now that we're generating so much of the chrome content (banners, commands, footers) in JS.  Given our current architecture, the only way I could share the banner code without copying it around or doing another GET for it was sticking HTML banner fragments in the JS!

So in our current state, we are downloading mostly javascript and a skeletal DOM, and then generating both chrome and content in JS.

After reading this lengthy but very thorough analysis of the hash bang situation, I find myself nodding my head to the guidelines proposed and in particular to this comment from Brian Gallagher
    http://www.jenitennison.com/blog/node/154#comment-10620

I'm repeating the most important part of it here:
<brian>
From a user-experience, content-oriented framework, this entire architecture should be reversed. The URI should point to the content, not the presentation as it does with hashbang. The content should be served first, in a readable format, and then the JavaScript magic should kick in, download all the chrome in the background and then update the page once with all the other elements.

If you’re going to have your page do a secondary load anyway (as hashbang does now) you might as well make the content the front-and-center part.
</brian>

This would mean the server had to be smart enough to look for a resource in the server workspace and then serve up an HTML representation the javascript needed to turn it into a "task."  With js turned off (I realize we don't have to care about that user group) you'd still see the code.

Then the JS could GET the html fragments for the chrome, install the editor, etc.

The hashes would still navigate things like line numbers, or search tokens, etc.
Comment 2 Susan McCourt CLA 2011-03-10 19:25:30 EST
To be specific...

http://localhost:8080/coding.html#/file/D/static/js/favorites.js?line=69
becomes
http://localhost:8080/file/D/static/js/favorites.js?task=edit#!line=69

http://localhost:8080/navigate-table.html#/file/D/static/?depth=1
becomes
http://localhost:8080/file/D/static?task=navigate&depth=1


http://localhost:8080/git-status.html#http://localhost:8080/git/status/file/D
becomes
http://localhost:8080/git/status/file/D?task=edit

http://localhost:8080/searchResults.html#/search?q=BorderContainer
becomes
http://localhost:8080/search?q=BorderContainer&task=view

I know there are pros and cons to both ways, and we may have different approaches for different tasks.

For cases like the navigator where you stay on the same page a lot, changing small bits of data, you would probably rather keep it the way it is, so that you keep all your js around and just fetch the part you need.  

But for cases where we expect the user to work mostly with the same data on a page, like the editor, this seems more intuitive to me.  If we expected users to keep reloading the same editor with different files, then again, maybe not a good idea.
Comment 3 Simon Kaegi CLA 2011-03-10 22:17:01 EST
The problem I see with this approach is that (architecturally) we do not control the resource.

e.g. how do I edit my external dropbox/webdav (etc.) resources
Comment 4 John Arthorne CLA 2015-05-05 15:50:15 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html
Comment 5 John Arthorne CLA 2015-05-05 16:02:52 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html