sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject svn commit: r1594935 - in /sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal: SlingBundleModuleFactory.java SlingContentModuleFactory.java SlingLaunchpadServer.java
Date Thu, 15 May 2014 14:48:01 GMT
Author: rombert
Date: Thu May 15 14:48:00 2014
New Revision: 1594935

URL: http://svn.apache.org/r1594935
Log:
SLING-3165 - Cannot remove Bundle or Content Package Module from Server

Make our own sling modules extend ProjectModule instead of
ModuleDelegate, as ProjectModule provides a better implementation.

Modified:
    sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java
    sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java
    sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadServer.java

Modified: sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java?rev=1594935&r1=1594934&r2=1594935&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java
(original)
+++ sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingBundleModuleFactory.java
Thu May 15 14:48:00 2014
@@ -41,6 +41,7 @@ import org.eclipse.wst.server.core.IModu
 import org.eclipse.wst.server.core.model.IModuleResource;
 import org.eclipse.wst.server.core.model.ModuleDelegate;
 import org.eclipse.wst.server.core.util.ModuleFile;
+import org.eclipse.wst.server.core.util.ProjectModule;
 import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate;
 
 public class SlingBundleModuleFactory extends ProjectModuleFactoryDelegate {
@@ -83,12 +84,10 @@ public class SlingBundleModuleFactory ex
         return null;
     }
 
-    static class SlingBundleModuleDelegate extends ModuleDelegate {
-
-        private final IModule module;
+    static class SlingBundleModuleDelegate extends ProjectModule {
 
         public SlingBundleModuleDelegate(IModule module) {
-            this.module = module;
+            super(module.getProject());
         }
 
         @Override
@@ -112,8 +111,7 @@ public class SlingBundleModuleFactory ex
          */
         @Override
         public IModuleResource[] members() throws CoreException {
-            IProject project = module.getProject();
-            final IJavaProject javaProject = ProjectHelper.asJavaProject(project);
+            final IJavaProject javaProject = ProjectHelper.asJavaProject(getProject());
             final List<IModuleResource> resources = new ArrayList<IModuleResource>();
             
             final Set<String> filteredLocations = new HashSet<String>();
@@ -124,12 +122,12 @@ public class SlingBundleModuleFactory ex
 				IClasspathEntry aCp = rawCp[i];
 				IPath outputLocation = aCp.getOutputLocation();
 				if (outputLocation!=null) {
-					outputLocation = outputLocation.makeRelativeTo(project.getFullPath());
+                    outputLocation = outputLocation.makeRelativeTo(getProject().getFullPath());
 					filteredLocations.add(outputLocation.toString());
 				}
 			}
             
-            project.accept(new IResourceVisitor() {
+            getProject().accept(new IResourceVisitor() {
                 @Override
                 public boolean visit(IResource resource) throws CoreException {
 
@@ -165,7 +163,7 @@ public class SlingBundleModuleFactory ex
 
             for (Iterator<IModuleResource> it = resources.iterator(); it.hasNext();)
{
 				IModuleResource iModuleResource = it.next();
-                logger.trace("For module {0} added {1}", module.getName(), iModuleResource.getModuleRelativePath()
+                logger.trace("For module {0} added {1}", getName(), iModuleResource.getModuleRelativePath()
                         .toString());
 			}
             return resources.toArray(new IModuleResource[resources.size()]);

Modified: sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java?rev=1594935&r1=1594934&r2=1594935&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java
(original)
+++ sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingContentModuleFactory.java
Thu May 15 14:48:00 2014
@@ -22,6 +22,7 @@ import org.eclipse.wst.server.core.model
 import org.eclipse.wst.server.core.model.ModuleDelegate;
 import org.eclipse.wst.server.core.util.ModuleFile;
 import org.eclipse.wst.server.core.util.ModuleFolder;
+import org.eclipse.wst.server.core.util.ProjectModule;
 import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate;
 
 public class SlingContentModuleFactory extends ProjectModuleFactoryDelegate {
@@ -64,12 +65,11 @@ public class SlingContentModuleFactory e
         return null;
     }
 
-    static class SlingContentModuleDelegate extends ModuleDelegate {
+    static class SlingContentModuleDelegate extends ProjectModule {
 
-        private final IModule module;
 
         public SlingContentModuleDelegate(IModule module) {
-            this.module = module;
+            super(module.getProject());
         }
 
         @Override
@@ -79,15 +79,14 @@ public class SlingContentModuleFactory e
 
         @Override
         public IModuleResource[] members() throws CoreException {
-            IProject project = module.getProject();
             final List<IModuleResource> resources = new ArrayList<IModuleResource>();
-            final IFolder syncFolder = project.getFolder(ProjectUtil.getSyncDirectoryValue(project));
+            final IFolder syncFolder = getProject().getFolder(ProjectUtil.getSyncDirectoryValue(getProject()));
 
             if (!syncFolder.exists()) {
                 return new IModuleResource[0];
             }
 
-            project.accept(new IResourceVisitor() {
+            getProject().accept(new IResourceVisitor() {
                 @Override
                 public boolean visit(IResource resource) throws CoreException {
 

Modified: sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadServer.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadServer.java?rev=1594935&r1=1594934&r2=1594935&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadServer.java
(original)
+++ sling/trunk/tooling/ide/eclipse-core/src/org/apache/sling/ide/eclipse/core/internal/SlingLaunchpadServer.java
Thu May 15 14:48:00 2014
@@ -64,8 +64,8 @@ public class SlingLaunchpadServer extend
 
             if (!MODULE_TYPE_SLING_CONTENT.equals(module.getModuleType().getId()) &&
             		!MODULE_TYPE_SLING_BUNDLE.equals(module.getModuleType().getId())) {
-                return new Status(IStatus.ERROR, "org.apache.sling.slingclipse", 0,
-                        "Will only handle modules of type 'sling.content' or 'sling.bundle'",
null);
+                return new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+                        "Will only handle modules of type 'sling.content' or 'sling.bundle'");
             }
         }
 
@@ -113,7 +113,7 @@ public class SlingLaunchpadServer extend
             throw new CoreException(status);
         }
 
-        // TODO - actually add/remove modules ...
+        // TODO - what else do we do?
     }
 
     @Override



Mime
View raw message