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

Bug 360482

Summary: Orion does not render content from a remote location
Product: [ECD] Orion Reporter: Pradyut Sarma <pradyutksarma>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: simon_kaegi
Version: 0.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
content.json
none
content.html
none
crash results
none
State of the Navigator just before the crash none

Description Pradyut Sarma CLA 2011-10-10 16:06:28 EDT
Hi,

Hi,

I have created a orion plugin (content.html attached with the ticket) which contributes some content to the Navigator via the extension point "orion.core.file". The content consists of a folder called "Depots" which basically contains some java files not present in the orion workspace but streamed from the location specified within the content.json (attached here) file. 

On clicking of this file, it is expected that the client fires a GET request to the specified location, gets a response of type "text/plain" and renders it within the orion editor. The location currently points to a servlet which returns the source in the java file. The plan is to use a similar mechanism to render other custom artifacts, which also include java artifacts.

But on actually clicking the file, the editor crashes. The snapshot is also attached with the ticket along with the JS console with the error. Am I missing something here?

Is the Orion editor equipped to render content within the orion workspace only?

Thanks and Regards,
Pradyut.
Comment 1 Pradyut Sarma CLA 2011-10-10 16:07:01 EDT
Created attachment 204903 [details]
content.json
Comment 2 Pradyut Sarma CLA 2011-10-10 16:07:22 EDT
Created attachment 204904 [details]
content.html
Comment 3 Pradyut Sarma CLA 2011-10-10 16:08:16 EDT
Created attachment 204905 [details]
crash results
Comment 4 Pradyut Sarma CLA 2011-10-10 16:09:01 EDT
Created attachment 204906 [details]
State of the Navigator just before the crash
Comment 5 Simon Kaegi CLA 2011-10-10 23:57:59 EDT
Hi Pradyut,

This is not a bug in the editor. The problem is that you've provided an incomplete implementation of "orion.core.file" service. In particular you're missing an implementation for read.

The Orion client does not do XHRs itself to GET the content - that's the responsibility of the service implementation in the plugin. The reason that is the case is that because of the browsers single origin policy we would be restricting the location of content one server or else relying on something like CORS. Another problem is that we would be making an assumption on the implementation that is not universal. For example, I'm working on an implementation that uses the HTML5 FileSystem for offline.

I'd suggest taking a look at plugins/filePlugin/webdavImpl.js in orion.client.core to fill in a more complete implementation.
Comment 6 Pradyut Sarma CLA 2011-10-11 00:25:17 EDT
Hey Simon,

Thanks for the tip. I will check this out immediately.

Thanks and Regards,
Pradyut.

(In reply to comment #5)
> Hi Pradyut,
> 
> This is not a bug in the editor. The problem is that you've provided an
> incomplete implementation of "orion.core.file" service. In particular you're
> missing an implementation for read.
> 
> The Orion client does not do XHRs itself to GET the content - that's the
> responsibility of the service implementation in the plugin. The reason that is
> the case is that because of the browsers single origin policy we would be
> restricting the location of content one server or else relying on something
> like CORS. Another problem is that we would be making an assumption on the
> implementation that is not universal. For example, I'm working on an
> implementation that uses the HTML5 FileSystem for offline.
> 
> I'd suggest taking a look at plugins/filePlugin/webdavImpl.js in
> orion.client.core to fill in a more complete implementation.