Author: rob.stryker(a)jboss.com
Date: 2007-11-02 17:20:11 -0400 (Fri, 02 Nov 2007)
New Revision: 4678
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java
Log:
Full Publish on EAR not republishing child modules. Will now.
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ModuleUtil.java 2007-11-02
21:20:11 UTC (rev 4678)
@@ -0,0 +1,34 @@
+package org.jboss.ide.eclipse.as.core.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+
+public class ModuleUtil {
+ public static ArrayList<IModule[]> getShallowChildren(IServer server, IModule[]
root) {
+ ArrayList<IModule[]> list = new ArrayList<IModule[]>();
+ IModule[] children = server.getChildModules(root, new NullProgressMonitor());
+ // children is { aWar, bWar, cWar } projects
+ for( int i = 0; i < children.length; i++ ) {
+ ArrayList<IModule> inner = new ArrayList<IModule>();
+ inner.addAll(Arrays.asList(root));
+ inner.add(children[i]);
+ IModule[] innerMods = inner.toArray(new IModule[inner.size()]);
+ list.add(innerMods);
+ }
+ return list;
+ }
+
+ public static ArrayList<IModule[]> getDeepChildren(IServer server, IModule[] mod)
{
+ ArrayList<IModule[]> deep = getShallowChildren(server, mod);
+ IModule[] toBeSearched;
+ for( int i = 0; i < deep.size(); i++ ) {
+ toBeSearched = deep.get(i);
+ deep.addAll(getShallowChildren(server, toBeSearched));
+ }
+ return deep;
+ }
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java 2007-11-02
20:50:56 UTC (rev 4677)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java 2007-11-02
21:20:11 UTC (rev 4678)
@@ -43,12 +43,11 @@
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.PublishServerJob;
import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.eclipse.wst.server.ui.ServerUICore;
import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.core.util.ModuleUtil;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
@@ -133,7 +132,12 @@
if( selection != null && selection.length > 0 ) {
Server s = ((Server)selection[0].server);
for( int i = 0; i < selection.length; i++ ) {
- s.setModulePublishState(selection[i].module, type);
+ IModule[] mod = selection[i].module;
+ s.setModulePublishState(mod, type);
+ ArrayList<IModule[]> allChildren = ModuleUtil.getDeepChildren(s, mod);
+ for( int j = 0; j < allChildren.size(); j++ ) {
+ s.setModulePublishState((IModule[])allChildren.get(j), type);
+ }
}
new PublishServerJob(s, IServer.PUBLISH_INCREMENTAL, true).schedule();
}
Show replies by date