incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1409889 - in /sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards: ImportWizard.java ImportWizardPage.java
Date Thu, 15 Nov 2012 17:29:42 GMT
Author: asanso
Date: Thu Nov 15 17:29:41 2012
New Revision: 1409889

URL: http://svn.apache.org/viewvc?rev=1409889&view=rev
Log:
SLING-2655 - [Tooling] Slingclipse import wizard should notify the user in case of errors.
Applied patch from Robert Munteanu. Thanks!!

Modified:
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards/ImportWizard.java
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards/ImportWizardPage.java

Modified: sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards/ImportWizard.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards/ImportWizard.java?rev=1409889&r1=1409888&r2=1409889&view=diff
==============================================================================
--- sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards/ImportWizard.java
(original)
+++ sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards/ImportWizard.java
Thu Nov 15 17:29:41 2012
@@ -17,10 +17,6 @@
 package org.apache.sling.slingclipse.ui.wizards;
 
 import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
 import java.nio.charset.Charset;
 import java.util.Iterator;
 
@@ -37,18 +33,13 @@ import org.apache.sling.slingclipse.pref
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
 import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
@@ -122,8 +113,9 @@ public class ImportWizard extends Wizard
 						monitor.setTaskName("Import Complete");
 						monitor.worked(100);
 					} catch ( Exception e) {
-						SlingclipsePlugin.getDefault().getLog().
-						log(new CoreException(new Status(Status.ERROR, SlingclipsePlugin.PLUGIN_ID, "Failed
importing repository ", e)).getStatus());
+						Status status = new Status(Status.ERROR, SlingclipsePlugin.PLUGIN_ID, "Failed importing
repository ", e);
+						SlingclipsePlugin.getDefault().getLog().log(status);
+						return status;
 					}finally{
 						//restore to the original value
 						store.setValue(PreferencesMessages.REPOSITORY_AUTO_SYNC.getKey(), autoSync);
@@ -141,15 +133,6 @@ public class ImportWizard extends Wizard
                         createFolder(project, rootImportPath.removeLastSegments(i));
                 }
 			};
-			job.addJobChangeListener(new JobChangeAdapter() {
-				public void done(IJobChangeEvent event) {
-					if (event.getResult().isOK()) {
-						System.out.println("Job Succeeded!");
-					} else {
-						System.err.println("Job Failed!");
-					}
-				}
-			});
 			job.setSystem(false);
 			job.setUser(true);
 			job.schedule();

Modified: sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards/ImportWizardPage.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards/ImportWizardPage.java?rev=1409889&r1=1409888&r2=1409889&view=diff
==============================================================================
--- sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards/ImportWizardPage.java
(original)
+++ sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/ui/wizards/ImportWizardPage.java
Thu Nov 15 17:29:41 2012
@@ -257,6 +257,12 @@ public class ImportWizardPage extends Wi
 			setErrorMessage("Please enter valid server information");
 			return false;
 		}
+		
+		if ( !getRepositoryPath().startsWith("/") ) {
+			setErrorMessage("The repository path needs to be absolute");
+			return false;
+		}
+		
 		IPath containerNameField= super.getResourcePath();  
 		if (!containerNameField.toOSString().endsWith(SlingclipseHelper.JCR_ROOT)){
 			setErrorMessage("Please enter a valid Sling project folder (e.g. jcr_root)");



Mime
View raw message