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

Bug 395593

Summary: [Sites] View on Site and Sites page does not work for remote sites services
Product: [ECD] Orion Reporter: Szymon Brandys <Szymon.Brandys>
Component: ClientAssignee: Szymon Brandys <Szymon.Brandys>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: ken_walker, mamacdon
Version: 1.0   
Target Milestone: 2.0 M1   
Hardware: All   
OS: All   
Whiteboard: integrations_sb
Bug Depends on:    
Bug Blocks: 395898, 395901    

Description Szymon Brandys CLA 2012-12-03 06:30:24 EST
Steps:

1) Have two Orions e.g. orion.eclipse.org (Orion 1) and local Orion (Orion 2)
2) Install Orion Site service from Orion 2 (http://localhost:8080/plugins/site/sitePlugin.html) into Orion 1
3) Install filesystem service from Orion 2 into Orion 1

Now when you open orion.eclipse.org navigator, you will see two Places.

4) Create a folder on the remote fs (from Orion 2) make it an html project
5) Open actions for it and click View on Site

You will see an empty 'View on Site' page.

You also can't create a site on the remote fs from the Sites page.
Comment 1 Mark Macdonald CLA 2012-12-03 11:08:09 EST
One place to start debugging would be orion/sites/siteClient.js -- the forFileLocation() code (lines 145-179 in particular) is responsible for finding a site service that can deal with a given file service. Perhaps this code is making an invalid assumption about the host page's domain matching the service's domain, or it's not resolving URLs correctly or something. (just an initial guess)
Comment 2 Szymon Brandys CLA 2012-12-04 07:01:53 EST
I pushed a simple fix for 'View on Site' page. Now if you try to use 'View on Site' action for a remote fs, you will at least see the list of remote sites. However 'Add to site' still does not work :|

I''l keep working on it.
Comment 3 Szymon Brandys CLA 2012-12-04 07:55:43 EST
I found two more issues
- I can see the list of all sites, but can start/stop just those local ones
- in my case (I have remote fs and sites service plugged in) 'View on Site' action in the navigator is shown just for the remote files,
but not for the local one :(
Comment 4 Szymon Brandys CLA 2012-12-05 08:27:27 EST
"I can see the list of all sites, but can start/stop just those local ones" - this is fixed now.

Mark, when I add a mapping, is there some magic happening with adding some access rights to mapped folders?
Comment 5 Szymon Brandys CLA 2012-12-05 09:35:41 EST
"in my case (I have remote fs and sites service plugged in) 'View on Site' action in the navigator is shown just for the remote files,
but not for the local one" - fixed too

The only missing part is the problem with mapping. We'll try to investigate that too.
Comment 6 Szymon Brandys CLA 2012-12-06 04:45:17 EST
The last problem was the workspace name used in
siteCommand.js#createSiteServiceCommands around line 44

See this code:
return fileService.loadWorkspaces().then(function(workspaces) {
	return mSiteClient.forFileLocation(serviceRegistry, file.Location).mapOnSiteAndStart(site, file, workspaces[0].Id);
}).then(data.userData.addToCallback, data.userData.errorCallback);

If you dig deeper into the code, you will see that always the default workspace (the one connected to the default filesystem) is used.
So if I try to create a site using a remote filesystem, this will not work.
				
However the check against the workspace on the server side is not required. The one against the file is enough.
So I just removed the workspace check and left the file one. See HostedSiteServlet#serveOrionFile.

I will raise a separate bug the get rid of workspace name from the site js api.