Community
Participate
Working Groups
When Orion serves up an editable file, we need to include headers that allow you to construct the URL where that file can be edited. Firebug can use these headers to make links that take you directly to the code editor.
The suggested approach was to do this using 2 headers: X-edit-server X-edit-token
This is now in the repo. For example, a request for http://localhost:8080/file/A/test.js returns the headers: X-Edit-Server http://localhost:8080/coding.html# X-Edit-Token /file/A/test.js Combining server + token gives us http://localhost:8080/coding.html#/file/A/test.js, the editing page for the file.
(For Orion developers who are self-hosting): The VM argument "org.eclipse.orion.server.core.selfHostPath" can be provided when launching the server. It gives a default path that will be prepended to resources in the X-Edit-Token header. This solves the issue of, for example, /js/editorContainer.js mapping to something like /A/static/js/editorContainer.js in your Orion filesystem. If you don't supply a value for this argument, then only /file/ URIs will have X-Edit- headers.
I've opened a bug at WebKit, in case Web Inspector can also take advantage of this: https://bugs.webkit.org/show_bug.cgi?id=53181
Firebug extn dyne uses this header and opened the Orion editor one time http://code.google.com/p/fbug/source/detail?r=9061
(In reply to comment #5) > Firebug extn dyne uses this header and opened the Orion editor one time Cool! How can I get/install this extension?
http://getfirebug.com/wiki/index.php/Editing#Orion_Web_Editor
Mark, can you please give this a try? Does it work with our own files in self-hosting mode as described in comment 3?
John, what version of Firebug should I be running to try this out? I tested with 1.7X built from trunk, but it gave me a JavaScript error when I clicked Edit: > Error: isSystemURL is not defined > Source File: chrome://firebug/content/chrome.js > Line: 695
(In reply to comment #9) > John, what version of Firebug should I be running to try this out? I tested > with 1.7X built from trunk, but it gave me a JavaScript error when I clicked I hope you did not mean literally 'trunk'. See http://getfirebug.com/wiki/index.php/Firebug_Internals > Edit: > > Error: isSystemURL is not defined > > Source File: chrome://firebug/content/chrome.js > > Line: 695 This code is called from the external editors feature, so I'd like to know just how you hit it. [Edit] on the script panel from dyne should not trigger this code.
Well now I am puzzled, because the header does not come out on http://localhost:8080/navigate-table.html# but it does come out when I go to http://localhost:8080/file/org.eclipse.orion.client.core/static/navigate-table.html#
And http://localhost:8080/file/org.eclipse.orion.client.core/static/navigate-table.html# has CSS urls like http://localhost:8080/ide.css so they can't be edited either.
(In reply to comment #11) > Well now I am puzzled, because the header does not come out on > http://localhost:8080/navigate-table.html# > but it does come out when I go to > http://localhost:8080/file/org.eclipse.orion.client.core/static/navigate-table.html# This is what comment 3 is about - if the file is coming from /file/* we know that this is an editable URL (one that supports PUT) and add the header. For files like /navigate-table.html and /ide.css we only add a header if the server has been started with an additional argument that provides the mapping to where under /file/* these files are editable.
Oh, sorry I just did not make the connection. -Dorg.eclipse.orion.server.core.selfHostPath=<path> puts <path> into the middle of x-edit-token: /file<path>/navigate-table.html So with a host url of: http://localhost:8080/navigate-table.html# You can find the edit url by navigating the self-hosted files: http://localhost:8080/coding.html#http://localhost:8080/file/org.eclipse.orion.client.core/static/navigate-tree.html The file service url you want to mimic is on the end: http://localhost:8080/file/org.eclipse.orion.client.core/static/navigate-tree.html# So the config is: -Dorg.eclipse.orion.server.core.selfHostPath=/org.eclipse.orion.client.core/static Note that this means only one project can be set on the path at a time. dyne revision R9087 edits the self-hosting files, but you can only see the results if you open the file-service URL. I think the self-hosting story would be clearer if the home page listed "File service" and "Project Navigator", with the self-hosting entries on the File-service branch
(In reply to comment #14) > Note that this means only one project can be set on the path at a time. Correct - the story on our end is incomplete. We didn't want to invest too much in the self-hosting scenario without also adding value for regular users of Orion. The next step (I think) for us is to implement a way to define a "site" so that we can host it for the user rather than it appearing under "/file". For example, I could be working on a couple of files for a website, under a directory "mywebsite". I'd want to be able to have the files under that directory hosted such that they appear at the root of the namespace. In this case my "site definition" could be something like: mysite = [{target: "/", source: "/mywebsite"}] Once you've defined a "site", Orion should be able to host it for you, either on a different port (http://localhost:8081/) or a different name for the same server (http://127.0.0.2:8080) or a subdomain assuming this is set up properly with DNS and wildcards (http://mysite.boris.orion.eclipse.org). If you allow more than one mapping from target to source per site definition, we could handle the self-hosting scenario as follows: selfhostingsite = [ {target: "/", source: "/org.eclipse.orion.client.core/static/"}, {target: "/editor", source: "/org.eclipse.orion.client.editor/web/"}, ... ] But that's for after we've declared M5.
I've copied the contents of comment 15 into a new bug 335789 that we can target for M6.
at R9098 dyne supports launching Orion from chromebug http://getfirebug.com/wiki/index.php/Editing#Orion_Web_Editor_in_Chromebug_for_Local_Files pretty convoluted to setup
(In reply to comment #10) > I hope you did not mean literally 'trunk'. See > http://getfirebug.com/wiki/index.php/Firebug_Internals No: I should've said "the 1.7 branch". > This code is called from the external editors feature, so I'd like to know just > how you hit it. [Edit] on the script panel from dyne should not trigger this > code. Here's what I did: 1. Create new Firefox profile 2. Checkout Firebug from SVN 3. Link to dyne0.1 and firebug1.7 in my Firefox profile extensions folder. 4. Navigate to a file on the Orion server that has the X-Edit headers. 5. Open Firebug Script panel, click [Edit] 6. Get error from Comment 9 If I use the Firebug 1.7X.0a9 release build instead of the code from SVN, I get a different error in step 6: Error: Firebug.chrome.getSelectedPanelLocation is not a function Source File: chrome://dyne/content/dyne.js Line: 44
(In reply to Mark Macdonald from comment #0) > When Orion serves up an editable file, we need to include headers that allow > you to construct the URL where that file can be edited. Firebug can use > these headers to make links that take you directly to the code editor.