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

Bug 412344

Summary: [projects] recover Orion 2.0 projects feature
Product: [ECD] Orion Reporter: Anthony Hunter <ahunter.eclipse>
Component: ClientAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: antonm, arthorne.eclipse, ken_walker, Szymon.Brandys
Version: 4.0Flags: antonm: review+
Target Milestone: 4.0 M1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Anthony Hunter CLA 2013-07-04 15:58:38 EDT
In Orion 2.0 M2 ( Bug 397721 ), we introduced a very early preview of a new project concept. Currently, support is implemented to edit code and other sources directly on a remote SFTP server. For more details, see Anton McConville’s
blog post at http://www.hickory.ca/2013/01/28/managing-an-sftp-type-website-using-orion/.

This project plugin is not working in Orion 3.0.

This enhancement is to recover this feature as delivered to a working state again.

Once we have this projects feature working, we can consider moving it forward.
Comment 1 Szymon Brandys CLA 2013-07-05 04:43:15 EDT
That is great Anthony. Do you know where we were regarding repository support in the Projects view?
Comment 2 Anthony Hunter CLA 2013-07-08 17:16:36 EDT
(In reply to comment #1)
> That is great Anthony. Do you know where we were regarding repository
> support in the Projects view?

I do not believe repository support was started in the Projects view.
Comment 3 Anthony Hunter CLA 2013-07-08 17:44:51 EDT
It looks like the "ContentLocation: sftp://:@server.example.com:22" is handled differently in 3.0.

In 2.0, when you added the remote content location using the drive UI, it appears as a child under /workspace/user/drive and not a child project under /workspace/user.

In 3.0, it does not appear as a child under /workspace/user/drive but does appear as a child project under /workspace/user. As a result orion thinks the remote project is local on the orion server.

It is possible this is something to be done from the MetadataInfo migration in 3.0?
Comment 4 Anthony Hunter CLA 2013-07-09 14:29:59 EDT
I have fixed several issues and restored the project feature as it was delivered in Orion 2.0:

As I said in comment 3 there was a small issue on the server side:

https://github.com/ahunter-orion/orion.server/commit/84b02581add5006ae9be7a6d36d941072a99b02a

WebProject.java:
We have a change during the MetadataInfo migration to always return an absolute URI in getContentLocation(). The workaround is applied to all URL and not just file:/, so you get a corrupted content location like ftp:/somethingsftp:/something. I have added a check to return if the location is not local.

on the client side, a few small fixes:

https://github.com/ahunter-orion/orion.client/commit/ebeb5c572640e7a2d82213ff550dedc728b46465

ProjectDataManager.js
There is an exception in the nested save callback, I have added protection code around the callback to prevent the exception (this problem was also in 2.0 but you did not see the issue unless you were debugging).

ProjectGrid.js
Fixed the two image sprites as per the sprite changes in 3.0. The images are missing on the projects page.

ProjectTree.js
Fixed an exception in the addAutoDismiss call for the dropdown menu, the first parameter expects an array.
Comment 5 Anthony Hunter CLA 2013-07-09 14:31:34 EDT
I asked for John to review the server change and Anton to review the client change. I can push when my committer rights are activated.
Comment 6 Anthony Hunter CLA 2013-07-15 12:57:48 EDT
Pushed the changes to master. The project feature is restored as it was delivered in Orion 2.0. We can now work further on projects during 4.0.
Comment 7 Anthony Hunter CLA 2013-07-15 15:29:10 EDT
The changes work with an internal ftp/http site on vottachrh6x64, but these same changes do not work with Anton's hickory site. Reopening.
Comment 8 Anthony Hunter CLA 2013-07-31 11:40:46 EDT
Ken would like to demo this feature next week, so need to look at fixing this.
Comment 9 Anthony Hunter CLA 2013-08-01 17:44:15 EDT
Ken, can you try this out. I am going to get another ftp site to test out.

Steps to using the project support:

1) Create a new account, after login you are on the editor page ( http://localhost:8080/edit/edit.html )
2) Create a new folder from the new dropdown menu. The projects do not work if there is not an existing folder (project) in your workspace.
3) Select settings from the options dropdown menu and select plugins.
4) Click the Install button, enter /plugins/projectsPlugin.html and click submit.
5) After the plugin says it is installed, refresh the page so that Projects is available as a link in the Navigation dropdown menu.
6) Select Projects to go to the projects page ( http://localhost:8080/projects/project.html )
7) Click the create a project button and select either project type from the list (both do the exact same thing) 
8) Enter Project Name, URL and Description and click the save button.
9) Click the Add a new drive button.
10) Change the default name, enter the SFTP hostname and SFTP port (22) and click the save button again. The drive does not work with the default name "New Drive 1".
11) Click the connect button. a folder with the name of your drive should be added to the drives list.
12) You can expand the folders under the drive. Clicking on a file or folder link sends you to the editor page on that link. 

The editor page is working on files at the drive location will save directly to the files on the SFTP server. You are editing your site on the SFTP server.

Back on the project page, you can select a folder and click the add button to add to the working set, but there is no way to see the working set in the editor.
Comment 10 Anthony Hunter CLA 2013-08-01 17:52:22 EDT
Forgot to add that in step 11) when you press connect your browser will give you a login dialog for the userid and password of your SFTP site.
Comment 11 Anthony Hunter CLA 2013-08-02 11:56:49 EDT
(In reply to comment #9)
> Ken, can you try this out. I am going to get another ftp site to test out.

I have had some luck with my other SFTP site (at Godaddy). 

The first try, the browser accepted my userid and password that is sent to the Orion server, but the server never came back. For whatever reason, the drive name was created under Orion Content. I clicked disconnect, removed this folder from the Navigator and connected again.

The second try clicking connect worked fine and the drive was correctly mounted. I was able to update files on the SFTP site using the Orion editor.

In addition, I have found that if you type an incorrect user or password for your drive, you are never given the opportunity to correct it, Orion just tells you cannot connect.

Can you try this again and let me know where the issue is?

Obviously this SFTP project feature needs lots of improvement.
Comment 12 Anthony Hunter CLA 2013-08-07 11:07:32 EDT
(In reply to comment #11)
> Can you try this again and let me know where the issue is?

Closing this defect for now. We can reopen when we confirm there is an issue.