JBoss Tools SVN: r3537 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: META-INF and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-11 01:26:57 -0400 (Tue, 11 Sep 2007)
New Revision: 3537
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ModulePackageTypeConverter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackageModuleFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagedArtifactAdapter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesModelModuleContributor.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ModulePackageTypeConverter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackageModuleFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackagedArtifactAdapter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/SingleDeployableFactory.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/EarArchiveType.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
Renamed package from as.core.packages to as.core.modules
Moving to a cleaner API which can be opened up logically and more easily extended.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11 05:26:57 UTC (rev 3537)
@@ -24,7 +24,7 @@
Export-Package: org.jboss.ide.eclipse.as.core,
org.jboss.ide.eclipse.as.core.extensions.descriptors,
org.jboss.ide.eclipse.as.core.extensions.events,
- org.jboss.ide.eclipse.as.core.packages,
+ org.jboss.ide.eclipse.as.core.modules,
org.jboss.ide.eclipse.as.core.packages.types,
org.jboss.ide.eclipse.as.core.publishers,
org.jboss.ide.eclipse.as.core.runtime,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -29,7 +29,7 @@
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
-import org.jboss.ide.eclipse.as.core.packages.ArchivesBuildListener;
+import org.jboss.ide.eclipse.as.core.modules.ArchivesBuildListener;
import org.osgi.framework.BundleContext;
/**
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java (from rev 3530, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesBuildListener.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -0,0 +1,199 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.core.modules;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.internal.ModuleFactory;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
+import org.jboss.ide.eclipse.archives.core.model.other.IArchiveBuildListener;
+import org.jboss.ide.eclipse.archives.core.model.other.IArchiveModelListener;
+import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
+import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.PackagedModuleDelegate;
+import org.jboss.ide.eclipse.as.core.server.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+
+/**
+ *
+ * @author rob.stryker(a)jboss.com
+ */
+public class ArchivesBuildListener implements IArchiveBuildListener, IArchiveModelListener {
+
+ public static ArchivesBuildListener instance;
+ public static final String DEPLOY_SERVERS = "org.jboss.ide.eclipse.as.core.model.PackagesListener.DeployServers";
+ public static final String DEPLOY_AFTER_BUILD = "org.jboss.ide.eclipse.as.core.model.PackagesListener.DeployAfterBuild";
+
+ public static ArchivesBuildListener getInstance() {
+ if( instance == null ) {
+ instance = new ArchivesBuildListener();
+ }
+ return instance;
+ }
+
+ public ArchivesBuildListener() {
+ ArchivesModel.instance().addBuildListener(this);
+ ArchivesModel.instance().addModelListener(this, ArchivesModel.LIST_FRONT);
+ }
+
+ public void cleanArchive(IArchive pkg) {
+ }
+
+
+ public void finishedBuildingArchive(IArchive pkg) {
+ if( pkg.isTopLevel() && new Boolean(pkg.getProperty(DEPLOY_AFTER_BUILD)).booleanValue()) {
+ publish(pkg);
+ }
+ }
+
+ public void fileRemoved(IArchive topLevelPackage, IArchiveFileSet fileset, IPath filePath) {
+ }
+ public void fileUpdated(IArchive topLevelPackage, IArchiveFileSet fileset, IPath filePath) {
+ }
+
+ // If we're supposed to auto-deploy, get on it
+ protected static void publish(IArchive pkg) {
+ String servers = pkg.getProperty(ArchivesBuildListener.DEPLOY_SERVERS);
+ publish(pkg, servers, IServer.PUBLISH_INCREMENTAL);
+ }
+ public static void publish(IArchive pkg, String servers, int publishType) {
+ IModule[] module = getModule(pkg);
+ if( module[0] == null ) return;
+ DeployableServerBehavior[] serverBehaviors = ArchivesBuildListener.getServers(servers);
+ if( serverBehaviors != null ) {
+ for( int i = 0; i < serverBehaviors.length; i++ ) {
+ serverBehaviors[i].publishOneModule(publishType, module, ServerBehaviourDelegate.CHANGED, new NullProgressMonitor());
+ }
+ }
+ }
+ protected static IModule[] getModule(IArchive node) {
+ ModuleFactory factory = ServerPlugin.findModuleFactory("org.jboss.ide.eclipse.as.core.PackageModuleFactory");
+ IModule mod = factory.findModule(PackageModuleFactory.getID(node), new NullProgressMonitor());
+ return new IModule[] { mod };
+ }
+ protected static PackagedModuleDelegate getModuleDelegate(IArchive node) {
+ IModule mod = getModule(node)[0];
+ return (PackagedModuleDelegate)mod.loadAdapter(PackagedModuleDelegate.class, new NullProgressMonitor());
+ }
+
+ protected IDeployableServer getDeployableServerFromBehavior(DeployableServerBehavior dsb) {
+ IServer server = dsb.getServer();
+ IDeployableServer ids = (IDeployableServer)server.loadAdapter(IDeployableServer.class, new NullProgressMonitor());
+ return ids;
+ }
+
+ public static DeployableServerBehavior[] getServers(String servers) {
+ if( servers == null || "".equals(servers))
+ return null;
+ ArrayList list = new ArrayList();
+ String[] byId = servers.split(",");
+ for( int i = 0; i < byId.length; i++ ) {
+ IServer server = ServerCore.findServer(byId[i]);
+ if( server != null ) {
+ Object o = server.loadAdapter(DeployableServerBehavior.class, new NullProgressMonitor());
+ if( o != null ) {
+ list.add((DeployableServerBehavior)o);
+ }
+ }
+ }
+ return (DeployableServerBehavior[]) list.toArray(new DeployableServerBehavior[list.size()]);
+ }
+
+ /*
+ * If a node is changing from exploded to imploded, or vice versa
+ * make sure to delete the pre-existing file or folder on the server.
+ */
+ public void packageBuildTypeChanged(IArchive topLevelPackage, boolean isExploded) {
+ String servers = topLevelPackage.getProperty(ArchivesBuildListener.DEPLOY_SERVERS);
+ DeployableServerBehavior[] serverBehaviors = ArchivesBuildListener.getServers(servers);
+ if( serverBehaviors != null ) {
+ IPath sourcePath, destPath;
+ IDeployableServer depServer;
+ for( int i = 0; i < serverBehaviors.length; i++ ) {
+ sourcePath = topLevelPackage.getArchiveFilePath();
+ depServer = getDeployableServerFromBehavior(serverBehaviors[i]);
+ destPath = new Path(depServer.getDeployDirectory()).append(sourcePath.lastSegment());
+ FileUtil.safeDelete(destPath.toFile());
+ FileUtil.fileSafeCopy(sourcePath.toFile(), destPath.toFile());
+ }
+ }
+ }
+
+ public void buildFailed(IArchive pkg, IStatus status) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void finishedBuild(IPath project) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void finishedCollectingFileSet(IArchiveFileSet fileset) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void startedBuild(IPath project) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void startedBuildingArchive(IArchive pkg) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void startedCollectingFileSet(IArchiveFileSet fileset) {
+ // TODO Auto-generated method stub
+ }
+ public void startedBuildingPackage(IArchive pkg) {
+ // TODO Auto-generated method stub
+ }
+
+ public void cleanProject(IPath project) {
+ }
+
+ public void modelChanged(IArchiveNodeDelta delta) {
+ IPath p ;
+ if( delta.getPreNode() == null )
+ p = delta.getPostNode().getProjectPath();
+ else
+ p = delta.getPreNode().getProjectPath();
+
+ ArchivesModelModuleContributor.getInstance().refreshProject(p);
+ }
+
+
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java (from rev 3530, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesModelModuleContributor.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -0,0 +1,130 @@
+package org.jboss.ide.eclipse.as.core.modules;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.wst.server.core.IModule;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModelCore;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.IModuleContributor;
+import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.PackagedModuleDelegate;
+
+public class ArchivesModelModuleContributor implements IModuleContributor {
+
+ private static ArchivesModelModuleContributor instance;
+ public static ArchivesModelModuleContributor getInstance() {
+ if( instance == null ) {
+ instance = new ArchivesModelModuleContributor(PackageModuleFactory.getFactory());
+ }
+ return instance;
+ }
+
+ private PackageModuleFactory factory;
+ protected ArrayList modules = null;
+ protected HashMap projectToModules = new HashMap(5); //IPath to IModule
+ protected HashMap moduleDelegates = new HashMap(5);
+ protected HashMap packageToModule = new HashMap(5);
+
+ private ArchivesModelModuleContributor(PackageModuleFactory factory) {
+ this.factory = factory;
+ }
+
+ public IModule[] getModules() {
+ if( modules == null ) {
+ modules = new ArrayList();
+ IProject[] projects2 = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ int size = projects2.length;
+ for (int i = 0; i < size; i++) {
+ if (projects2[i].isAccessible()) {
+ createModules(projects2[i]);
+ }
+ }
+ }
+ return (IModule[]) modules.toArray(new IModule[modules.size()]);
+ }
+
+ protected void createModules(IProject project) {
+ IArchive[] packs = ArchivesModelCore.getProjectPackages(project.getLocation(), null, false);
+ if( packs != null && packs.length > 0 ) {
+ IModule module;
+ IArchive[] packages = ArchivesModelCore.getProjectPackages(project.getLocation(), new NullProgressMonitor(), true);
+ boolean requiresSave = ensureArchivesHaveIDs(project, packages);
+ ArrayList mods = new ArrayList();
+ for( int i = 0; i < packages.length; i++ ) {
+ module = factory.createModule2(packages[i], project);
+ modules.add(module);
+ Object moduleDelegate = new PackagedModuleDelegate(packages[i]);
+ packageToModule.put(packages[i], module);
+ moduleDelegates.put(module, moduleDelegate);
+ mods.add(module);
+ }
+ projectToModules.put(project.getLocation(), mods);
+ }
+ }
+
+ public boolean containsModule(IModule module) {
+ return moduleDelegates.containsKey(module);
+ }
+
+ public PackagedModuleDelegate getModuleDelegate(IModule module) {
+ return (PackagedModuleDelegate)moduleDelegates.get(module);
+ }
+
+ public void refreshProject(IPath projectLoc) {
+ // remove old mods
+ ArrayList mods = (ArrayList)projectToModules.get(projectLoc);
+ IModule mod;
+ IArchive arc;
+ if (mods != null) {
+ for( Iterator i = mods.iterator(); i.hasNext();) {
+ mod = (IModule)i.next();
+ if( moduleDelegates.get(mod) != null ) {
+ arc = ((PackagedModuleDelegate)moduleDelegates.get(mod)).getPackage();
+ packageToModule.remove(arc);
+ moduleDelegates.remove(mod);
+ }
+ }
+ }
+ createModules(findProject(projectLoc));
+ factory.clearModuleCache();
+ }
+
+ protected IProject findProject(IPath projectLoc) {
+ IProject proj = null;
+ IProject[] projects2 = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ int size = projects2.length;
+ for (int i = 0; i < size; i++) {
+ if( projects2[i].getLocation().equals(projectLoc))
+ proj = projects2[i];
+ }
+ return proj;
+ }
+
+ /**
+ * Set a property so that each module that's here in the factory
+ * has a unique ID other than it's name (which is not unique)
+ * @param archives
+ * @return returns whether a save has occurred
+ */
+ protected boolean ensureArchivesHaveIDs(IProject project, IArchive[] archives) {
+ boolean requiresSave = false;
+ for( int i = 0; i < archives.length; i++ ) {
+ if( PackageModuleFactory.getID(archives[i]) == null ) {
+ requiresSave = true;
+ archives[i].setProperty(PackageModuleFactory.MODULE_ID_PROPERTY_KEY,
+ PackageModuleFactory.getID(archives[i], true));
+ }
+ }
+ if( requiresSave ) {
+ // save
+ ArchivesModel.instance().saveModel(project.getLocation(), new NullProgressMonitor());
+ }
+ return requiresSave;
+ }
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ModulePackageTypeConverter.java (from rev 3530, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ModulePackageTypeConverter.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ModulePackageTypeConverter.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ModulePackageTypeConverter.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -0,0 +1,48 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.core.modules;
+
+import org.eclipse.wst.server.core.IModule;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
+import org.jboss.ide.eclipse.as.core.packages.types.EarArchiveType;
+import org.jboss.ide.eclipse.as.core.packages.types.EjbArchiveType;
+import org.jboss.ide.eclipse.as.core.packages.types.WarArchiveType;
+
+/**
+ *
+ * @author rob.stryker(a)jboss.com
+ */
+public class ModulePackageTypeConverter {
+ public static IArchiveType getPackageTypeFor(IModule module) {
+ String modType = module.getModuleType().getId();
+ if("jst.web".equals(modType)) {
+ return ArchivesCore.getInstance().getExtensionManager().getArchiveType(WarArchiveType.WAR_PACKAGE_TYPE);
+ } else if("jst.ear".equals(modType)) {
+ return ArchivesCore.getInstance().getExtensionManager().getArchiveType(EarArchiveType.ID);
+ } else if("jst.ejb".equals(modType)) {
+ return ArchivesCore.getInstance().getExtensionManager().getArchiveType(EjbArchiveType.ID);
+ }
+
+ return null;
+ }
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackageModuleFactory.java (from rev 3530, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackageModuleFactory.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackageModuleFactory.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackageModuleFactory.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -0,0 +1,437 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.core.modules;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.internal.ModuleFactory;
+import org.eclipse.wst.server.core.internal.ModuleFile;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.model.IModuleFile;
+import org.eclipse.wst.server.core.model.IModuleFolder;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeVisitor;
+import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.osgi.service.prefs.BackingStoreException;
+
+/**
+ *
+ * @author rob.stryker(a)jboss.com
+ */
+public class PackageModuleFactory extends ModuleFactoryDelegate {
+
+ private static int nextArchiveId = -1;
+ private static final String NEXT_ARCHIVE_KEY = "org.jboss.ide.eclipse.as.core.PackageModuleFactory.nextId";
+
+ public static final String FACTORY_TYPE_ID = "org.jboss.ide.eclipse.as.core.PackageModuleFactory";
+ public static final String MODULE_TYPE = "jboss.package";
+ public static final String VERSION = "1.0";
+
+ public static final String MODULE_ID_PROPERTY_KEY = "org.jboss.ide.eclipse.as.core.packages.ModuleIDPropertyKey";
+
+ // the factory delegate and the factory respectively
+ private static PackageModuleFactory factDelegate;
+ private static ModuleFactory factory;
+
+ /**
+ * Find the module factory wrapper WTP provides for us
+ * @return
+ */
+ public static PackageModuleFactory getFactory() {
+ if( factDelegate == null ) {
+ ModuleFactory[] factories = ServerPlugin.getModuleFactories();
+
+ for( int i = 0; i < factories.length; i++ ) {
+ if( factories[i].getId().equals(PackageModuleFactory.FACTORY_TYPE_ID)) {
+ Object o = factories[i].getDelegate(new NullProgressMonitor());
+ if( o instanceof PackageModuleFactory ) {
+ factory = factories[i];
+ factDelegate = (PackageModuleFactory)o;
+ return factDelegate;
+ }
+ }
+ }
+ }
+ return factDelegate;
+ }
+
+ /**
+ * Get the module ID of this IArchive if it exists.
+ * Do not create a new one otherwise
+ * @param pack
+ * @return
+ */
+ public static String getID(IArchive pack) {
+ return getID(pack, false);
+ }
+
+ /**
+ * Get the module ID of this IArchive if it exists.
+ * If create is true, and the ID is not set, set a default ID.
+ * @param pack
+ * @param create
+ * @return
+ */
+ protected static String getID(IArchive pack, boolean create) {
+ String propVal = pack.getProperty(MODULE_ID_PROPERTY_KEY);
+ if( propVal == null && create ) {
+ if( nextArchiveId == -1 ) {
+ nextArchiveId =
+ new InstanceScope().getNode(JBossServerCorePlugin.PLUGIN_ID).getInt(NEXT_ARCHIVE_KEY, 0);
+ }
+ nextArchiveId++;
+ IEclipsePreferences prefs = new InstanceScope().getNode(JBossServerCorePlugin.PLUGIN_ID);
+ prefs.putInt(NEXT_ARCHIVE_KEY, nextArchiveId);
+ try {
+ prefs.flush();
+ } catch( BackingStoreException bse ) {
+ }
+ return "" + nextArchiveId;
+ } else if( propVal == null ) {
+ return null;
+ }
+ return propVal;
+ }
+
+ /**
+ * Return the name of the project in the workspace
+ * @param node
+ * @return
+ */
+ public static String getProjectName(IArchiveNode node) {
+ IPath projPath = node.getProjectPath();
+ if( projPath == null ) return null;
+ IProject[] list = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for( int i = 0; i < list.length; i++ )
+ if( list[i].getLocation().equals(projPath))
+ return list[i].getName();
+ return null;
+ }
+
+ /**
+ * Get the visible name of this module
+ * @param pack
+ * @return
+ */
+ public static String getName(IArchive pack) {
+ return getProjectName(pack) + "/" + pack.getName();
+ }
+
+
+
+ protected IModuleContributor[] moduleContributors;
+ public PackageModuleFactory() {
+ super();
+ moduleContributors = new IModuleContributor[] { ArchivesModelModuleContributor.getInstance() };
+
+ }
+
+ protected IModule createModule2(IArchive pack, IProject project) {
+ return createModule(getID(pack), getName(pack), MODULE_TYPE, VERSION, project);
+ }
+
+
+ public IModule[] getModules() {
+ ArrayList list = new ArrayList();
+ for( int i = 0; i < moduleContributors.length; i++ ) {
+ list.addAll(Arrays.asList(moduleContributors[i].getModules()));
+ }
+ return (IModule[]) list.toArray(new IModule[list.size()]);
+ }
+
+ public ModuleDelegate getModuleDelegate(IModule module) {
+ for( int i = 0; i < moduleContributors.length; i++ ) {
+ if( moduleContributors[i].containsModule(module))
+ return moduleContributors[i].getModuleDelegate(module);
+ }
+ return null;
+ }
+
+ public static interface IModuleContributor {
+ public IModule[] getModules();
+ public boolean containsModule(IModule module);
+ public PackagedModuleDelegate getModuleDelegate(IModule module);
+ }
+
+ public static interface IExtendedModuleResource extends IModuleResource {
+ public IPath getSourcePath();
+ public IArchiveNode getNode();
+ public IPath getDeepDestination();
+ public IPath getConcreteDestFile();
+ }
+
+ public static class DelegateInitVisitor implements IArchiveNodeVisitor {
+
+ private IArchive pack;
+ private HashMap members; // node -> imoduleresource
+ private HashMap pathToNode; // path -> node
+ public DelegateInitVisitor(IArchive pack) {
+ this.pack = pack;
+ reset();
+ }
+ public void reset() {
+ members = new HashMap();
+ pathToNode = new HashMap();
+ }
+ public boolean visit(IArchiveNode node) {
+ int type = node.getNodeType();
+ if( type == IArchiveNode.TYPE_ARCHIVE && ((IArchive)node).isTopLevel()) {
+ IPath rel = ((IArchive)node).getRootArchiveRelativePath();
+ members.put(node, new ArchiveContainerResource(((IArchive)node).getName(), node, rel));
+ pathToNode.put(rel, node);
+ } else if( type == IArchiveNode.TYPE_ARCHIVE || type == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
+ String name = type == IArchiveNode.TYPE_ARCHIVE ? ((IArchive)node).getName() : ((IArchiveFolder)node).getName();
+ // if we're any other archive or a folder, create us and add to parent
+ IArchiveNode parent = node.getParent();
+ ArchiveContainerResource parentAsResource = (ArchiveContainerResource)members.get(parent);
+ IPath rel = node.getRootArchiveRelativePath();
+ members.put(node, new ArchiveContainerResource(name, node, rel));
+ pathToNode.put(rel, node);
+ parentAsResource.addChild((IModuleResource)members.get(node));
+ } else if( type == IArchiveNode.TYPE_ARCHIVE_FILESET ) {
+ ArchiveContainerResource parentAsResource = (ArchiveContainerResource)members.get(node.getParent());
+ parentAsResource.addFilesetAsChild((IArchiveFileSet)node);
+ }
+
+ return true;
+ }
+
+ public IModuleResource getRootResource() {
+ return (IModuleResource)members.get(pack);
+ }
+
+ public IModuleResource getResourceForNode(IArchiveNode node) {
+ return (IModuleResource)members.get(node);
+ }
+ }
+
+ public static class ArchiveContainerResource implements IModuleFolder, IExtendedModuleResource {
+
+ protected IPath moduleRelativePath;
+ protected IArchiveNode node;
+ protected String name;
+ private HashMap members;
+
+ // represents source folder on disk. only used if node is fileset
+ private IPath folderGlobalPath = null;
+ public ArchiveContainerResource(String name,IArchiveNode node,IPath moduleRelativePath ) {
+ this.name = name;
+ this.node = node;
+ this.moduleRelativePath = moduleRelativePath;
+ members = new HashMap();
+ if( node instanceof IArchiveFileSet) {
+ IPath tmp = moduleRelativePath.removeFirstSegments(node.getParent().getRootArchiveRelativePath().segmentCount());
+ folderGlobalPath = ((IArchiveFileSet)node).getGlobalSourcePath().append(tmp);
+ }
+ }
+
+ public int hashCode() {
+ return name.hashCode() * 37 + moduleRelativePath.hashCode();
+ }
+
+ public boolean equals(Object other) {
+ if (other instanceof IModuleFolder) {
+ IModuleFolder resource = (IModuleFolder) other;
+ return resource.getModuleRelativePath().equals(getModuleRelativePath());
+ }
+ return false;
+ }
+
+ public void addChild(IModuleResource resource) {
+ members.put(resource.getModuleRelativePath(), resource);
+ }
+
+ public void removeChild(IPath moduleRelativePath) {
+ members.remove(moduleRelativePath);
+ }
+ public IModuleResource getChild(IPath path) {
+ return (IModuleResource)members.get(path);
+ }
+
+ public void addFilesetAsChild(IArchiveFileSet fs) {
+ IPath[] paths = fs.findMatchingPaths(); // file-system based source paths
+ IPath globalSource = fs.getGlobalSourcePath();
+ for( int i = 0; i < paths.length; i++ ) {
+ addFilesetPathAsChild(fs, globalSource, paths[i]);
+ }
+ }
+
+ public void addFilesetPathAsChild(IArchiveFileSet fs, IPath globalSource, IPath path) {
+ IPath archiveRelative = fs.getRootArchiveRelativePath(path);
+ IPath fsRelative = path.removeFirstSegments(globalSource.segmentCount());
+ ArchiveContainerResource parent = find(fs, globalSource, fsRelative.removeLastSegments(1), true);
+ ExtendedModuleFile emf = new ExtendedModuleFile(archiveRelative.lastSegment(), archiveRelative, path.toFile().lastModified(), path, fs);
+ parent.addChild(emf);
+ }
+
+ public void removeFilesetPathAsChild(IArchiveFileSet fs, IPath path) {
+ IPath globalSource = fs.getGlobalSourcePath();
+ IPath fsRelative = path.removeFirstSegments(globalSource.segmentCount());
+ ArchiveContainerResource parent = find(fs, globalSource, fsRelative.removeLastSegments(1), false);
+ if( parent != null )
+ parent.removeFilesetPathAsChild(fs, path);
+ }
+
+ protected ArchiveContainerResource find(IArchiveFileSet fs, IPath globalSource, IPath fsRelative, boolean create) {
+ ArchiveContainerResource resource = this;
+ ArchiveContainerResource tmpResource;
+ IPath tmpPath = fs.getRootArchiveRelativePath();
+ int count = fsRelative.segmentCount();
+ for( int i = 0; i < count; i++ ) {
+ tmpPath = tmpPath.append(fsRelative.segment(i));
+ tmpResource = (ArchiveContainerResource)resource.getChild(tmpPath);
+ if( tmpResource == null ) {
+ if( !create )
+ return null;
+ tmpResource = new ArchiveContainerResource(tmpPath.lastSegment(), fs, tmpPath);
+ resource.addChild(tmpResource);
+ }
+ resource = tmpResource;
+ }
+ return resource;
+ }
+
+ public IModuleResource[] members() {
+ Collection c = members.values();
+ return (IModuleResource[]) c.toArray(new IModuleResource[c.size()]);
+ }
+
+ public IPath getModuleRelativePath() {
+ return moduleRelativePath;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public IPath getDeepDestination() {
+ IPath tmp = node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET ?
+ ((IArchiveFileSet)node).getRootArchiveRelativePath(folderGlobalPath) : node.getRootArchiveRelativePath();
+ return node.getRootArchive().getGlobalDestinationPath().append(tmp);
+ }
+ public IPath getConcreteDestFile() {
+ return ModelUtil.getBaseDestinationFile(node,folderGlobalPath);
+ }
+ public IArchiveNode getNode() {
+ return node;
+ }
+
+ public IPath getSourcePath() {
+ return null;
+ }
+
+ }
+
+ public static class ExtendedModuleFile extends ModuleFile implements IExtendedModuleResource {
+ private IPath srcPath;
+ private IArchiveFileSet node;
+ public ExtendedModuleFile(String name, IPath relativePath, long stamp,
+ IPath srcPath, IArchiveFileSet fs) {
+ super(name, relativePath, stamp);
+ this.srcPath = srcPath;
+ this.node = fs;
+ }
+ public int hashCode() {
+ return name.hashCode() * 37 + path.hashCode();
+ }
+
+ public IPath getPath() { return srcPath; }
+ public IArchiveNode getNode() { return node; }
+ public IPath getDeepDestination() {
+ return node.getRootArchive().getGlobalDestinationPath().append(node.getRootArchiveRelativePath(path));
+ }
+ public IPath getSourcePath() {
+ return this.srcPath;
+ }
+
+ public IPath getConcreteDestFile() {
+ return ModelUtil.getBaseDestinationFile(node, srcPath);
+ }
+
+ public boolean equals(Object other) {
+ if (other instanceof IModuleFile) {
+ IModuleFile resource = (IModuleFile) other;
+ return resource.getModuleRelativePath().equals(getModuleRelativePath());
+ }
+ return false;
+ }
+
+ }
+
+ public static class PackagedModuleDelegate extends ModuleDelegate {
+ private IArchive pack;
+ private IModuleResource rootResource;
+ private DelegateInitVisitor initVisitor;
+ public PackagedModuleDelegate(IArchive pack) {
+ this.pack = pack;
+ initVisitor = new DelegateInitVisitor(pack);
+ }
+
+ public IArchive getPackage() {
+ return pack;
+ }
+ public IModule[] getChildModules() {
+ return new IModule[0];
+ }
+
+ protected void init() {
+ initVisitor.reset();
+ pack.accept(initVisitor);
+ rootResource = initVisitor.getRootResource();
+ }
+
+ public IModuleResource[] members() throws CoreException {
+ init();
+ return new IModuleResource[] { rootResource };
+ }
+
+ public IStatus validate() {
+ return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
+ 0, "", null);
+ }
+ }
+
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagedArtifactAdapter.java (from rev 3530, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackagedArtifactAdapter.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagedArtifactAdapter.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagedArtifactAdapter.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -0,0 +1,56 @@
+package org.jboss.ide.eclipse.as.core.modules;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
+
+public class PackagedArtifactAdapter extends ModuleArtifactAdapterDelegate {
+
+ public PackagedArtifactAdapter() {
+ }
+
+ public IModuleArtifact getModuleArtifact(Object obj) {
+ if( obj instanceof IJavaProject ) {
+ IProject[] projects2 = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ boolean done = false;
+ String jpName = ((IJavaProject)obj).getElementName();
+ for( int i = 0; i < projects2.length && !done; i++ ) {
+ if( projects2[i].getName().equals(jpName)) {
+ done = true;
+ obj = projects2[i];
+ break;
+ }
+ }
+ }
+
+ if( obj instanceof IProject ) {
+ PackageModuleFactory factory = PackageModuleFactory.getFactory();
+ if( factory != null ) {
+// IModule[] mods = factory.getModulesFromProject((IProject)obj);
+// if( mods != null && mods.length != 0) {
+// return getArtifact(mods);
+// }
+ }
+ }
+ return null;
+ }
+
+ protected IModuleArtifact getArtifact(IModule[] mod) {
+ //return new PackagedArtifact(mod);
+ // TODO Blocking on eclipse bug 174372
+ return null;
+ }
+
+ public class PackagedArtifact implements IModuleArtifact{
+ protected IModule mod;
+ public PackagedArtifact(IModule module) {
+ this.mod = module;
+ }
+ public IModule getModule() {
+ return mod;
+ }
+ }
+}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java (from rev 3533, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/SingleDeployableFactory.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -0,0 +1,156 @@
+package org.jboss.ide.eclipse.as.core.modules;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.internal.ModuleFactory;
+import org.eclipse.wst.server.core.internal.ModuleFile;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+
+public class SingleDeployableFactory extends ModuleFactoryDelegate {
+ public static final String FACTORY_ID = "org.jboss.ide.eclipse.as.core.singledeployablefactory";
+ private static SingleDeployableFactory factDelegate;
+ public static final String MODULE_TYPE = "jboss.singlefile";
+ public static final String VERSION = "1.0";
+ private static final String PREFERENCE_KEY = "org.jboss.ide.eclipse.as.core.singledeployable.deployableList";
+ private static final String DELIM = "\r";
+
+
+ private static ModuleFactory factory;
+ public static SingleDeployableFactory getFactory() {
+ if( factDelegate == null ) {
+ ModuleFactory[] factories = ServerPlugin.getModuleFactories();
+ for( int i = 0; i < factories.length; i++ ) {
+ if( factories[i].getId().equals(FACTORY_ID)) {
+ Object o = factories[i].getDelegate(new NullProgressMonitor());
+ if( o instanceof SingleDeployableFactory ) {
+ factory = factories[i];
+ factDelegate = (SingleDeployableFactory)o;
+ return factDelegate;
+ }
+ }
+ }
+ }
+ return factDelegate;
+ }
+
+ public static boolean makeDeployable(IResource resource) {
+ return makeDeployable(resource.getFullPath());
+ }
+
+ public static boolean makeDeployable(IPath workspaceRelative) {
+ boolean ret = getFactory().addModule(workspaceRelative);
+ getFactory().saveDeployableList();
+ return ret;
+ }
+
+ public static void unmakeDeployable(IResource resource) {
+ unmakeDeployable(resource.getFullPath());
+ }
+
+ public static void unmakeDeployable(IPath workspaceRelative) {
+ getFactory().removeModule(workspaceRelative);
+ getFactory().saveDeployableList();
+ }
+
+ public static IModule findModule(IResource resource) {
+ return findModule(resource.getFullPath());
+ }
+ public static IModule findModule(IPath workspaceRelative) {
+ return getFactory().getModule(workspaceRelative);
+ }
+
+
+
+ private HashMap moduleIdToModule;
+ private HashMap moduleToDelegate;
+ public SingleDeployableFactory() {
+ moduleIdToModule = new HashMap();
+ moduleToDelegate = new HashMap();
+ String files = JBossServerCorePlugin.getDefault().getPluginPreferences().getString(PREFERENCE_KEY);
+ if( files.equals("")) return;
+ String[] files2 = files.split(DELIM);
+ for( int i = 0; i < files2.length; i++ ) {
+ addModule(new Path(files2[i]));
+ }
+ }
+
+ public IModule getModule(IPath path) {
+ return (IModule)moduleIdToModule.get(path);
+ }
+ public void saveDeployableList() {
+ Iterator i = moduleIdToModule.keySet().iterator();
+ String val = "";
+ while(i.hasNext()) {
+ val += ((IPath)i.next()).toString() + DELIM;
+ }
+ JBossServerCorePlugin.getDefault().getPluginPreferences().setValue(PREFERENCE_KEY, val);
+ JBossServerCorePlugin.getDefault().savePluginPreferences();
+ }
+
+ protected boolean addModule(IPath path) {
+ IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+ if( resource != null && resource.exists() ) {
+ IModule module = createModule(path.toString(), path.toString(), MODULE_TYPE, VERSION, resource.getProject());
+ moduleIdToModule.put(path, module);
+ moduleToDelegate.put(module, new SingleDeployableModuleDelegate(path));
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected void removeModule(IPath path) {
+ IModule mod = (IModule)moduleIdToModule.get(path);
+ moduleIdToModule.remove(path);
+ moduleToDelegate.remove(mod);
+ }
+
+ public IModule[] getModules() {
+ Collection c = moduleIdToModule.values();
+ return (IModule[]) c.toArray(new IModule[c.size()]);
+ }
+
+ public ModuleDelegate getModuleDelegate(IModule module) {
+ return (ModuleDelegate)moduleToDelegate.get(module);
+ }
+
+ public class SingleDeployableModuleDelegate extends ModuleDelegate {
+ private IPath global;
+ public SingleDeployableModuleDelegate(IPath workspaceRelative) {
+ global = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(workspaceRelative);
+ }
+ public IModule[] getChildModules() {
+ return new IModule[0];
+ }
+
+ public IModuleResource[] members() throws CoreException {
+ return new IModuleResource[] {
+ new ModuleFile(global.lastSegment(),
+ new Path(global.lastSegment()),
+ global.toFile().lastModified()) };
+ }
+
+ public IStatus validate() {
+ return Status.OK_STATUS;
+ }
+
+ public IPath getGlobalSourcePath() {
+ return this.global;
+ }
+ }
+}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesBuildListener.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -1,199 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.packages;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.internal.ModuleFactory;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
-import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
-import org.jboss.ide.eclipse.archives.core.model.other.IArchiveBuildListener;
-import org.jboss.ide.eclipse.archives.core.model.other.IArchiveModelListener;
-import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
-import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.PackagedModuleDelegate;
-import org.jboss.ide.eclipse.as.core.server.DeployableServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-
-/**
- *
- * @author rob.stryker(a)jboss.com
- */
-public class ArchivesBuildListener implements IArchiveBuildListener, IArchiveModelListener {
-
- public static ArchivesBuildListener instance;
- public static final String DEPLOY_SERVERS = "org.jboss.ide.eclipse.as.core.model.PackagesListener.DeployServers";
- public static final String DEPLOY_AFTER_BUILD = "org.jboss.ide.eclipse.as.core.model.PackagesListener.DeployAfterBuild";
-
- public static ArchivesBuildListener getInstance() {
- if( instance == null ) {
- instance = new ArchivesBuildListener();
- }
- return instance;
- }
-
- public ArchivesBuildListener() {
- ArchivesModel.instance().addBuildListener(this);
- ArchivesModel.instance().addModelListener(this, ArchivesModel.LIST_FRONT);
- }
-
- public void cleanArchive(IArchive pkg) {
- }
-
-
- public void finishedBuildingArchive(IArchive pkg) {
- if( pkg.isTopLevel() && new Boolean(pkg.getProperty(DEPLOY_AFTER_BUILD)).booleanValue()) {
- publish(pkg);
- }
- }
-
- public void fileRemoved(IArchive topLevelPackage, IArchiveFileSet fileset, IPath filePath) {
- }
- public void fileUpdated(IArchive topLevelPackage, IArchiveFileSet fileset, IPath filePath) {
- }
-
- // If we're supposed to auto-deploy, get on it
- protected static void publish(IArchive pkg) {
- String servers = pkg.getProperty(ArchivesBuildListener.DEPLOY_SERVERS);
- publish(pkg, servers, IServer.PUBLISH_INCREMENTAL);
- }
- public static void publish(IArchive pkg, String servers, int publishType) {
- IModule[] module = getModule(pkg);
- if( module[0] == null ) return;
- DeployableServerBehavior[] serverBehaviors = ArchivesBuildListener.getServers(servers);
- if( serverBehaviors != null ) {
- for( int i = 0; i < serverBehaviors.length; i++ ) {
- serverBehaviors[i].publishOneModule(publishType, module, ServerBehaviourDelegate.CHANGED, new NullProgressMonitor());
- }
- }
- }
- protected static IModule[] getModule(IArchive node) {
- ModuleFactory factory = ServerPlugin.findModuleFactory("org.jboss.ide.eclipse.as.core.PackageModuleFactory");
- IModule mod = factory.findModule(PackageModuleFactory.getID(node), new NullProgressMonitor());
- return new IModule[] { mod };
- }
- protected static PackagedModuleDelegate getModuleDelegate(IArchive node) {
- IModule mod = getModule(node)[0];
- return (PackagedModuleDelegate)mod.loadAdapter(PackagedModuleDelegate.class, new NullProgressMonitor());
- }
-
- protected IDeployableServer getDeployableServerFromBehavior(DeployableServerBehavior dsb) {
- IServer server = dsb.getServer();
- IDeployableServer ids = (IDeployableServer)server.loadAdapter(IDeployableServer.class, new NullProgressMonitor());
- return ids;
- }
-
- public static DeployableServerBehavior[] getServers(String servers) {
- if( servers == null || "".equals(servers))
- return null;
- ArrayList list = new ArrayList();
- String[] byId = servers.split(",");
- for( int i = 0; i < byId.length; i++ ) {
- IServer server = ServerCore.findServer(byId[i]);
- if( server != null ) {
- Object o = server.loadAdapter(DeployableServerBehavior.class, new NullProgressMonitor());
- if( o != null ) {
- list.add((DeployableServerBehavior)o);
- }
- }
- }
- return (DeployableServerBehavior[]) list.toArray(new DeployableServerBehavior[list.size()]);
- }
-
- /*
- * If a node is changing from exploded to imploded, or vice versa
- * make sure to delete the pre-existing file or folder on the server.
- */
- public void packageBuildTypeChanged(IArchive topLevelPackage, boolean isExploded) {
- String servers = topLevelPackage.getProperty(ArchivesBuildListener.DEPLOY_SERVERS);
- DeployableServerBehavior[] serverBehaviors = ArchivesBuildListener.getServers(servers);
- if( serverBehaviors != null ) {
- IPath sourcePath, destPath;
- IDeployableServer depServer;
- for( int i = 0; i < serverBehaviors.length; i++ ) {
- sourcePath = topLevelPackage.getArchiveFilePath();
- depServer = getDeployableServerFromBehavior(serverBehaviors[i]);
- destPath = new Path(depServer.getDeployDirectory()).append(sourcePath.lastSegment());
- FileUtil.safeDelete(destPath.toFile());
- FileUtil.fileSafeCopy(sourcePath.toFile(), destPath.toFile());
- }
- }
- }
-
- public void buildFailed(IArchive pkg, IStatus status) {
- // TODO Auto-generated method stub
-
- }
-
- public void finishedBuild(IPath project) {
- // TODO Auto-generated method stub
-
- }
-
- public void finishedCollectingFileSet(IArchiveFileSet fileset) {
- // TODO Auto-generated method stub
-
- }
-
- public void startedBuild(IPath project) {
- // TODO Auto-generated method stub
-
- }
-
- public void startedBuildingArchive(IArchive pkg) {
- // TODO Auto-generated method stub
-
- }
-
- public void startedCollectingFileSet(IArchiveFileSet fileset) {
- // TODO Auto-generated method stub
- }
- public void startedBuildingPackage(IArchive pkg) {
- // TODO Auto-generated method stub
- }
-
- public void cleanProject(IPath project) {
- }
-
- public void modelChanged(IArchiveNodeDelta delta) {
- IPath p ;
- if( delta.getPreNode() == null )
- p = delta.getPostNode().getProjectPath();
- else
- p = delta.getPreNode().getProjectPath();
-
- ArchivesModelModuleContributor.getInstance().refreshProject(p);
- }
-
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesModelModuleContributor.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesModelModuleContributor.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesModelModuleContributor.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -1,130 +0,0 @@
-package org.jboss.ide.eclipse.as.core.packages;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.server.core.IModule;
-import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
-import org.jboss.ide.eclipse.archives.core.model.ArchivesModelCore;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.IModuleContributor;
-import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.PackagedModuleDelegate;
-
-public class ArchivesModelModuleContributor implements IModuleContributor {
-
- private static ArchivesModelModuleContributor instance;
- public static ArchivesModelModuleContributor getInstance() {
- if( instance == null ) {
- instance = new ArchivesModelModuleContributor(PackageModuleFactory.getFactory());
- }
- return instance;
- }
-
- private PackageModuleFactory factory;
- protected ArrayList modules = null;
- protected HashMap projectToModules = new HashMap(5); //IPath to IModule
- protected HashMap moduleDelegates = new HashMap(5);
- protected HashMap packageToModule = new HashMap(5);
-
- private ArchivesModelModuleContributor(PackageModuleFactory factory) {
- this.factory = factory;
- }
-
- public IModule[] getModules() {
- if( modules == null ) {
- modules = new ArrayList();
- IProject[] projects2 = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- int size = projects2.length;
- for (int i = 0; i < size; i++) {
- if (projects2[i].isAccessible()) {
- createModules(projects2[i]);
- }
- }
- }
- return (IModule[]) modules.toArray(new IModule[modules.size()]);
- }
-
- protected void createModules(IProject project) {
- IArchive[] packs = ArchivesModelCore.getProjectPackages(project.getLocation(), null, false);
- if( packs != null && packs.length > 0 ) {
- IModule module;
- IArchive[] packages = ArchivesModelCore.getProjectPackages(project.getLocation(), new NullProgressMonitor(), true);
- boolean requiresSave = ensureArchivesHaveIDs(project, packages);
- ArrayList mods = new ArrayList();
- for( int i = 0; i < packages.length; i++ ) {
- module = factory.createModule2(packages[i], project);
- modules.add(module);
- Object moduleDelegate = new PackagedModuleDelegate(packages[i]);
- packageToModule.put(packages[i], module);
- moduleDelegates.put(module, moduleDelegate);
- mods.add(module);
- }
- projectToModules.put(project.getLocation(), mods);
- }
- }
-
- public boolean containsModule(IModule module) {
- return moduleDelegates.containsKey(module);
- }
-
- public PackagedModuleDelegate getModuleDelegate(IModule module) {
- return (PackagedModuleDelegate)moduleDelegates.get(module);
- }
-
- public void refreshProject(IPath projectLoc) {
- // remove old mods
- ArrayList mods = (ArrayList)projectToModules.get(projectLoc);
- IModule mod;
- IArchive arc;
- if (mods != null) {
- for( Iterator i = mods.iterator(); i.hasNext();) {
- mod = (IModule)i.next();
- if( moduleDelegates.get(mod) != null ) {
- arc = ((PackagedModuleDelegate)moduleDelegates.get(mod)).getPackage();
- packageToModule.remove(arc);
- moduleDelegates.remove(mod);
- }
- }
- }
- createModules(findProject(projectLoc));
- factory.clearModuleCache();
- }
-
- protected IProject findProject(IPath projectLoc) {
- IProject proj = null;
- IProject[] projects2 = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- int size = projects2.length;
- for (int i = 0; i < size; i++) {
- if( projects2[i].getLocation().equals(projectLoc))
- proj = projects2[i];
- }
- return proj;
- }
-
- /**
- * Set a property so that each module that's here in the factory
- * has a unique ID other than it's name (which is not unique)
- * @param archives
- * @return returns whether a save has occurred
- */
- protected boolean ensureArchivesHaveIDs(IProject project, IArchive[] archives) {
- boolean requiresSave = false;
- for( int i = 0; i < archives.length; i++ ) {
- if( PackageModuleFactory.getID(archives[i]) == null ) {
- requiresSave = true;
- archives[i].setProperty(PackageModuleFactory.MODULE_ID_PROPERTY_KEY,
- PackageModuleFactory.getID(archives[i], true));
- }
- }
- if( requiresSave ) {
- // save
- ArchivesModel.instance().saveModel(project.getLocation(), new NullProgressMonitor());
- }
- return requiresSave;
- }
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ModulePackageTypeConverter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ModulePackageTypeConverter.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ModulePackageTypeConverter.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -1,48 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.packages;
-
-import org.eclipse.wst.server.core.IModule;
-import org.jboss.ide.eclipse.archives.core.ArchivesCore;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
-import org.jboss.ide.eclipse.as.core.packages.types.EarArchiveType;
-import org.jboss.ide.eclipse.as.core.packages.types.EjbArchiveType;
-import org.jboss.ide.eclipse.as.core.packages.types.WarArchiveType;
-
-/**
- *
- * @author rob.stryker(a)jboss.com
- */
-public class ModulePackageTypeConverter {
- public static IArchiveType getPackageTypeFor(IModule module) {
- String modType = module.getModuleType().getId();
- if("jst.web".equals(modType)) {
- return ArchivesCore.getInstance().getExtensionManager().getArchiveType(WarArchiveType.WAR_PACKAGE_TYPE);
- } else if("jst.ear".equals(modType)) {
- return ArchivesCore.getInstance().getExtensionManager().getArchiveType(EarArchiveType.ID);
- } else if("jst.ejb".equals(modType)) {
- return ArchivesCore.getInstance().getExtensionManager().getArchiveType(EjbArchiveType.ID);
- }
-
- return null;
- }
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackageModuleFactory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackageModuleFactory.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackageModuleFactory.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -1,437 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.packages;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.internal.ModuleFactory;
-import org.eclipse.wst.server.core.internal.ModuleFile;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.core.model.IModuleFile;
-import org.eclipse.wst.server.core.model.IModuleFolder;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.ModuleDelegate;
-import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeVisitor;
-import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- *
- * @author rob.stryker(a)jboss.com
- */
-public class PackageModuleFactory extends ModuleFactoryDelegate {
-
- private static int nextArchiveId = -1;
- private static final String NEXT_ARCHIVE_KEY = "org.jboss.ide.eclipse.as.core.PackageModuleFactory.nextId";
-
- public static final String FACTORY_TYPE_ID = "org.jboss.ide.eclipse.as.core.PackageModuleFactory";
- public static final String MODULE_TYPE = "jboss.package";
- public static final String VERSION = "1.0";
-
- public static final String MODULE_ID_PROPERTY_KEY = "org.jboss.ide.eclipse.as.core.packages.ModuleIDPropertyKey";
-
- // the factory delegate and the factory respectively
- private static PackageModuleFactory factDelegate;
- private static ModuleFactory factory;
-
- /**
- * Find the module factory wrapper WTP provides for us
- * @return
- */
- public static PackageModuleFactory getFactory() {
- if( factDelegate == null ) {
- ModuleFactory[] factories = ServerPlugin.getModuleFactories();
-
- for( int i = 0; i < factories.length; i++ ) {
- if( factories[i].getId().equals(PackageModuleFactory.FACTORY_TYPE_ID)) {
- Object o = factories[i].getDelegate(new NullProgressMonitor());
- if( o instanceof PackageModuleFactory ) {
- factory = factories[i];
- factDelegate = (PackageModuleFactory)o;
- return factDelegate;
- }
- }
- }
- }
- return factDelegate;
- }
-
- /**
- * Get the module ID of this IArchive if it exists.
- * Do not create a new one otherwise
- * @param pack
- * @return
- */
- public static String getID(IArchive pack) {
- return getID(pack, false);
- }
-
- /**
- * Get the module ID of this IArchive if it exists.
- * If create is true, and the ID is not set, set a default ID.
- * @param pack
- * @param create
- * @return
- */
- protected static String getID(IArchive pack, boolean create) {
- String propVal = pack.getProperty(MODULE_ID_PROPERTY_KEY);
- if( propVal == null && create ) {
- if( nextArchiveId == -1 ) {
- nextArchiveId =
- new InstanceScope().getNode(JBossServerCorePlugin.PLUGIN_ID).getInt(NEXT_ARCHIVE_KEY, 0);
- }
- nextArchiveId++;
- IEclipsePreferences prefs = new InstanceScope().getNode(JBossServerCorePlugin.PLUGIN_ID);
- prefs.putInt(NEXT_ARCHIVE_KEY, nextArchiveId);
- try {
- prefs.flush();
- } catch( BackingStoreException bse ) {
- }
- return "" + nextArchiveId;
- } else if( propVal == null ) {
- return null;
- }
- return propVal;
- }
-
- /**
- * Return the name of the project in the workspace
- * @param node
- * @return
- */
- public static String getProjectName(IArchiveNode node) {
- IPath projPath = node.getProjectPath();
- if( projPath == null ) return null;
- IProject[] list = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for( int i = 0; i < list.length; i++ )
- if( list[i].getLocation().equals(projPath))
- return list[i].getName();
- return null;
- }
-
- /**
- * Get the visible name of this module
- * @param pack
- * @return
- */
- public static String getName(IArchive pack) {
- return getProjectName(pack) + "/" + pack.getName();
- }
-
-
-
- protected IModuleContributor[] moduleContributors;
- public PackageModuleFactory() {
- super();
- moduleContributors = new IModuleContributor[] { ArchivesModelModuleContributor.getInstance() };
-
- }
-
- protected IModule createModule2(IArchive pack, IProject project) {
- return createModule(getID(pack), getName(pack), MODULE_TYPE, VERSION, project);
- }
-
-
- public IModule[] getModules() {
- ArrayList list = new ArrayList();
- for( int i = 0; i < moduleContributors.length; i++ ) {
- list.addAll(Arrays.asList(moduleContributors[i].getModules()));
- }
- return (IModule[]) list.toArray(new IModule[list.size()]);
- }
-
- public ModuleDelegate getModuleDelegate(IModule module) {
- for( int i = 0; i < moduleContributors.length; i++ ) {
- if( moduleContributors[i].containsModule(module))
- return moduleContributors[i].getModuleDelegate(module);
- }
- return null;
- }
-
- public static interface IModuleContributor {
- public IModule[] getModules();
- public boolean containsModule(IModule module);
- public PackagedModuleDelegate getModuleDelegate(IModule module);
- }
-
- public static interface IExtendedModuleResource extends IModuleResource {
- public IPath getSourcePath();
- public IArchiveNode getNode();
- public IPath getDeepDestination();
- public IPath getConcreteDestFile();
- }
-
- public static class DelegateInitVisitor implements IArchiveNodeVisitor {
-
- private IArchive pack;
- private HashMap members; // node -> imoduleresource
- private HashMap pathToNode; // path -> node
- public DelegateInitVisitor(IArchive pack) {
- this.pack = pack;
- reset();
- }
- public void reset() {
- members = new HashMap();
- pathToNode = new HashMap();
- }
- public boolean visit(IArchiveNode node) {
- int type = node.getNodeType();
- if( type == IArchiveNode.TYPE_ARCHIVE && ((IArchive)node).isTopLevel()) {
- IPath rel = ((IArchive)node).getRootArchiveRelativePath();
- members.put(node, new ArchiveContainerResource(((IArchive)node).getName(), node, rel));
- pathToNode.put(rel, node);
- } else if( type == IArchiveNode.TYPE_ARCHIVE || type == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
- String name = type == IArchiveNode.TYPE_ARCHIVE ? ((IArchive)node).getName() : ((IArchiveFolder)node).getName();
- // if we're any other archive or a folder, create us and add to parent
- IArchiveNode parent = node.getParent();
- ArchiveContainerResource parentAsResource = (ArchiveContainerResource)members.get(parent);
- IPath rel = node.getRootArchiveRelativePath();
- members.put(node, new ArchiveContainerResource(name, node, rel));
- pathToNode.put(rel, node);
- parentAsResource.addChild((IModuleResource)members.get(node));
- } else if( type == IArchiveNode.TYPE_ARCHIVE_FILESET ) {
- ArchiveContainerResource parentAsResource = (ArchiveContainerResource)members.get(node.getParent());
- parentAsResource.addFilesetAsChild((IArchiveFileSet)node);
- }
-
- return true;
- }
-
- public IModuleResource getRootResource() {
- return (IModuleResource)members.get(pack);
- }
-
- public IModuleResource getResourceForNode(IArchiveNode node) {
- return (IModuleResource)members.get(node);
- }
- }
-
- public static class ArchiveContainerResource implements IModuleFolder, IExtendedModuleResource {
-
- protected IPath moduleRelativePath;
- protected IArchiveNode node;
- protected String name;
- private HashMap members;
-
- // represents source folder on disk. only used if node is fileset
- private IPath folderGlobalPath = null;
- public ArchiveContainerResource(String name,IArchiveNode node,IPath moduleRelativePath ) {
- this.name = name;
- this.node = node;
- this.moduleRelativePath = moduleRelativePath;
- members = new HashMap();
- if( node instanceof IArchiveFileSet) {
- IPath tmp = moduleRelativePath.removeFirstSegments(node.getParent().getRootArchiveRelativePath().segmentCount());
- folderGlobalPath = ((IArchiveFileSet)node).getGlobalSourcePath().append(tmp);
- }
- }
-
- public int hashCode() {
- return name.hashCode() * 37 + moduleRelativePath.hashCode();
- }
-
- public boolean equals(Object other) {
- if (other instanceof IModuleFolder) {
- IModuleFolder resource = (IModuleFolder) other;
- return resource.getModuleRelativePath().equals(getModuleRelativePath());
- }
- return false;
- }
-
- public void addChild(IModuleResource resource) {
- members.put(resource.getModuleRelativePath(), resource);
- }
-
- public void removeChild(IPath moduleRelativePath) {
- members.remove(moduleRelativePath);
- }
- public IModuleResource getChild(IPath path) {
- return (IModuleResource)members.get(path);
- }
-
- public void addFilesetAsChild(IArchiveFileSet fs) {
- IPath[] paths = fs.findMatchingPaths(); // file-system based source paths
- IPath globalSource = fs.getGlobalSourcePath();
- for( int i = 0; i < paths.length; i++ ) {
- addFilesetPathAsChild(fs, globalSource, paths[i]);
- }
- }
-
- public void addFilesetPathAsChild(IArchiveFileSet fs, IPath globalSource, IPath path) {
- IPath archiveRelative = fs.getRootArchiveRelativePath(path);
- IPath fsRelative = path.removeFirstSegments(globalSource.segmentCount());
- ArchiveContainerResource parent = find(fs, globalSource, fsRelative.removeLastSegments(1), true);
- ExtendedModuleFile emf = new ExtendedModuleFile(archiveRelative.lastSegment(), archiveRelative, path.toFile().lastModified(), path, fs);
- parent.addChild(emf);
- }
-
- public void removeFilesetPathAsChild(IArchiveFileSet fs, IPath path) {
- IPath globalSource = fs.getGlobalSourcePath();
- IPath fsRelative = path.removeFirstSegments(globalSource.segmentCount());
- ArchiveContainerResource parent = find(fs, globalSource, fsRelative.removeLastSegments(1), false);
- if( parent != null )
- parent.removeFilesetPathAsChild(fs, path);
- }
-
- protected ArchiveContainerResource find(IArchiveFileSet fs, IPath globalSource, IPath fsRelative, boolean create) {
- ArchiveContainerResource resource = this;
- ArchiveContainerResource tmpResource;
- IPath tmpPath = fs.getRootArchiveRelativePath();
- int count = fsRelative.segmentCount();
- for( int i = 0; i < count; i++ ) {
- tmpPath = tmpPath.append(fsRelative.segment(i));
- tmpResource = (ArchiveContainerResource)resource.getChild(tmpPath);
- if( tmpResource == null ) {
- if( !create )
- return null;
- tmpResource = new ArchiveContainerResource(tmpPath.lastSegment(), fs, tmpPath);
- resource.addChild(tmpResource);
- }
- resource = tmpResource;
- }
- return resource;
- }
-
- public IModuleResource[] members() {
- Collection c = members.values();
- return (IModuleResource[]) c.toArray(new IModuleResource[c.size()]);
- }
-
- public IPath getModuleRelativePath() {
- return moduleRelativePath;
- }
-
- public String getName() {
- return name;
- }
-
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- public IPath getDeepDestination() {
- IPath tmp = node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET ?
- ((IArchiveFileSet)node).getRootArchiveRelativePath(folderGlobalPath) : node.getRootArchiveRelativePath();
- return node.getRootArchive().getGlobalDestinationPath().append(tmp);
- }
- public IPath getConcreteDestFile() {
- return ModelUtil.getBaseDestinationFile(node,folderGlobalPath);
- }
- public IArchiveNode getNode() {
- return node;
- }
-
- public IPath getSourcePath() {
- return null;
- }
-
- }
-
- public static class ExtendedModuleFile extends ModuleFile implements IExtendedModuleResource {
- private IPath srcPath;
- private IArchiveFileSet node;
- public ExtendedModuleFile(String name, IPath relativePath, long stamp,
- IPath srcPath, IArchiveFileSet fs) {
- super(name, relativePath, stamp);
- this.srcPath = srcPath;
- this.node = fs;
- }
- public int hashCode() {
- return name.hashCode() * 37 + path.hashCode();
- }
-
- public IPath getPath() { return srcPath; }
- public IArchiveNode getNode() { return node; }
- public IPath getDeepDestination() {
- return node.getRootArchive().getGlobalDestinationPath().append(node.getRootArchiveRelativePath(path));
- }
- public IPath getSourcePath() {
- return this.srcPath;
- }
-
- public IPath getConcreteDestFile() {
- return ModelUtil.getBaseDestinationFile(node, srcPath);
- }
-
- public boolean equals(Object other) {
- if (other instanceof IModuleFile) {
- IModuleFile resource = (IModuleFile) other;
- return resource.getModuleRelativePath().equals(getModuleRelativePath());
- }
- return false;
- }
-
- }
-
- public static class PackagedModuleDelegate extends ModuleDelegate {
- private IArchive pack;
- private IModuleResource rootResource;
- private DelegateInitVisitor initVisitor;
- public PackagedModuleDelegate(IArchive pack) {
- this.pack = pack;
- initVisitor = new DelegateInitVisitor(pack);
- }
-
- public IArchive getPackage() {
- return pack;
- }
- public IModule[] getChildModules() {
- return new IModule[0];
- }
-
- protected void init() {
- initVisitor.reset();
- pack.accept(initVisitor);
- rootResource = initVisitor.getRootResource();
- }
-
- public IModuleResource[] members() throws CoreException {
- init();
- return new IModuleResource[] { rootResource };
- }
-
- public IStatus validate() {
- return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
- 0, "", null);
- }
- }
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackagedArtifactAdapter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackagedArtifactAdapter.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/PackagedArtifactAdapter.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -1,56 +0,0 @@
-package org.jboss.ide.eclipse.as.core.packages;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
-
-public class PackagedArtifactAdapter extends ModuleArtifactAdapterDelegate {
-
- public PackagedArtifactAdapter() {
- }
-
- public IModuleArtifact getModuleArtifact(Object obj) {
- if( obj instanceof IJavaProject ) {
- IProject[] projects2 = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- boolean done = false;
- String jpName = ((IJavaProject)obj).getElementName();
- for( int i = 0; i < projects2.length && !done; i++ ) {
- if( projects2[i].getName().equals(jpName)) {
- done = true;
- obj = projects2[i];
- break;
- }
- }
- }
-
- if( obj instanceof IProject ) {
- PackageModuleFactory factory = PackageModuleFactory.getFactory();
- if( factory != null ) {
-// IModule[] mods = factory.getModulesFromProject((IProject)obj);
-// if( mods != null && mods.length != 0) {
-// return getArtifact(mods);
-// }
- }
- }
- return null;
- }
-
- protected IModuleArtifact getArtifact(IModule[] mod) {
- //return new PackagedArtifact(mod);
- // TODO Blocking on eclipse bug 174372
- return null;
- }
-
- public class PackagedArtifact implements IModuleArtifact{
- protected IModule mod;
- public PackagedArtifact(IModule module) {
- this.mod = module;
- }
- public IModule getModule() {
- return mod;
- }
- }
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/SingleDeployableFactory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/SingleDeployableFactory.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/SingleDeployableFactory.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -1,156 +0,0 @@
-package org.jboss.ide.eclipse.as.core.packages;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.internal.ModuleFactory;
-import org.eclipse.wst.server.core.internal.ModuleFile;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.ModuleDelegate;
-import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-
-public class SingleDeployableFactory extends ModuleFactoryDelegate {
- public static final String FACTORY_ID = "org.jboss.ide.eclipse.as.core.singledeployablefactory";
- private static SingleDeployableFactory factDelegate;
- public static final String MODULE_TYPE = "jboss.singlefile";
- public static final String VERSION = "1.0";
- private static final String PREFERENCE_KEY = "org.jboss.ide.eclipse.as.core.singledeployable.deployableList";
- private static final String DELIM = "\r";
-
-
- private static ModuleFactory factory;
- public static SingleDeployableFactory getFactory() {
- if( factDelegate == null ) {
- ModuleFactory[] factories = ServerPlugin.getModuleFactories();
- for( int i = 0; i < factories.length; i++ ) {
- if( factories[i].getId().equals(FACTORY_ID)) {
- Object o = factories[i].getDelegate(new NullProgressMonitor());
- if( o instanceof SingleDeployableFactory ) {
- factory = factories[i];
- factDelegate = (SingleDeployableFactory)o;
- return factDelegate;
- }
- }
- }
- }
- return factDelegate;
- }
-
- public static boolean makeDeployable(IResource resource) {
- return makeDeployable(resource.getFullPath());
- }
-
- public static boolean makeDeployable(IPath workspaceRelative) {
- boolean ret = getFactory().addModule(workspaceRelative);
- getFactory().saveDeployableList();
- return ret;
- }
-
- public static void unmakeDeployable(IResource resource) {
- unmakeDeployable(resource.getFullPath());
- }
-
- public static void unmakeDeployable(IPath workspaceRelative) {
- getFactory().removeModule(workspaceRelative);
- getFactory().saveDeployableList();
- }
-
- public static IModule findModule(IResource resource) {
- return findModule(resource.getFullPath());
- }
- public static IModule findModule(IPath workspaceRelative) {
- return getFactory().getModule(workspaceRelative);
- }
-
-
-
- private HashMap moduleIdToModule;
- private HashMap moduleToDelegate;
- public SingleDeployableFactory() {
- moduleIdToModule = new HashMap();
- moduleToDelegate = new HashMap();
- String files = JBossServerCorePlugin.getDefault().getPluginPreferences().getString(PREFERENCE_KEY);
- if( files.equals("")) return;
- String[] files2 = files.split(DELIM);
- for( int i = 0; i < files2.length; i++ ) {
- addModule(new Path(files2[i]));
- }
- }
-
- public IModule getModule(IPath path) {
- return (IModule)moduleIdToModule.get(path);
- }
- public void saveDeployableList() {
- Iterator i = moduleIdToModule.keySet().iterator();
- String val = "";
- while(i.hasNext()) {
- val += ((IPath)i.next()).toString() + DELIM;
- }
- JBossServerCorePlugin.getDefault().getPluginPreferences().setValue(PREFERENCE_KEY, val);
- JBossServerCorePlugin.getDefault().savePluginPreferences();
- }
-
- protected boolean addModule(IPath path) {
- IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
- if( resource != null && resource.exists() ) {
- IModule module = createModule(path.toString(), path.toString(), MODULE_TYPE, VERSION, resource.getProject());
- moduleIdToModule.put(path, module);
- moduleToDelegate.put(module, new SingleDeployableModuleDelegate(path));
- return true;
- } else {
- return false;
- }
- }
-
- protected void removeModule(IPath path) {
- IModule mod = (IModule)moduleIdToModule.get(path);
- moduleIdToModule.remove(path);
- moduleToDelegate.remove(mod);
- }
-
- public IModule[] getModules() {
- Collection c = moduleIdToModule.values();
- return (IModule[]) c.toArray(new IModule[c.size()]);
- }
-
- public ModuleDelegate getModuleDelegate(IModule module) {
- return (ModuleDelegate)moduleToDelegate.get(module);
- }
-
- public class SingleDeployableModuleDelegate extends ModuleDelegate {
- private IPath global;
- public SingleDeployableModuleDelegate(IPath workspaceRelative) {
- global = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(workspaceRelative);
- }
- public IModule[] getChildModules() {
- return new IModule[0];
- }
-
- public IModuleResource[] members() throws CoreException {
- return new IModuleResource[] {
- new ModuleFile(global.lastSegment(),
- new Path(global.lastSegment()),
- global.toFile().lastModified()) };
- }
-
- public IStatus validate() {
- return Status.OK_STATUS;
- }
-
- public IPath getGlobalSourcePath() {
- return this.global;
- }
- }
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/EarArchiveType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/EarArchiveType.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/types/EarArchiveType.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -11,7 +11,7 @@
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
import org.jboss.ide.eclipse.archives.core.model.IArchiveType;
-import org.jboss.ide.eclipse.as.core.packages.ModulePackageTypeConverter;
+import org.jboss.ide.eclipse.as.core.modules.ModulePackageTypeConverter;
public class EarArchiveType extends J2EEArchiveType {
public final static String ID = "org.jboss.ide.eclipse.as.core.packages.earPackageType";
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -36,9 +36,9 @@
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.ExtendedModuleFile;
-import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.IExtendedModuleResource;
-import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.PackagedModuleDelegate;
+import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.ExtendedModuleFile;
+import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.IExtendedModuleResource;
+import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory.PackagedModuleDelegate;
import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.PublishEvent;
import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.PublisherFileUtilListener;
import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -10,8 +10,8 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
-import org.jboss.ide.eclipse.as.core.packages.SingleDeployableFactory;
-import org.jboss.ide.eclipse.as.core.packages.SingleDeployableFactory.SingleDeployableModuleDelegate;
+import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
+import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory.SingleDeployableModuleDelegate;
import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11 05:26:57 UTC (rev 3537)
@@ -19,7 +19,7 @@
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory;
+import org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory;
import org.jboss.ide.eclipse.as.core.publishers.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.publishers.JstPublisher;
import org.jboss.ide.eclipse.as.core.publishers.NullPublisher;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2007-09-11 05:25:21 UTC (rev 3536)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2007-09-11 05:26:57 UTC (rev 3537)
@@ -241,7 +241,7 @@
<extension
point="org.eclipse.wst.server.core.moduleFactories">
<moduleFactory
- class="org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory"
+ class="org.jboss.ide.eclipse.as.core.modules.PackageModuleFactory"
id="org.jboss.ide.eclipse.as.core.PackageModuleFactory"
projects="true">
<moduleType
@@ -249,7 +249,7 @@
versions="1.0"/>
</moduleFactory>
<moduleFactory
- class="org.jboss.ide.eclipse.as.core.packages.SingleDeployableFactory"
+ class="org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory"
id="org.jboss.ide.eclipse.as.core.singledeployablefactory"
projects="false">
<moduleType
@@ -266,7 +266,7 @@
<extension
point="org.eclipse.wst.server.core.moduleArtifactAdapters">
<moduleArtifactAdapter
- class="org.jboss.ide.eclipse.as.core.packages.PackagedArtifactAdapter"
+ class="org.jboss.ide.eclipse.as.core.modules.PackagedArtifactAdapter"
id="org.jboss.ide.eclipse.as.core.PackagedArtifactAdapter"
priority="0">
<enablement>
17 years, 4 months
JBoss Tools SVN: r3536 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-11 01:25:21 -0400 (Tue, 11 Sep 2007)
New Revision: 3536
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
Log:
Undo
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-09-11 05:25:18 UTC (rev 3535)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-09-11 05:25:21 UTC (rev 3536)
@@ -9,7 +9,7 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.modules.PublisherEventLogger;
+import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.IEventLogLabelProvider;
17 years, 4 months
JBoss Tools SVN: r3535 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: jbosscore/org/jboss/ide/eclipse/as/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-11 01:25:18 -0400 (Tue, 11 Sep 2007)
New Revision: 3535
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/IJBossServerPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
Log:
Undo
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11 05:20:51 UTC (rev 3534)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11 05:25:18 UTC (rev 3535)
@@ -24,9 +24,9 @@
Export-Package: org.jboss.ide.eclipse.as.core,
org.jboss.ide.eclipse.as.core.extensions.descriptors,
org.jboss.ide.eclipse.as.core.extensions.events,
- org.jboss.ide.eclipse.as.core.modules,
org.jboss.ide.eclipse.as.core.packages,
org.jboss.ide.eclipse.as.core.packages.types,
+ org.jboss.ide.eclipse.as.core.publishers,
org.jboss.ide.eclipse.as.core.runtime,
org.jboss.ide.eclipse.as.core.runtime.server.polling,
org.jboss.ide.eclipse.as.core.server,
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers (from rev 3533, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/IJBossServerPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/IJBossServerPublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/IJBossServerPublisher.java 2007-09-11 05:25:18 UTC (rev 3535)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.ide.eclipse.as.core.modules;
+package org.jboss.ide.eclipse.as.core.publishers;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/JstPublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-09-11 05:25:18 UTC (rev 3535)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.ide.eclipse.as.core.modules;
+package org.jboss.ide.eclipse.as.core.publishers;
import java.io.File;
import java.io.IOException;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/NullPublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java 2007-09-11 05:25:18 UTC (rev 3535)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.ide.eclipse.as.core.modules;
+package org.jboss.ide.eclipse.as.core.publishers;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagesPublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-09-11 05:25:18 UTC (rev 3535)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.ide.eclipse.as.core.modules;
+package org.jboss.ide.eclipse.as.core.publishers;
import java.util.ArrayList;
@@ -36,11 +36,11 @@
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.modules.PublisherEventLogger.PublishEvent;
-import org.jboss.ide.eclipse.as.core.modules.PublisherEventLogger.PublisherFileUtilListener;
import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.ExtendedModuleFile;
import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.IExtendedModuleResource;
import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.PackagedModuleDelegate;
+import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.PublishEvent;
+import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.PublisherFileUtilListener;
import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PublisherEventLogger.java 2007-09-11 05:20:35 UTC (rev 3533)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java 2007-09-11 05:25:18 UTC (rev 3535)
@@ -1,4 +1,4 @@
-package org.jboss.ide.eclipse.as.core.modules;
+package org.jboss.ide.eclipse.as.core.publishers;
import java.io.File;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleFilePublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-09-11 05:25:18 UTC (rev 3535)
@@ -1,4 +1,4 @@
-package org.jboss.ide.eclipse.as.core.modules;
+package org.jboss.ide.eclipse.as.core.publishers;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11 05:20:51 UTC (rev 3534)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11 05:25:18 UTC (rev 3535)
@@ -19,13 +19,13 @@
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.modules.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.modules.JstPublisher;
-import org.jboss.ide.eclipse.as.core.modules.NullPublisher;
-import org.jboss.ide.eclipse.as.core.modules.PackagesPublisher;
-import org.jboss.ide.eclipse.as.core.modules.PublisherEventLogger;
-import org.jboss.ide.eclipse.as.core.modules.SingleFilePublisher;
import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory;
+import org.jboss.ide.eclipse.as.core.publishers.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.publishers.JstPublisher;
+import org.jboss.ide.eclipse.as.core.publishers.NullPublisher;
+import org.jboss.ide.eclipse.as.core.publishers.PackagesPublisher;
+import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger;
+import org.jboss.ide.eclipse.as.core.publishers.SingleFilePublisher;
import org.jboss.ide.eclipse.as.core.server.internal.launch.DeployableLaunchConfiguration;
public class DeployableServerBehavior extends ServerBehaviourDelegate {
17 years, 4 months
JBoss Tools SVN: r3534 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-11 01:20:51 -0400 (Tue, 11 Sep 2007)
New Revision: 3534
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
Log:
Moved SingleDeployableFactory into a package with other module-related objects.
Renamed that package from as.core.packages to as.core.modules
Moving to a cleaner API which can be opened up logically and more easily extended.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-09-11 05:20:35 UTC (rev 3533)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-09-11 05:20:51 UTC (rev 3534)
@@ -9,7 +9,7 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger;
+import org.jboss.ide.eclipse.as.core.modules.PublisherEventLogger;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.IEventLogLabelProvider;
17 years, 4 months
JBoss Tools SVN: r3533 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-11 01:20:35 -0400 (Tue, 11 Sep 2007)
New Revision: 3533
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagesPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PublisherEventLogger.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/SingleDeployableFactory.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagesPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PublisherEventLogger.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/singledeployable/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/IJBossServerPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/NullPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleFilePublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
Moved SingleDeployableFactory into a package with other module-related objects.
Renamed that package from as.core.packages to as.core.modules
Moving to a cleaner API which can be opened up logically and more easily extended.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11 05:16:49 UTC (rev 3532)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11 05:20:35 UTC (rev 3533)
@@ -24,16 +24,15 @@
Export-Package: org.jboss.ide.eclipse.as.core,
org.jboss.ide.eclipse.as.core.extensions.descriptors,
org.jboss.ide.eclipse.as.core.extensions.events,
+ org.jboss.ide.eclipse.as.core.modules,
org.jboss.ide.eclipse.as.core.packages,
org.jboss.ide.eclipse.as.core.packages.types,
- org.jboss.ide.eclipse.as.core.publishers,
org.jboss.ide.eclipse.as.core.runtime,
org.jboss.ide.eclipse.as.core.runtime.server.polling,
org.jboss.ide.eclipse.as.core.server,
org.jboss.ide.eclipse.as.core.server.attributes,
org.jboss.ide.eclipse.as.core.server.internal.launch,
org.jboss.ide.eclipse.as.core.server.xpl,
- org.jboss.ide.eclipse.as.core.singledeployable,
org.jboss.ide.eclipse.as.core.util
Bundle-ClassPath: dom4j-1.6.1.jar,
jaxen-1.1-beta-6.jar,
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules (from rev 3530, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/IJBossServerPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/IJBossServerPublisher.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/IJBossServerPublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.ide.eclipse.as.core.publishers;
+package org.jboss.ide.eclipse.as.core.modules;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/JstPublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -1,303 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.publishers;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IFile;
-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.jst.server.core.IEnterpriseApplication;
-import org.eclipse.jst.server.core.IWebModule;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.DeletedModule;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.model.IModuleFolder;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.eclipse.wst.server.core.model.ModuleDelegate;
-import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
-import org.eclipse.wst.server.core.util.ProjectModule;
-import org.eclipse.wst.server.core.util.PublishUtil;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.server.NestedPublishInfo;
-import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.xpl.ModulePackager;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-
-/**
- * This class provides a default implementation for packaging different types of
- * flexible projects. It uses the built-in heirarchy of the projects to do so.
- *
- * @author rob.stryker(a)jboss.com
- */
-public class JstPublisher extends PackagesPublisher {
-
- public static final int BUILD_FAILED_CODE = 100;
- public static final int PACKAGE_UNDETERMINED_CODE = 101;
-
- protected IModuleResourceDelta[] delta;
-
- public JstPublisher(IServer server, EventLogTreeItem context) {
- super(server, context);
- }
-
- public void setDelta(IModuleResourceDelta[] delta) {
- this.delta = delta;
- }
-
- public IStatus publishModule(int kind, int deltaKind,
- int modulePublishState, IModule module, IProgressMonitor monitor)
- throws CoreException {
- IStatus status = null;
-
- IPath root = new Path(server.getDeployDirectory());
- if (ServerBehaviourDelegate.REMOVED == deltaKind) {
- status = unpublish(server, module, monitor);
- } else if (kind == IServer.PUBLISH_FULL || kind == IServer.PUBLISH_CLEAN) {
- status = fullPublishPackIntoFolder(module, root, monitor);
- } else if (kind == IServer.PUBLISH_INCREMENTAL) {
- status = incrementalPublish(new ArrayList(), root, module, monitor);
- }
- return status;
- }
-
- protected void fullWebPublish(IModule module, IPath root, IProgressMonitor monitor ) throws CoreException {
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IModuleResource[] members = md.members();
- IWebModule webmodule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
- IPath moduleDeployPath = root.append(webmodule.getContextRoot() + ".war");
- FileUtil.safeDelete(moduleDeployPath.toFile());
- PublishUtil.publishSmart(members, moduleDeployPath, monitor);
- IWebModule webModule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
- IModule[] childModules = webModule.getModules();
- for (int i = 0; i < childModules.length; i++) {
- IModule module2 = childModules[i];
- packModuleIntoJar(module, webModule.getURI(module2), moduleDeployPath);
- }
- }
- protected void fullEarPublish(IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
- if( module instanceof DeletedModule ) {
- // TODO FIX ME
- return;
- }
-
-
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IModuleResource[] members = md.members();
- IEnterpriseApplication earModule = (IEnterpriseApplication)module.loadAdapter(IEnterpriseApplication.class, monitor);
- IPath moduleDeployPath = root.append(module.getProject().getName() + ".ear");
- FileUtil.safeDelete(moduleDeployPath.toFile());
- PublishUtil.publishFull(members, moduleDeployPath, monitor);
- IModule[] childModules = earModule.getModules();
- for (int i = 0; i < childModules.length; i++) {
- IModule module2 = childModules[i];
- String uri = earModule.getURI(module2);
- if(uri==null){
- IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0, "unable to assemble module null uri",null ); //$NON-NLS-1$
- throw new CoreException(status);
- }
- if( module2.getModuleType().getId().equals("jst.utility")) {
- packModuleIntoJar(module2, uri, moduleDeployPath);
- } else {
- fullPublishPackIntoFolder(module2, moduleDeployPath, monitor);
- }
- }
- }
-
- protected IStatus fullPublishPackIntoFolder(IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
- if( module.getModuleType().getId().equals("jst.web")) {
- fullWebPublish(module, root, monitor);
- } else if( module.getModuleType().getId().equals("jst.ear")) {
- fullEarPublish(module, root, monitor);
- } else {
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IModuleResource[] members = md.members();
- IPath moduleDeployPath = root.append(module.getProject().getName() + ".jar");
- FileUtil.safeDelete(moduleDeployPath.toFile());
- PublishUtil.publishSmart(members, moduleDeployPath, monitor);
- }
- return null;
- }
-
- private boolean hasDelta( IModule module, ArrayList moduleTree ) {
- return getDelta(module, moduleTree).length > 0;
- }
-
- public IModuleResourceDelta[] getDelta(IModule module, ArrayList moduleTree) {
- IModuleResourceDelta[] deltas;
- if( moduleTree.size() == 0 ) {
- final IModule[] modules ={module};
- deltas = ((Server)server.getServer()).getPublishedResourceDelta( modules );
- } else {
- deltas = NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getDelta(moduleTree, module);
- }
- return deltas;
- }
-
-
- protected void packModuleIntoJar(IModule module, String deploymentUnitName, IPath destination)throws CoreException {
- String dest = destination.append(deploymentUnitName).toString();
- ModulePackager packager = null;
- try {
- packager = new ModulePackager(dest, false);
- ProjectModule pm = (ProjectModule) module.loadAdapter(ProjectModule.class, null);
- IModuleResource[] resources = pm.members();
- for (int i = 0; i < resources.length; i++) {
- doPackModule(resources[i], packager);
- }
- } catch (IOException e) {
- IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0,
- "unable to assemble module", e); //$NON-NLS-1$
- throw new CoreException(status);
- }
- finally{
- try{
- packager.finished();
- }
- catch(IOException e){
- //unhandled
- }
- }
- }
-
-
- /* Add one file or folder to a jar */
- private void doPackModule(IModuleResource resource, ModulePackager packager) throws CoreException, IOException{
- if (resource instanceof IModuleFolder) {
- IModuleFolder mFolder = (IModuleFolder)resource;
- IModuleResource[] resources = mFolder.members();
-
- packager.writeFolder(resource.getModuleRelativePath().append(resource.getName()).toPortableString());
-
- for (int i = 0; resources!= null && i < resources.length; i++) {
- doPackModule(resources[i], packager);
- }
- } else {
- String destination = resource.getModuleRelativePath().append(resource.getName()).toPortableString();
- IFile file = (IFile) resource.getAdapter(IFile.class);
- if (file != null)
- packager.write(file, destination);
- else {
- File file2 = (File) resource.getAdapter(File.class);
- packager.write(file2, destination);
- }
- }
- }
-
-
- protected IStatus incrementalPublish(ArrayList moduleTree, IPath root, IModule module, IProgressMonitor monitor) throws CoreException {
- if( module.getModuleType().getId().equals("jst.web")) {
- incrementalWarPublish(moduleTree, module, root, monitor);
- } else if( module.getModuleType().getId().equals("jst.ear")) {
- incrementalEarPublish(moduleTree, module, root, monitor);
- } else {
- // cannot incrementally publish something unknown
- // just package it
- packModuleIntoJar(module, module.getName() + ".jar", root);
- }
- return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
- IStatus.OK, "", null);
- }
-
- protected void incrementalWarPublish(ArrayList moduleTree, IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
- ArrayList newTree = new ArrayList();
- newTree.addAll(moduleTree); newTree.add(module);
-
- IModule[] modules = new IModule[] {module};
- IModuleResourceDelta[] deltas = getDelta(module, moduleTree);
- //((Server)server.getServer()).getPublishedResourceDelta( modules );
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IModuleResource[] members = md.members();
- IWebModule webmodule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
- IPath moduleDeployPath = root.append(webmodule.getContextRoot() + ".war");
- PublishUtil.publishDelta(deltas, moduleDeployPath, monitor);
- IWebModule webModule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
- IModule[] childModules = webModule.getModules();
- for (int i = 0; i < childModules.length; i++) {
- IModule module2 = childModules[i];
- // if a lib .jar needs to be repacked, repack the whole thing
- if( hasDelta(module2, newTree))
- packModuleIntoJar(module, webModule.getURI(module2), moduleDeployPath);
- }
- if( moduleTree.size() > 0 ) {
- // published it
- NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getPublishInfo(moduleTree, module).setResources(md.members());
- }
- }
-
- protected void incrementalEarPublish(ArrayList moduleTree, IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
- ArrayList newTree = new ArrayList();
- newTree.addAll(moduleTree);
- newTree.add(module);
-
- IModuleResourceDelta[] deltas = getDelta(module, moduleTree);
- //((Server)server.getServer()).getPublishedResourceDelta( modules );
- IEnterpriseApplication earModule = (IEnterpriseApplication)module.loadAdapter(IEnterpriseApplication.class, monitor);
- IPath moduleDeployPath = root.append(module.getProject().getName() + ".ear");
- PublishUtil.publishDelta(deltas, moduleDeployPath, monitor);
- IModule[] childModules = earModule.getModules();
- for (int i = 0; i < childModules.length; i++) {
- IModule childModule = childModules[i];
- String uri = earModule.getURI(childModule);
- if(uri==null){
- IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0, "unable to assemble module null uri",null ); //$NON-NLS-1$
- throw new CoreException(status);
- }
-
- incrementalPublish(newTree, root, childModule, monitor);
- }
-
- }
-
- protected IStatus unpublish(IDeployableServer jbServer, IModule module,
- IProgressMonitor monitor) throws CoreException {
-
- IPath root = new Path(jbServer.getDeployDirectory());
- if( module.getModuleType().getId().equals("jst.web")) {
- // copy the module first
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IModuleResource[] members = md.members();
- IWebModule webmodule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
- IPath moduleDeployPath = root.append(webmodule.getContextRoot() + ".war");
- FileUtil.completeDelete(moduleDeployPath.toFile());
- } else if( module.getModuleType().getId().equals("jst.ear")) {
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IModuleResource[] members = md.members();
- IEnterpriseApplication earModule = (IEnterpriseApplication)module.loadAdapter(IEnterpriseApplication.class, monitor);
- IPath moduleDeployPath = root.append(module.getProject().getName() + ".ear");
- FileUtil.completeDelete(moduleDeployPath.toFile());
- }
-
- return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
- IStatus.OK, "", null);
- }
-
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/JstPublisher.java (from rev 3531, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/JstPublisher.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/JstPublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -0,0 +1,303 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.core.modules;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFile;
+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.jst.server.core.IEnterpriseApplication;
+import org.eclipse.jst.server.core.IWebModule;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.internal.DeletedModule;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.model.IModuleFolder;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.eclipse.wst.server.core.util.ProjectModule;
+import org.eclipse.wst.server.core.util.PublishUtil;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.server.NestedPublishInfo;
+import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.xpl.ModulePackager;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+
+/**
+ * This class provides a default implementation for packaging different types of
+ * flexible projects. It uses the built-in heirarchy of the projects to do so.
+ *
+ * @author rob.stryker(a)jboss.com
+ */
+public class JstPublisher extends PackagesPublisher {
+
+ public static final int BUILD_FAILED_CODE = 100;
+ public static final int PACKAGE_UNDETERMINED_CODE = 101;
+
+ protected IModuleResourceDelta[] delta;
+
+ public JstPublisher(IServer server, EventLogTreeItem context) {
+ super(server, context);
+ }
+
+ public void setDelta(IModuleResourceDelta[] delta) {
+ this.delta = delta;
+ }
+
+ public IStatus publishModule(int kind, int deltaKind,
+ int modulePublishState, IModule module, IProgressMonitor monitor)
+ throws CoreException {
+ IStatus status = null;
+
+ IPath root = new Path(server.getDeployDirectory());
+ if (ServerBehaviourDelegate.REMOVED == deltaKind) {
+ status = unpublish(server, module, monitor);
+ } else if (kind == IServer.PUBLISH_FULL || kind == IServer.PUBLISH_CLEAN) {
+ status = fullPublishPackIntoFolder(module, root, monitor);
+ } else if (kind == IServer.PUBLISH_INCREMENTAL) {
+ status = incrementalPublish(new ArrayList(), root, module, monitor);
+ }
+ return status;
+ }
+
+ protected void fullWebPublish(IModule module, IPath root, IProgressMonitor monitor ) throws CoreException {
+ ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
+ IModuleResource[] members = md.members();
+ IWebModule webmodule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
+ IPath moduleDeployPath = root.append(webmodule.getContextRoot() + ".war");
+ FileUtil.safeDelete(moduleDeployPath.toFile());
+ PublishUtil.publishSmart(members, moduleDeployPath, monitor);
+ IWebModule webModule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
+ IModule[] childModules = webModule.getModules();
+ for (int i = 0; i < childModules.length; i++) {
+ IModule module2 = childModules[i];
+ packModuleIntoJar(module, webModule.getURI(module2), moduleDeployPath);
+ }
+ }
+ protected void fullEarPublish(IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
+ if( module instanceof DeletedModule ) {
+ // TODO FIX ME
+ return;
+ }
+
+
+ ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
+ IModuleResource[] members = md.members();
+ IEnterpriseApplication earModule = (IEnterpriseApplication)module.loadAdapter(IEnterpriseApplication.class, monitor);
+ IPath moduleDeployPath = root.append(module.getProject().getName() + ".ear");
+ FileUtil.safeDelete(moduleDeployPath.toFile());
+ PublishUtil.publishFull(members, moduleDeployPath, monitor);
+ IModule[] childModules = earModule.getModules();
+ for (int i = 0; i < childModules.length; i++) {
+ IModule module2 = childModules[i];
+ String uri = earModule.getURI(module2);
+ if(uri==null){
+ IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0, "unable to assemble module null uri",null ); //$NON-NLS-1$
+ throw new CoreException(status);
+ }
+ if( module2.getModuleType().getId().equals("jst.utility")) {
+ packModuleIntoJar(module2, uri, moduleDeployPath);
+ } else {
+ fullPublishPackIntoFolder(module2, moduleDeployPath, monitor);
+ }
+ }
+ }
+
+ protected IStatus fullPublishPackIntoFolder(IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
+ if( module.getModuleType().getId().equals("jst.web")) {
+ fullWebPublish(module, root, monitor);
+ } else if( module.getModuleType().getId().equals("jst.ear")) {
+ fullEarPublish(module, root, monitor);
+ } else {
+ ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
+ IModuleResource[] members = md.members();
+ IPath moduleDeployPath = root.append(module.getProject().getName() + ".jar");
+ FileUtil.safeDelete(moduleDeployPath.toFile());
+ PublishUtil.publishSmart(members, moduleDeployPath, monitor);
+ }
+ return null;
+ }
+
+ private boolean hasDelta( IModule module, ArrayList moduleTree ) {
+ return getDelta(module, moduleTree).length > 0;
+ }
+
+ public IModuleResourceDelta[] getDelta(IModule module, ArrayList moduleTree) {
+ IModuleResourceDelta[] deltas;
+ if( moduleTree.size() == 0 ) {
+ final IModule[] modules ={module};
+ deltas = ((Server)server.getServer()).getPublishedResourceDelta( modules );
+ } else {
+ deltas = NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getDelta(moduleTree, module);
+ }
+ return deltas;
+ }
+
+
+ protected void packModuleIntoJar(IModule module, String deploymentUnitName, IPath destination)throws CoreException {
+ String dest = destination.append(deploymentUnitName).toString();
+ ModulePackager packager = null;
+ try {
+ packager = new ModulePackager(dest, false);
+ ProjectModule pm = (ProjectModule) module.loadAdapter(ProjectModule.class, null);
+ IModuleResource[] resources = pm.members();
+ for (int i = 0; i < resources.length; i++) {
+ doPackModule(resources[i], packager);
+ }
+ } catch (IOException e) {
+ IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0,
+ "unable to assemble module", e); //$NON-NLS-1$
+ throw new CoreException(status);
+ }
+ finally{
+ try{
+ packager.finished();
+ }
+ catch(IOException e){
+ //unhandled
+ }
+ }
+ }
+
+
+ /* Add one file or folder to a jar */
+ private void doPackModule(IModuleResource resource, ModulePackager packager) throws CoreException, IOException{
+ if (resource instanceof IModuleFolder) {
+ IModuleFolder mFolder = (IModuleFolder)resource;
+ IModuleResource[] resources = mFolder.members();
+
+ packager.writeFolder(resource.getModuleRelativePath().append(resource.getName()).toPortableString());
+
+ for (int i = 0; resources!= null && i < resources.length; i++) {
+ doPackModule(resources[i], packager);
+ }
+ } else {
+ String destination = resource.getModuleRelativePath().append(resource.getName()).toPortableString();
+ IFile file = (IFile) resource.getAdapter(IFile.class);
+ if (file != null)
+ packager.write(file, destination);
+ else {
+ File file2 = (File) resource.getAdapter(File.class);
+ packager.write(file2, destination);
+ }
+ }
+ }
+
+
+ protected IStatus incrementalPublish(ArrayList moduleTree, IPath root, IModule module, IProgressMonitor monitor) throws CoreException {
+ if( module.getModuleType().getId().equals("jst.web")) {
+ incrementalWarPublish(moduleTree, module, root, monitor);
+ } else if( module.getModuleType().getId().equals("jst.ear")) {
+ incrementalEarPublish(moduleTree, module, root, monitor);
+ } else {
+ // cannot incrementally publish something unknown
+ // just package it
+ packModuleIntoJar(module, module.getName() + ".jar", root);
+ }
+ return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
+ IStatus.OK, "", null);
+ }
+
+ protected void incrementalWarPublish(ArrayList moduleTree, IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
+ ArrayList newTree = new ArrayList();
+ newTree.addAll(moduleTree); newTree.add(module);
+
+ IModule[] modules = new IModule[] {module};
+ IModuleResourceDelta[] deltas = getDelta(module, moduleTree);
+ //((Server)server.getServer()).getPublishedResourceDelta( modules );
+ ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
+ IModuleResource[] members = md.members();
+ IWebModule webmodule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
+ IPath moduleDeployPath = root.append(webmodule.getContextRoot() + ".war");
+ PublishUtil.publishDelta(deltas, moduleDeployPath, monitor);
+ IWebModule webModule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
+ IModule[] childModules = webModule.getModules();
+ for (int i = 0; i < childModules.length; i++) {
+ IModule module2 = childModules[i];
+ // if a lib .jar needs to be repacked, repack the whole thing
+ if( hasDelta(module2, newTree))
+ packModuleIntoJar(module, webModule.getURI(module2), moduleDeployPath);
+ }
+ if( moduleTree.size() > 0 ) {
+ // published it
+ NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getPublishInfo(moduleTree, module).setResources(md.members());
+ }
+ }
+
+ protected void incrementalEarPublish(ArrayList moduleTree, IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
+ ArrayList newTree = new ArrayList();
+ newTree.addAll(moduleTree);
+ newTree.add(module);
+
+ IModuleResourceDelta[] deltas = getDelta(module, moduleTree);
+ //((Server)server.getServer()).getPublishedResourceDelta( modules );
+ IEnterpriseApplication earModule = (IEnterpriseApplication)module.loadAdapter(IEnterpriseApplication.class, monitor);
+ IPath moduleDeployPath = root.append(module.getProject().getName() + ".ear");
+ PublishUtil.publishDelta(deltas, moduleDeployPath, monitor);
+ IModule[] childModules = earModule.getModules();
+ for (int i = 0; i < childModules.length; i++) {
+ IModule childModule = childModules[i];
+ String uri = earModule.getURI(childModule);
+ if(uri==null){
+ IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0, "unable to assemble module null uri",null ); //$NON-NLS-1$
+ throw new CoreException(status);
+ }
+
+ incrementalPublish(newTree, root, childModule, monitor);
+ }
+
+ }
+
+ protected IStatus unpublish(IDeployableServer jbServer, IModule module,
+ IProgressMonitor monitor) throws CoreException {
+
+ IPath root = new Path(jbServer.getDeployDirectory());
+ if( module.getModuleType().getId().equals("jst.web")) {
+ // copy the module first
+ ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
+ IModuleResource[] members = md.members();
+ IWebModule webmodule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
+ IPath moduleDeployPath = root.append(webmodule.getContextRoot() + ".war");
+ FileUtil.completeDelete(moduleDeployPath.toFile());
+ } else if( module.getModuleType().getId().equals("jst.ear")) {
+ ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
+ IModuleResource[] members = md.members();
+ IEnterpriseApplication earModule = (IEnterpriseApplication)module.loadAdapter(IEnterpriseApplication.class, monitor);
+ IPath moduleDeployPath = root.append(module.getProject().getName() + ".ear");
+ FileUtil.completeDelete(moduleDeployPath.toFile());
+ }
+
+ return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
+ IStatus.OK, "", null);
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/NullPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/NullPublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.ide.eclipse.as.core.publishers;
+package org.jboss.ide.eclipse.as.core.modules;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagesPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagesPublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -1,212 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.publishers;
-
-import java.util.ArrayList;
-
-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.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleResource;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.ExtendedModuleFile;
-import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.IExtendedModuleResource;
-import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.PackagedModuleDelegate;
-import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.PublishEvent;
-import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.PublisherFileUtilListener;
-import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-
-/**
- *
- * @author rob.stryker(a)jboss.com
- */
-public class PackagesPublisher implements IJBossServerPublisher {
-
- protected IDeployableServer server;
- protected IModuleResourceDelta[] delta;
- protected EventLogTreeItem eventRoot;
-
- public PackagesPublisher(IDeployableServer server, EventLogTreeItem eventContext) {
- this.server = server;
- eventRoot = eventContext;
- }
- public PackagesPublisher(IServer server, EventLogTreeItem eventContext) {
- this( ServerConverter.getDeployableServer(server), eventContext);
- }
- public void setDelta(IModuleResourceDelta[] delta) {
- this.delta = delta;
- }
-
-
- public int getPublishState() {
- return IServer.PUBLISH_STATE_NONE;
- }
-
- public IStatus publishModule(int kind, int deltaKind, int modulePublishState,
- IModule module, IProgressMonitor monitor) throws CoreException {
- try {
- // if it's being removed
- if( deltaKind == ServerBehaviourDelegate.REMOVED ) {
- removeModule(module, kind, deltaKind, monitor);
- return null;
- }
-
- if( deltaKind == ServerBehaviourDelegate.ADDED || deltaKind == ServerBehaviourDelegate.CHANGED) {
- publishModule(module, kind, deltaKind, modulePublishState, monitor);
- return null;
- }
- }catch(Exception e) {
- e.printStackTrace();
- }
- return null;
- }
-
- protected void removeModule(IModule module, int kind, int deltaKind, IProgressMonitor monitor) {
- IArchive pack = getPackage(module);
- // remove all of the deployed items
- PublishEvent event = PublisherEventLogger.createSingleModuleTopEvent(eventRoot, module, kind, deltaKind);
- if( pack != null ) {
- IPath sourcePath = pack.getArchiveFilePath();
- IPath destPath = new Path(server.getDeployDirectory()).append(sourcePath.lastSegment());
- // remove the entire file or folder
- PublisherFileUtilListener listener = new PublisherFileUtilListener(event);
- FileUtil.safeDelete(destPath.toFile(), listener);
- }
- }
-
-
-
- protected void publishModule(IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) {
- PublishEvent event = PublisherEventLogger.createSingleModuleTopEvent(eventRoot, module, kind, deltaKind);
- IArchive pack = getPackage(module);
- IPath sourcePath = pack.getArchiveFilePath();
- IPath destPathRoot = new Path(server.getDeployDirectory());
-
- // if destination is deploy directory... no need to re-copy!
- if( destPathRoot.toOSString().equals(pack.getGlobalDestinationPath().toOSString())) {
- // fire null publish event
- return;
- }
-
- PublisherFileUtilListener listener = new PublisherFileUtilListener(event);
-
- if( shouldPublishIncremental(module, kind, deltaKind, modulePublishState) ) {
- publishFromDelta(module, destPathRoot, sourcePath.removeLastSegments(1), delta, listener);
- } else {
- // full publish, copy whole folder or file
- FileUtil.fileSafeCopy(sourcePath.toFile(), destPathRoot.append(sourcePath.lastSegment()).toFile(), listener);
- }
- }
- protected boolean shouldPublishIncremental(IModule module, int kind, int deltaKind, int modulePublishState) {
- if(modulePublishState == IServer.PUBLISH_STATE_FULL || kind == IServer.PUBLISH_FULL)
- return false;
- return true;
- }
- protected void publishFromDelta(IModule module, IPath destPathRoot, IPath sourcePrefix,
- IModuleResourceDelta[] delta, PublisherFileUtilListener listener) {
- ArrayList changedFiles = new ArrayList();
- for( int i = 0; i < delta.length; i++ ) {
- publishFromDeltaHandle(delta[i], destPathRoot, sourcePrefix, changedFiles, listener);
- }
- }
- protected void publishFromDeltaHandle(IModuleResourceDelta delta, IPath destRoot,
- IPath sourcePrefix, ArrayList changedFiles, PublisherFileUtilListener listener) {
- switch( delta.getKind()) {
- case IModuleResourceDelta.REMOVED:
- // removed might not be IExtendedModuleResource
- IModuleResource imr = delta.getModuleResource();
- if( imr instanceof IExtendedModuleResource) {
- IExtendedModuleResource emr = ((IExtendedModuleResource)imr);
- IPath concrete = emr.getConcreteDestFile();
- if( !changedFiles.contains(concrete)) {
- IPath destPath = destRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
-
- // file hasnt been updated yet.
- // But we don't know whether to delete or copy this file.
- // depends where it is in the tree and what's exploded.
- changedFiles.add(concrete);
- IPath concreteRelative = concrete.removeFirstSegments(sourcePrefix.segmentCount()).setDevice(null);
- IPath emrModRelative = emr.getModuleRelativePath();
- boolean delete = concreteRelative.equals(emrModRelative);
-
- if( delete ) {
- FileUtil.safeDelete(destPath.toFile(), listener);
- } else {
- // copy
- FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
- }
- }
- return;
- } else {
- System.out.println("not an extended module resource. need help here");
- return;
- }
- case IModuleResourceDelta.ADDED:
- imr = delta.getModuleResource();
- if( imr instanceof IExtendedModuleResource) {
- IPath concrete = ((IExtendedModuleResource)imr).getConcreteDestFile();
- if( !changedFiles.contains(concrete)) {
- changedFiles.add(concrete);
- IPath destPath = destRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
- FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
- }
- return;
- } else {
- System.out.println("not an extended module resource. need help here");
- return;
- }
- case IModuleResourceDelta.CHANGED:
- imr = delta.getModuleResource();
- if( imr instanceof ExtendedModuleFile ) {
- IPath concrete = ((ExtendedModuleFile)imr).getConcreteDestFile();
- if( !changedFiles.contains(concrete)) {
- changedFiles.add(concrete);
- IPath destPath = destRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
- FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
- }
- }
- break;
- }
-
- IModuleResourceDelta[] children = delta.getAffectedChildren();
- if( children != null ) {
- for( int i = 0; i < children.length; i++ ) {
- publishFromDeltaHandle(children[i], destRoot, sourcePrefix, changedFiles, listener);
- }
- }
- }
-
- protected IArchive getPackage(IModule module) {
- PackagedModuleDelegate delegate = (PackagedModuleDelegate)module.loadAdapter(PackagedModuleDelegate.class, new NullProgressMonitor());
- return delegate == null ? null : delegate.getPackage();
- }
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagesPublisher.java (from rev 3531, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagesPublisher.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PackagesPublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -0,0 +1,212 @@
+/**
+ * JBoss, a Division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+* This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ide.eclipse.as.core.modules;
+
+import java.util.ArrayList;
+
+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.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.modules.PublisherEventLogger.PublishEvent;
+import org.jboss.ide.eclipse.as.core.modules.PublisherEventLogger.PublisherFileUtilListener;
+import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.ExtendedModuleFile;
+import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.IExtendedModuleResource;
+import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.PackagedModuleDelegate;
+import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+
+/**
+ *
+ * @author rob.stryker(a)jboss.com
+ */
+public class PackagesPublisher implements IJBossServerPublisher {
+
+ protected IDeployableServer server;
+ protected IModuleResourceDelta[] delta;
+ protected EventLogTreeItem eventRoot;
+
+ public PackagesPublisher(IDeployableServer server, EventLogTreeItem eventContext) {
+ this.server = server;
+ eventRoot = eventContext;
+ }
+ public PackagesPublisher(IServer server, EventLogTreeItem eventContext) {
+ this( ServerConverter.getDeployableServer(server), eventContext);
+ }
+ public void setDelta(IModuleResourceDelta[] delta) {
+ this.delta = delta;
+ }
+
+
+ public int getPublishState() {
+ return IServer.PUBLISH_STATE_NONE;
+ }
+
+ public IStatus publishModule(int kind, int deltaKind, int modulePublishState,
+ IModule module, IProgressMonitor monitor) throws CoreException {
+ try {
+ // if it's being removed
+ if( deltaKind == ServerBehaviourDelegate.REMOVED ) {
+ removeModule(module, kind, deltaKind, monitor);
+ return null;
+ }
+
+ if( deltaKind == ServerBehaviourDelegate.ADDED || deltaKind == ServerBehaviourDelegate.CHANGED) {
+ publishModule(module, kind, deltaKind, modulePublishState, monitor);
+ return null;
+ }
+ }catch(Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ protected void removeModule(IModule module, int kind, int deltaKind, IProgressMonitor monitor) {
+ IArchive pack = getPackage(module);
+ // remove all of the deployed items
+ PublishEvent event = PublisherEventLogger.createSingleModuleTopEvent(eventRoot, module, kind, deltaKind);
+ if( pack != null ) {
+ IPath sourcePath = pack.getArchiveFilePath();
+ IPath destPath = new Path(server.getDeployDirectory()).append(sourcePath.lastSegment());
+ // remove the entire file or folder
+ PublisherFileUtilListener listener = new PublisherFileUtilListener(event);
+ FileUtil.safeDelete(destPath.toFile(), listener);
+ }
+ }
+
+
+
+ protected void publishModule(IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) {
+ PublishEvent event = PublisherEventLogger.createSingleModuleTopEvent(eventRoot, module, kind, deltaKind);
+ IArchive pack = getPackage(module);
+ IPath sourcePath = pack.getArchiveFilePath();
+ IPath destPathRoot = new Path(server.getDeployDirectory());
+
+ // if destination is deploy directory... no need to re-copy!
+ if( destPathRoot.toOSString().equals(pack.getGlobalDestinationPath().toOSString())) {
+ // fire null publish event
+ return;
+ }
+
+ PublisherFileUtilListener listener = new PublisherFileUtilListener(event);
+
+ if( shouldPublishIncremental(module, kind, deltaKind, modulePublishState) ) {
+ publishFromDelta(module, destPathRoot, sourcePath.removeLastSegments(1), delta, listener);
+ } else {
+ // full publish, copy whole folder or file
+ FileUtil.fileSafeCopy(sourcePath.toFile(), destPathRoot.append(sourcePath.lastSegment()).toFile(), listener);
+ }
+ }
+ protected boolean shouldPublishIncremental(IModule module, int kind, int deltaKind, int modulePublishState) {
+ if(modulePublishState == IServer.PUBLISH_STATE_FULL || kind == IServer.PUBLISH_FULL)
+ return false;
+ return true;
+ }
+ protected void publishFromDelta(IModule module, IPath destPathRoot, IPath sourcePrefix,
+ IModuleResourceDelta[] delta, PublisherFileUtilListener listener) {
+ ArrayList changedFiles = new ArrayList();
+ for( int i = 0; i < delta.length; i++ ) {
+ publishFromDeltaHandle(delta[i], destPathRoot, sourcePrefix, changedFiles, listener);
+ }
+ }
+ protected void publishFromDeltaHandle(IModuleResourceDelta delta, IPath destRoot,
+ IPath sourcePrefix, ArrayList changedFiles, PublisherFileUtilListener listener) {
+ switch( delta.getKind()) {
+ case IModuleResourceDelta.REMOVED:
+ // removed might not be IExtendedModuleResource
+ IModuleResource imr = delta.getModuleResource();
+ if( imr instanceof IExtendedModuleResource) {
+ IExtendedModuleResource emr = ((IExtendedModuleResource)imr);
+ IPath concrete = emr.getConcreteDestFile();
+ if( !changedFiles.contains(concrete)) {
+ IPath destPath = destRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
+
+ // file hasnt been updated yet.
+ // But we don't know whether to delete or copy this file.
+ // depends where it is in the tree and what's exploded.
+ changedFiles.add(concrete);
+ IPath concreteRelative = concrete.removeFirstSegments(sourcePrefix.segmentCount()).setDevice(null);
+ IPath emrModRelative = emr.getModuleRelativePath();
+ boolean delete = concreteRelative.equals(emrModRelative);
+
+ if( delete ) {
+ FileUtil.safeDelete(destPath.toFile(), listener);
+ } else {
+ // copy
+ FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
+ }
+ }
+ return;
+ } else {
+ System.out.println("not an extended module resource. need help here");
+ return;
+ }
+ case IModuleResourceDelta.ADDED:
+ imr = delta.getModuleResource();
+ if( imr instanceof IExtendedModuleResource) {
+ IPath concrete = ((IExtendedModuleResource)imr).getConcreteDestFile();
+ if( !changedFiles.contains(concrete)) {
+ changedFiles.add(concrete);
+ IPath destPath = destRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
+ FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
+ }
+ return;
+ } else {
+ System.out.println("not an extended module resource. need help here");
+ return;
+ }
+ case IModuleResourceDelta.CHANGED:
+ imr = delta.getModuleResource();
+ if( imr instanceof ExtendedModuleFile ) {
+ IPath concrete = ((ExtendedModuleFile)imr).getConcreteDestFile();
+ if( !changedFiles.contains(concrete)) {
+ changedFiles.add(concrete);
+ IPath destPath = destRoot.append(concrete.removeFirstSegments(sourcePrefix.segmentCount()));
+ FileUtil.fileSafeCopy(concrete.toFile(), destPath.toFile(), listener);
+ }
+ }
+ break;
+ }
+
+ IModuleResourceDelta[] children = delta.getAffectedChildren();
+ if( children != null ) {
+ for( int i = 0; i < children.length; i++ ) {
+ publishFromDeltaHandle(children[i], destRoot, sourcePrefix, changedFiles, listener);
+ }
+ }
+ }
+
+ protected IArchive getPackage(IModule module) {
+ PackagedModuleDelegate delegate = (PackagedModuleDelegate)module.loadAdapter(PackagedModuleDelegate.class, new NullProgressMonitor());
+ return delegate == null ? null : delegate.getPackage();
+ }
+}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PublisherEventLogger.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PublisherEventLogger.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -1,105 +0,0 @@
-package org.jboss.ide.eclipse.as.core.publishers;
-
-import java.io.File;
-
-import org.eclipse.wst.server.core.IModule;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
-import org.jboss.ide.eclipse.as.core.util.FileUtil.IFileUtilListener;
-
-public class PublisherEventLogger {
- public static final String PUBLISH_MAJOR_TYPE = "org.jboss.ide.eclipse.as.core.publishers.Events.MajorType";
- public static final String MODULE_NAME = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.ModuleName";
-
- public static class PublishEvent extends EventLogTreeItem {
- public PublishEvent(SimpleTreeItem parent, String specificType) {
- super(parent, PUBLISH_MAJOR_TYPE, specificType);
- }
- public PublishEvent(SimpleTreeItem parent, String specificType, IModule module) {
- super(parent, PUBLISH_MAJOR_TYPE, specificType);
- setProperty(MODULE_NAME, module.getName());
- }
- }
-
- // type
- public static final String MULTIPLE_MODULE_TOP_EVENT = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MULTIPLE_MODULE_TOP_EVENT";
-
- // properties
- public static final String MULTIPLE_MODULE_MODULE_COUNT = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MULTIPLE_MODULE_MODULE_COUNT";
-
- public static PublishEvent createMultipleModuleTopLevelEvent(EventLogTreeItem parent, int numMods) {
- PublishEvent event = new PublishEvent(parent, MULTIPLE_MODULE_TOP_EVENT );
- event.setProperty(MULTIPLE_MODULE_MODULE_COUNT, new Integer(numMods));
- EventLogModel.markChanged(parent);
- return event;
- }
-
- // type
- public static final String SINGLE_MODULE_TOP_EVENT = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.SINGLE_MODULE_TOP_EVENT";
- // properties
- public static final String MODULE_KIND = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MODULE_KIND";
- public static final String DELTA_KIND = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.DELTA_KIND";
- public static PublishEvent createSingleModuleTopEvent(EventLogTreeItem parent, IModule module, int kind, int deltaKind) {
- PublishEvent event = new PublishEvent(parent, SINGLE_MODULE_TOP_EVENT);
- event.setProperty(MODULE_KIND, new Integer(kind));
- event.setProperty(DELTA_KIND, new Integer(deltaKind));
- event.setProperty(MODULE_NAME, module.getName());
- EventLogModel.markChanged(parent);
- return event;
- }
-
- public static PublishEvent createRemoveResultsEvent() {
- return null;
- }
-
- public static class PublisherFileUtilListener implements IFileUtilListener {
- EventLogTreeItem log;
- public PublisherFileUtilListener(EventLogTreeItem log) {
- this.log = log;
- }
- public void fileCoppied(File source, File dest, boolean result, Exception e) {
- new CoppiedEvent(log, source, dest, result, e);
- EventLogModel.markChanged(log);
- }
- public void fileDeleted(File file, boolean result, Exception e) {
- new DeletedEvent(log, file, result, e);
- EventLogModel.markChanged(log);
- }
- public void folderDeleted(File file, boolean result, Exception e) {
- new DeletedEvent(log, file, result, e);
- EventLogModel.markChanged(log);
- }
- }
- // event types
- public static final String FILE_EVENT_MAJOR_TYPE = "org.jboss.ide.eclipse.as.core.publishers.Events.FILE_EVENT_MAJOR_TYPE";
- public static final String FOLDER_DELETED_EVENT = "org.jboss.ide.eclipse.as.core.publishers.Events.FOLDER_DELETED_EVENT";
- public static final String FILE_DELETED_EVENT = "org.jboss.ide.eclipse.as.core.publishers.Events.FILE_DELETED_EVENT";
- public static final String FILE_COPPIED_EVENT = "org.jboss.ide.eclipse.as.core.publishers.Events.FILE_COPPIED_EVENT";
- // properties
- public static final String SUCCESS_PROPERTY = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.SUCCESS_PROPERTY";
- public static final String SOURCE_PROPERTY = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.SOURCE_PROPERTY";
- public static final String DEST_PROPERTY = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.DEST_PROPERTY";
- public static final String EXCEPTION_MESSAGE = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.EXCEPTION_PROPERTY";
- public static class DeletedEvent extends EventLogTreeItem {
- public DeletedEvent(EventLogTreeItem parent, File file, boolean result, Exception e) {
- super(parent, FILE_EVENT_MAJOR_TYPE, file.isDirectory() ? FOLDER_DELETED_EVENT : FILE_DELETED_EVENT);
- setProperty(SUCCESS_PROPERTY, new Boolean(result));
- setProperty(DEST_PROPERTY, file.getAbsolutePath());
- if( e != null )
- setProperty(EXCEPTION_MESSAGE, e.getMessage());
- }
-
- }
- public static class CoppiedEvent extends EventLogTreeItem {
- public CoppiedEvent(EventLogTreeItem parent, File source, File destination, boolean result, Exception e) {
- super(parent, FILE_EVENT_MAJOR_TYPE, FILE_COPPIED_EVENT);
- setProperty(SOURCE_PROPERTY, source.getAbsolutePath());
- setProperty(DEST_PROPERTY, destination.getAbsolutePath());
- setProperty(SUCCESS_PROPERTY, new Boolean(result));
- if( e != null )
- setProperty(EXCEPTION_MESSAGE, e.getMessage());
- }
- }
-
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PublisherEventLogger.java (from rev 3531, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PublisherEventLogger.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/PublisherEventLogger.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -0,0 +1,105 @@
+package org.jboss.ide.eclipse.as.core.modules;
+
+import java.io.File;
+
+import org.eclipse.wst.server.core.IModule;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
+import org.jboss.ide.eclipse.as.core.util.FileUtil.IFileUtilListener;
+
+public class PublisherEventLogger {
+ public static final String PUBLISH_MAJOR_TYPE = "org.jboss.ide.eclipse.as.core.publishers.Events.MajorType";
+ public static final String MODULE_NAME = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.ModuleName";
+
+ public static class PublishEvent extends EventLogTreeItem {
+ public PublishEvent(SimpleTreeItem parent, String specificType) {
+ super(parent, PUBLISH_MAJOR_TYPE, specificType);
+ }
+ public PublishEvent(SimpleTreeItem parent, String specificType, IModule module) {
+ super(parent, PUBLISH_MAJOR_TYPE, specificType);
+ setProperty(MODULE_NAME, module.getName());
+ }
+ }
+
+ // type
+ public static final String MULTIPLE_MODULE_TOP_EVENT = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MULTIPLE_MODULE_TOP_EVENT";
+
+ // properties
+ public static final String MULTIPLE_MODULE_MODULE_COUNT = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MULTIPLE_MODULE_MODULE_COUNT";
+
+ public static PublishEvent createMultipleModuleTopLevelEvent(EventLogTreeItem parent, int numMods) {
+ PublishEvent event = new PublishEvent(parent, MULTIPLE_MODULE_TOP_EVENT );
+ event.setProperty(MULTIPLE_MODULE_MODULE_COUNT, new Integer(numMods));
+ EventLogModel.markChanged(parent);
+ return event;
+ }
+
+ // type
+ public static final String SINGLE_MODULE_TOP_EVENT = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.SINGLE_MODULE_TOP_EVENT";
+ // properties
+ public static final String MODULE_KIND = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.MODULE_KIND";
+ public static final String DELTA_KIND = "org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger.DELTA_KIND";
+ public static PublishEvent createSingleModuleTopEvent(EventLogTreeItem parent, IModule module, int kind, int deltaKind) {
+ PublishEvent event = new PublishEvent(parent, SINGLE_MODULE_TOP_EVENT);
+ event.setProperty(MODULE_KIND, new Integer(kind));
+ event.setProperty(DELTA_KIND, new Integer(deltaKind));
+ event.setProperty(MODULE_NAME, module.getName());
+ EventLogModel.markChanged(parent);
+ return event;
+ }
+
+ public static PublishEvent createRemoveResultsEvent() {
+ return null;
+ }
+
+ public static class PublisherFileUtilListener implements IFileUtilListener {
+ EventLogTreeItem log;
+ public PublisherFileUtilListener(EventLogTreeItem log) {
+ this.log = log;
+ }
+ public void fileCoppied(File source, File dest, boolean result, Exception e) {
+ new CoppiedEvent(log, source, dest, result, e);
+ EventLogModel.markChanged(log);
+ }
+ public void fileDeleted(File file, boolean result, Exception e) {
+ new DeletedEvent(log, file, result, e);
+ EventLogModel.markChanged(log);
+ }
+ public void folderDeleted(File file, boolean result, Exception e) {
+ new DeletedEvent(log, file, result, e);
+ EventLogModel.markChanged(log);
+ }
+ }
+ // event types
+ public static final String FILE_EVENT_MAJOR_TYPE = "org.jboss.ide.eclipse.as.core.publishers.Events.FILE_EVENT_MAJOR_TYPE";
+ public static final String FOLDER_DELETED_EVENT = "org.jboss.ide.eclipse.as.core.publishers.Events.FOLDER_DELETED_EVENT";
+ public static final String FILE_DELETED_EVENT = "org.jboss.ide.eclipse.as.core.publishers.Events.FILE_DELETED_EVENT";
+ public static final String FILE_COPPIED_EVENT = "org.jboss.ide.eclipse.as.core.publishers.Events.FILE_COPPIED_EVENT";
+ // properties
+ public static final String SUCCESS_PROPERTY = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.SUCCESS_PROPERTY";
+ public static final String SOURCE_PROPERTY = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.SOURCE_PROPERTY";
+ public static final String DEST_PROPERTY = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.DEST_PROPERTY";
+ public static final String EXCEPTION_MESSAGE = "org.jboss.ide.eclipse.as.core.publishers.Events.Properties.EXCEPTION_PROPERTY";
+ public static class DeletedEvent extends EventLogTreeItem {
+ public DeletedEvent(EventLogTreeItem parent, File file, boolean result, Exception e) {
+ super(parent, FILE_EVENT_MAJOR_TYPE, file.isDirectory() ? FOLDER_DELETED_EVENT : FILE_DELETED_EVENT);
+ setProperty(SUCCESS_PROPERTY, new Boolean(result));
+ setProperty(DEST_PROPERTY, file.getAbsolutePath());
+ if( e != null )
+ setProperty(EXCEPTION_MESSAGE, e.getMessage());
+ }
+
+ }
+ public static class CoppiedEvent extends EventLogTreeItem {
+ public CoppiedEvent(EventLogTreeItem parent, File source, File destination, boolean result, Exception e) {
+ super(parent, FILE_EVENT_MAJOR_TYPE, FILE_COPPIED_EVENT);
+ setProperty(SOURCE_PROPERTY, source.getAbsolutePath());
+ setProperty(DEST_PROPERTY, destination.getAbsolutePath());
+ setProperty(SUCCESS_PROPERTY, new Boolean(result));
+ if( e != null )
+ setProperty(EXCEPTION_MESSAGE, e.getMessage());
+ }
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleFilePublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleFilePublisher.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -1,4 +1,4 @@
-package org.jboss.ide.eclipse.as.core.publishers;
+package org.jboss.ide.eclipse.as.core.modules;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -10,9 +10,9 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.jboss.ide.eclipse.as.core.packages.SingleDeployableFactory;
+import org.jboss.ide.eclipse.as.core.packages.SingleDeployableFactory.SingleDeployableModuleDelegate;
import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.singledeployable.SingleDeployableFactory;
-import org.jboss.ide.eclipse.as.core.singledeployable.SingleDeployableFactory.SingleDeployableModuleDelegate;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/SingleDeployableFactory.java (from rev 3530, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/singledeployable/SingleDeployableFactory.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/SingleDeployableFactory.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/SingleDeployableFactory.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -0,0 +1,156 @@
+package org.jboss.ide.eclipse.as.core.packages;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.internal.ModuleFactory;
+import org.eclipse.wst.server.core.internal.ModuleFile;
+import org.eclipse.wst.server.core.internal.ServerPlugin;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+
+public class SingleDeployableFactory extends ModuleFactoryDelegate {
+ public static final String FACTORY_ID = "org.jboss.ide.eclipse.as.core.singledeployablefactory";
+ private static SingleDeployableFactory factDelegate;
+ public static final String MODULE_TYPE = "jboss.singlefile";
+ public static final String VERSION = "1.0";
+ private static final String PREFERENCE_KEY = "org.jboss.ide.eclipse.as.core.singledeployable.deployableList";
+ private static final String DELIM = "\r";
+
+
+ private static ModuleFactory factory;
+ public static SingleDeployableFactory getFactory() {
+ if( factDelegate == null ) {
+ ModuleFactory[] factories = ServerPlugin.getModuleFactories();
+ for( int i = 0; i < factories.length; i++ ) {
+ if( factories[i].getId().equals(FACTORY_ID)) {
+ Object o = factories[i].getDelegate(new NullProgressMonitor());
+ if( o instanceof SingleDeployableFactory ) {
+ factory = factories[i];
+ factDelegate = (SingleDeployableFactory)o;
+ return factDelegate;
+ }
+ }
+ }
+ }
+ return factDelegate;
+ }
+
+ public static boolean makeDeployable(IResource resource) {
+ return makeDeployable(resource.getFullPath());
+ }
+
+ public static boolean makeDeployable(IPath workspaceRelative) {
+ boolean ret = getFactory().addModule(workspaceRelative);
+ getFactory().saveDeployableList();
+ return ret;
+ }
+
+ public static void unmakeDeployable(IResource resource) {
+ unmakeDeployable(resource.getFullPath());
+ }
+
+ public static void unmakeDeployable(IPath workspaceRelative) {
+ getFactory().removeModule(workspaceRelative);
+ getFactory().saveDeployableList();
+ }
+
+ public static IModule findModule(IResource resource) {
+ return findModule(resource.getFullPath());
+ }
+ public static IModule findModule(IPath workspaceRelative) {
+ return getFactory().getModule(workspaceRelative);
+ }
+
+
+
+ private HashMap moduleIdToModule;
+ private HashMap moduleToDelegate;
+ public SingleDeployableFactory() {
+ moduleIdToModule = new HashMap();
+ moduleToDelegate = new HashMap();
+ String files = JBossServerCorePlugin.getDefault().getPluginPreferences().getString(PREFERENCE_KEY);
+ if( files.equals("")) return;
+ String[] files2 = files.split(DELIM);
+ for( int i = 0; i < files2.length; i++ ) {
+ addModule(new Path(files2[i]));
+ }
+ }
+
+ public IModule getModule(IPath path) {
+ return (IModule)moduleIdToModule.get(path);
+ }
+ public void saveDeployableList() {
+ Iterator i = moduleIdToModule.keySet().iterator();
+ String val = "";
+ while(i.hasNext()) {
+ val += ((IPath)i.next()).toString() + DELIM;
+ }
+ JBossServerCorePlugin.getDefault().getPluginPreferences().setValue(PREFERENCE_KEY, val);
+ JBossServerCorePlugin.getDefault().savePluginPreferences();
+ }
+
+ protected boolean addModule(IPath path) {
+ IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+ if( resource != null && resource.exists() ) {
+ IModule module = createModule(path.toString(), path.toString(), MODULE_TYPE, VERSION, resource.getProject());
+ moduleIdToModule.put(path, module);
+ moduleToDelegate.put(module, new SingleDeployableModuleDelegate(path));
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ protected void removeModule(IPath path) {
+ IModule mod = (IModule)moduleIdToModule.get(path);
+ moduleIdToModule.remove(path);
+ moduleToDelegate.remove(mod);
+ }
+
+ public IModule[] getModules() {
+ Collection c = moduleIdToModule.values();
+ return (IModule[]) c.toArray(new IModule[c.size()]);
+ }
+
+ public ModuleDelegate getModuleDelegate(IModule module) {
+ return (ModuleDelegate)moduleToDelegate.get(module);
+ }
+
+ public class SingleDeployableModuleDelegate extends ModuleDelegate {
+ private IPath global;
+ public SingleDeployableModuleDelegate(IPath workspaceRelative) {
+ global = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(workspaceRelative);
+ }
+ public IModule[] getChildModules() {
+ return new IModule[0];
+ }
+
+ public IModuleResource[] members() throws CoreException {
+ return new IModuleResource[] {
+ new ModuleFile(global.lastSegment(),
+ new Path(global.lastSegment()),
+ global.toFile().lastModified()) };
+ }
+
+ public IStatus validate() {
+ return Status.OK_STATUS;
+ }
+
+ public IPath getGlobalSourcePath() {
+ return this.global;
+ }
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11 05:16:49 UTC (rev 3532)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11 05:20:35 UTC (rev 3533)
@@ -19,13 +19,13 @@
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.modules.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.modules.JstPublisher;
+import org.jboss.ide.eclipse.as.core.modules.NullPublisher;
+import org.jboss.ide.eclipse.as.core.modules.PackagesPublisher;
+import org.jboss.ide.eclipse.as.core.modules.PublisherEventLogger;
+import org.jboss.ide.eclipse.as.core.modules.SingleFilePublisher;
import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory;
-import org.jboss.ide.eclipse.as.core.publishers.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.publishers.JstPublisher;
-import org.jboss.ide.eclipse.as.core.publishers.NullPublisher;
-import org.jboss.ide.eclipse.as.core.publishers.PackagesPublisher;
-import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger;
-import org.jboss.ide.eclipse.as.core.publishers.SingleFilePublisher;
import org.jboss.ide.eclipse.as.core.server.internal.launch.DeployableLaunchConfiguration;
public class DeployableServerBehavior extends ServerBehaviourDelegate {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2007-09-11 05:16:49 UTC (rev 3532)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2007-09-11 05:20:35 UTC (rev 3533)
@@ -249,7 +249,7 @@
versions="1.0"/>
</moduleFactory>
<moduleFactory
- class="org.jboss.ide.eclipse.as.core.singledeployable.SingleDeployableFactory"
+ class="org.jboss.ide.eclipse.as.core.packages.SingleDeployableFactory"
id="org.jboss.ide.eclipse.as.core.singledeployablefactory"
projects="false">
<moduleType
17 years, 4 months
JBoss Tools SVN: r3532 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server: providers and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-11 01:16:49 -0400 (Tue, 11 Sep 2007)
New Revision: 3532
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/IEventLogLabelProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/ComplexEventLogLabelProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PollingLabelProvider.java
Log:
Moved as.core.model to as.core.extensions.events, as it had only one file in it, the event log.
Moving to a cleaner API which can be opened up logically and more easily extended.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/IEventLogLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/IEventLogLabelProvider.java 2007-09-11 05:16:46 UTC (rev 3531)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/IEventLogLabelProvider.java 2007-09-11 05:16:49 UTC (rev 3532)
@@ -25,7 +25,7 @@
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.swt.graphics.Image;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
/**
*
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java 2007-09-11 05:16:46 UTC (rev 3531)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java 2007-09-11 05:16:49 UTC (rev 3532)
@@ -52,10 +52,10 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogRoot;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.IEventLogListener;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogRoot;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.IEventLogListener;
import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.preferencepages.ViewProviderPreferenceComposite;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/ComplexEventLogLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/ComplexEventLogLabelProvider.java 2007-09-11 05:16:46 UTC (rev 3531)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/ComplexEventLogLabelProvider.java 2007-09-11 05:16:49 UTC (rev 3532)
@@ -29,7 +29,7 @@
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.IEventLogLabelProvider;
/**
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-09-11 05:16:46 UTC (rev 3531)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-09-11 05:16:49 UTC (rev 3532)
@@ -8,7 +8,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.IEventLogLabelProvider;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PollingLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PollingLabelProvider.java 2007-09-11 05:16:46 UTC (rev 3531)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PollingLabelProvider.java 2007-09-11 05:16:49 UTC (rev 3532)
@@ -34,7 +34,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.ui.internal.provisional.UIDecoratorManager;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.runtime.server.polling.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.runtime.server.polling.PollThread;
import org.jboss.ide.eclipse.as.core.runtime.server.polling.JMXPoller;
17 years, 4 months
JBoss Tools SVN: r3531 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: jbosscore/org/jboss/ide/eclipse/as/core and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-11 01:16:46 -0400 (Tue, 11 Sep 2007)
New Revision: 3531
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/JMXPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/PollThread.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java
Log:
Moved as.core.model to as.core.extensions.events, as it had only one file in it, the event log.
Moving to a cleaner API which can be opened up logically and more easily extended.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11 05:16:46 UTC (rev 3531)
@@ -23,7 +23,7 @@
Eclipse-LazyStart: true
Export-Package: org.jboss.ide.eclipse.as.core,
org.jboss.ide.eclipse.as.core.extensions.descriptors,
- org.jboss.ide.eclipse.as.core.model,
+ org.jboss.ide.eclipse.as.core.extensions.events,
org.jboss.ide.eclipse.as.core.packages,
org.jboss.ide.eclipse.as.core.packages.types,
org.jboss.ide.eclipse.as.core.publishers,
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events (from rev 3530, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/EventLogModel.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java 2007-09-11 05:16:46 UTC (rev 3531)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.ide.eclipse.as.core.model;
+package org.jboss.ide.eclipse.as.core.extensions.events;
import java.util.ArrayList;
import java.util.Date;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-09-11 05:16:46 UTC (rev 3531)
@@ -46,7 +46,7 @@
import org.eclipse.wst.server.core.util.ProjectModule;
import org.eclipse.wst.server.core.util.PublishUtil;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.server.NestedPublishInfo;
import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.xpl.ModulePackager;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-09-11 05:16:46 UTC (rev 3531)
@@ -35,7 +35,7 @@
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.ExtendedModuleFile;
import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.IExtendedModuleResource;
import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory.PackagedModuleDelegate;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublisherEventLogger.java 2007-09-11 05:16:46 UTC (rev 3531)
@@ -3,8 +3,8 @@
import java.io.File;
import org.eclipse.wst.server.core.IModule;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
import org.jboss.ide.eclipse.as.core.util.FileUtil.IFileUtilListener;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/JMXPoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/JMXPoller.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/JMXPoller.java 2007-09-11 05:16:46 UTC (rev 3531)
@@ -49,7 +49,7 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/PollThread.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/PollThread.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/PollThread.java 2007-09-11 05:16:46 UTC (rev 3531)
@@ -26,9 +26,9 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.internal.ServerType;
import org.jboss.ide.eclipse.as.core.ExtensionManager;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogRoot;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogRoot;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.runtime.server.polling.IServerStatePoller.PollingException;
import org.jboss.ide.eclipse.as.core.server.JBossServer;
import org.jboss.ide.eclipse.as.core.server.JBossServerBehavior;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11 05:16:46 UTC (rev 3531)
@@ -17,8 +17,8 @@
import org.eclipse.wst.server.core.internal.ServerPlugin;
import org.eclipse.wst.server.core.model.PublishOperation;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.packages.PackageModuleFactory;
import org.jboss.ide.eclipse.as.core.publishers.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.publishers.JstPublisher;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java 2007-09-11 05:09:17 UTC (rev 3530)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java 2007-09-11 05:16:46 UTC (rev 3531)
@@ -29,8 +29,8 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel;
-import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.runtime.server.polling.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.runtime.server.polling.PollThread;
import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
17 years, 4 months
JBoss Tools SVN: r3530 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: server and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-11 01:09:17 -0400 (Tue, 11 Sep 2007)
New Revision: 3530
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/singledeployable/SingleFilePublisher.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
Log:
Moved the SingleFilePublisher into the publishers directory.
Moving to a cleaner API which can be opened up logically and more easily extended.
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java (from rev 3525, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/singledeployable/SingleFilePublisher.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-09-11 05:09:17 UTC (rev 3530)
@@ -0,0 +1,75 @@
+package org.jboss.ide.eclipse.as.core.publishers;
+
+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.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.singledeployable.SingleDeployableFactory;
+import org.jboss.ide.eclipse.as.core.singledeployable.SingleDeployableFactory.SingleDeployableModuleDelegate;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+
+public class SingleFilePublisher implements IJBossServerPublisher {
+
+ private IDeployableServer server;
+ public SingleFilePublisher(IServer server) {
+ this.server = ServerConverter.getDeployableServer(server);
+ }
+
+ public int getPublishState() {
+ return IServer.PUBLISH_STATE_NONE;
+ }
+
+ public IStatus publishModule(int kind, int deltaKind,
+ int modulePublishState, IModule module, IProgressMonitor monitor)
+ throws CoreException {
+
+
+ IStatus status = null;
+ if(ServerBehaviourDelegate.REMOVED == deltaKind){
+ status = unpublish(server, module, kind, deltaKind, modulePublishState, monitor);
+ } else if( ServerBehaviourDelegate.NO_CHANGE != deltaKind || kind == IServer.PUBLISH_FULL || kind == IServer.PUBLISH_CLEAN ){
+ // if there's no change, do nothing. Otherwise, on change or add, re-publish
+ status = publish(server, module, kind, deltaKind, modulePublishState, monitor);
+ } else if( ServerBehaviourDelegate.NO_CHANGE != deltaKind && kind == IServer.PUBLISH_INCREMENTAL ){
+ status = publish(server, module, kind, deltaKind, modulePublishState, monitor);
+ }
+ return status;
+
+ }
+
+ protected IStatus publish(IDeployableServer server, IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) {
+ // COPY THE FILE HERE!!!
+ SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
+ if( delegate != null ) {
+ IPath sourcePath = delegate.getGlobalSourcePath();
+ IPath destFolder = new Path(server.getDeployDirectory());
+ FileUtil.fileSafeCopy(sourcePath.toFile(), destFolder.append(sourcePath.lastSegment()).toFile());
+ }
+
+ return null;
+ }
+
+ protected IStatus unpublish(IDeployableServer server, IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) {
+ // delete file
+ SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
+ if( delegate != null ) {
+ IPath sourcePath = delegate.getGlobalSourcePath();
+ IPath destFolder = new Path(server.getDeployDirectory());
+ FileUtil.safeDelete(destFolder.append(sourcePath.lastSegment()).toFile());
+ }
+
+ return null;
+ }
+ public void setDelta(IModuleResourceDelta[] delta) {
+ // ignore delta
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11 05:07:14 UTC (rev 3529)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/DeployableServerBehavior.java 2007-09-11 05:09:17 UTC (rev 3530)
@@ -25,8 +25,8 @@
import org.jboss.ide.eclipse.as.core.publishers.NullPublisher;
import org.jboss.ide.eclipse.as.core.publishers.PackagesPublisher;
import org.jboss.ide.eclipse.as.core.publishers.PublisherEventLogger;
+import org.jboss.ide.eclipse.as.core.publishers.SingleFilePublisher;
import org.jboss.ide.eclipse.as.core.server.internal.launch.DeployableLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.singledeployable.SingleFilePublisher;
public class DeployableServerBehavior extends ServerBehaviourDelegate {
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/singledeployable/SingleFilePublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/singledeployable/SingleFilePublisher.java 2007-09-11 05:07:14 UTC (rev 3529)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/singledeployable/SingleFilePublisher.java 2007-09-11 05:09:17 UTC (rev 3530)
@@ -1,75 +0,0 @@
-package org.jboss.ide.eclipse.as.core.singledeployable;
-
-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.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
-import org.jboss.ide.eclipse.as.core.publishers.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.singledeployable.SingleDeployableFactory.SingleDeployableModuleDelegate;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-
-public class SingleFilePublisher implements IJBossServerPublisher {
-
- private IDeployableServer server;
- public SingleFilePublisher(IServer server) {
- this.server = ServerConverter.getDeployableServer(server);
- }
-
- public int getPublishState() {
- return IServer.PUBLISH_STATE_NONE;
- }
-
- public IStatus publishModule(int kind, int deltaKind,
- int modulePublishState, IModule module, IProgressMonitor monitor)
- throws CoreException {
-
-
- IStatus status = null;
- if(ServerBehaviourDelegate.REMOVED == deltaKind){
- status = unpublish(server, module, kind, deltaKind, modulePublishState, monitor);
- } else if( ServerBehaviourDelegate.NO_CHANGE != deltaKind || kind == IServer.PUBLISH_FULL || kind == IServer.PUBLISH_CLEAN ){
- // if there's no change, do nothing. Otherwise, on change or add, re-publish
- status = publish(server, module, kind, deltaKind, modulePublishState, monitor);
- } else if( ServerBehaviourDelegate.NO_CHANGE != deltaKind && kind == IServer.PUBLISH_INCREMENTAL ){
- status = publish(server, module, kind, deltaKind, modulePublishState, monitor);
- }
- return status;
-
- }
-
- protected IStatus publish(IDeployableServer server, IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) {
- // COPY THE FILE HERE!!!
- SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
- if( delegate != null ) {
- IPath sourcePath = delegate.getGlobalSourcePath();
- IPath destFolder = new Path(server.getDeployDirectory());
- FileUtil.fileSafeCopy(sourcePath.toFile(), destFolder.append(sourcePath.lastSegment()).toFile());
- }
-
- return null;
- }
-
- protected IStatus unpublish(IDeployableServer server, IModule module, int kind, int deltaKind, int modulePublishState, IProgressMonitor monitor) {
- // delete file
- SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
- if( delegate != null ) {
- IPath sourcePath = delegate.getGlobalSourcePath();
- IPath destFolder = new Path(server.getDeployDirectory());
- FileUtil.safeDelete(destFolder.append(sourcePath.lastSegment()).toFile());
- }
-
- return null;
- }
- public void setDelta(IModuleResourceDelta[] delta) {
- // ignore delta
- }
-
-}
17 years, 4 months
JBoss Tools SVN: r3529 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: views/server/providers and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-11 01:07:14 -0400 (Tue, 11 Sep 2007)
New Revision: 3529
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ConvertNodeToXPathDialog.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/DescriptorXPathPropertySheetPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyContentProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyLabelProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
Log:
Moved as.model.descriptor package's files into the as.core.extensions.descriptors package.
Moving to a cleaner API which can be opened up logically and more easily extended.
The intention here is to decouple the server logic from the XPath back end, eventually through an extension point.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ConvertNodeToXPathDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ConvertNodeToXPathDialog.java 2007-09-11 05:06:52 UTC (rev 3528)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ConvertNodeToXPathDialog.java 2007-09-11 05:07:14 UTC (rev 3529)
@@ -49,9 +49,9 @@
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.xml.core.internal.document.AttrImpl;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathCategory;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathModel;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathDialog;
import org.w3c.dom.NamedNodeMap;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2007-09-11 05:06:52 UTC (rev 3528)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2007-09-11 05:07:14 UTC (rev 3529)
@@ -64,12 +64,12 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerCore;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XMLDocumentRepository;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathCategory;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathModel;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathQuery;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XMLDocumentRepository;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
import org.jboss.ide.eclipse.as.core.server.JBossServer;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.Messages;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java 2007-09-11 05:06:52 UTC (rev 3528)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java 2007-09-11 05:07:14 UTC (rev 3529)
@@ -49,11 +49,11 @@
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathCategory;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathModel;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathQuery;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs;
import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathCategoryDialog;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/DescriptorXPathPropertySheetPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/DescriptorXPathPropertySheetPage.java 2007-09-11 05:06:52 UTC (rev 3528)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/DescriptorXPathPropertySheetPage.java 2007-09-11 05:07:14 UTC (rev 3529)
@@ -34,10 +34,10 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathCategory;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathQuery;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.views.server.ExtensionTableViewer.ContentWrapper;
import org.jboss.ide.eclipse.as.ui.views.server.providers.DescriptorXPathViewProvider;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyContentProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyContentProvider.java 2007-09-11 05:06:52 UTC (rev 3528)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyContentProvider.java 2007-09-11 05:07:14 UTC (rev 3529)
@@ -2,10 +2,10 @@
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathCategory;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathQuery;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
public class XPathPropertyContentProvider implements ITreeContentProvider {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyLabelProvider.java 2007-09-11 05:06:52 UTC (rev 3528)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyLabelProvider.java 2007-09-11 05:07:14 UTC (rev 3529)
@@ -6,9 +6,9 @@
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathQuery;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
import org.jboss.ide.eclipse.as.ui.Messages;
public class XPathPropertyLabelProvider extends LabelProvider implements ITableLabelProvider {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2007-09-11 05:06:52 UTC (rev 3528)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2007-09-11 05:07:14 UTC (rev 3529)
@@ -51,7 +51,7 @@
import org.eclipse.wst.server.core.internal.ServerWorkingCopy;
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.AbstractJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.JBossServer;
17 years, 4 months
JBoss Tools SVN: r3528 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: jbosscore/org/jboss/ide/eclipse/as/core and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-11 01:06:52 -0400 (Tue, 11 Sep 2007)
New Revision: 3528
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/AntFileFilter.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java
Log:
Moved as.model.descriptor package's files into the as.core.extensions.descriptors package.
Moving to a cleaner API which can be opened up logically and more easily extended.
The intention here is to decouple the server logic from the XPath back end, eventually through an extension point.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11 05:04:39 UTC (rev 3527)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-09-11 05:06:52 UTC (rev 3528)
@@ -22,8 +22,8 @@
org.apache.ant
Eclipse-LazyStart: true
Export-Package: org.jboss.ide.eclipse.as.core,
+ org.jboss.ide.eclipse.as.core.extensions.descriptors,
org.jboss.ide.eclipse.as.core.model,
- org.jboss.ide.eclipse.as.core.model.descriptor,
org.jboss.ide.eclipse.as.core.packages,
org.jboss.ide.eclipse.as.core.packages.types,
org.jboss.ide.eclipse.as.core.publishers,
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors (from rev 3525, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/AntFileFilter.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/AntFileFilter.java 2007-09-11 04:54:29 UTC (rev 3525)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/AntFileFilter.java 2007-09-11 05:06:52 UTC (rev 3528)
@@ -1,4 +1,4 @@
-package org.jboss.ide.eclipse.as.core.model.descriptor;
+package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import org.apache.tools.ant.DirectoryScanner;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/XMLDocumentRepository.java 2007-09-11 04:54:29 UTC (rev 3525)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XMLDocumentRepository.java 2007-09-11 05:06:52 UTC (rev 3528)
@@ -1,4 +1,4 @@
-package org.jboss.ide.eclipse.as.core.model.descriptor;
+package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.io.File;
import java.io.FileOutputStream;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/XPathCategory.java 2007-09-11 04:54:29 UTC (rev 3525)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2007-09-11 05:06:52 UTC (rev 3528)
@@ -1,4 +1,4 @@
-package org.jboss.ide.eclipse.as.core.model.descriptor;
+package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.util.HashMap;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/XPathFileResult.java 2007-09-11 04:54:29 UTC (rev 3525)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathFileResult.java 2007-09-11 05:06:52 UTC (rev 3528)
@@ -1,4 +1,4 @@
-package org.jboss.ide.eclipse.as.core.model.descriptor;
+package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.util.ArrayList;
import java.util.Iterator;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/XPathModel.java 2007-09-11 04:54:29 UTC (rev 3525)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2007-09-11 05:06:52 UTC (rev 3528)
@@ -1,4 +1,4 @@
-package org.jboss.ide.eclipse.as.core.model.descriptor;
+package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.net.URL;
import java.util.ArrayList;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/descriptor/XPathQuery.java 2007-09-11 04:54:29 UTC (rev 3525)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2007-09-11 05:06:52 UTC (rev 3528)
@@ -1,11 +1,11 @@
-package org.jboss.ide.eclipse.as.core.model.descriptor;
+package org.jboss.ide.eclipse.as.core.extensions.descriptors;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.Path;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
/**
* A simple value object to hold the XPath query data
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java 2007-09-11 05:04:39 UTC (rev 3527)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java 2007-09-11 05:06:52 UTC (rev 3528)
@@ -44,8 +44,8 @@
import org.eclipse.wst.server.core.model.IURLProvider;
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathModel;
-import org.jboss.ide.eclipse.as.core.model.descriptor.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.attributes.IServerStartupParameters;
17 years, 4 months