JBoss Tools SVN: r23621 - in branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: configuration and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-07-21 04:56:53 -0400 (Wed, 21 Jul 2010)
New Revision: 23621
Removed:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/dbm/editor/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/figures/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/autolayout/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/process/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/serialize/
Log:
15 years, 9 months
JBoss Tools SVN: r23620 - trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-21 04:30:57 -0400 (Wed, 21 Jul 2010)
New Revision: 23620
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6636
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-07-21 08:30:32 UTC (rev 23619)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-07-21 08:30:57 UTC (rev 23620)
@@ -33,7 +33,7 @@
*/
public void testLegalTypesInTyped() throws Exception {
IFile petShopFile = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/PetShop.java");
- assertMarkerIsCreated(petShopFile, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, 25);
+ assertMarkerIsCreated(petShopFile, CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD, 25);
int markerNumbers = getMarkersNumber(petShopFile);
assertEquals("PetShop.java should has the only error marker.", markerNumbers, 1);
}
15 years, 9 months
JBoss Tools SVN: r23619 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-21 04:30:32 -0400 (Wed, 21 Jul 2010)
New Revision: 23619
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6636
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-07-21 08:26:58 UTC (rev 23618)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-07-21 08:30:32 UTC (rev 23619)
@@ -1651,7 +1651,14 @@
}
}
if (!typeWasFound) {
- addError(CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION, CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION, typedDeclaration, bean.getResource());
+ String message = bean instanceof IClassBean
+ ? CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_BEAN_CLASS
+ : bean instanceof IProducerField
+ ? CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD
+ : bean instanceof IProducerMethod
+ ? CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_METHOD
+ : CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION;
+ addError(message, CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION, typedDeclaration, bean.getResource());
}
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-07-21 08:26:58 UTC (rev 23618)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-07-21 08:30:32 UTC (rev 23619)
@@ -30,6 +30,9 @@
public static String UNSATISFIED_INJECTION_POINTS;
public static String AMBIGUOUS_INJECTION_POINTS;
public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION;
+ public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_BEAN_CLASS;
+ public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_METHOD;
+ public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD;
public static String PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD;
public static String PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE;
public static String PRODUCER_FIELD_TYPE_HAS_WILDCARD;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-07-21 08:26:58 UTC (rev 23618)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-07-21 08:30:32 UTC (rev 23619)
@@ -9,6 +9,9 @@
UNSATISFIED_INJECTION_POINTS=No bean is eligible for injection to the injection point
AMBIGUOUS_INJECTION_POINTS=Multiple beans are eligible for injection to the injection point
ILLEGAL_TYPE_IN_TYPED_DECLARATION=Bean class or producer method or field specifies a @Typed annotation, and the value member specifies a class which does not correspond to a type in the unrestricted set of bean types of a bean
+ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_BEAN_CLASS=Bean class specifies a @Typed annotation, and the value member specifies a class which does not correspond to a type in the unrestricted set of bean types of a bean
+ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_METHOD=Producer method specifies a @Typed annotation, and the value member specifies a class which does not correspond to a type in the unrestricted set of bean types of a bean
+ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD=Producer field specifies a @Typed annotation, and the value member specifies a class which does not correspond to a type in the unrestricted set of bean types of a bean
PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD=Producer method return type contains a wildcard type parameter
PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE=Producer method return type is a type variable
PRODUCER_FIELD_TYPE_HAS_WILDCARD=Producer field type contains a wildcard type parameter
15 years, 9 months
JBoss Tools SVN: r23618 - in workspace/rstryker/rse/as/plugins: org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-07-21 04:26:58 -0400 (Wed, 21 Jul 2010)
New Revision: 23618
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractServerToolsPublisher.java
Modified:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackageModuleFactory.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse/RSEZippedJSTPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractJSTPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/SingleFileRSEPublisher.java
Log:
Trimmed down publishers substantially
Made single file deployables respond as binary to better fit the model
Made project-archives deployables respond as binary if top archive is zipped
JBIDE-6580
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackageModuleFactory.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackageModuleFactory.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackageModuleFactory.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -41,6 +41,7 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeVisitor;
import org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory.DirectoryScannerExtension.FileWrapper;
import org.jboss.ide.eclipse.archives.core.util.ModelUtil;
+import org.jboss.ide.eclipse.as.wtp.core.modules.IJBTModule;
/**
*
@@ -285,7 +286,7 @@
}
- public static class PackagedModuleDelegate extends ModuleDelegate {
+ public static class PackagedModuleDelegate extends ModuleDelegate implements IJBTModule {
private IArchive pack;
private IModuleResource rootResource;
private DelegateInitVisitor initVisitor;
@@ -317,6 +318,18 @@
public IStatus validate() {
return Status.OK_STATUS;
}
+
+ public IModule[] getModules() {
+ return new IModule[]{};
+ }
+
+ public String getURI(IModule module) {
+ return null; // not called i hope
+ }
+
+ public boolean isBinary() {
+ return rootResource instanceof IModuleFile;
+ }
}
public static class PackagesModuleFolder extends ModuleFolder {
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/PackagesPublisher.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -1,179 +1,46 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.archives.webtools.modules;
-import java.io.File;
-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.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
+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.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.util.PathUtils;
-import org.jboss.ide.eclipse.archives.webtools.IntegrationPlugin;
-import org.jboss.ide.eclipse.archives.webtools.Messages;
-import org.jboss.ide.eclipse.archives.webtools.modules.PackageModuleFactory.PackagedModuleDelegate;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
-import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.core.util.FileUtil.FileUtilListener;
+import org.jboss.ide.eclipse.as.rse.core.AbstractServerToolsPublisher;
-/**
- *
- * @author rob.stryker(a)jboss.com
- */
-public class PackagesPublisher implements IJBossServerPublisher {
-
- protected IDeployableServer server;
- protected IModuleResourceDelta[] delta;
- protected FileUtilListener listener;
- public PackagesPublisher() {
- }
-
- public int getPublishState() {
- return IServer.PUBLISH_STATE_NONE;
- }
-
+public class PackagesPublisher extends AbstractServerToolsPublisher {
public boolean accepts(String method, IServer server, IModule[] module) {
if( LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(method) && module != null && module.length > 0
&& PackageModuleFactory.MODULE_TYPE.equals(module[0].getModuleType().getId()))
return true;
return false;
}
- public IStatus publishModule(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor)
- throws CoreException {
- listener = new FileUtilListener();
- this.server = ServerConverter.getDeployableServer(server);
- this.delta = delta;
- IModule module2 = module[0];
- try {
- // if it's being removed
- if( publishType == REMOVE_PUBLISH ) {
- removeModule(module2, monitor);
- } else if( publishType == FULL_PUBLISH ) {
- publishModule(module2, false, monitor);
- } else if( publishType == INCREMENTAL_PUBLISH ) {
- publishModule(module2, true, monitor);
- }
- }catch(Exception e) {
- IStatus status = new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID,
- NLS.bind(Messages.ErrorDuringPublish, module2.getName()), e);
- return status;
- }
-
- if( listener.getStatuses().length > 0 ) {
- MultiStatus ms = new MultiStatus(IntegrationPlugin.PLUGIN_ID, IStatus.ERROR,
- NLS.bind(Messages.ErrorDuringPublish, module2.getName()), null);
- for( int i = 0; i < listener.getStatuses().length; i++ ) {
- ms.add(listener.getStatuses()[i]);
- }
- return ms;
- }
-
- IStatus ret = new Status(IStatus.OK, IntegrationPlugin.PLUGIN_ID,
- NLS.bind(Messages.PublishSuccessful, module2.getName()));
- return ret;
+ @Override
+ protected IPublishCopyCallbackHandler getCallbackHandler(IPath path,
+ IServer server, IJBossServerPublishMethod method) {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ return new LocalCopyCallback(server, path,
+ new Path(ds.getTempDeployFolder()));
}
- protected void removeModule(IModule module, IProgressMonitor monitor) {
- IArchive pack = getPackage(module);
- // remove all of the deployed items
- if( pack != null ) {
- IPath sourcePath = pack.getArchiveFilePath();
- IModule[] tree = new IModule[] { module };
- IPath destPath = PublishUtil.getDeployPath(tree, server);
- IPath destPath2 = destPath.append(sourcePath.lastSegment());
- // remove the entire file or folder
- FileUtil.safeDelete(destPath2.toFile(), listener);
- }
+ @Override
+ protected String getPublishDefaultRootFolder() {
+ return server.getDeployFolder();
}
-
-
- protected void publishModule(IModule module, boolean incremental, IProgressMonitor monitor) {
- IArchive pack = getPackage(module);
- IPath sourcePath = pack.getArchiveFilePath();
- IModule[] tree = new IModule[] { module };
- IPath destPathRoot = PublishUtil.getDeployPath(tree, server);
-
- // if destination is deploy directory... no need to re-copy!
- if( destPathRoot.toOSString().equals(PathUtils.getGlobalLocation(pack).toOSString())) {
- // fire null publish event
- return;
- }
-
- if( !incremental || !pack.isExploded() ) { // full publish, or zipped
- // full publish, copy whole folder or file
- FileUtil.fileSafeCopy(sourcePath.toFile(), destPathRoot.toFile(), listener);
- } else if( destPathRoot.toFile().exists() && destPathRoot.toFile().isFile()) {
- FileUtil.fileSafeCopy(sourcePath.toFile(), destPathRoot.toFile(), listener);
- } else {
- publishFromDelta(module, destPathRoot, sourcePath.removeLastSegments(1), delta);
- }
- }
-
- protected void publishFromDelta(IModule module, IPath destPathRoot, IPath sourcePrefix,
- IModuleResourceDelta[] delta) {
- ArrayList<IPath> changedFiles = new ArrayList<IPath>();
- for( int i = 0; i < delta.length; i++ ) {
- publishFromDeltaHandle(delta[i], destPathRoot, sourcePrefix, changedFiles);
- }
- }
-
- protected void publishFromDeltaHandle(IModuleResourceDelta delta, IPath destRoot,
- IPath sourcePrefix, ArrayList<IPath> changedFiles) {
- IModuleResource imr = delta.getModuleResource();
- File f = (File)imr.getAdapter(File.class);
- if( f != null ) {
- IPath destPath = destRoot.append(imr.getModuleRelativePath()).append(imr.getName());
- switch( delta.getKind()) {
- case IModuleResourceDelta.REMOVED:
- FileUtil.safeDelete(destPath.toFile(), listener);
- return;
- case IModuleResourceDelta.ADDED:
- FileUtil.fileSafeCopy(f, destPath.toFile(), listener);
- return;
- case IModuleResourceDelta.CHANGED:
- FileUtil.fileSafeCopy(f, 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);
- }
- }
- }
-
- protected IArchive getPackage(IModule module) {
- PackagedModuleDelegate delegate = (PackagedModuleDelegate)module.loadAdapter(PackagedModuleDelegate.class, new NullProgressMonitor());
- return delegate == null ? null : delegate.getPackage();
- }
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse/RSEZippedJSTPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse/RSEZippedJSTPublisher.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/rse/RSEZippedJSTPublisher.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -30,6 +30,11 @@
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
+/**
+ * This class is in charge of RSE zipped publishing for flexible projects.
+ * It extends the functionality of the local zipped publishing class
+ * by uploading the file after building it in a temporary directory
+ */
public class RSEZippedJSTPublisher extends WTPZippedPublisher {
protected String getPublishMethod() {
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -186,6 +186,7 @@
} catch( NumberFormatException nfe) {}
publishers.add(new PublisherWrapper(p, zipDelegate, (IJBossServerPublisher)clazz, cf[i]));
} catch( CoreException e ) {
+ e.printStackTrace();
} catch( ClassCastException cce ) {
}
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/SingleDeployableFactory.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -55,6 +55,7 @@
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
+import org.jboss.ide.eclipse.as.wtp.core.modules.IJBTModule;
import org.osgi.service.prefs.BackingStoreException;
/**
@@ -277,7 +278,7 @@
return moduleToDelegate.get(module);
}
- public class SingleDeployableModuleDelegate extends ModuleDelegate {
+ public class SingleDeployableModuleDelegate extends ModuleDelegate implements IJBTModule {
private IPath global;
private IPath workspaceRelative;
public SingleDeployableModuleDelegate(IPath workspaceRelative) {
@@ -291,9 +292,9 @@
public IModuleResource[] members() throws CoreException {
return new IModuleResource[] {
- new ModuleFile(global.lastSegment(),
- new Path(global.lastSegment()),
- global.toFile().lastModified()) };
+ new ModuleFile(global.toFile(),
+ global.lastSegment(),
+ global.removeLastSegments(1)) };
}
public IStatus validate() {
@@ -307,6 +308,15 @@
public IPath getWorkspaceRelativePath() {
return workspaceRelative;
}
+ public IModule[] getModules() {
+ return new IModule[0]; // no children
+ }
+ public String getURI(IModule module) {
+ return null; // never called
+ }
+ public boolean isBinary() {
+ return true;
+ }
}
public class FileDeletionListener implements IResourceChangeListener, IResourceDeltaVisitor {
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2010 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,248 +10,33 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.publishers;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.Assert;
-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.MultiStatus;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
-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.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-import org.jboss.ide.eclipse.as.core.util.FileUtil.FileUtilListener;
-import org.jboss.ide.eclipse.as.core.util.FileUtil.IFileUtilListener;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
+import org.jboss.ide.eclipse.as.rse.core.AbstractJSTPublisher;
-/**
- * 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 PublishUtil implements IJBossServerPublisher {
-
-
- protected IModuleResourceDelta[] delta;
- protected IDeployableServer server;
- protected int publishState = IServer.PUBLISH_STATE_NONE;
-
-
- public JstPublisher() {
+public class JstPublisher extends AbstractJSTPublisher {
+ protected String getTargetedPublishMethodId() {
+ return LocalPublishMethod.LOCAL_PUBLISH_METHOD;
}
-
- public boolean accepts(String type, IServer server, IModule[] module) {
+
+ @Override
+ protected IPublishCopyCallbackHandler getCallbackHandler(IPath path,
+ IServer server, IJBossServerPublishMethod method) {
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- boolean shouldAccept = ds != null && LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(type)
- && !ds.zipsWTPDeployments()
- && PublishUtil.isModuleCoreProject(module);
- return shouldAccept;
+ String tempDeployPath = ds.getTempDeployFolder();
+ LocalCopyCallback handler = new LocalCopyCallback(server,
+ path, new Path(tempDeployPath));
+ return handler;
}
-
- public IStatus publishModule(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor) throws CoreException {
- IStatus status = null;
- this.server = ServerConverter.getDeployableServer(server);
- this.delta = delta;
- boolean deleted = false;
- for( int i = 0; i < module.length; i++ ) {
- if( module[i].isExternal() )
- deleted = true;
- }
-
- if (publishType == REMOVE_PUBLISH ) {
- status = unpublish(this.server, module, monitor);
- } else {
- if( deleted ) {
- publishState = IServer.PUBLISH_STATE_UNKNOWN;
- } else {
- if (publishType == FULL_PUBLISH ) {
- status = fullPublish(module, module[module.length-1], monitor);
- } else if (publishType == INCREMENTAL_PUBLISH) {
- if(getDeployPath(module, this.server).toFile().isDirectory()) {
- status = incrementalPublish(module, module[module.length-1], monitor);
- } else {
- status =fullPublish(module, module[module.length-1], monitor);
- }
- }
- }
- }
- return status;
+ @Override
+ protected String getPublishDefaultRootFolder() {
+ return server.getDeployFolder();
}
-
-
- protected IStatus fullPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
- IPath deployPath = getDeployPath(moduleTree, server);
- IPath tempDeployPath = getTempDeployFolder(moduleTree, server);
- IModuleResource[] members = getResources(module);
-
- ArrayList<IStatus> list = new ArrayList<IStatus>();
- boolean isBinary = ServerModelUtilities.isBinaryModule(module);
- boolean delete = true;
- if (isBinary) {
- delete = false;
- }
- // if the module we're publishing is a project, not a binary, clean it's folder
- if( !(new Path(module.getName()).segmentCount() > 1 ) && delete)
- list.addAll(Arrays.asList(localSafeDelete(deployPath)));
-
- if( !deployPackaged(moduleTree) && !isBinary) {
- LocalCopyCallback handler = new LocalCopyCallback(server.getServer(), deployPath, tempDeployPath);
- PublishCopyUtil util = new PublishCopyUtil(handler);
- list.addAll(Arrays.asList(util.publishFull(members, monitor)));
- }
- else if(isBinary)
- list.addAll(Arrays.asList(copyBinaryModule(moduleTree)));
- else
- list.addAll(Arrays.asList(packModuleIntoJar(moduleTree[moduleTree.length-1], deployPath)));
-
-
- touchXMLFiles(deployPath, module);
-
- if( list.size() > 0 ) {
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_FAIL,
- NLS.bind(Messages.FullPublishFail, module.getName()), null);
- for( int i = 0; i < list.size(); i++ )
- ms.add(list.get(i));
- return ms;
- }
-
- publishState = IServer.PUBLISH_STATE_NONE;
- IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_SUCCESS,
- NLS.bind(Messages.CountModifiedMembers, countMembers(module), module.getName()), null);
- return ret;
- }
-
- private void touchXMLFiles(IPath deployPath, IModule module) {
- JSTPublisherXMLToucher.getInstance().touch(deployPath, module);
- }
-
- protected IStatus incrementalPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
- IStatus[] results = new IStatus[] {};
- IPath deployPath = getDeployPath(moduleTree, server);
- IPath tempDeployPath = getTempDeployFolder(moduleTree, server);
- boolean isBinary = ServerModelUtilities.isBinaryModule(module);
- LocalCopyCallback handler = null;
- if( !deployPackaged(moduleTree) && !isBinary) {
- handler = new LocalCopyCallback(server.getServer(), deployPath, tempDeployPath);
- results = new PublishCopyUtil(handler).publishDelta(delta, monitor);
- } else if( delta.length > 0 ) {
- if( isBinary)
- results = copyBinaryModule(moduleTree);
- else
- results = packModuleIntoJar(moduleTree[moduleTree.length-1], deployPath);
- }
- if( results != null && results.length > 0 ) {
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_INC_FAIL,
- NLS.bind(Messages.IncrementalPublishFail, module.getName()), null);
- for( int i = 0; i < results.length; i++ )
- ms.add(results[i]);
- return ms;
- }
-
- if( handler != null && handler.shouldRestartModule() )
- touchXMLFiles(deployPath, module);
-
- IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_SUCCESS,
- NLS.bind(Messages.CountModifiedMembers, countChanges(delta), module.getName()), null);
- return ret;
- }
-
- protected IStatus unpublish(IDeployableServer jbServer, IModule[] module,
- IProgressMonitor monitor) throws CoreException {
- IModule mod = module[module.length-1];
- IStatus[] errors = localSafeDelete(getDeployPath(module, server));
- if( errors.length > 0 ) {
- publishState = IServer.PUBLISH_STATE_FULL;
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_REMOVE_FAIL,
- NLS.bind(Messages.DeleteModuleFail, mod.getName()),
- new Exception(Messages.DeleteModuleFail2));
- for( int i = 0; i < errors.length; i++ )
- ms.addAll(errors[i]);
- throw new CoreException(ms);
- }
- IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_REMOVE_SUCCESS,
- NLS.bind(Messages.ModuleDeleted, mod.getName()), null);
- return ret;
- }
-
-
-
- protected IStatus[] copyBinaryModule(IModule[] moduleTree) {
- try {
- IPath deployPath = getDeployPath(moduleTree, server);
- FileUtilListener listener = new FileUtilListener();
- IModuleResource[] members = getResources(moduleTree);
- File source = getFile(members[0]);
- if( source != null ) {
- FileUtil.fileSafeCopy(source, deployPath.toFile(), listener);
- return listener.getStatuses();
- } else {
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_COPY_BINARY_FAIL,
- NLS.bind(Messages.CouldNotPublishModule,
- moduleTree[moduleTree.length-1]), null);
- return new IStatus[] {s};
- }
- } catch( CoreException ce ) {
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_COPY_BINARY_FAIL,
- NLS.bind(Messages.CouldNotPublishModule,
- moduleTree[moduleTree.length-1]), null);
- return new IStatus[] {s};
- }
- }
- /**
- *
- * @param deployPath
- * @param event
- * @return returns whether an error was found
- */
- protected IStatus[] localSafeDelete(IPath deployPath) {
- String serverDeployFolder = server.getDeployFolder();
- Assert.isTrue(!deployPath.toFile().equals(new Path(serverDeployFolder).toFile()),
- "An attempt to delete your entire deploy folder has been prevented. This should never happen"); //$NON-NLS-1$
- final ArrayList<IStatus> status = new ArrayList<IStatus>();
- IFileUtilListener listener = new IFileUtilListener() {
- public void fileCopied(File source, File dest, boolean result,Exception e) {}
- public void fileDeleted(File file, boolean result, Exception e) {
- if( result == false || e != null ) {
- status.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FILE_DELETE_FAIL,
- NLS.bind(Messages.DeleteFileError, file.getAbsolutePath()),e));
- }
- }
- public void folderDeleted(File file, boolean result, Exception e) {
- if( result == false || e != null ) {
- status.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FILE_DELETE_FAIL,
- NLS.bind(Messages.DeleteFolderError, file.getAbsolutePath()),e));
- }
- }
- };
- FileUtil.safeDelete(deployPath.toFile(), listener);
- return (IStatus[]) status.toArray(new IStatus[status.size()]);
- }
-
- public int getPublishState() {
- return publishState;
- }
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -22,7 +22,6 @@
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.IJ2EEModule;
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.internal.DeletedModule;
@@ -138,7 +137,6 @@
IPath root = new Path( deployFolder );
String type, modName, name, uri, suffixedName;
for( int i = 0; i < moduleTree.length; i++ ) {
- IJ2EEModule j2eeModule = (IJ2EEModule) moduleTree[i].loadAdapter(IJ2EEModule.class, null);
type = moduleTree[i].getModuleType().getId();
modName = moduleTree[i].getName();
name = new Path(modName).lastSegment();
@@ -185,6 +183,9 @@
private static String getSuffix(String type) {
+ // TODO
+ // VirtualReferenceUtilities.INSTANCE. has utility methods to help!!
+
String suffix = null;
if( IJBossServerConstants.FACET_EAR.equals(type))
suffix = IJBossServerConstants.EXT_EAR;
@@ -197,6 +198,8 @@
else if( "jboss.package".equals(type)) //$NON-NLS-1$
// no suffix required, name already has it
suffix = ""; //$NON-NLS-1$
+ else if( "jboss.singlefile".equals(type)) //$NON-NLS-1$
+ suffix = ""; //$NON-NLS-1$
else
suffix = IJBossServerConstants.EXT_JAR;
return suffix;
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -10,44 +10,19 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.core.publishers;
-import java.io.File;
-import java.util.Date;
-
-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.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
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.model.IModuleResourceDelta;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
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.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-import org.jboss.ide.eclipse.as.core.util.FileUtil.IFileUtilListener;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.LocalCopyCallback;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.rse.core.AbstractServerToolsPublisher;
-public class SingleFilePublisher implements IJBossServerPublisher {
-
- private IDeployableServer server;
- private int publishState = IServer.PUBLISH_STATE_NONE;
- public SingleFilePublisher() {
- }
-
- public int getPublishState() {
- return publishState;
- }
-
+public class SingleFilePublisher extends AbstractServerToolsPublisher {
public boolean accepts(String method, IServer server, IModule[] module) {
if( LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(method)
&& module != null && module.length > 0
@@ -57,119 +32,18 @@
return false;
}
- public IStatus publishModule(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor) throws CoreException {
-
- this.server = ServerConverter.getDeployableServer(server);
-
- IModule module2 = module[0];
-
- IStatus status = null;
- if(publishType == REMOVE_PUBLISH){
- status = unpublish(this.server, module2, monitor);
- } else if( publishType == FULL_PUBLISH ){
- // if there's no change, do nothing. Otherwise, on change or add, re-publish
- status = publish(this.server, module2, true, monitor);
- } else if( publishType == INCREMENTAL_PUBLISH ) {
- status = publish(this.server, module2, false, monitor);
- }
- return status;
-
+ @Override
+ protected IPublishCopyCallbackHandler getCallbackHandler(IPath path,
+ IServer server, IJBossServerPublishMethod method) {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ String tempDeployPath = ds.getTempDeployFolder();
+ LocalCopyCallback handler = new LocalCopyCallback(server,
+ path, new Path(tempDeployPath));
+ return handler;
}
-
- protected IStatus publish(IDeployableServer server, IModule module, boolean updateTimestamp, IProgressMonitor monitor) throws CoreException {
- SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
- if( delegate != null ) {
- IPath sourcePath = delegate.getGlobalSourcePath();
-
- IPath destFolder = PublishUtil.getDeployPath(new IModule[]{module}, server).removeLastSegments(1);;
- IPath tempDestFolder = PublishUtil.getTempDeployFolder(new IModule[]{module}, server).removeLastSegments(1);;
- File destFile = destFolder.append(sourcePath.lastSegment()).toFile();
- File tempDestFile = tempDestFolder.append(sourcePath.lastSegment()).toFile();
- if( destFile.exists())
- destFile.delete();
- FileUtilListener l = new FileUtilListener();
- FileUtil.fileSafeCopy(sourcePath.toFile(), tempDestFile, l);
- boolean success = tempDestFile.renameTo(destFile);
- if( success && updateTimestamp )
- destFile.setLastModified(new Date().getTime());
- if( l.errorFound || !success ) {
- publishState = IServer.PUBLISH_STATE_FULL;
- Exception e = l.e != null ? l.e : new Exception(
- NLS.bind(Messages.CopyFileError, tempDestFile, destFile));
- return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_PUBLISH_FAIL,
- NLS.bind(Messages.CouldNotPublishModule, module.getName()), e);
- }
- } else {
- // deleted module. o noes. Ignore it. We can't re-publish it, so just ignore it.
- publishState = IServer.PUBLISH_STATE_UNKNOWN;
- Status status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_PUBLISH_MNF,
- NLS.bind(Messages.CouldNotPublishModule, module.getName()), null);
- return status;
- }
-
- Status status = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
- IEventCodes.SINGLE_FILE_PUBLISH_SUCCESS,
- NLS.bind(Messages.ModulePublished,module.getName()), null);
- return status;
- }
- protected IStatus unpublish(IDeployableServer server, IModule module, IProgressMonitor monitor) throws CoreException {
- // delete file
- String fileName = null;
- if( module instanceof DeletedModule ) {
- String path = module.getId().substring(SingleDeployableFactory.FACTORY_ID.length()+1);
- fileName = new Path(path).lastSegment();
- } else {
- SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
- IPath sourcePath = delegate.getGlobalSourcePath();
- fileName = sourcePath.lastSegment();
- }
- if( fileName != null ) {
- IPath destFolder = PublishUtil.getDeployPath(new IModule[]{module}, server).removeLastSegments(1);
- FileUtilListener l = new FileUtilListener();
- File destFile = destFolder.append(fileName).toFile();
- FileUtil.safeDelete(destFile, l);
- if( l.errorFound ) {
- publishState = IServer.PUBLISH_STATE_FULL;
- return new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_UNPUBLISH_FAIL,
- NLS.bind(Messages.DeleteModuleFail, module.getName()), l.e);
- }
- } else {
- // deleted module. o noes. Ignore it.
- publishState = IServer.PUBLISH_STATE_UNKNOWN;
- Status status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_UNPUBLISH_MNF,
- NLS.bind(Messages.DeleteModuleFail, module.getName()), null);
- return status;
- }
- Status status = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_UNPUBLISH_SUCCESS,
- NLS.bind(Messages.ModuleDeleted, module.getName()), null);
- return status;
+ @Override
+ protected String getPublishDefaultRootFolder() {
+ return server.getDeployFolder();
}
-
- public static class FileUtilListener implements IFileUtilListener {
- protected boolean errorFound = false;
- protected Exception e;
- public void fileCopied(File source, File dest, boolean result,Exception e) {
- if( result == false || e != null ) {
- errorFound = true;
- this.e = e;
- }
- }
- public void fileDeleted(File file, boolean result, Exception e) {
- if( result == false || e != null ) {
- errorFound = true;
- this.e = e;
- }
- }
- public void folderDeleted(File file, boolean result, Exception e) {
- if( result == false || e != null ) {
- errorFound = true;
- this.e = e;
- }
- }
- }
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractJSTPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractJSTPublisher.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractJSTPublisher.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2010 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,94 +10,27 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-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.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
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.util.ModuleFile;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
-import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-public abstract class AbstractJSTPublisher implements IJBossServerPublisher {
- protected IModuleResourceDelta[] delta;
- protected IDeployableServer server;
- protected int publishState = IServer.PUBLISH_STATE_NONE;
- protected IJBossServerPublishMethod publishMethod;
-
+public abstract class AbstractJSTPublisher extends AbstractServerToolsPublisher {
public AbstractJSTPublisher() {}
+
+ /**
+ * This abstract publisher is only suitable for non force-zipped deployments
+ */
public boolean accepts(String method, IServer server, IModule[] module) {
- if( !method.equals(getTargetedPublishMethodId()))
+ if( module == null || !method.equals(getTargetedPublishMethodId()))
return false;
- if( module == null )
- return true;
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- boolean shouldAccept = ds != null
+ return ds != null
&& ModuleCoreNature.isFlexibleProject(module[0].getProject())
- && zipSettingsMatch(server);
- return shouldAccept;
+ && !ds.zipsWTPDeployments();
}
-
- public int getPublishState() {
- return publishState;
- }
-
- public IStatus publishModule(IJBossServerPublishMethod method,
- IServer server, IModule[] module, int publishType,
- IModuleResourceDelta[] delta, IProgressMonitor monitor)
- throws CoreException {
- IStatus status = null;
- this.server = ServerConverter.getDeployableServer(server);
- this.delta = delta;
- this.publishMethod = method;
-
- boolean deleted = false;
- for( int i = 0; i < module.length; i++ ) {
- if( module[i].isExternal() )
- deleted = true;
- }
-
- if (publishType == REMOVE_PUBLISH ) {
- status = unpublish(this.server, module, monitor);
- } else {
- if( deleted ) {
- publishState = IServer.PUBLISH_STATE_UNKNOWN;
- } else {
- if (publishType == FULL_PUBLISH ) {
- status = fullPublish(module, module[module.length-1], monitor);
- } else if (publishType == INCREMENTAL_PUBLISH) {
- status = incrementalPublish(module, module[module.length-1], monitor);
- }
- }
- }
- return status;
- }
/**
* Get the publish method this publisher is associated with
@@ -106,180 +39,10 @@
protected abstract String getTargetedPublishMethodId();
/**
- * Get the callback handler to be used for building the module.
- * If the module is to be published locally, this may be a handler which only copies locally.
- * If the module is to be zipped & published locally, this may be
- * a handler which zips to a temporary directory, and allows the finish method to move the file
- *
- * @param path
- * @param server
- * @param method
- * @return
+ * JST projects require certain children (utility, etc) to be zipped up
*/
- protected abstract IPublishCopyCallbackHandler getCallbackHandler(IPath path, IServer server, IJBossServerPublishMethod method);
-
- /**
- * Gets the actual deploy path for this module
- *
- * @param moduleTree
- * @param server
- * @return
- */
- protected abstract IPath getDeployPath(IModule[] moduleTree, IDeployableServer server);
-
- /**
- * Finish up the publishing. This may be moving a final zipped entity into the proper
- * folder or sending it over the wire to a remote machine.
- *
- * @param publishType
- * @param moduleTree
- * @param server
- * @param monitor
- */
- protected abstract void finishPublish(int publishType, IModule[] moduleTree, IDeployableServer server, IProgressMonitor monitor);
-
- /**
- * Check whether the current zip settings for the publish method
- * match with what this publisher expects.
- * @param the server
- * @return
- */
- protected boolean zipSettingsMatch(IServer server) {
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- boolean settingZips = ds.zipsWTPDeployments();
- return requiresZips() == settingZips;
+ @Override
+ protected boolean forceZipModule(IModule[] moduleTree) {
+ return PublishUtil.deployPackaged(moduleTree);
}
-
- /**
- * Check whether the current publisher requires the zip flag
- *
- * @param the server
- * @return
- */
- protected abstract boolean requiresZips();
-
- private IPublishCopyCallbackHandler getCallbackHandler(IPath path) {
- return getCallbackHandler(path, server.getServer(), publishMethod);
- }
-
- protected IStatus fullPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
- IPath deployPath = getDeployPath(moduleTree, server);
- IPublishCopyCallbackHandler callback = getCallbackHandler(deployPath);
- IModuleResource[] members = PublishUtil.getResources(module);
-
- // First delete it
- // if the module we're publishing is a project, not a binary, clean it's folder
- if( !(new Path(module.getName()).segmentCount() > 1 ))
- callback.deleteResource(new Path("/"), monitor); //$NON-NLS-1$
-
- ArrayList<IStatus> list = new ArrayList<IStatus>();
-
- if( !PublishUtil.deployPackaged(moduleTree) && !PublishUtil.isBinaryObject(moduleTree)) {
- PublishCopyUtil util = new PublishCopyUtil(callback);
- list.addAll(Arrays.asList(util.publishFull(members, monitor)));
- } else if( PublishUtil.isBinaryObject(moduleTree))
- list.addAll(Arrays.asList(copyBinaryModule(moduleTree, monitor)));
- else {
- // A child that must be zipped
- IPath deployRoot = JBossServerCorePlugin.getServerStateLocation(server.getServer()).
- append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute();
-
- try {
- File temp = deployRoot.toFile().createTempFile(module.getName(), ".tmp", deployRoot.toFile()); //$NON-NLS-1$
- IPath tempFile = new Path(temp.getAbsolutePath());
- list.addAll(Arrays.asList(PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile)));
- IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
- String parentFolder = deployPath.removeLastSegments(1).toString();
- handler.makeDirectoryIfRequired(new Path(parentFolder), new NullProgressMonitor());
- ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile);
- handler.copyFile(mf, deployPath, new NullProgressMonitor());
- } catch( IOException ioe) {
- list.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, ioe.getMessage(), ioe));
- }
- }
-
- if( list.size() > 0 )
- return createMultiStatus(list, module);
- return Status.OK_STATUS;
- }
-
- protected IStatus incrementalPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
- IStatus[] results = new IStatus[] {};
- IPath deployPath = getDeployPath(moduleTree, server);
- if( !PublishUtil.deployPackaged(moduleTree) && !PublishUtil.isBinaryObject(moduleTree)) {
- IPublishCopyCallbackHandler handler = getCallbackHandler(deployPath);
- results = new PublishCopyUtil(handler).publishDelta(delta, monitor);
- } else if( delta.length > 0 ) {
- if( PublishUtil.isBinaryObject(moduleTree))
- results = copyBinaryModule(moduleTree, monitor);
- else {
- IPath localDeployRoot = JBossServerCorePlugin.getServerStateLocation(server.getServer()).
- append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute();
- try {
- File temp = File.createTempFile(module.getName(), ".tmp", localDeployRoot.toFile()); //$NON-NLS-1$
- IPath tempFile = new Path(temp.getAbsolutePath());
- PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile);
- IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
- String parentFolder = deployPath.removeLastSegments(1).toString();
- handler.makeDirectoryIfRequired(new Path(parentFolder), new NullProgressMonitor());
- ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile);
- handler.copyFile(mf, deployPath, new NullProgressMonitor());
- } catch( IOException ioe) {
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, ioe.getMessage(), ioe);
- results = new IStatus[] { s };
- }
- }
- }
-
- if( results != null && results.length > 0 ) {
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_INC_FAIL,
- NLS.bind(Messages.IncrementalPublishFail, module.getName()), null);
- for( int i = 0; i < results.length; i++ )
- ms.add(results[i]);
- return ms;
- }
-
- IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_SUCCESS,
- NLS.bind(Messages.CountModifiedMembers, PublishUtil.countChanges(delta), module.getName()), null);
- return ret;
- }
-
- protected IStatus createMultiStatus(List<IStatus> list, IModule module) {
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_FAIL,
- NLS.bind(Messages.FullPublishFail, module.getName()), null);
- for( int i = 0; i < list.size(); i++ )
- ms.add(list.get(i));
- return ms;
- }
-
- protected IStatus[] copyBinaryModule(IModule[] moduleTree, IProgressMonitor monitor) {
- try {
- IPath destinationPath = getDeployPath(moduleTree, server);
- IModuleResource[] members = PublishUtil.getResources(moduleTree);
- File source = PublishUtil.getFile(members[0]);
- if( source != null ) {
- IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
- IPath localFilePath = new Path(source.getAbsolutePath());
- ModuleFile mf = new ModuleFile(localFilePath.toFile(), localFilePath.lastSegment(), localFilePath);
- handler.copyFile(mf, destinationPath, new NullProgressMonitor());
- } else {
-// IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_COPY_BINARY_FAIL,
-// NLS.bind(Messages.CouldNotPublishModule,
-// moduleTree[moduleTree.length-1]), null);
-// return new IStatus[] {s};
- // TODO
- }
- } catch( CoreException ce ) {
- return new IStatus[] {ce.getStatus()};
- }
- return new IStatus[]{Status.OK_STATUS};
- }
-
- protected IStatus unpublish(IDeployableServer jbServer, IModule[] module,
- IProgressMonitor monitor) throws CoreException {
- IPath remotePath = getDeployPath(module, server);
- IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
- handler.deleteResource(remotePath, monitor);
- return Status.OK_STATUS;
- }
}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractServerToolsPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractServerToolsPublisher.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/AbstractServerToolsPublisher.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -0,0 +1,290 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+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.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+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.util.ModuleFile;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
+
+/**
+ * Class suitable for parsing any properly formed servertools-api module
+ */
+public abstract class AbstractServerToolsPublisher implements IJBossServerPublisher {
+ protected IModuleResourceDelta[] delta;
+ protected IDeployableServer server;
+ protected int publishState = IServer.PUBLISH_STATE_NONE;
+ protected IJBossServerPublishMethod publishMethod;
+
+ public AbstractServerToolsPublisher() {}
+ public abstract boolean accepts(String method, IServer server, IModule[] module);
+
+ public int getPublishState() {
+ return publishState;
+ }
+
+ protected void setPublishState(int state) {
+ this.publishState = state;
+ }
+
+ public IStatus publishModule(IJBossServerPublishMethod method,
+ IServer server, IModule[] module, int publishType,
+ IModuleResourceDelta[] delta, IProgressMonitor monitor)
+ throws CoreException {
+ IStatus status = null;
+ this.server = ServerConverter.getDeployableServer(server);
+ this.delta = delta;
+ this.publishMethod = method;
+
+ boolean deleted = false;
+ for( int i = 0; i < module.length; i++ ) {
+ if( module[i].isExternal() )
+ deleted = true;
+ }
+
+ if (publishType == REMOVE_PUBLISH ) {
+ status = unpublish(this.server, module, monitor);
+ } else {
+ if( deleted ) {
+ publishState = IServer.PUBLISH_STATE_UNKNOWN;
+ } else {
+ if (publishType == FULL_PUBLISH ) {
+ status = fullPublish(module, module[module.length-1], monitor);
+ } else if (publishType == INCREMENTAL_PUBLISH) {
+ status = incrementalPublish(module, module[module.length-1], monitor);
+ }
+ }
+ }
+ return status;
+ }
+
+ /**
+ * Get the callback handler to be used for building the module.
+ * If the module is to be published locally, this may be a handler which only copies locally.
+ * If the module is to be zipped & published locally, this may be
+ * a handler which zips to a temporary directory, and allows the finish method to move the file
+ *
+ * @param path
+ * @param server
+ * @param method
+ * @return
+ */
+ protected abstract IPublishCopyCallbackHandler getCallbackHandler(IPath path, IServer server, IJBossServerPublishMethod method);
+
+ /**
+ * Gets the actual deploy path for this module
+ *
+ * @param moduleTree
+ * @param server
+ * @return
+ */
+ protected IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
+ DeploymentPreferenceLoader.getCurrentDeploymentMethodType(server.getServer());
+ String folder = PublishUtil.getDeployRootFolder(
+ moduleTree, server,
+ getPublishDefaultRootFolder(),
+ IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
+ return PublishUtil.getDeployPath(moduleTree, folder);
+ }
+
+ /**
+ * In the event that no module-specific preferences are enabled,
+ * get the default publish folder
+ * @return
+ */
+ protected abstract String getPublishDefaultRootFolder();
+
+ /**
+ * Finish up the publishing. This may be moving a final zipped entity into the proper
+ * folder or sending it over the wire to a remote machine.
+ *
+ * Subclasses may override
+ *
+ * @param publishType
+ * @param moduleTree
+ * @param server
+ * @param monitor
+ */
+ protected void finishPublish(int publishType, IModule[] moduleTree, IDeployableServer server, IProgressMonitor monitor){}
+
+ private IPublishCopyCallbackHandler getCallbackHandler(IPath path) {
+ return getCallbackHandler(path, server.getServer(), publishMethod);
+ }
+
+ /**
+ * For certain module trees, some publishers may want to force a child to be zipped.
+ * For example, JST Publisher may want to force utility project children to be zipped.
+ *
+ * @param moduleTree
+ * @return
+ */
+ protected boolean forceZipModule(IModule[] moduleTree) {
+ return false;
+ }
+
+ protected IStatus fullPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
+ IPath deployPath = getDeployPath(moduleTree, server);
+ IPublishCopyCallbackHandler callback = getCallbackHandler(deployPath);
+ IModuleResource[] members = PublishUtil.getResources(module);
+
+ // First delete it
+ // if the module we're publishing is a project, not a binary, clean it's folder
+ if( !(new Path(module.getName()).segmentCount() > 1 ))
+ callback.deleteResource(new Path("/"), monitor); //$NON-NLS-1$
+
+ ArrayList<IStatus> list = new ArrayList<IStatus>();
+
+ boolean isBinaryObject = ServerModelUtilities.isBinaryModule(module);
+ boolean forceZip = forceZipModule(moduleTree);
+ if( !forceZip && !isBinaryObject) {
+ PublishCopyUtil util = new PublishCopyUtil(callback);
+ list.addAll(Arrays.asList(util.publishFull(members, monitor)));
+ } else if( isBinaryObject )
+ list.addAll(Arrays.asList(copyBinaryModule(moduleTree, monitor)));
+ else {
+ // A child that must be zipped, forceZip is true
+ IPath deployRoot = JBossServerCorePlugin.getServerStateLocation(server.getServer()).
+ append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute();
+
+ try {
+ File temp = deployRoot.toFile().createTempFile(module.getName(), ".tmp", deployRoot.toFile()); //$NON-NLS-1$
+ IPath tempFile = new Path(temp.getAbsolutePath());
+ list.addAll(Arrays.asList(PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile)));
+ IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
+ String parentFolder = deployPath.removeLastSegments(1).toString();
+ handler.makeDirectoryIfRequired(new Path(parentFolder), new NullProgressMonitor());
+ ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile);
+ handler.copyFile(mf, deployPath, new NullProgressMonitor());
+ } catch( IOException ioe) {
+ list.add(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, ioe.getMessage(), ioe));
+ }
+ }
+
+ if( list.size() > 0 )
+ return createMultiStatus(list, module);
+ return Status.OK_STATUS;
+ }
+
+ protected IStatus incrementalPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
+ IStatus[] results = new IStatus[] {};
+ IPath deployPath = getDeployPath(moduleTree, server);
+ boolean isBinaryObject = ServerModelUtilities.isBinaryModule(module);
+ boolean forceZip = forceZipModule(moduleTree);
+ if( !forceZip && !isBinaryObject) {
+ IPublishCopyCallbackHandler handler = getCallbackHandler(deployPath);
+ results = new PublishCopyUtil(handler).publishDelta(delta, monitor);
+ } else if( delta.length > 0 ) {
+ if( isBinaryObject)
+ results = copyBinaryModule(moduleTree, monitor);
+ else {
+ // forceZip a child module
+ IPath localDeployRoot = JBossServerCorePlugin.getServerStateLocation(server.getServer()).
+ append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute();
+ try {
+ File temp = File.createTempFile(module.getName(), ".tmp", localDeployRoot.toFile()); //$NON-NLS-1$
+ IPath tempFile = new Path(temp.getAbsolutePath());
+ PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile);
+ IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
+ String parentFolder = deployPath.removeLastSegments(1).toString();
+ handler.makeDirectoryIfRequired(new Path(parentFolder), new NullProgressMonitor());
+ ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile);
+ handler.copyFile(mf, deployPath, new NullProgressMonitor());
+ } catch( IOException ioe) {
+ IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, ioe.getMessage(), ioe);
+ results = new IStatus[] { s };
+ }
+ }
+ }
+
+ if( results != null && results.length > 0 ) {
+ MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_INC_FAIL,
+ NLS.bind(Messages.IncrementalPublishFail, module.getName()), null);
+ for( int i = 0; i < results.length; i++ )
+ ms.add(results[i]);
+ return ms;
+ }
+
+ IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_SUCCESS,
+ NLS.bind(Messages.CountModifiedMembers, PublishUtil.countChanges(delta), module.getName()), null);
+ return ret;
+ }
+
+ protected IStatus createMultiStatus(List<IStatus> list, IModule module) {
+ MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_FAIL,
+ NLS.bind(Messages.FullPublishFail, module.getName()), null);
+ for( int i = 0; i < list.size(); i++ )
+ ms.add(list.get(i));
+ return ms;
+ }
+
+ protected IStatus[] copyBinaryModule(IModule[] moduleTree, IProgressMonitor monitor) {
+ try {
+ IPath destinationPath = getDeployPath(moduleTree, server);
+ IModuleResource[] members = PublishUtil.getResources(moduleTree);
+ File source = PublishUtil.getFile(members[0]);
+ if( source != null ) {
+ IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
+ IPath localFilePath = new Path(source.getAbsolutePath());
+ ModuleFile mf = new ModuleFile(localFilePath.toFile(), localFilePath.lastSegment(), localFilePath);
+ handler.copyFile(mf, destinationPath, new NullProgressMonitor());
+ } else {
+// IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_COPY_BINARY_FAIL,
+// NLS.bind(Messages.CouldNotPublishModule,
+// moduleTree[moduleTree.length-1]), null);
+// return new IStatus[] {s};
+ // TODO
+ }
+ } catch( CoreException ce ) {
+ return new IStatus[] {ce.getStatus()};
+ }
+ return new IStatus[]{Status.OK_STATUS};
+ }
+
+ protected IStatus unpublish(IDeployableServer jbServer, IModule[] module,
+ IProgressMonitor monitor) throws CoreException {
+ IPath remotePath = getDeployPath(module, server);
+ IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$
+ handler.deleteResource(remotePath, monitor);
+ return Status.OK_STATUS;
+ }
+}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/RSEJSTPublisher.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -21,67 +21,41 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleFile;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethodType;
import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class RSEJSTPublisher extends AbstractJSTPublisher {
- private RSEPublishMethod method;
-
@Override
protected String getTargetedPublishMethodId() {
return RSEPublishMethod.RSE_ID;
}
- /*
- * This publisher does not handle zipped deployments
- * (non-Javadoc)
- * @see org.jboss.ide.eclipse.as.rse.core.AbstractJSTPublisher#requiresZips()
- */
- @Override
- protected boolean requiresZips() {
- return false;
+ private RSEPublishMethod getPublishMethod() {
+ return (RSEPublishMethod)publishMethod;
}
-
+
@Override
- public IStatus publishModule(IJBossServerPublishMethod method,
- IServer server, IModule[] module, int publishType,
- IModuleResourceDelta[] delta, IProgressMonitor monitor)
- throws CoreException {
- this.method = (RSEPublishMethod)method;
- return super.publishModule(method, server, module, publishType, delta, monitor);
+ protected String getPublishDefaultRootFolder() {
+ return getPublishMethod().getRemoteRootFolder().toString();
}
@Override
- protected IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
- String folder = PublishUtil.getDeployRootFolder(
- moduleTree, server,
- method.getRemoteRootFolder().toString(),
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- return PublishUtil.getDeployPath(moduleTree, folder);
- }
-
- @Override
protected IPublishCopyCallbackHandler getCallbackHandler(IPath path, IServer server,
IJBossServerPublishMethod method) {
- return new RSERemotePublishHandler(path);
+ return new RSERemotePublishHandler(path, getPublishMethod());
}
- protected class RSERemotePublishHandler implements IPublishCopyCallbackHandler {
- public IPath root;
+ public static class RSERemotePublishHandler implements IPublishCopyCallbackHandler {
+ protected IPath root;
+ protected RSEPublishMethod method;
private ArrayList<IPath> createdFolders = new ArrayList<IPath>();
- public RSERemotePublishHandler(IPath path) {
+ public RSERemotePublishHandler(IPath path, RSEPublishMethod method) {
this.root = path;
+ this.method = method;
}
public IStatus[] copyFile(IModuleFile mf, IPath path,
IProgressMonitor monitor) throws CoreException {
@@ -123,12 +97,4 @@
return null;
}
}
-
- @Override
- protected void finishPublish(int publishType, IModule[] moduleTree,
- IDeployableServer server, IProgressMonitor monitor) {
- // do nothing
- }
-
-
}
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/SingleFileRSEPublisher.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/SingleFileRSEPublisher.java 2010-07-21 08:04:59 UTC (rev 23617)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/rse/core/SingleFileRSEPublisher.java 2010-07-21 08:26:58 UTC (rev 23618)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2010 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,41 +10,16 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core;
-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.Status;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
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.publishers.PublishUtil;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.core.server.xpl.PublishCopyUtil.IPublishCopyCallbackHandler;
+import org.jboss.ide.eclipse.as.rse.core.RSEJSTPublisher.RSERemotePublishHandler;
-public class SingleFileRSEPublisher implements IJBossServerPublisher {
+public class SingleFileRSEPublisher extends AbstractServerToolsPublisher {
- private IDeployableServer server;
- private RSEPublishMethod method;
- private int publishState = IServer.PUBLISH_STATE_NONE;
- public SingleFileRSEPublisher() {
- }
-
- public int getPublishState() {
- return publishState;
- }
-
public boolean accepts(String method, IServer server, IModule[] module) {
if( RSEPublishMethod.RSE_ID.equals(method)
&& module != null && module.length > 0
@@ -54,72 +29,14 @@
return false;
}
- public IStatus publishModule(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor) throws CoreException {
-
- this.server = ServerConverter.getDeployableServer(server);
- this.method = (RSEPublishMethod)method;
- IModule module2 = module[0];
-
- IStatus status = null;
- if(publishType == REMOVE_PUBLISH){
- status = unpublish(this.server, module2, monitor);
- } else if( publishType == FULL_PUBLISH ){
- // if there's no change, do nothing. Otherwise, on change or add, re-publish
- status = publish(this.server, module2, true, monitor);
- } else if( publishType == INCREMENTAL_PUBLISH ) {
- status = publish(this.server, module2, false, monitor);
- }
- return status;
-
+ @Override
+ protected IPublishCopyCallbackHandler getCallbackHandler(IPath path,
+ IServer server, IJBossServerPublishMethod method) {
+ return new RSERemotePublishHandler(path, (RSEPublishMethod)method);
}
-
- protected IStatus publish(IDeployableServer server, IModule module, boolean updateTimestamp, IProgressMonitor monitor) throws CoreException {
- SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
- if( delegate != null ) {
- IPath sourcePath = delegate.getGlobalSourcePath();
- IPath destFolder = RSEPublishMethod.findModuleFolderWithDefault(module, server, method.getRemoteRootFolder());
- IPath tempDestFolder = RSEPublishMethod.findModuleFolderWithDefault(module, server, method.getRemoteTemporaryFolder());
- String name = sourcePath.lastSegment();
-
- try {
- method.getFileService().upload(sourcePath.toFile(), tempDestFolder.toString(), name, true, null, null, new NullProgressMonitor());
- method.getFileService().move(tempDestFolder.toString(), name, destFolder.toString(), name, new NullProgressMonitor());
- } catch( SystemMessageException sme ) {
- // TODO fix
- sme.printStackTrace();
- }
- // TODO log?
-// publishState = IServer.PUBLISH_STATE_FULL;
-// Exception e = l.e != null ? l.e : new Exception(
-// NLS.bind(Messages.CopyFileError, tempDestFile, destFile));
-// return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_PUBLISH_FAIL,
-// NLS.bind(Messages.CouldNotPublishModule, module.getName()), e);
- }
- Status status = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
- IEventCodes.SINGLE_FILE_PUBLISH_SUCCESS,
- NLS.bind(Messages.ModulePublished,module.getName()), null);
- return status;
- }
- protected IStatus unpublish(IDeployableServer server, IModule module, IProgressMonitor monitor) throws CoreException {
- SingleDeployableModuleDelegate delegate = (SingleDeployableModuleDelegate)module.loadAdapter(SingleDeployableModuleDelegate.class, new NullProgressMonitor());
- if( delegate != null ) {
- IPath sourcePath = delegate.getGlobalSourcePath();
- IPath destFolder = RSEPublishMethod.findModuleFolderWithDefault(module, server, method.getRemoteRootFolder());
- String name = sourcePath.lastSegment();
- try {
- method.getFileService().delete(destFolder.toString(), name, new NullProgressMonitor());
- } catch( SystemMessageException sme ) {
- // TODO fix
- sme.printStackTrace();
- }
- }
- Status status = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.SINGLE_FILE_UNPUBLISH_SUCCESS,
- NLS.bind(Messages.ModuleDeleted, module.getName()), null);
- return status;
+ @Override
+ protected String getPublishDefaultRootFolder() {
+ return ((RSEPublishMethod)publishMethod).getRemoteRootFolder().toString();
}
}
15 years, 9 months
JBoss Tools SVN: r23617 - trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-21 04:04:59 -0400 (Wed, 21 Jul 2010)
New Revision: 23617
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6633
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-07-21 07:58:33 UTC (rev 23616)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-07-21 08:04:59 UTC (rev 23617)
@@ -68,7 +68,7 @@
*/
public void testMultipleBeanScope() throws Exception {
IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/definition/scope/broken/tooManyScopes/BeanWithTooManyScopeTypes_Broken.java");
- assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS, 22, 23);
+ assertMarkerIsCreated(file, CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS, 22, 23);
int markerNumbers = getMarkersNumber(file);
assertEquals("StereotypeWithTyped_Broken.java should has two error markers.", markerNumbers, 2);
}
15 years, 9 months
JBoss Tools SVN: r23616 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-21 03:58:33 -0400 (Wed, 21 Jul 2010)
New Revision: 23616
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6633
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-07-21 07:41:53 UTC (rev 23615)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-07-21 07:58:33 UTC (rev 23616)
@@ -1664,8 +1664,15 @@
// - bean class or producer method or field specifies multiple scope type annotations
//
if (scopes.size() > 1) {
+ String message = bean instanceof IClassBean
+ ? CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS
+ : bean instanceof IProducerField
+ ? CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_PRODUCER_FIELD
+ : bean instanceof IProducerMethod
+ ? CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_PRODUCER_METHOD
+ : CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS;
for (IScopeDeclaration scope : scopes) {
- addError(CDIValidationMessages.MULTIPLE_SCOPE_TYPE_ANNOTATIONS, CDIPreferences.MULTIPLE_SCOPE_TYPE_ANNOTATIONS, scope, bean.getResource());
+ addError(message, CDIPreferences.MULTIPLE_SCOPE_TYPE_ANNOTATIONS, scope, bean.getResource());
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-07-21 07:41:53 UTC (rev 23615)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-07-21 07:58:33 UTC (rev 23616)
@@ -46,6 +46,9 @@
public static String MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE;
public static String MULTIPLE_SCOPE_TYPE_ANNOTATIONS;
+ public static String MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS;
+ public static String MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_PRODUCER_METHOD;
+ public static String MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_PRODUCER_FIELD;
public static String MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE;
public static String STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE;
public static String ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-07-21 07:41:53 UTC (rev 23615)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-07-21 07:58:33 UTC (rev 23616)
@@ -25,6 +25,9 @@
MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE=Qualifier annotation type should be annotated with @Retention(RUNTIME)
MULTIPLE_SCOPE_TYPE_ANNOTATIONS=Bean class or producer method or field specifies multiple scope type annotations
+MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS=Bean class specifies multiple scope type annotations
+MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_PRODUCER_METHOD=Producer method specifies multiple scope type annotations
+MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_PRODUCER_FIELD=Producer field specifies multiple scope type annotations
MISSING_SCOPE_WHEN_THERE_IS_NO_DEFAULT_SCOPE=Bean does not explicitly declare a scope when there is no default scope
STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE=Stereotype declares more than one scope
ILLEGAL_SCOPE_FOR_MANAGED_BEAN_WITH_PUBLIC_FIELD=Managed bean with a public field declares any scope other than @Dependent
15 years, 9 months
JBoss Tools SVN: r23615 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-21 03:41:53 -0400 (Wed, 21 Jul 2010)
New Revision: 23615
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
Log:
https://jira.jboss.org/browse/JBIDE-6667
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2010-07-21 03:48:25 UTC (rev 23614)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreBuilder.java 2010-07-21 07:41:53 UTC (rev 23615)
@@ -13,6 +13,7 @@
import java.util.Map;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
@@ -51,10 +52,8 @@
IResourceDelta delta = getDelta(getProject());
if (seamProject.hasNoStorage() || delta == null ) {
- IPath[] paths = resourceVisitor.getPathsToVisit();
- for (IPath iPath : paths) {
- getProject().findMember(iPath.removeFirstSegments(1)).accept(resourceVisitor);
- }
+ //Resource visitor filters project members to be processed
+ getProject().accept(resourceVisitor);
} else {
delta.accept(resourceVisitor);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2010-07-21 03:48:25 UTC (rev 23614)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2010-07-21 07:41:53 UTC (rev 23615)
@@ -70,7 +70,7 @@
cleanCachedProjects();
ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener);
ISavedState lastState =
- ResourcesPlugin.getWorkspace().addSaveParticipant(this, new ISaveParticipant() {
+ ResourcesPlugin.getWorkspace().addSaveParticipant(PLUGIN_ID, new ISaveParticipant() {
public void saving(ISaveContext context)
throws CoreException {
@@ -81,7 +81,10 @@
case ISaveContext.PROJECT_SAVE:
SeamProject sp = (SeamProject)SeamCorePlugin.getSeamProject(context.getProject(), false);
try {
- sp.store();
+ if(sp != null) {
+ //Not any project is a seam project
+ sp.store();
+ }
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2010-07-21 03:48:25 UTC (rev 23614)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2010-07-21 07:41:53 UTC (rev 23615)
@@ -53,12 +53,6 @@
IPath[] srcs = new IPath[0];
IPath webinf = null;
- public IPath[] getPathsToVisit() {
- IPath[] dest = new IPath[1];
- dest[0] = p.getProject().getFullPath();
- return dest;
- }
-
public SeamResourceVisitor(SeamProject p) {
this.p = p;
15 years, 9 months
JBoss Tools SVN: r23614 - trunk.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-20 23:48:25 -0400 (Tue, 20 Jul 2010)
New Revision: 23614
Modified:
trunk/parent-pom.xml
Log:
increment test timeout to 30 min to deal w/ test timeouts
Modified: trunk/parent-pom.xml
===================================================================
--- trunk/parent-pom.xml 2010-07-21 02:56:05 UTC (rev 23613)
+++ trunk/parent-pom.xml 2010-07-21 03:48:25 UTC (rev 23614)
@@ -85,8 +85,8 @@
<version>${tychoVersion}</version>
<configuration>
<!-- timeout in seconds -->
- <surefire.timeout>1200</surefire.timeout>
- <forkedProcessTimeoutInSeconds>1200</forkedProcessTimeoutInSeconds>
+ <surefire.timeout>1800</surefire.timeout>
+ <forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
<useUIHarness>true</useUIHarness>
<useUIThread>true</useUIThread>
<argLine>${memoryOptions1} ${memoryOptions2} ${systemProperties}
15 years, 9 months
JBoss Tools SVN: r23613 - trunk/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-20 22:56:05 -0400 (Tue, 20 Jul 2010)
New Revision: 23613
Modified:
trunk/site/site.xml
Log:
remove suffix in site version description
Modified: trunk/site/site.xml
===================================================================
--- trunk/site/site.xml 2010-07-21 02:36:24 UTC (rev 23612)
+++ trunk/site/site.xml 2010-07-21 02:56:05 UTC (rev 23613)
@@ -235,7 +235,7 @@
</description>
</category-def>
- <category-def name="AllTools" label="All JBoss Tools 3.2.0.M1">
+ <category-def name="AllTools" label="All JBoss Tools 3.2.0">
<description>
Contains ALL the plugins that are available from
JBoss Tools except those
15 years, 9 months
JBoss Tools SVN: r23612 - trunk/build/results.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-07-20 22:36:24 -0400 (Tue, 20 Jul 2010)
New Revision: 23612
Modified:
trunk/build/results/build.xml
Log:
add fully qualified path to location for template.file
Modified: trunk/build/results/build.xml
===================================================================
--- trunk/build/results/build.xml 2010-07-21 02:05:16 UTC (rev 23611)
+++ trunk/build/results/build.xml 2010-07-21 02:36:24 UTC (rev 23612)
@@ -124,7 +124,6 @@
replace="\1"
casesensitive="false"
override="true" />
-
<if>
<and>
<isset property="JOB_NAME" />
@@ -177,7 +176,7 @@
<equals arg1="${template.file}" arg2="download-template.xml" />
<then>
<copy todir="${output.dir}" overwrite="true">
- <fileset file="${template.file}" />
+ <fileset dir="${output.dir}" file="${template.file}" />
<mapper type="merge" to="download.xml" />
<filterchain>
<expandproperties />
@@ -206,7 +205,7 @@
<then>
<!-- use pre-existing snippet file -->
<copy todir="${output.dir}" overwrite="true">
- <fileset file="${template.file.cleaned}.in" />
+ <fileset dir="${output.dir}" file="${template.file.cleaned}.in" />
<mapper type="merge" to="download-snippet.txt" />
<filterchain>
<expandproperties />
@@ -218,7 +217,7 @@
<!-- fall back to default template file -->
<var name="template.file" value="download-template.xml" />
<copy todir="${output.dir}" overwrite="true">
- <fileset file="${template.file}" />
+ <fileset dir="${output.dir}" file="${template.file}" />
<mapper type="merge" to="download.xml" />
<filterchain>
<expandproperties />
15 years, 9 months