Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Orion » Orion and same origin policy
Orion and same origin policy [message #938107] Tue, 09 October 2012 10:52 Go to next message
Bryan Hunt is currently offline Bryan Hunt
Messages: 346
Registered: July 2009
Senior Member
How do people developing web sites with Orion deal with the same origin policy?

I'm creating a web site where the server is using RESTful web services / resources with a JavaScript application. I'm interested in the possibility of using Orion for the front-end development. The entire system is currently developed in Eclipse and I'm deploying my own OSGi based server using Jetty and Restlet. The HTML, CSS, and JavaScript files are currently served from an OSGi bundle by Restlet.

I'd really like to be able to "run" from Orion without having to deploy everything. Is this possible? It seems this is where the same origin policy would come into play.

Would a possible solution be to deploy my server-side OSGi bundles together with the Orion server? How would I deploy a site - meaning, how would I make the changes to the HTML, CSS, and JavaScript live?
Re: Orion and same origin policy [message #940248 is a reply to message #938107] Thu, 11 October 2012 09:08 Go to previous messageGo to next message
John Arthorne is currently offline John Arthorne
Messages: 174
Registered: July 2009
Senior Member
The answer to the "same origin" problem in Orion is plugins. Each plugin in Orion lives in a separate iframe, and can therefore have a different origin. Some background on that can be found here if you want to know more:

http://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Architecture

But your situation is really about deployment. There are mixed opinions right now on how to best deploy an application developed in Orion into a test/runtime environment. There are a number of options:

1) Manual deploy with SFTP to the target server.
2) Target server "pulls" content from Orion workspace. Each folder in an Orion workspace has a URL responding to a zip representation of that folder. So with a simple wget + unzip one can pull content from Orion into a deployment environment.
3) Have an Orion file system plugin running in the target server, so you are editing files directly on the "live" server from Orion. Because of the Orion architecture it is only a single plugin that would need to live in the target domain, and the rest of the tools could be on a separate Orion server (or orionhub.org)
4) Embed all of Orion in the target server. While this is not strictly needed, it can be easier to manage. The current Orion server is just a set of servlets so it seems compatible with your architecture.

John
Re: Orion and same origin policy [message #940916 is a reply to message #940248] Fri, 12 October 2012 00:03 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
Quote:
Target server "pulls" content from Orion workspace. Each folder in an Orion workspace has a URL responding to a zip representation of that folder. So with a simple wget + unzip one can pull content from Orion into a deployment environment.


Two questions about this:

1) I could get directory listings (in HTML) and the file contents, but couldn't get a workspace zip for a workspace. What would the workspace URL look like? Would it work for child folders as well?

2) I guess this depends on Orion running with orion.file.anonymous.read=true. Is OrionHub going to to continue like that going forward? (as a plugin developer, I'd hope so).
Re: Orion and same origin policy [message #940926 is a reply to message #940916] Fri, 12 October 2012 00:14 Go to previous message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
Okay, answering my 1st question: should use the ExportLocation, which looks like this:

http://orionhub.org/xfer/export/cH/cloudfier-site.zip

Previous Topic:Async ContentAssist
Next Topic:Need help writing Authentication Plugin
Goto Forum:
  


Current Time: Sat Aug 23 05:36:46 EDT 2014

Powered by FUDForum. Page generated in 0.02097 seconds