Bug 416547 Add Create a project from a sftp site
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/projectClient.js b/bundles/org.eclipse.orion.client.core/web/orion/projectClient.js
index 38b5abf..26659f6 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/projectClient.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/projectClient.js
@@ -143,7 +143,7 @@
 		},
 		
 		createProject: function(workspaceLocation, projectMetadata){
-				return this.fileClient.createProject(workspaceLocation, projectMetadata.Name, null, true).then(function(fileMetadata){
+				return this.fileClient.createProject(workspaceLocation, projectMetadata.Name, projectMetadata.ContentLocation, true).then(function(fileMetadata){
 					delete projectMetadata.Name;
 					return this.initProject(fileMetadata.ContentLocation, projectMetadata);
 				}.bind(this), 
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js b/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js
index fcc07be..499de45 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/projectCommands.js
@@ -634,6 +634,34 @@
 			
 			commandService.addCommand(createBasicProjectCommand);
 			
+			var createSftpProjectCommand = new mCommands.Command({
+				name: "Create a project from a sftp site",
+				tooltip: "Create a project from a sftp site",
+				id: "orion.project.create.sftp",
+				parameters : new mCommandRegistry.ParametersDescription([new mCommandRegistry.CommandParameter('name', 'text', 'Name:'),  //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+		                                                               		new mCommandRegistry.CommandParameter('url', 'url', 'Url:')]), //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+				callback: function(data){
+						var name = data.parameters.valueFor("name");
+						if(!name){
+							return;
+						}
+						var url = data.parameters.valueFor("url");
+						if(!url){
+							return;
+						}
+						var item = forceSingleItem(data.items);
+						progress.progress(projectClient.createProject(item.Location, {Name: name, ContentLocation: url}), "Creating project " + name).then(function(project){
+							dispatchNewProject(item, project);
+						});
+					},
+				visibleWhen: function(item) {
+						return(!!item.Location);
+					}
+				}
+				);
+				
+				commandService.addCommand(createSftpProjectCommand);
+				
 			var createZipProjectCommand = new mCommands.Command({
 			name: "Create a project from a zipped folder",
 			tooltip: "Create project and fill it with data from local file",
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/nav/mini-nav.js b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/nav/mini-nav.js
index 4e1abdc..f73c80f 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/nav/mini-nav.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/nav/mini-nav.js
@@ -73,12 +73,13 @@
 					
 					commandRegistry.registerCommandContribution(newActionsScope, "orion.project.create.basic", 1, "orion.commonNavNewGroup/orion.newContentGroup/orion.projectsNewGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
 					commandRegistry.registerCommandContribution(newActionsScope, "orion.project.create.fromfile", 2, "orion.commonNavNewGroup/orion.newContentGroup/orion.projectsNewGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+					commandRegistry.registerCommandContribution(newActionsScope, "orion.project.create.sftp", 3, "orion.commonNavNewGroup/orion.newContentGroup/orion.projectsNewGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
 					
 					var projectClient = serviceRegistry.getService("orion.project.client"); //$NON-NLS-0$
 					var dependencyTypesDef = new Deferred();
 					projectClient.getProjectHandlerTypes().then(function(dependencyTypes){
 						for(var i=0; i<dependencyTypes.length; i++){
-							commandRegistry.registerCommandContribution(newActionsScope, "orion.project.createproject." + dependencyTypes[i], i+3, "orion.commonNavNewGroup/orion.newContentGroup/orion.projectsNewGroup"); //$NON-NLS-1$ //$NON-NLS-0$
+							commandRegistry.registerCommandContribution(newActionsScope, "orion.project.createproject." + dependencyTypes[i], i+4, "orion.commonNavNewGroup/orion.newContentGroup/orion.projectsNewGroup"); //$NON-NLS-1$ //$NON-NLS-0$
 						}
 						
 						ProjectCommands.createProjectCommands(serviceRegistry, commandRegistry, this, fileClient, projectClient, dependencyTypes).then(dependencyTypesDef.resolve, dependencyTypesDef.resolve);