JBoss Tools SVN: r43798 - in trunk: examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-09-18 11:19:51 -0400 (Tue, 18 Sep 2012)
New Revision: 43798
Added:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/
trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/commons-codec-1.3.jar
trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/commons-logging-1.1.1.jar
trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/httpclient-4.0.1.jar
trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/httpcore-4.0.1.jar
trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/jboss-logging-3.1.2.GA.jar
trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/snakeyaml-1.10.jar
trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/stacks-client-1.0.0.CR2.jar
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/stacks/
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/stacks/StacksManager.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/stacks/StacksUtil.java
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ArchetypeModel.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleUtil.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/.classpath
trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.project.examples/build.properties
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/MavenProjectConstants.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/NewProjectExamplesStacksRequirementsPage.java
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/xpl/MavenProjectWizardArchetypeParametersPage.java
Log:
JBIDE-12472 Use JDF stacks to manage different archetype versions
JBIDE-12166 Support selection of "blank" archetypes
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml 2012-09-18 15:19:51 UTC (rev 43798)
@@ -77,7 +77,11 @@
<extension
point="org.jboss.tools.project.examples.projectExamplesXml"
name="Shared Examples">
- <url>http://download.jboss.org/jbosstools/examples/project-examples-shared-4.0...</url>
+ <!--
+ <url>http://download.jboss.org/jbosstools/examples/project-examples-shared-4.0...</url>
+ -->
+ <url>file://D:/Dev/jbt-trunk/download.jboss.org/jbosstools/examples/project-ex...</url>
+
<experimental>false</experimental>
</extension>
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ArchetypeModel.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ArchetypeModel.java 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ArchetypeModel.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -16,7 +16,7 @@
* @author snjeza
*
*/
-public class ArchetypeModel {
+public class ArchetypeModel implements Cloneable {
private String groupId;
private String artifactId;
private String version;
@@ -99,4 +99,9 @@
public void addProperty(String key, String value) {
archetypeProperties.put(key, value);
}
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleUtil.java 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleUtil.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -479,7 +479,7 @@
} else if (nodeName.equals("essentialEnterpriseDependencies")) { //$NON-NLS-1$
parseEssentialEnterpriseDependencies(project, child);
} else if (nodeName.equals("stacksId")) { //$NON-NLS-1$
- String stacksId = child.getAttribute("stacksId"); //$NON-NLS-1$
+ String stacksId = getContent(child);
if (stacksId != null) {
project.setStacksId(stacksId);
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -68,11 +68,13 @@
public class NewProjectExamplesRequirementsPage extends WizardPage implements IProjectExamplesWizardPage {
private static final String PAGE_NAME = "org.jboss.tools.project.examples.requirements"; //$NON-NLS-1$
- private ProjectExample projectExample;
- private Text descriptionText;
- private Text projectSize;
+ protected ProjectExample projectExample;
+ protected Text descriptionText;
+ protected Label projectSizeLabel;
+ protected Text projectSize;
+ protected WizardContext wizardContext;
+ protected TableViewer tableViewer;
private List<ProjectFix> fixes = new ArrayList<ProjectFix>();
- private TableViewer tableViewer;
private ArrayList<ProjectFix> unsatisfiedFixes = new ArrayList<ProjectFix>();
private Image checkboxOn;
private Image checkboxOff;
@@ -90,6 +92,36 @@
checkboxOff = RuntimeUIActivator.imageDescriptorFromPlugin(RuntimeUIActivator.PLUGIN_ID, "/icons/xpl/incomplete_tsk.gif").createImage();
}
+ protected void setDescriptionArea(Composite composite) {
+ Label descriptionLabel = new Label(composite,SWT.NONE);
+ descriptionLabel.setText(Messages.NewProjectExamplesWizardPage_Description);
+ GridData gd = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
+ gd.horizontalSpan = 2;
+ descriptionLabel.setLayoutData(gd);
+ descriptionText = new Text(composite, SWT.H_SCROLL | SWT.V_SCROLL
+ | SWT.READ_ONLY | SWT.BORDER | SWT.WRAP);
+ gd = new GridData(SWT.FILL, SWT.FILL, false, false);
+ GC gc = new GC(composite.getParent());
+ gd.heightHint = Dialog.convertHeightInCharsToPixels(gc
+ .getFontMetrics(), 6);
+ gc.dispose();
+ gd.horizontalSpan = 2;
+ gd.widthHint = 250;
+ descriptionText.setLayoutData(gd);
+ }
+
+ protected void setSelectionArea(Composite composite) {
+ projectSizeLabel = new Label(composite,SWT.NULL);
+ projectSizeLabel.setText(Messages.NewProjectExamplesWizardPage_Project_size);
+ projectSize = new Text(composite,SWT.READ_ONLY);
+ projectSize.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Label label = new Label(composite, SWT.NONE);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ gd.horizontalSpan = 2;
+ label.setLayoutData(gd);
+ }
+
protected void setTitleAndDescription(ProjectExample projectExample) {
setTitle( "Requirements" );
setDescription( "Project Example Requirements" );
@@ -104,7 +136,7 @@
if (projectExample.getDescription() != null) {
descriptionText.setText(projectExample.getDescription());
}
- if (projectExample.getSizeAsText() != null) {
+ if (projectExample.getSizeAsText() != null && projectSize != null) {
projectSize.setText(projectExample.getSizeAsText());
}
}
@@ -113,7 +145,9 @@
setDescription( "Project Example Requirements" );
if (descriptionText != null) {
descriptionText.setText(""); //$NON-NLS-1$
- projectSize.setText(""); //$NON-NLS-1$
+ if (projectSize != null) {
+ projectSize.setText(""); //$NON-NLS-1$
+ }
}
}
}
@@ -133,31 +167,11 @@
composite.setLayoutData(gd);
Dialog.applyDialogFont(composite);
- Label descriptionLabel = new Label(composite,SWT.NONE);
- descriptionLabel.setText(Messages.NewProjectExamplesWizardPage_Description);
- gd = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
- gd.horizontalSpan = 2;
- descriptionLabel.setLayoutData(gd);
- descriptionText = new Text(composite, SWT.H_SCROLL | SWT.V_SCROLL
- | SWT.READ_ONLY | SWT.BORDER | SWT.WRAP);
- gd = new GridData(SWT.FILL, SWT.FILL, false, false);
- GC gc = new GC(parent);
- gd.heightHint = Dialog.convertHeightInCharsToPixels(gc
- .getFontMetrics(), 6);
- gc.dispose();
- gd.horizontalSpan = 2;
- gd.widthHint = 250;
- descriptionText.setLayoutData(gd);
+ //Set description
+ setDescriptionArea(composite);
- Label projectSizeLabel = new Label(composite,SWT.NULL);
- projectSizeLabel.setText(Messages.NewProjectExamplesWizardPage_Project_size);
- projectSize = new Text(composite,SWT.READ_ONLY);
- projectSize.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label label = new Label(composite, SWT.NONE);
- gd = new GridData(SWT.FILL, SWT.FILL, true, false);
- gd.horizontalSpan = 2;
- label.setLayoutData(gd);
+ //Set project size label or runtime/archetype selection
+ setSelectionArea(composite);
Group fixesGroup = new Group(composite, SWT.NONE);
gd = new GridData(SWT.FILL, SWT.FILL, true, false);
@@ -569,6 +583,16 @@
}
+
+ public void setDescriptionText(String longDescription) {
+ if (descriptionText != null) {
+ if (longDescription == null) {
+ longDescription = "";
+ }
+ descriptionText.setText(longDescription);
+ }
+ }
+
@Override
public IWizardPage getNextPage() {
// FIXME
@@ -625,8 +649,7 @@
@Override
public void setWizardContext(WizardContext context) {
- // TODO Auto-generated method stub
-
+ this.wizardContext = context;
}
@Override
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -177,13 +177,9 @@
Set<String> keySet = extensionPages.keySet();
for (String key:keySet) {
List<ContributedPage> contributions = extensionPages.get(key);
- boolean canSetProjectExample = isCentral && projectExample != null && key.equals(projectExample.getImportType());
for(ContributedPage page:contributions) {
try {
IProjectExamplesWizardPage contributedPage = (IProjectExamplesWizardPage) page.getConfigurationElement().createExecutableExtension(ProjectExamplesActivator.CLASS);
- if (canSetProjectExample) {
- contributedPage.setProjectExample(projectExample);
- }
contributedPages.add(contributedPage);
} catch (CoreException e) {
ProjectExamplesActivator.log(e);
@@ -290,6 +286,10 @@
IProjectExamplesWizardPage ewp = (IProjectExamplesWizardPage)page;
ewp.setWizardContext(wizardContext);
wizardContext.addListener(ewp);
+ if (projectExample != null && ewp.getProjectExampleType().equals(projectExample.getImportType())) {
+ ewp.setProjectExample(projectExample);
+ }
+
}
super.addPage(page);
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/.classpath
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/.classpath 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/.classpath 2012-09-18 15:19:51 UTC (rev 43798)
@@ -1,7 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/commons-codec-1.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/httpclient-4.0.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/jboss-logging-3.1.2.GA.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/snakeyaml-1.10.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/stacks-client-1.0.0.CR2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src/"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/META-INF/MANIFEST.MF 2012-09-18 15:19:51 UTC (rev 43798)
@@ -23,3 +23,11 @@
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor
+Bundle-ClassPath: lib/stacks-client-1.0.0.CR2.jar,
+ lib/commons-codec-1.3.jar,
+ lib/commons-logging-1.1.1.jar,
+ lib/httpclient-4.0.1.jar,
+ lib/httpcore-4.0.1.jar,
+ lib/jboss-logging-3.1.2.GA.jar,
+ lib/snakeyaml-1.10.jar,
+ .
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/build.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/build.properties 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/build.properties 2012-09-18 15:19:51 UTC (rev 43798)
@@ -9,5 +9,11 @@
about.mappings,\
about.properties,\
jboss_about.png,\
- icons/
+ icons/,\
+ lib/commons-codec-1.3.jar,\
+ lib/commons-logging-1.1.1.jar,\
+ lib/httpclient-4.0.1.jar,\
+ lib/httpcore-4.0.1.jar,\
+ lib/jboss-logging-3.1.2.GA.jar,\
+ lib/snakeyaml-1.10.jar
src.includes = src/
Added: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/commons-codec-1.3.jar
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/commons-codec-1.3.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/commons-logging-1.1.1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/commons-logging-1.1.1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/httpclient-4.0.1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/httpclient-4.0.1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/httpcore-4.0.1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/httpcore-4.0.1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/jboss-logging-3.1.2.GA.jar
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/jboss-logging-3.1.2.GA.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/snakeyaml-1.10.jar
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/snakeyaml-1.10.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/stacks-client-1.0.0.CR2.jar
===================================================================
(Binary files differ)
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.project.examples/lib/stacks-client-1.0.0.CR2.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/stacks/StacksManager.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/stacks/StacksManager.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/stacks/StacksManager.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -0,0 +1,55 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.project.examples.stacks;
+import static org.jboss.tools.project.examples.model.ProjectExampleUtil.getProjectExamplesFile;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.jdf.stacks.model.Stacks;
+import org.jboss.jdf.stacks.parser.Parser;
+
+
+public class StacksManager {
+
+ private static final String STACKS_URL;
+
+ static {
+ String defaultUrl = "http://raw.github.com/jboss-jdf/jdf-stack/1.0.0.CR1/stacks.yaml"; //$NON-NLS-1$
+ STACKS_URL = System.getProperty("org.jboss.examples.stacks.url", defaultUrl); //$NON-NLS-1$
+ }
+
+ public Stacks getStacks(IProgressMonitor monitor) throws MalformedURLException {
+ Stacks stacks = null;
+ File f = getProjectExamplesFile(new URL(STACKS_URL), "stacks", "yaml", monitor); //$NON-NLS-1$ //$NON-NLS-2$
+ if (f != null && f.exists()) {
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(f);
+ Parser p = new Parser();
+ stacks = p.parse(fis);
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ try {
+ fis.close();
+ } catch(Exception e) {
+ //ignore
+ }
+ }
+ }
+ return stacks;
+
+ }
+}
Added: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/stacks/StacksUtil.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/stacks/StacksUtil.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/stacks/StacksUtil.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -0,0 +1,184 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.project.examples.stacks;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+
+import org.jboss.jdf.stacks.model.Archetype;
+import org.jboss.jdf.stacks.model.ArchetypeVersion;
+import org.jboss.jdf.stacks.model.Runtime;
+import org.jboss.jdf.stacks.model.Stacks;
+import org.jboss.tools.project.examples.model.ArchetypeModel;
+
+public class StacksUtil {
+ /*
+ public static final String EAP_TYPE = "EAP";
+
+ public static final String AS_TYPE = "AS";
+ */
+ private StacksUtil() {
+ // no need for public constructor
+ }
+
+ public static Archetype getArchetype(String archetypeId, Stacks fromStacks) {
+ if (fromStacks == null || archetypeId == null) {
+ return null;
+ }
+
+ for (Archetype a : fromStacks.getAvailableArchetypes()) {
+ if (archetypeId.equals(a.getArtifactId())) {
+ return a;
+ }
+ }
+
+ return null;
+ }
+
+ public static List<Runtime> getCompatibleRuntimes(Archetype archetype, Stacks fromStacks, String ... runtimeTypes) {
+ if (fromStacks == null || archetype == null) {
+ return Collections.emptyList();
+ }
+
+ List<Runtime> runtimes = new ArrayList<Runtime>();
+
+ for (Runtime runtime : getRuntimes(fromStacks, runtimeTypes)) {
+ List<ArchetypeVersion> versions = getCompatibleArchetypeVersions(archetype, runtime);
+ if (!versions.isEmpty()) {
+ runtimes.add(runtime);
+ }
+ }
+ return Collections.unmodifiableList(runtimes);
+ }
+
+ public static List<Runtime> getRuntimes(Stacks fromStacks, String ... runtimeTypes) {
+ if (fromStacks == null) {
+ return Collections.emptyList();
+ }
+
+ List<Runtime> runtimes = new ArrayList<Runtime>();
+ List<String> runtimeTypeFilter = null;
+ if (runtimeTypes != null && runtimeTypes.length > 0) {
+ runtimeTypeFilter = Arrays.asList(runtimeTypes);
+ }
+
+ for (Runtime runtime : fromStacks.getAvailableRuntimes()) {
+
+ if (runtimeTypeFilter != null) {
+ String runtimeType = getRuntimeType(runtime);
+ if (!runtimeTypeFilter.contains(runtimeType)) {
+ continue;
+ }
+ }
+ runtimes.add(runtime);
+ }
+ return Collections.unmodifiableList(runtimes);
+ }
+
+
+ /*
+ public static List<Runtime> getCompatibleRuntimes(Archetype archetype, Stacks fromStacks) {
+ return getCompatibleRuntimes(archetype, fromStacks, AS_TYPE, EAP_TYPE);
+ }
+ */
+
+ /**
+ * Returns an unmodifiable {@link List} of compatible {@link ArchetypeVersion} of an {@link Archetype} for a given {@link Runtime}.
+ * The recommended {@link ArchetypeVersion} is always first in the list.
+ * @param archetype
+ * @param runtime
+ * @return a non-null {@link List} of compatible {@link ArchetypeVersion}.
+ */
+ public static List<ArchetypeVersion> getCompatibleArchetypeVersions(Archetype archetype, Runtime runtime) {
+ if (archetype == null || runtime == null) {
+ return Collections.emptyList();
+ }
+
+ List<ArchetypeVersion> compatibleVersions = new ArrayList<ArchetypeVersion>();
+ List<ArchetypeVersion> versions = runtime.getArchetypes();
+ if (versions != null && !versions.isEmpty()) {
+ String bestVersion = archetype.getRecommendedVersion();
+ for (ArchetypeVersion v : versions) {
+ if (archetype.equals(v.getArchetype())) {
+ if (v.getVersion().equals(bestVersion)) {
+ //Put best version on top
+ compatibleVersions.add(0, v);
+ }
+ else {
+ compatibleVersions.add(v);
+ }
+ }
+ }
+ }
+ return Collections.unmodifiableList(compatibleVersions);
+ }
+
+ public static boolean isRuntimeCompatible(ArchetypeVersion archetypeVersion, Runtime runtime) {
+ if (archetypeVersion == null || runtime == null) {
+ return false;
+ }
+
+ List<ArchetypeVersion> versions = runtime.getArchetypes();
+ return versions != null && versions.contains(archetypeVersion);
+ }
+
+ /*
+ public static boolean isEnterprise(Runtime runtime) {
+ return EAP_TYPE.equals(getRuntimeType(runtime));
+ }
+ */
+
+ public static String getRuntimeType(Runtime runtime) {
+ if (runtime == null) {
+ return null;
+ }
+
+ Properties p = runtime.getLabels();
+ return (String)p.get("runtimeType");
+ }
+
+ public static ArchetypeModel createArchetypeModel(ArchetypeModel archetypeModel, ArchetypeVersion archetypeVersion) throws CloneNotSupportedException {
+ ArchetypeModel a = (ArchetypeModel) archetypeModel.clone();
+ a.setArchetypeArtifactId(archetypeVersion.getArchetype().getArtifactId());
+ a.setArchetypeGroupId(archetypeVersion.getArchetype().getGroupId());
+ a.setArchetypeVersion(archetypeVersion.getVersion());
+ return a;
+ }
+
+ public static ArchetypeVersion getDefaultArchetypeVersion(String archetypeId, Stacks fromStacks) {
+ if (fromStacks == null || archetypeId == null) {
+ return null;
+ }
+
+ Archetype targetArchetype = getArchetype(archetypeId, fromStacks);
+ return getDefaultArchetypeVersion(targetArchetype, fromStacks);
+ }
+
+ public static ArchetypeVersion getDefaultArchetypeVersion(Archetype archetype, Stacks fromStacks) {
+ if (fromStacks == null || archetype == null) {
+ return null;
+ }
+
+ List<ArchetypeVersion> versions = fromStacks.getAvailableArchetypeVersions();
+ for (ArchetypeVersion version : versions) {
+ if (archetype.equals(version.getArchetype())
+ && version.getVersion().equals(archetype.getRecommendedVersion())) {
+ return version;
+ }
+ }
+ return (versions.isEmpty())?null:versions.get(0);
+ }
+
+
+}
\ No newline at end of file
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardFirstPage.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -62,6 +62,7 @@
import org.jboss.tools.maven.project.examples.Messages;
import org.jboss.tools.maven.project.examples.utils.MavenArtifactHelper;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.jboss.tools.project.examples.model.ArchetypeModel;
import org.jboss.tools.project.examples.model.ProjectExample;
import org.jboss.tools.project.examples.wizard.IProjectExamplesWizardPage;
import org.jboss.tools.project.examples.wizard.NewProjectExamplesWizard2;
@@ -93,6 +94,7 @@
private IRuntimeLifecycleListener listener;
private Button isWorkspace;
private Combo outputDirectoryCombo;
+ private ArchetypeModel archetypeModel;
public ArchetypeExamplesWizardFirstPage() {
super(new ProjectImportConfiguration(), "", "",new ArrayList<IWorkingSet>());
@@ -183,8 +185,8 @@
/*
- projectNameCombo.setText(projectDescription.getArchetypeModel().getArtifactId());
- packageCombo.setText(projectDescription.getArchetypeModel().getJavaPackage());
+ projectNameCombo.setText(archetypeModel.getArtifactId());
+ packageCombo.setText(archetypeModel.getJavaPackage());
*/
}
@@ -361,22 +363,23 @@
return;
}
projectDescription = projectExample;
- String projectName = projectDescription.getArchetypeModel().getArtifactId();
- if (StringUtils.isNotBlank(projectName)) {
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if (!p.exists()) {
- projectNameCombo.setText(projectName);
+ if (archetypeModel != null) {
+ String projectName = archetypeModel.getArtifactId();
+ if (StringUtils.isNotBlank(projectName)) {
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if (!p.exists()) {
+ projectNameCombo.setText(projectName);
+ }
}
+
+ String packageName = archetypeModel.getJavaPackage();
+ if (StringUtils.isBlank(packageName) && packageCombo.getItemCount() > 0) {
+ packageName = packageCombo.getItem(0);
+ }
+ if (packageName != null) {
+ packageCombo.setText(packageName);
+ }
}
-
- String packageName = projectDescription.getArchetypeModel().getJavaPackage();
- if (StringUtils.isBlank(packageName) && packageCombo.getItemCount() > 0) {
- packageName = packageCombo.getItem(0);
- }
- if (packageName != null) {
- packageCombo.setText(packageName);
- }
-
//Force setting of enterprise value
context.setProperty(MavenProjectConstants.ENTERPRISE_TARGET, isEnterpriseTargetRuntime());
@@ -513,6 +516,7 @@
if (projectExample.getDescription() != null) {
setDescription(ProjectExamplesActivator.getShortDescription(projectExample.getDescription()));
}
+ archetypeModel = projectExample.getArchetypeModel();
initDefaultValues();
}
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/ArchetypeExamplesWizardPage.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -77,6 +77,8 @@
private MissingRepositoryWarningComponent warningComponent;
private IStatus enterpriseRepoStatus;
+ private ArchetypeModel archetypeModel;
+
public ArchetypeExamplesWizardPage() {
super(new ProjectImportConfiguration());
}
@@ -103,14 +105,17 @@
});
if (projectExample != null && !initialized) {
- initialize();
+ initializeArchetype();
}
}
- protected void initialize() {
+ protected void initializeArchetype() {
+ if (getContainer() == null || archetypeModel == null) {
+ return;
+ }
+ //System.err.println("Initializing archetype data "+ archetypeModel.getArchetypeArtifactId() + " "+archetypeModel.getArchetypeVersion());
Archetype archetype = new Archetype();
- ArchetypeModel archetypeModel = projectDescription.getArchetypeModel();
archetype.setGroupId(archetypeModel.getArchetypeGroupId());
archetype.setArtifactId(archetypeModel.getArchetypeArtifactId());
@@ -141,7 +146,9 @@
// when setVisible() is called in MavenProjectWizardArchetypeParametersPage.
// It needs to be called AFTER setArchetype(archetype) !!!
archetypeChanged = false;
- resolverConfigurationComponent.setExpanded(!resolverConfigurationComponent.getResolverConfiguration().getActiveProfileList().isEmpty());
+ if (resolverConfigurationComponent != null) {
+ resolverConfigurationComponent.setExpanded(!resolverConfigurationComponent.getResolverConfiguration().getActiveProfileList().isEmpty());
+ }
initialized = true;
}
@@ -452,9 +459,8 @@
}
}
projectDescription = projectExample;
- if (getContainer() != null) {
- initialize();
- }
+ archetypeModel = projectDescription.getArchetypeModel();
+ initializeArchetype();
}
}
@@ -475,6 +481,11 @@
//Make sure it's a boolean :
Boolean enterprise = Boolean.parseBoolean(value.toString());
updateArchetypeProperty("enterprise", enterprise.toString());
+ } else if (MavenProjectConstants.ARCHETYPE_MODEL.equals(key)) {
+ if (value instanceof ArchetypeModel) {
+ archetypeModel = (ArchetypeModel)value;
+ initializeArchetype();
+ }
}
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/MavenProjectConstants.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/MavenProjectConstants.java 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/MavenProjectConstants.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -12,6 +12,8 @@
public static final String MAVEN_MODEL = "mavenModel";
+ public static final String ARCHETYPE_MODEL = "archetypeModel";
+
private MavenProjectConstants(){
}
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/NewProjectExamplesStacksRequirementsPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/NewProjectExamplesStacksRequirementsPage.java 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/NewProjectExamplesStacksRequirementsPage.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -10,6 +10,23 @@
************************************************************************************/
package org.jboss.tools.maven.project.examples.wizard;
+import static org.jboss.tools.maven.project.examples.stacks.StacksUtil.createArchetypeModel;
+import static org.jboss.tools.maven.project.examples.stacks.StacksUtil.getArchetype;
+
+import java.net.MalformedURLException;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.jdf.stacks.model.ArchetypeVersion;
+import org.jboss.jdf.stacks.model.Stacks;
+import org.jboss.tools.maven.project.examples.stacks.StacksManager;
+import org.jboss.tools.maven.project.examples.stacks.StacksUtil;
+import org.jboss.tools.project.examples.model.ArchetypeModel;
import org.jboss.tools.project.examples.model.ProjectExample;
import org.jboss.tools.project.examples.wizard.NewProjectExamplesRequirementsPage;
@@ -17,8 +34,21 @@
private static final String PAGE_NAME = "org.jboss.tools.project.examples.stacksrequirements"; //$NON-NLS-1$
+ org.jboss.jdf.stacks.model.Archetype stacksArchetype;
+
+ private ArchetypeVersion version;
+
+ private Button useBlankArchetype;
+
+ private Stacks stacks;
+
public NewProjectExamplesStacksRequirementsPage() {
this(null);
+ try {
+ stacks = new StacksManager().getStacks(new NullProgressMonitor());
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
}
public NewProjectExamplesStacksRequirementsPage(ProjectExample projectExample) {
@@ -29,5 +59,88 @@
public String getProjectExampleType() {
return "mavenArchetype";
}
+
+ @Override
+ protected void setDescriptionArea(Composite composite) {
+ super.setDescriptionArea(composite);
+ }
+
+ @Override
+ public void setProjectExample(ProjectExample projectExample) {
+ super.setProjectExample(projectExample);
+ if (projectExample != null) {
+ String stacksId = projectExample.getStacksId();
+ stacksArchetype = getArchetype(stacksId, stacks);
+ setArchetypeVersion();
+ }
+ }
+ private void setArchetypeVersion() {
+ if (stacksArchetype == null) {
+ return;
+ }
+
+ org.jboss.jdf.stacks.model.Archetype a;
+
+ if (useBlankArchetype != null && useBlankArchetype.getSelection()) {
+ a = stacksArchetype.getBlank();
+ } else {
+ a = stacksArchetype;
+ }
+ version = StacksUtil.getDefaultArchetypeVersion(a, stacks);
+
+
+ StringBuilder description = new StringBuilder(version.getArchetype().getDescription());
+ description.append("\r\n").append("\r\n")
+ .append("Project based on the ")
+ .append(version.getArchetype().getGroupId())
+ .append(":")
+ .append(version.getArchetype().getArtifactId())
+ .append(":")
+ .append(version.getVersion())
+ .append(" Maven archetype");
+
+ setDescriptionText(description.toString());
+
+ ArchetypeModel mavenArchetype;
+ try {
+ mavenArchetype = createArchetypeModel(projectExample.getArchetypeModel(), version);
+
+ wizardContext.setProperty(MavenProjectConstants.ARCHETYPE_MODEL, mavenArchetype);
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ @Override
+ protected void setSelectionArea(Composite composite) {
+ useBlankArchetype = new Button(composite, SWT.CHECK);
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gd.verticalAlignment = SWT.BOTTOM;
+ useBlankArchetype.setLayoutData(gd);
+ useBlankArchetype.setText("Create an empty project");
+ useBlankArchetype.addSelectionListener(new SelectionListener() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setArchetypeVersion();
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ if (visible) {
+ useBlankArchetype.setVisible(stacksArchetype != null
+ && stacksArchetype.getBlank() != null );
+ }
+ super.setVisible(visible);
+ }
+
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/xpl/MavenProjectWizardArchetypeParametersPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/xpl/MavenProjectWizardArchetypeParametersPage.java 2012-09-18 15:14:33 UTC (rev 43797)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/wizard/xpl/MavenProjectWizardArchetypeParametersPage.java 2012-09-18 15:19:51 UTC (rev 43798)
@@ -45,7 +45,6 @@
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.internal.MavenPluginActivator;
import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory;
-import org.eclipse.m2e.core.internal.archetype.ArchetypeManager;
import org.eclipse.m2e.core.project.ProjectImportConfiguration;
import org.eclipse.m2e.core.ui.internal.Messages;
import org.eclipse.m2e.core.ui.internal.components.TextComboBoxCellEditor;
@@ -368,23 +367,26 @@
public void setArchetype(Archetype archetype) {
if(archetype == null) {
- propertiesTable.removeAll();
+ if (propertiesTable != null)
+ propertiesTable.removeAll();
archetypeChanged = false;
} else if(!archetype.equals(this.archetype)) {
this.archetype = archetype;
- propertiesTable.removeAll();
requiredProperties.clear();
optionalProperties.clear();
archetypeChanged = true;
- Properties properties = archetype.getProperties();
- if(properties != null) {
- for(Iterator<Map.Entry<Object, Object>> it = properties.entrySet().iterator(); it.hasNext();) {
- Map.Entry<?, ?> e = it.next();
- String key = (String) e.getKey();
- addTableItem(key, (String) e.getValue());
- optionalProperties.add(key);
- }
+ if (propertiesTable != null) {
+ propertiesTable.removeAll();
+ Properties properties = archetype.getProperties();
+ if(properties != null) {
+ for(Iterator<Map.Entry<Object, Object>> it = properties.entrySet().iterator(); it.hasNext();) {
+ Map.Entry<?, ?> e = it.next();
+ String key = (String) e.getKey();
+ addTableItem(key, (String) e.getValue());
+ optionalProperties.add(key);
+ }
+ }
}
}
}
13 years, 6 months
JBoss Tools SVN: r43797 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-09-18 11:14:33 -0400 (Tue, 18 Sep 2012)
New Revision: 43797
Added:
trunk/download.jboss.org/jbosstools/examples/project-examples-shared-4.0....
Log:
JBIDE-12472 : use stacksId for compatible examples
Added: trunk/download.jboss.org/jbosstools/examples/project-examples-shared-4.0....
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-shared-4.0.... (rev 0)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-shared-4.0.... 2012-09-18 15:14:33 UTC (rev 43797)
@@ -0,0 +1,377 @@
+<projects>
+ <!--
+ Beware : the project name MUST NOT be changed. It's referenced in JBoss Central
+ -->
+
+ <!-- Java EE Web Project -->
+ <project>
+ <category>JBoss Maven Archetypes</category>
+ <name>jboss-javaee6-webapp</name>
+ <included-projects>jboss-javaee6-webapp</included-projects>
+ <shortDescription>Java EE Web Project</shortDescription>
+ <priority>1</priority>
+ <description>
+This is your project! It's a sample, deployable Maven 3 project to help you get your foot in the door developing with Java EE 6 on JBoss Enterprise Application Platform 6 or JBoss Application Server 7.1.
+This project is setup to allow you to create a compliant Java EE 6 application using JSF 2.0, CDI 1.0, EJB 3.1, JPA 2.0 and Bean Validation 1.0.
+This project is based on the org.jboss.spec.archetypes:jboss-javaee6-webapp-archetype:7.1.1.CR1 Maven archetype.
+ </description>
+ <size>8192</size>
+ <url/>
+ <stacksId>jboss-javaee6-webapp-archetype</stacksId>
+ <fixes>
+ <fix type="wtpruntime">
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
+ <property name="description">This project example requires JBoss Enterprise Application Platform 6 or JBoss Application Server 7.1</property>
+ <property name="downloadId">org.jboss.tools.runtime.core.as.711</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.core</property>
+ <property name="versions">[1.0.0,2.0.0)</property>
+ <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="connectorIds">org.eclipse.m2e.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.wtp</property>
+ <property name="versions">[0.16,2.0)</property>
+ <property name="description">This project example requires m2e-wtp >= 0.16.0.</property>
+ <property name="connectorIds">org.maven.ide.eclipse.wtp.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.jboss.tools.maven.core</property>
+ <property name="versions">[1.3.0,2.0.0)</property>
+ <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.hibernate.feature,org.jboss.tools.maven.jaxrs.feature</property>
+ </fix>
+ </fixes>
+ <importType>mavenArchetype</importType>
+ <importTypeDescription>The project example requires the m2e, m2e-wtp and JBoss Maven Integration features.</importTypeDescription>
+ <defaultMavenProfiles>arq-jbossas-remote</defaultMavenProfiles>
+ <mavenArchetype>
+ <archetypeGroupId>org.jboss.spec.archetypes</archetypeGroupId>
+ <archetypeArtifactId>jboss-javaee6-webapp-archetype</archetypeArtifactId>
+ <archetypeVersion>7.1.1.CR1</archetypeVersion>
+ <!--
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
+ <archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
+ -->
+ <groupId>org.jboss.tools.examples</groupId>
+ <artifactId>jboss-javaee6-webapp</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <javaPackage>org.jboss.tools.examples</javaPackage>
+ <properties>
+ <property name="name" value="Java EE 6 webapp project"/>
+ </properties>
+ </mavenArchetype>
+ <tags>wizard</tags>
+ <icon path="icons/newwebprj_wiz.gif" />
+ </project>
+ <!-- Java EE Project -->
+ <project>
+ <category>JBoss Maven Archetypes</category>
+ <name>multi-javaee6-archetype</name>
+ <included-projects>multi-javaee6-archetype</included-projects>
+ <shortDescription>Java EE Project</shortDescription>
+ <priority>2</priority>
+ <description>An archetype that generates a starter Java EE 6 webapp project for JBoss Enterprise Application Platform 6 or JBoss Application Server. The project is an EAR, with an EJB-JAR and WAR.
+
+This project is based on the org.jboss.spec.archetypes:jboss-javaee6-webapp-ear-archetype:7.1.1.CR1 Maven archetype.
+ </description>
+ <size>13806</size>
+ <url/>
+ <stacksId>jboss-javaee6-webapp-ear-archetype</stacksId>
+ <fixes>
+ <fix type="wtpruntime">
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
+ <property name="description">This project example requires JBoss Enterprise Application Platform 6 or JBoss Application Server 7.1</property>
+ <property name="downloadId">org.jboss.tools.runtime.core.as.710</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.core</property>
+ <property name="versions">[1.0.0,2.0.0)</property>
+ <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="connectorIds">org.eclipse.m2e.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.wtp</property>
+ <property name="versions">[0.16,2.0)</property>
+ <property name="description">This project example requires m2e-wtp >= 0.16.0.</property>
+ <property name="connectorIds">org.maven.ide.eclipse.wtp.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.jboss.tools.maven.core</property>
+ <property name="versions">[1.3.0,2.0.0)</property>
+ <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.hibernate.feature,org.jboss.tools.maven.jaxrs.feature</property>
+ </fix>
+ </fixes>
+ <importType>mavenArchetype</importType>
+ <importTypeDescription>The project example requires the m2e, m2e-wtp and JBoss Maven Integration features.</importTypeDescription>
+ <defaultMavenProfiles>arq-jbossas-remote</defaultMavenProfiles>
+ <mavenArchetype>
+ <archetypeGroupId>org.jboss.spec.archetypes</archetypeGroupId>
+ <archetypeArtifactId>jboss-javaee6-webapp-ear-archetype</archetypeArtifactId>
+ <archetypeVersion>7.1.1.CR1</archetypeVersion>
+ <!--
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
+ <archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
+ -->
+ <groupId>org.jboss.tools.example</groupId>
+ <artifactId>multi</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <javaPackage>org.jboss.tools.example</javaPackage>
+ </mavenArchetype>
+ <!--targetProjectFacet facet="jst.ear" version="6.0"/-->
+ <tags>wizard</tags>
+ <icon path="icons/ear-wiz-icon.gif" />
+ </project>
+ <!-- HTML5 project -->
+ <project>
+ <category>JBoss Maven Archetypes</category>
+ <name>jboss-javaee6-poh5-archetype</name>
+ <included-projects>jboss-javaee6-poh5</included-projects>
+ <shortDescription>HTML5 Project</shortDescription>
+ <priority>3</priority>
+ <description>An archetype that generates a Java EE 6 HTML5 Mobile Webapp project for JBoss Enterprise Application Platform 6 or JBoss Application Server 7.1
+
+This project is based on the org.jboss.aerogear.archetypes:jboss-html5-mobile-archetype:1.0.0.M5 Maven archetype.
+ </description>
+ <size>165567</size>
+ <url/>
+ <fixes>
+ <fix type="wtpruntime">
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
+ <property name="description">This project example requires JBoss Enterprise Application Platform 6 or JBoss Application Server 7.1</property>
+ <property name="downloadId">org.jboss.tools.runtime.core.as.710</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.core</property>
+ <property name="versions">[1.0.0,2.0.0)</property>
+ <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="connectorIds">org.eclipse.m2e.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.wtp</property>
+ <property name="versions">[0.16,2.0)</property>
+ <property name="description">This project example requires m2e-wtp >= 0.16.0.</property>
+ <property name="connectorIds">org.maven.ide.eclipse.wtp.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.jboss.tools.maven.core</property>
+ <property name="versions">[1.3.0,2.0.0)</property>
+ <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.hibernate.feature,org.jboss.tools.maven.jaxrs.feature</property>
+ </fix>
+ </fixes>
+ <importType>mavenArchetype</importType>
+ <importTypeDescription>The project example requires the m2e, m2e-wtp and JBoss Maven Integration features.</importTypeDescription>
+ <defaultMavenProfiles>arq-jbossas-remote</defaultMavenProfiles>
+ <mavenArchetype>
+ <archetypeGroupId>org.jboss.aerogear.archetypes</archetypeGroupId>
+ <archetypeArtifactId>jboss-html5-mobile-archetype</archetypeArtifactId>
+ <archetypeVersion>1.0.0.M5</archetypeVersion>
+ <!--
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
+ <archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
+ -->
+ <groupId>org.jboss.tools.example</groupId>
+ <artifactId>poh5</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <javaPackage>org.jboss.tools.example.html5</javaPackage>
+ </mavenArchetype>
+ <tags>wizard</tags>
+ <icon path="icons/html5.png" />
+ </project>
+ <!-- Richfaces project -->
+ <project>
+ <category>JBoss Maven Archetypes</category>
+ <name>richfaces-archetype-simpleapp</name>
+ <included-projects>richfaces-archetype-simpleapp</included-projects>
+ <shortDescription>RichFaces Project</shortDescription>
+ <priority>4</priority>
+ <description>An archetype that generates a simple Richfaces application
+
+This project is based on the org.richfaces.archetypes:richfaces-archetype-kitchensink:4.2.2.Final-2 Maven archetype.</description>
+ <size>165567</size>
+ <url/>
+ <fixes>
+ <fix type="wtpruntime">
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
+ <property name="description">This project example requires JBoss Enterprise Application Platform 6 or JBoss Application Server 7.1</property>
+ <property name="downloadId">org.jboss.tools.runtime.core.as.710</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.core</property>
+ <property name="versions">[1.0.0,2.0.0)</property>
+ <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="connectorIds">org.eclipse.m2e.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.wtp</property>
+ <property name="versions">[0.16,2.0)</property>
+ <property name="description">This project example requires m2e-wtp >= 0.16.0.</property>
+ <property name="connectorIds">org.maven.ide.eclipse.wtp.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.jboss.tools.maven.core</property>
+ <property name="versions">[1.3.0,2.0.0)</property>
+ <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.hibernate.feature,org.jboss.tools.maven.jaxrs.feature</property>
+ </fix>
+ </fixes>
+ <importType>mavenArchetype</importType>
+ <importTypeDescription>The project example requires the m2e, m2e-wtp and JBoss Maven Integration features.</importTypeDescription>
+ <defaultMavenProfiles>arq-jbossas-remote</defaultMavenProfiles>
+ <mavenArchetype>
+ <archetypeGroupId>org.richfaces.archetypes</archetypeGroupId>
+ <archetypeArtifactId>richfaces-archetype-kitchensink</archetypeArtifactId>
+ <archetypeVersion>4.2.2.Final-2</archetypeVersion>
+ <!--
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
+ <archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
+ <archetypeRepository>https://repository.jboss.org/nexus/content/repositories/jboss_releases_st...</archetypeRepository>
+ <archetypeRepository>http://repository.jboss.org/nexus/content/repositories/snapshots/</archetypeRepository>
+ -->
+ <groupId>org.jboss.tools.example</groupId>
+ <artifactId>richfaces-webapp</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <javaPackage>org.jboss.tools.example.richfaces</javaPackage>
+ <properties>
+ <property name="richfaces-enterprise-version" value="4.2.2.Final-redhat-1" /> <!-- RF is broken in WFK / WFK repo not available-->
+ <property name="richfaces-version" value="4.2.2.Final" />
+ <property name="javaee6-with-tools-enterprise-version" value="1.0.0.M12-redhat-1" />
+ </properties>
+ </mavenArchetype>
+ <essentialEnterpriseDependencies>org.jboss.bom:jboss-javaee-6.0-with-tools:pom:1.0.0.M12-redhat-1::,org.richfaces:richfaces-bom:pom:4.2.2.Final-redhat-1::,</essentialEnterpriseDependencies>
+ <!--
+ <essentialEnterpriseDependencies>org.richfaces:richfaces-bom:pom:4.2.1.Final-redhat-1::,</essentialEnterpriseDependencies>
+ -->
+ <tags>wizard</tags>
+ <icon path="icons/rf_logo.png" />
+ </project>
+ <!-- Spring MVC -->
+ <project>
+ <category>JBoss Maven Archetypes</category>
+ <name>spring-mvc-webapp</name>
+ <included-projects>spring-mvc-webapp</included-projects>
+ <shortDescription>Spring MVC Project</shortDescription>
+ <priority>5</priority>
+ <description>An archetype that generates a starter Spring MVC application with Java EE persistence settings (server bootstrapped JPA, JTA transaction management) for JBoss Enterprise Application Platform 6 or JBoss Application Server 7.1
+
+This project is based on the org.jboss.spring.archetypes:spring-mvc-webapp:1.0.0.CR6 Maven archetype.</description>
+ <size>165567</size>
+ <url/>
+ <fixes>
+ <fix type="wtpruntime">
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
+ <property name="description">This project example requires JBoss Enterprise Application Platform 6 or JBoss Application Server 7.1</property>
+ <property name="downloadId">org.jboss.tools.runtime.core.as.710</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.core</property>
+ <property name="versions">[1.0.0,2.0.0)</property>
+ <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="connectorIds">org.eclipse.m2e.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.wtp</property>
+ <property name="versions">[0.16,2.0)</property>
+ <property name="description">This project example requires m2e-wtp >= 0.16.0.</property>
+ <property name="connectorIds">org.maven.ide.eclipse.wtp.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.jboss.tools.maven.core</property>
+ <property name="versions">[1.3.0,2.0.0)</property>
+ <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.hibernate.feature</property>
+ </fix>
+ </fixes>
+ <importType>mavenArchetype</importType>
+ <importTypeDescription>The project example requires the m2e, m2e-wtp and JBoss Maven Integration features.</importTypeDescription>
+ <mavenArchetype>
+ <archetypeGroupId>org.jboss.spring.archetypes</archetypeGroupId>
+ <archetypeArtifactId>spring-mvc-webapp</archetypeArtifactId>
+ <archetypeVersion>1.0.0.CR6</archetypeVersion>
+ <!--
+ <archetypeRepository>http://repository.jboss.org/nexus/content/repositories/releases/</archetypeRepository>
+ -->
+ <groupId>org.jboss.tools.example</groupId>
+ <artifactId>springmvc</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <javaPackage>org.jboss.tools.example.springmvc</javaPackage>
+ <!--
+ <properties>
+ <property name="springBomVersion" value="2.0.0-redhat-5" />
+ </properties>
+ -->
+ </mavenArchetype>
+ <tags>wizard</tags>
+ <icon path="icons/spring_wiz.gif" />
+ </project>
+ <!-- GWT/Errai Project -->
+ <project>
+ <category>JBoss Maven Archetypes</category>
+ <name>gwt-webapp</name>
+ <included-projects>gwt-kitchensink</included-projects>
+ <priority>6</priority>
+ <shortDescription>GWT Web Project</shortDescription>
+ <description>An archetype that generates a starter GWT application with Java EE 6 and Errai.
+Make sure you read the deployment instructions in README.md.
+
+This project is based on the org.jboss.errai.archetypes:jboss-errai-kitchensink-archetype:2.0.0.Final Maven archetype.</description>
+ <size>165567</size>
+ <url/>
+ <fixes>
+ <fix type="wtpruntime">
+ <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71, org.jboss.ide.eclipse.as.runtime.eap.60</property>
+ <property name="description">This project example requires JBoss Enterprise Application Platform 6 or JBoss Application Server 7.1</property>
+ <property name="downloadId">org.jboss.tools.runtime.core.as.710</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.core</property>
+ <property name="versions">[1.0.0,2.0.0)</property>
+ <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="connectorIds">org.eclipse.m2e.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.eclipse.m2e.wtp</property>
+ <property name="versions">[0.16,2.0)</property>
+ <property name="description">This project example requires m2e-wtp >= 0.16.0.</property>
+ <property name="connectorIds">org.maven.ide.eclipse.wtp.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">org.jboss.tools.maven.core</property>
+ <property name="versions">[1.3.0,2.0.0)</property>
+ <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.gwt.feature</property>
+ </fix>
+ <fix type="plugin">
+ <property name="id">com.google.gwt.eclipse.core</property>
+ <property name="versions">[2.4,)</property>
+ <property name="description">This project example requires Google Plugin for Eclipse</property>
+ <property name="connectorIds">com.google.gwt.eclipse.sdkbundle.e37.feature,com.google.gdt.eclipse.suite.e37.feature</property>
+ </fix>
+ </fixes>
+ <importType>mavenArchetype</importType>
+ <importTypeDescription>The project example requires the m2e, m2e-wtp, JBoss Maven GWT Integration and Google Plugin for Eclipse features.</importTypeDescription>
+ <!-- Activating the profile causes a build error :
+ 'dependencies.dependency.version' for org.jboss.as:jboss-as-arquillian-container-remote:jar is missing.
+ <defaultMavenProfiles>arq-jbossas-remote</defaultMavenProfiles>
+ -->
+ <mavenArchetype>
+ <archetypeGroupId>org.jboss.errai.archetypes</archetypeGroupId>
+ <archetypeArtifactId>jboss-errai-kitchensink-archetype</archetypeArtifactId>
+ <archetypeVersion>2.0.0.Final</archetypeVersion>
+ <!--
+ <archetypeRepository>http://anonsvn.jboss.org/repos/jbosstools/workspace/fred/repositories/sna...</archetypeRepository>
+ <archetypeRepository>https://repository.jboss.org/nexus/content/groups/public/</archetypeRepository>
+ -->
+ <groupId>org.jboss.tools.example</groupId>
+ <artifactId>gwt-kitchensink</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <javaPackage>org.jboss.tools.gwt.kitchensink</javaPackage>
+ </mavenArchetype>
+ <tags>wizard</tags>
+ <icon path="icons/new-gdt-project.png" />
+ </project>
+
+</projects>
13 years, 6 months
JBoss Tools SVN: r43796 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal: ui/utils and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-09-18 11:13:09 -0400 (Tue, 18 Sep 2012)
New Revision: 43796
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobChainBuilder.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java
Log:
[JBIDE-11912] finished implementing "Add existing SSH key"
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java 2012-09-18 13:01:10 UTC (rev 43795)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java 2012-09-18 15:13:09 UTC (rev 43796)
@@ -324,4 +324,13 @@
return delegate.putSSHKey(name, key);
}
+ public boolean hasSSHKeyName(String name) {
+ return delegate.hasSSHKeyName(name);
+ }
+
+ public boolean hasSSHPublicKey(String publicKey) {
+ return delegate.hasSSHPublicKey(publicKey);
+ }
+
+
}
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobChainBuilder.java (from rev 43795, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobChainBuilder.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobChainBuilder.java 2012-09-18 15:13:09 UTC (rev 43796)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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 Incorporated - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.openshift.express.internal.ui.utils;
+
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class JobChainBuilder {
+
+ private Job job;
+
+ public JobChainBuilder(Job job) {
+ this.job = job;
+ }
+
+ public JobConstraint andRunWhenDone(Job constrainedJob) {
+ return new JobConstraint(job).runWhenDone(constrainedJob);
+ }
+
+ public class JobConstraint {
+ private Job job;
+
+ private JobConstraint(Job job) {
+ this.job = job;
+ }
+
+ public JobConstraint runWhenDone(final Job constrainedJob) {
+ job.addJobChangeListener(new JobChangeAdapter() {
+
+ @Override
+ public void done(IJobChangeEvent event) {
+ constrainedJob.schedule();
+ }});
+ return new JobConstraint(constrainedJob);
+ }
+
+ public void schedule() {
+ JobChainBuilder.this.job.schedule();
+ }
+
+ public Job build() {
+ return JobChainBuilder.this.job;
+ }
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobChainBuilder.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java 2012-09-18 13:01:10 UTC (rev 43795)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java 2012-09-18 15:13:09 UTC (rev 43796)
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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 Incorporated - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui.utils;
-
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-
-/**
- * @author Andre Dietisheim
- */
-public class JobScheduler {
-
- private Job job;
-
- public JobScheduler(Job job) {
- this.job = job;
- }
-
- public JobConstraint runWhenDone(Job constrainedJob) {
- return new JobConstraint(job).runWhenDone(constrainedJob);
- }
-
- public class JobConstraint {
- private Job job;
-
- private JobConstraint(Job job) {
- this.job = job;
- }
-
- public JobConstraint runWhenDone(final Job constrainedJob) {
- job.addJobChangeListener(new JobChangeAdapter() {
-
- @Override
- public void done(IJobChangeEvent event) {
- constrainedJob.schedule();
- }});
- return new JobConstraint(constrainedJob);
- }
-
- public void schedule() {
- JobScheduler.this.job.schedule();
- }
- }
-}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java 2012-09-18 13:01:10 UTC (rev 43795)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizard.java 2012-09-18 15:13:09 UTC (rev 43796)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.wizard.Wizard;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
@@ -28,8 +29,8 @@
@Override
public boolean performFinish() {
- addSSHKeyWizardPage.addConfiguredSSHKey();
- return true;
+ IStatus status = addSSHKeyWizardPage.addConfiguredSSHKey();
+ return status.isOK();
}
@Override
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java 2012-09-18 13:01:10 UTC (rev 43795)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPage.java 2012-09-18 15:13:09 UTC (rev 43796)
@@ -10,14 +10,26 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.ValidationStatusProvider;
import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.validation.MultiValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -28,13 +40,19 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.databinding.AlphanumericStringValidator;
import org.jboss.tools.openshift.express.internal.ui.databinding.RequiredControlDecorationUpdater;
import org.jboss.tools.openshift.express.internal.ui.utils.SSHUtils;
+import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
import org.jboss.tools.openshift.express.internal.ui.wizard.AbstractOpenShiftWizardPage;
+import com.openshift.client.OpenShiftException;
+import com.openshift.client.SSHPublicKey;
+
/**
* @author André Dietisheim
*/
@@ -70,7 +88,22 @@
.align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).applyTo(nameText);
Binding nameBinding = ValueBindingBuilder
.bind(WidgetProperties.text(SWT.Modify).observe(nameText))
- .validatingAfterConvert(new AlphanumericStringValidator("key name"))
+ .validatingAfterConvert(new AlphanumericStringValidator("key name") {
+
+ @Override
+ public IStatus validate(Object value) {
+ IStatus validationStatus = super.validate(value);
+ if (!validationStatus.isOK()) {
+ return validationStatus;
+ }
+ String keyName = (String) value;
+ if (pageModel.hasKeyName(keyName)) {
+ return ValidationStatus.error("There's already a key with the name " + keyName);
+ }
+ return ValidationStatus.ok();
+ }
+
+ })
.to(BeanProperties.value(AddSSHKeyWizardPageModel.PROPERTY_NAME).observe(pageModel))
.notUpdatingParticipant()
.in(dbc);
@@ -86,13 +119,12 @@
fileText.setEditable(false);
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(fileText);
- Binding filePathBinding = ValueBindingBuilder
- .bind(WidgetProperties.text(SWT.Modify).observe(fileText))
- .validatingAfterConvert(new AlphanumericStringValidator("key file"))
+ IObservableValue filePathObservable =
+ WidgetProperties.text(SWT.Modify).observe(fileText);
+ ValueBindingBuilder
+ .bind(filePathObservable)
.to(BeanProperties.value(AddSSHKeyWizardPageModel.PROPERTY_FILEPATH).observe(pageModel))
.in(dbc);
- ControlDecorationSupport.create(
- filePathBinding, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater());
Button browseButton = new Button(addSSHKeyGroup, SWT.PUSH);
browseButton.setText("Browse...");
@@ -100,6 +132,10 @@
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.CENTER).applyTo(browseButton);
+ ValidationStatusProvider sshPublicKeyValidator = new SSHPublicKeyValidator(filePathObservable);
+ dbc.addValidationStatusProvider(sshPublicKeyValidator);
+ ControlDecorationSupport.create(
+ sshPublicKeyValidator, SWT.LEFT | SWT.TOP, null, new RequiredControlDecorationUpdater());
}
private SelectionListener onBrowse() {
@@ -117,7 +153,62 @@
};
}
- public void addConfiguredSSHKey() {
- pageModel.addConfiguredSSHKey();
+ public IStatus addConfiguredSSHKey() {
+ try {
+ return WizardUtils.runInWizard(new AddSSHKeyJob(), getContainer());
+ } catch (Exception e) {
+ return OpenShiftUIActivator.createErrorStatus("Could not add ssh key " + pageModel.getName() + ".");
+ }
}
+
+ private class AddSSHKeyJob extends Job {
+
+ public AddSSHKeyJob() {
+ super("Adding SSH key " + pageModel.getName() + "...");
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ pageModel.addConfiguredSSHKey();
+ return Status.OK_STATUS;
+ } catch (Exception e) {
+ return OpenShiftUIActivator.createErrorStatus(
+ NLS.bind("Could not add SSH key {0} to OpenShift", pageModel.getName()), e);
+ }
+ }
+ }
+
+ public class SSHPublicKeyValidator extends MultiValidator {
+
+ private IObservableValue filePathObservable;
+
+ public SSHPublicKeyValidator(IObservableValue filePathObservable) {
+ this.filePathObservable = filePathObservable;
+ }
+
+ @Override
+ protected IStatus validate() {
+ String filePath = (String) filePathObservable.getValue();
+ if (StringUtils.isEmpty(filePath)) {
+ return ValidationStatus.cancel("You have to supply a public SSH key.");
+ }
+ try {
+ SSHPublicKey sshPublicKey = new SSHPublicKey(filePath);
+ if (pageModel.hasPublicKey(sshPublicKey.getPublicKey())) {
+ return ValidationStatus.error("The public key in " + filePath + " is already in use on OpenShift. Choose another key.");
+ }
+ } catch (FileNotFoundException e) {
+ return ValidationStatus.error("Could not load file: " + e.getMessage());
+ } catch (OpenShiftException e) {
+ return ValidationStatus.error(filePath + "is not a valid public SSH key: " + e.getMessage());
+ } catch (IOException e) {
+ return ValidationStatus.error("Could not load file: " + e.getMessage());
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ }
+
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPageModel.java 2012-09-18 13:01:10 UTC (rev 43795)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/AddSSHKeyWizardPageModel.java 2012-09-18 15:13:09 UTC (rev 43796)
@@ -10,9 +10,16 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
+import com.openshift.client.OpenShiftException;
+import com.openshift.client.SSHPublicKey;
+
/**
* @author Andre Dietisheim
*/
@@ -44,8 +51,19 @@
public void setFilePath(String filePath) {
firePropertyChange(PROPERTY_FILEPATH, this.filePath, this.filePath = filePath);
}
-
- public void addConfiguredSSHKey() {
+
+ public boolean hasKeyName(String name) {
+ return user.hasSSHKeyName(name);
}
+
+ public boolean hasPublicKey(String publicKeyContent) {
+ return user.hasSSHPublicKey(publicKeyContent);
+ }
+
+ public void addConfiguredSSHKey() throws FileNotFoundException, OpenShiftException, IOException {
+ SSHPublicKey sshPublicKey = new SSHPublicKey(new File(filePath));
+ user.putSSHKey(name, sshPublicKey);
+ }
+
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java 2012-09-18 13:01:10 UTC (rev 43795)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java 2012-09-18 15:13:09 UTC (rev 43796)
@@ -11,8 +11,6 @@
package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Collection;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.beans.BeanProperties;
@@ -41,7 +39,7 @@
import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-import org.jboss.tools.openshift.express.internal.ui.utils.JobScheduler;
+import org.jboss.tools.openshift.express.internal.ui.utils.JobChainBuilder;
import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.TableViewerBuilder;
import org.jboss.tools.openshift.express.internal.ui.utils.TableViewerBuilder.IColumnLabelProvider;
@@ -79,8 +77,8 @@
GridDataFactory.fillDefaults()
.span(1, 5).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(tableContainer);
ValueBindingBuilder.bind(ViewerProperties.singleSelection().observe(viewer))
- .to(BeanProperties.value(ManageSSHKeysWizardPageModel.PROPERTY_SELECTED_KEY).observe(pageModel))
- .in(dbc);
+ .to(BeanProperties.value(ManageSSHKeysWizardPageModel.PROPERTY_SELECTED_KEY).observe(pageModel))
+ .in(dbc);
Button addButton = new Button(sshKeysGroup, SWT.PUSH);
GridDataFactory.fillDefaults()
@@ -122,13 +120,15 @@
"Are you sure that you want to remove public SSH key {0} from OpenShift?",
keyName)))
try {
- RemoveKeyJob removeSSHKeyJob = new RemoveKeyJob();
- new JobScheduler(removeSSHKeyJob).runWhenDone(new RefreshViewerJob());
- setViewerInput(pageModel.getSSHKeys());
- WizardUtils.runInWizard(removeSSHKeyJob, getContainer()) ;
+ WizardUtils.runInWizard(
+ new JobChainBuilder(
+ new RemoveKeyJob()).andRunWhenDone(new RefreshViewerJob())
+ .build()
+ , getContainer());
} catch (Exception ex) {
StatusManager.getManager().handle(
- OpenShiftUIActivator.createErrorStatus("Could not remove key " + keyName + ".", ex), StatusManager.LOG);
+ OpenShiftUIActivator.createErrorStatus("Could not remove key " + keyName + ".", ex),
+ StatusManager.LOG);
}
}
};
@@ -140,6 +140,14 @@
@Override
public void widgetSelected(SelectionEvent e) {
WizardUtils.openWizardDialog(new AddSSHKeyWizard(pageModel.getUser()), getShell());
+ try {
+ WizardUtils.runInWizard(
+ new RefreshViewerJob(),
+ getContainer());
+ } catch (Exception ex) {
+ StatusManager.getManager().handle(
+ OpenShiftUIActivator.createErrorStatus("Could not refresh keys.", ex), StatusManager.LOG);
+ }
}
};
}
@@ -184,7 +192,7 @@
protected void onPageActivated(DataBindingContext dbc) {
try {
Job loadKeysJob = new LoadKeysJob();
- new JobScheduler(loadKeysJob).runWhenDone(new RefreshViewerJob());
+ new JobChainBuilder(loadKeysJob).andRunWhenDone(new RefreshViewerJob());
WizardUtils.runInWizard(loadKeysJob, getContainer());
} catch (Exception e) {
StatusManager.getManager().handle(
@@ -199,7 +207,7 @@
public void widgetSelected(SelectionEvent e) {
try {
Job refreshKeysJob = new RefreshKeysJob();
- new JobScheduler(refreshKeysJob).runWhenDone(new RefreshViewerJob());
+ new JobChainBuilder(refreshKeysJob).andRunWhenDone(new RefreshViewerJob());
WizardUtils.runInWizard(refreshKeysJob, getContainer());
} catch (Exception ex) {
StatusManager.getManager().handle(
@@ -210,22 +218,8 @@
};
}
- private void clearViewer() {
- setViewerInput(new ArrayList<IOpenShiftSSHKey>());
- }
-
- private void setViewerInput(final Collection<IOpenShiftSSHKey> keys) {
- getShell().getDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- viewer.setInput(keys);
- }
- });
- }
-
private class RemoveKeyJob extends Job {
-
+
private RemoveKeyJob() {
super("Removing SSH key " + pageModel.getSelectedSSHKey().getName() + "...");
}
@@ -236,9 +230,9 @@
return Status.OK_STATUS;
}
}
-
+
private class RefreshKeysJob extends Job {
-
+
private RefreshKeysJob() {
super("Refreshing SSH keys... ");
}
@@ -251,7 +245,7 @@
}
private class LoadKeysJob extends Job {
-
+
private LoadKeysJob() {
super("Loading SSH keys... ");
}
@@ -277,4 +271,3 @@
}
}
-
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java 2012-09-18 13:01:10 UTC (rev 43795)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java 2012-09-18 15:13:09 UTC (rev 43796)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
-import java.util.ArrayList;
import java.util.List;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
@@ -23,11 +22,9 @@
*/
public class ManageSSHKeysWizardPageModel extends ObservableUIPojo {
- public static final String PROPERTY_SSH_KEYS = "SSHKeys";
public static final String PROPERTY_SELECTED_KEY = "selectedSSHKey";
private UserDelegate user;
- private List<IOpenShiftSSHKey> keys = new ArrayList<IOpenShiftSSHKey>();
private IOpenShiftSSHKey selectedKey;
public ManageSSHKeysWizardPageModel(UserDelegate user) {
@@ -35,18 +32,13 @@
}
public List<IOpenShiftSSHKey> loadSSHKeys() {
- return setSSHKeys(user.getSSHKeys());
+ return user.getSSHKeys();
}
public List<IOpenShiftSSHKey> getSSHKeys() {
- return keys;
+ return user.getSSHKeys();
}
-
- public List<IOpenShiftSSHKey> setSSHKeys(List<IOpenShiftSSHKey> keys) {
- firePropertyChange(PROPERTY_SSH_KEYS, this.keys, this.keys = keys);
- return this.keys;
- }
-
+
public IOpenShiftSSHKey getSelectedSSHKey() {
return selectedKey;
}
@@ -60,12 +52,10 @@
return;
}
selectedKey.destroy();
- setSSHKeys(user.getSSHKeys());
}
public void refresh() {
user.refresh();
- setSSHKeys(user.getSSHKeys());
}
public UserDelegate getUser() {
13 years, 6 months
JBoss Tools SVN: r43794 - in trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core: src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-09-18 08:45:37 -0400 (Tue, 18 Sep 2012)
New Revision: 43794
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.xml
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsApplicationValidatorDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceValidatorDelegate.java
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java
Log:
Fixed - JBIDE-10287 Add support for JAX-RS Application
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.xml
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.xml 2012-09-18 12:25:27 UTC (rev 43793)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/plugin.xml 2012-09-18 12:45:37 UTC (rev 43794)
@@ -85,6 +85,9 @@
<super
type="org.eclipse.core.resources.problemmarker">
</super>
+ <persistent
+ value="true">
+ </persistent>
</extension>
<extension
point="org.jboss.tools.common.validation.validator">
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsApplicationValidatorDelegate.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsApplicationValidatorDelegate.java 2012-09-18 12:25:27 UTC (rev 43793)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsApplicationValidatorDelegate.java 2012-09-18 12:45:37 UTC (rev 43794)
@@ -1,5 +1,6 @@
package org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.common.validation.TempMarkerManager;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsJavaApplication;
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-09-18 12:25:27 UTC (rev 43793)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsMetamodelValidator.java 2012-09-18 12:45:37 UTC (rev 43794)
@@ -87,10 +87,28 @@
*/
public IStatus validate(Set<IFile> changedFiles, IProject project, ContextValidationHelper validationHelper,
IProjectValidationContext context, ValidatorManager manager, IReporter reporter) throws ValidationException {
+ Logger.debug("*** Validating project {} after files {} changed... ***", project.getName(), changedFiles.toString());
init(project, validationHelper, context, manager, reporter);
setAsYouTypeValidation(false);
- for (IFile changedFile : changedFiles) {
- validate(reporter, changedFile);
+ try {
+ if (!changedFiles.isEmpty()) {
+ for (IFile changedFile : changedFiles) {
+ try {
+ final JaxrsMetamodel jaxrsMetamodel = JaxrsMetamodelLocator.get(changedFile.getProject());
+ validateJaxrsApplicationDeclarations(jaxrsMetamodel);
+ validate(reporter, changedFile, jaxrsMetamodel);
+ } catch (CoreException e) {
+ Logger.error("Failed to validate changed file " + changedFile.getName() + " in project "
+ + changedFile.getProject(), e);
+ }
+ }
+ }
+ // trigger a full validation instead
+ else {
+ validateAll(project, validationHelper, context, manager, reporter);
+ }
+ } finally {
+ Logger.debug("Validation done.");
}
return Status.OK_STATUS;
}
@@ -100,15 +118,13 @@
* @param file
* @throws CoreException
*/
- private void validate(final IReporter reporter, final IFile file) {
+ private void validate(final IReporter reporter, final IFile file, final JaxrsMetamodel jaxrsMetamodel) {
if (reporter.isCancelled() || !file.isAccessible()) {
return;
}
displaySubtask(JaxrsValidationMessages.VALIDATING_RESOURCE,
new String[] { file.getProject().getName(), file.getName() });
try {
- // clearMarkers((IFile) resource);
- final JaxrsMetamodel jaxrsMetamodel = JaxrsMetamodelLocator.get(file.getProject());
if (jaxrsMetamodel != null) {
List<JaxrsBaseElement> elements = jaxrsMetamodel.getElements(JdtUtils.getCompilationUnit(file));
for (JaxrsBaseElement element : elements) {
@@ -124,6 +140,7 @@
public void validate(org.eclipse.wst.validation.internal.provisional.core.IValidator validatorManager,
IProject rootProject, Collection<IRegion> dirtyRegions, IValidationContext helper, IReporter reporter,
EditorValidationContext validationContext, IProjectValidationContext projectContext, IFile file) {
+ Logger.debug("*** Validating project {} after file {} changed... ***", file.getProject().getName(), file.getFullPath());
ContextValidationHelper validationHelper = new ContextValidationHelper();
validationHelper.setProject(rootProject);
validationHelper.setValidationContextManager(validationContext);
@@ -132,13 +149,24 @@
this.document = validationContext.getDocument();
displaySubtask(JaxrsValidationMessages.VALIDATING_RESOURCE,
new String[] { file.getProject().getName(), file.getName() });
- validate(reporter, file);
+ try {
+ final JaxrsMetamodel jaxrsMetamodel = JaxrsMetamodelLocator.get(file.getProject());
+ validateJaxrsApplicationDeclarations(jaxrsMetamodel);
+ validate(reporter, file, jaxrsMetamodel);
+ } catch (CoreException e) {
+ Logger.error(
+ "Failed to validate changed file " + file.getName() + " in project "
+ + file.getProject(), e);
+ } finally {
+ Logger.debug("Validation done.");
+ }
}
@Override
public IStatus validateAll(IProject project, ContextValidationHelper validationHelper,
IProjectValidationContext validationContext, ValidatorManager manager, IReporter reporter)
throws ValidationException {
+ Logger.debug("*** Validating all files in project {} ***", project.getName());
init(project, validationHelper, validationContext, manager, reporter);
setAsYouTypeValidation(false);
displaySubtask(JaxrsValidationMessages.VALIDATING_PROJECT, new String[] { project.getName() });
@@ -154,12 +182,17 @@
}
} catch (CoreException e) {
Logger.error("Failed to validate project '", e);
+ } finally {
+ Logger.debug("Validation done.");
}
return Status.OK_STATUS;
}
private void validateJaxrsApplicationDeclarations(JaxrsMetamodel jaxrsMetamodel) throws CoreException {
+ if(jaxrsMetamodel == null) {
+ return;
+ }
MarkerUtils.clearMarkers(jaxrsMetamodel.getProject());
final List<IJaxrsApplication> allApplications = jaxrsMetamodel.getAllApplications();
if(allApplications.isEmpty()) {
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceValidatorDelegate.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceValidatorDelegate.java 2012-09-18 12:25:27 UTC (rev 43793)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/JaxrsResourceValidatorDelegate.java 2012-09-18 12:45:37 UTC (rev 43794)
@@ -1,5 +1,6 @@
package org.jboss.tools.ws.jaxrs.core.internal.metamodel.validation;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.common.validation.TempMarkerManager;
import org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsResource;
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java 2012-09-18 12:25:27 UTC (rev 43793)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/validation/MarkerUtils.java 2012-09-18 12:45:37 UTC (rev 43794)
@@ -20,12 +20,12 @@
*/
public class MarkerUtils {
- public static void clearMarkers(IResource resource) throws CoreException {
+ public static void clearMarkers(final IResource resource) throws CoreException {
if (resource == null) {
return;
}
- Logger.debug("Clearing JAXRS markers for resource " + resource.getName());
- resource.deleteMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, true, org.eclipse.core.resources.IResource.DEPTH_INFINITE);
+ Logger.debug("Clearing JAX-RS markers for resource " + resource.getName());
+ resource.deleteMarkers(JaxrsMetamodelValidator.JAXRS_PROBLEM_TYPE, true, IResource.DEPTH_ONE);
}
}
13 years, 6 months
JBoss Tools SVN: r43793 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-09-18 08:25:27 -0400 (Tue, 18 Sep 2012)
New Revision: 43793
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/panel.xhtml.xml
Log:
https://issues.jboss.org/browse/JBIDE-12557 - path to resource on server was updated.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/panel.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/panel.xhtml.xml 2012-09-18 11:56:10 UTC (rev 43792)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/panel.xhtml.xml 2012-09-18 12:25:27 UTC (rev 43793)
@@ -17,7 +17,7 @@
<test id="p2">
<DIV CLASS="dr-pnl rich-panel">
<DIV VPE-FACET="header" CLASS="dr-pnl-h rich-panel-header headerClass"
- STYLE="/.*richfaces/resources/common/background.gif/">
+ STYLE="/.*resources/common/background.gif/">
<SPAN CLASS="vpe-text">
-Text_H1
</SPAN>
13 years, 6 months
JBoss Tools SVN: r43792 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: wizard/ssh and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-09-18 07:56:10 -0400 (Tue, 18 Sep 2012)
New Revision: 43792
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java
Log:
[JBIDE-11912] implemented key removal
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java 2012-09-18 10:20:16 UTC (rev 43791)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/JobScheduler.java 2012-09-18 11:56:10 UTC (rev 43792)
@@ -25,21 +25,29 @@
this.job = job;
}
- public class ChainedJob {
+ public JobConstraint runWhenDone(Job constrainedJob) {
+ return new JobConstraint(job).runWhenDone(constrainedJob);
+ }
+
+ public class JobConstraint {
private Job job;
- private ChainedJob(Job job) {
+ private JobConstraint(Job job) {
this.job = job;
}
- public ChainedJob andWhenDone(final Job constrainedJob) {
+ public JobConstraint runWhenDone(final Job constrainedJob) {
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
constrainedJob.schedule();
}});
- return new ChainedJob(constrainedJob);
+ return new JobConstraint(constrainedJob);
}
+
+ public void schedule() {
+ JobScheduler.this.job.schedule();
+ }
}
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java 2012-09-18 10:20:16 UTC (rev 43791)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/StringUtils.java 2012-09-18 11:56:10 UTC (rev 43792)
@@ -91,9 +91,10 @@
if (text.length() < maxLength) {
return text;
}
-
- return new StringBuilder(text.substring(0, maxLength - SHORTENING_MARKER.length()))
+ int availableCharacters = maxLength - SHORTENING_MARKER.length();
+ return new StringBuilder(text.substring(0, availableCharacters / 2))
.append(SHORTENING_MARKER)
+ .append(text.substring(text.length() - availableCharacters / 2, text.length()))
.toString();
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java 2012-09-18 10:20:16 UTC (rev 43791)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPage.java 2012-09-18 11:56:10 UTC (rev 43792)
@@ -10,14 +10,18 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard.ssh;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.BeanProperties;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.databinding.viewers.ViewerProperties;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.viewers.ArrayContentProvider;
@@ -31,14 +35,16 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Table;
+import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.statushandlers.StatusManager;
import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.utils.JobScheduler;
import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.TableViewerBuilder;
import org.jboss.tools.openshift.express.internal.ui.utils.TableViewerBuilder.IColumnLabelProvider;
-import org.jboss.tools.openshift.express.internal.ui.utils.UIUpdatingJob;
import org.jboss.tools.openshift.express.internal.ui.wizard.AbstractOpenShiftWizardPage;
import com.openshift.client.IOpenShiftSSHKey;
@@ -72,13 +78,16 @@
this.viewer = createTable(tableContainer);
GridDataFactory.fillDefaults()
.span(1, 5).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(tableContainer);
+ ValueBindingBuilder.bind(ViewerProperties.singleSelection().observe(viewer))
+ .to(BeanProperties.value(ManageSSHKeysWizardPageModel.PROPERTY_SELECTED_KEY).observe(pageModel))
+ .in(dbc);
Button addButton = new Button(sshKeysGroup, SWT.PUSH);
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.FILL).applyTo(addButton);
addButton.setText("Add Existing...");
addButton.addSelectionListener(onAdd());
-
+
Button newButton = new Button(sshKeysGroup, SWT.PUSH);
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.FILL).applyTo(newButton);
@@ -88,6 +97,7 @@
GridDataFactory.fillDefaults()
.align(SWT.FILL, SWT.FILL).applyTo(removeButton);
removeButton.setText("Remove...");
+ removeButton.addSelectionListener(onRemove());
Composite filler = new Composite(sshKeysGroup, SWT.None);
GridDataFactory.fillDefaults()
@@ -100,6 +110,30 @@
refreshButton.addSelectionListener(onRefresh());
}
+ private SelectionListener onRemove() {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ String keyName = pageModel.getSelectedSSHKey().getName();
+ if (MessageDialog.openConfirm(getShell(),
+ "Remove SSH Key",
+ MessageFormat.format(
+ "Are you sure that you want to remove public SSH key {0} from OpenShift?",
+ keyName)))
+ try {
+ RemoveKeyJob removeSSHKeyJob = new RemoveKeyJob();
+ new JobScheduler(removeSSHKeyJob).runWhenDone(new RefreshViewerJob());
+ setViewerInput(pageModel.getSSHKeys());
+ WizardUtils.runInWizard(removeSSHKeyJob, getContainer()) ;
+ } catch (Exception ex) {
+ StatusManager.getManager().handle(
+ OpenShiftUIActivator.createErrorStatus("Could not remove key " + keyName + ".", ex), StatusManager.LOG);
+ }
+ }
+ };
+ }
+
private SelectionListener onAdd() {
return new SelectionAdapter() {
@@ -149,23 +183,12 @@
@Override
protected void onPageActivated(DataBindingContext dbc) {
try {
- WizardUtils.runInWizard(new Job("Loading ssh keys...") {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- setViewerInput(pageModel.loadSSHKeys());
- pageModel.loadSSHKeys();
- return Status.OK_STATUS;
- } catch (Exception e) {
- clearViewer();
- return OpenShiftUIActivator.createErrorStatus("Could not load ssh keys.", e);
- }
- }
-
- }, getContainer(), getDataBindingContext());
+ Job loadKeysJob = new LoadKeysJob();
+ new JobScheduler(loadKeysJob).runWhenDone(new RefreshViewerJob());
+ WizardUtils.runInWizard(loadKeysJob, getContainer());
} catch (Exception e) {
- // ignore
+ StatusManager.getManager().handle(
+ OpenShiftUIActivator.createErrorStatus("Could not load ssh keys.", e), StatusManager.LOG);
}
}
@@ -175,15 +198,9 @@
@Override
public void widgetSelected(SelectionEvent e) {
try {
- WizardUtils.runInWizard(new UIUpdatingJob("Refreshing keys...") {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- pageModel.getUser().refresh();
- setViewerInput(pageModel.getUser().getSSHKeys());
- return Status.OK_STATUS;
- }
- }, getContainer());
+ Job refreshKeysJob = new RefreshKeysJob();
+ new JobScheduler(refreshKeysJob).runWhenDone(new RefreshViewerJob());
+ WizardUtils.runInWizard(refreshKeysJob, getContainer());
} catch (Exception ex) {
StatusManager.getManager().handle(
OpenShiftUIActivator.createErrorStatus("Could not refresh keys.", ex), StatusManager.LOG);
@@ -206,4 +223,58 @@
}
});
}
-}
\ No newline at end of file
+
+ private class RemoveKeyJob extends Job {
+
+ private RemoveKeyJob() {
+ super("Removing SSH key " + pageModel.getSelectedSSHKey().getName() + "...");
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ pageModel.removeKey();
+ return Status.OK_STATUS;
+ }
+ }
+
+ private class RefreshKeysJob extends Job {
+
+ private RefreshKeysJob() {
+ super("Refreshing SSH keys... ");
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ pageModel.refresh();
+ return Status.OK_STATUS;
+ }
+ }
+
+ private class LoadKeysJob extends Job {
+
+ private LoadKeysJob() {
+ super("Loading SSH keys... ");
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ pageModel.loadSSHKeys();
+ return Status.OK_STATUS;
+ }
+ }
+
+ private class RefreshViewerJob extends UIJob {
+
+ public RefreshViewerJob() {
+ super("Refreshing ssh keys...");
+ }
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ viewer.setInput(pageModel.getSSHKeys());
+ return Status.OK_STATUS;
+ }
+ }
+
+}
+
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java 2012-09-18 10:20:16 UTC (rev 43791)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ssh/ManageSSHKeysWizardPageModel.java 2012-09-18 11:56:10 UTC (rev 43792)
@@ -24,9 +24,11 @@
public class ManageSSHKeysWizardPageModel extends ObservableUIPojo {
public static final String PROPERTY_SSH_KEYS = "SSHKeys";
+ public static final String PROPERTY_SELECTED_KEY = "selectedSSHKey";
private UserDelegate user;
private List<IOpenShiftSSHKey> keys = new ArrayList<IOpenShiftSSHKey>();
+ private IOpenShiftSSHKey selectedKey;
public ManageSSHKeysWizardPageModel(UserDelegate user) {
this.user = user;
@@ -45,8 +47,30 @@
return this.keys;
}
+ public IOpenShiftSSHKey getSelectedSSHKey() {
+ return selectedKey;
+ }
+
+ public void setSelectedSSHKey(IOpenShiftSSHKey key) {
+ firePropertyChange(PROPERTY_SELECTED_KEY, this.selectedKey, this.selectedKey = key);
+ }
+
+ public void removeKey() {
+ if (selectedKey == null) {
+ return;
+ }
+ selectedKey.destroy();
+ setSSHKeys(user.getSSHKeys());
+ }
+
+ public void refresh() {
+ user.refresh();
+ setSSHKeys(user.getSSHKeys());
+ }
+
public UserDelegate getUser() {
return user;
}
+
}
13 years, 6 months
JBoss Tools SVN: r43791 - trunk/central/plugins/org.jboss.tools.central.themes/css.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-09-18 06:20:16 -0400 (Tue, 18 Sep 2012)
New Revision: 43791
Modified:
trunk/central/plugins/org.jboss.tools.central.themes/css/jbt.css
Log:
JBIDE-12552: Fix bundleClass.
Modified: trunk/central/plugins/org.jboss.tools.central.themes/css/jbt.css
===================================================================
--- trunk/central/plugins/org.jboss.tools.central.themes/css/jbt.css 2012-09-18 10:18:08 UTC (rev 43790)
+++ trunk/central/plugins/org.jboss.tools.central.themes/css/jbt.css 2012-09-18 10:20:16 UTC (rev 43791)
@@ -3,9 +3,9 @@
*/
.jeeeyul-chrome-theme{
/*
- * This selector rule is exist for detect Chrome Theme to find rewrite target.
+ * This selector rule is exist for detect Chrome Theme to find rewrite target.
* See "RewriteChormeCSS.java"
- */
+ */
}
.MTrimmedWindow.topLevel {
@@ -20,22 +20,22 @@
font-family: 'Arial';
swt-simple: true;
swt-tab-renderer:
- url('bundleclass://net.jeeeyul.eclipse.themes/net.jeeeyul.eclipse.themes.rendering.ChromeTabRendering');
+ url('bundleclass://org.jboss.tools.central.themes/net.jeeeyul.eclipse.themes.rendering.ChromeTabRendering');
padding: 1px 6px 8px 6px; /* top left bottom right */
swt-tab-outline: #b39797;
swt-outer-keyline-color: #b39797;
swt-unselected-tabs-color: #ecd2d2 #e0c3c3 #ffffff 99% 100%;
swt-shadow-visible: true;
-
+
swt-selected-tab-fill: #ffffff;
chrome-selected-tab-fill-highlight: #ffffff;
-
+
chrome-selected-tab-color: #000000;
chrome-unselected-tab-color: #000000;
-
+
swt-shadow-color: #e0c2c2;
-
+
chrome-shiney-shadow: true;
swt-mru-visible: true;
}
@@ -45,10 +45,10 @@
swt-tab-outline: #7b5d5d;
swt-outer-keyline-color: #7b5d5d;
swt-unselected-tabs-color: #b36b6b #aa5b5b #ffffff 99% 100%;
-
+
swt-selected-tab-fill: #ffffff;
chrome-selected-tab-fill-highlight: #ffffff;
-
+
chrome-selected-tab-color: #983030;
chrome-unselected-tab-color: #ffffff;
chrome-shiney-shadow: false;
13 years, 6 months
JBoss Tools SVN: r43790 - trunk/openshift/plugins/org.jboss.tools.openshift.express.client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-09-18 06:18:08 -0400 (Tue, 18 Sep 2012)
New Revision: 43790
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-2.0.0-SNAPSHOT.jar
Log:
[JBIDE-11912] committed latest openshift-java-client with IUser#deleteKey(name)
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-2.0.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
13 years, 6 months
JBoss Tools SVN: r43789 - in trunk: as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules and 12 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-09-18 06:15:59 -0400 (Tue, 18 Sep 2012)
New Revision: 43789
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/LocalExploreBehavior.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedJSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/OSGiPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/defect/PublishWeb2DeletesWeb1LibsTest.java
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java
Log:
JBIDE-12613 adding api to IDeployableServer because it otherwise lived inside an internal utility class
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2012-09-18 10:15:59 UTC (rev 43789)
@@ -51,56 +51,9 @@
</nodeContribution>
</extension>
- <!--
- * With these actions removed, if they never return, a large
- portion of this plugin and it's classes can be deprecated
- and eventually removed *
-
<extension
- point="org.jboss.ide.eclipse.archives.ui.newArchiveActions">
- <newPackageAction
- class="org.jboss.ide.eclipse.archives.webtools.ui.NewWARAction"
- icon="$nl$/icons/war.gif"
- id="org.jboss.ide.eclipse.packages.ui.newWARAction"
- label="%newPackageAction.label.war"/>
- <newPackageAction
- class="org.jboss.ide.eclipse.archives.webtools.ui.NewEJBJARAction"
- icon="$nl$/icons/EJBJar.gif"
- id="org.jboss.ide.eclipse.packages.ui.newEJBJarAction"
- label="%newPackageAction.label.ejbJar"/>
- <newPackageAction
- class="org.jboss.ide.eclipse.archives.webtools.ui.NewEARAction"
- icon="$nl$/icons/ear.gif"
- id="org.jboss.ide.eclipse.packages.ui.newEARAction"
- label="%newPackageAction.label.ear"/>
- </extension>
-
- -->
-
- <extension
point="org.jboss.ide.eclipse.as.core.publishers">
- <!--
<publisher
- class="org.jboss.ide.eclipse.archives.webtools.modules.PackagesPublisher"
- priority="5">
- </publisher>
- <publisher
- class="org.jboss.ide.eclipse.archives.webtools.modules.WTPZippedPublisher"
- priority="2"
- zipDelegate="true">
- </publisher>
- <publisher
- class="org.jboss.ide.eclipse.archives.webtools.modules.SingleFolderZippedPublisher"
- priority="2"
- zipDelegate="true">
- </publisher>
- <publisher
- class="org.jboss.ide.eclipse.archives.webtools.modules.AltMethodZippedFolderPublisher"
- priority="8"
- zipDelegate="true">
- </publisher>
- -->
- <publisher
class="org.jboss.ide.eclipse.archives.webtools.modules.AltMethodZippedJSTPublisher"
priority="3"
zipDelegate="true">
@@ -112,8 +65,6 @@
</publisher>
</extension>
-
-
<extension
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedJSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedJSTPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedJSTPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -18,6 +18,7 @@
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.wst.server.core.IModule;
@@ -26,11 +27,13 @@
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.Trace;
import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
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.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.internal.v7.DeploymentMarkerUtils;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -40,7 +43,85 @@
* It extends the functionality of the local zipped publishing class
* by uploading the file after building it in a temporary directory
*/
-public class AltMethodZippedJSTPublisher extends WTPZippedPublisher {
+public class AltMethodZippedJSTPublisher implements IJBossServerPublisher {
+
+ private int moduleState = IServer.PUBLISH_STATE_NONE;
+ private boolean requiresTransfer = true;
+
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ return ds != null && (module == null || ds.zipsWTPDeployments());
+ }
+
+ public int getPublishState() {
+ return moduleState;
+ }
+ public boolean requiresTransfer() {
+ return requiresTransfer;
+ }
+
+ protected IStatus localTempPublishModule(
+ IJBossServerPublishMethod method,
+ IServer server, IModule[] module,
+ int publishType, IModuleResourceDelta[] delta,
+ IProgressMonitor monitor) throws CoreException {
+ // Build all parts together at once.
+ // When a call for [ear, childWar] comes in, ignore it.
+ IStatus status = Status.OK_STATUS;
+
+ if( module.length > 1 )
+ return null;
+
+ if( DeploymentMarkerUtils.supportsJBoss7MarkerDeployment(server)) {
+ requiresTransfer = false;
+ status = handleJBoss7Deployment(method, server, module, publishType, delta, monitor);
+ } else {
+ Trace.trace(Trace.STRING_FINER, "Using as<=6 publishModule logic in WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
+ requiresTransfer = true;
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ String deployRoot = getDeployRoot(module, ds);
+ LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
+ status = util.publishModule(server, deployRoot, module, publishType, delta, monitor);
+ Trace.trace(Trace.STRING_FINER, "Zipping complete for module " + module[module.length-1].getName() ); //$NON-NLS-1$ monitor.done();
+ }
+ return status;
+ }
+
+ public IStatus handleJBoss7Deployment(
+ IJBossServerPublishMethod method,
+ IServer server, IModule[] module,
+ int publishType, IModuleResourceDelta[] delta,
+ IProgressMonitor monitor) throws CoreException {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ String deployRoot = getDeployRoot(module, ds);
+ if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
+ Trace.trace(Trace.STRING_FINER, "Removing .dodeploy marker in WTPZippedPublisher to undeploy module " + module[module.length-1].getName() ); //$NON-NLS-1$
+ DeploymentMarkerUtils.removeDeployedMarkerIfExists(method, ds, module, monitor);
+ } else {
+ Trace.trace(Trace.STRING_FINER, "Zipping module in WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
+ LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
+ IStatus s = util.publishModule(server, deployRoot, module, publishType, delta, monitor);
+ IPath outPath = util.getOutputFilePath();
+ if( util.hasBeenChanged()) {
+ Trace.trace(Trace.STRING_FINER, "Output zip changed. Copying file to destination. WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
+
+ // Copy out file
+ IPath depPath = ds.getDeploymentLocation(module, true);
+ IPath folder = depPath.removeLastSegments(1);
+ IPublishCopyCallbackHandler callback = method.getCallbackHandler(folder, server);
+ IModuleFile mf = new ModuleFile(outPath.toFile(), "", new Path("/")); //$NON-NLS-1$ //$NON-NLS-2$
+ callback.copyFile(mf, new Path(depPath.lastSegment()), monitor);
+
+ // Add marker
+ DeploymentMarkerUtils.addDoDeployMarker(method, ds, module, new NullProgressMonitor());
+ }
+ monitor.done();
+ return s;
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+
/**
* Here we put the deployment first in a temporary remote deploy folder
* Then during the publishModule call, we'll also upload it to remote machine
@@ -56,33 +137,34 @@
private IServer server;
private IJBossServerPublishMethod method;
- @Override
public IStatus publishModule(
IJBossServerPublishMethod method,
IServer server, IModule[] module,
int publishType, IModuleResourceDelta[] delta,
IProgressMonitor monitor) throws CoreException {
+
+ this.module = module;
+ this.server = server;
+ this.method = method;
+
+ String taskName = "Publishing " + module[0].getName(); //$NON-NLS-1$
+ monitor.beginTask(taskName, 200);
+ monitor.setTaskName(taskName);
+ if( module.length > 1 ) {
+ // Skip any module of length > 1, since a zip does it
+ // all in one attempt.
+ return null;
+ }
+
+ monitor.setTaskName("Publishing to remote server " + server.getName()); //$NON-NLS-1$
+
try {
- this.module = module;
- this.server = server;
- this.method = method;
- String taskName = "Publishing " + module[0].getName(); //$NON-NLS-1$
- monitor.beginTask(taskName, 200);
- monitor.setTaskName(taskName);
- if( module.length > 1 ) {
- return null;
- }
-
- monitor.setTaskName("Publishing to remote server " + server.getName()); //$NON-NLS-1$
-
-
-
// set up needed vars
IDeployableServer server2 = ServerConverter.getDeployableServer(server);
String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
- IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot, server2);
- IPath destination = PublishUtil.getDeployPath(method, module, server2);
+ IPath sourcePath = PublishUtil.getModuleNestedDeployPath(module, remoteTempDeployRoot, server2);
+ IPath destination = server2.getDeploymentLocation(module, true);
String name = sourcePath.lastSegment();
IStatus result = null;
@@ -122,12 +204,12 @@
IProgressMonitor monitor) throws CoreException {
IDeployableServer server2 = ServerConverter.getDeployableServer(server);
String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
- IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot, server2);
- IPath destination = PublishUtil.getDeployPath(method, module, server2);
+ IPath sourcePath = PublishUtil.getModuleNestedDeployPath(module, remoteTempDeployRoot, server2);
+ IPath destination = server2.getDeploymentLocation(module, true);
String name = sourcePath.lastSegment();
// Locally zip it up into the remote tmp folder
- IStatus result = super.publishModule(method, server, module, publishType, delta, monitor);
+ IStatus result = localTempPublishModule(method, server, module, publishType, delta, monitor);
if( result.isOK() && requiresTransfer()) { // It seems the superclass already transfers it upstream for as7 :|
result = remoteFullPublish(sourcePath, destination.removeLastSegments(1), name,
AbstractServerToolsPublisher.getSubMon(monitor, 150));
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -385,7 +385,7 @@
public IPath getOutputFilePath(IServer server, IModule[] module, String deployRoot) {
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- return getDeployPath(module, deployRoot, ds);
+ return getModuleNestedDeployPath(module, deployRoot, ds);
}
public boolean hasBeenChanged() {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/OSGiPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/OSGiPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/OSGiPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -38,12 +38,12 @@
IProgressMonitor monitor) throws CoreException {
IDeployableServer server2 = ServerConverter.getDeployableServer(server);
- IPath destination = PublishUtil.getDeployPath(method, module, server2);
+ IPath destination = server2.getDeploymentLocation(module, true);
String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
if( new Path(remoteTempDeployRoot).toFile().exists())
new Path(remoteTempDeployRoot).toFile().mkdirs();
- IPath presumedSourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot, server2);
+ IPath presumedSourcePath = PublishUtil.getModuleNestedDeployPath(module, remoteTempDeployRoot, server2);
String name = presumedSourcePath.lastSegment();
IPath realSourcePathFolder = presumedSourcePath.removeLastSegments(1).append("plugins"); //$NON-NLS-1$
IProject project = module[module.length-1].getProject();
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *
- * TODO: Logging and Progress Monitors
- ******************************************************************************/
-package org.jboss.ide.eclipse.archives.webtools.modules;
-
-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.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.eclipse.wst.server.core.util.ModuleFile;
-import org.jboss.ide.eclipse.as.core.Trace;
-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.server.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.DeploymentMarkerUtils;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-
-public class WTPZippedPublisher implements IJBossServerPublisher {
- private int moduleState = IServer.PUBLISH_STATE_NONE;
- private boolean requiresTransfer = true;
-
- public boolean accepts(String method, IServer server, IModule[] module) {
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- return ds != null && (module == null || ds.zipsWTPDeployments());
- }
-
- public int getPublishState() {
- return moduleState;
- }
- public boolean requiresTransfer() {
- return requiresTransfer;
- }
-
- protected String getDeployRoot(IModule[] module, IDeployableServer ds) {
- return PublishUtil.getDeployRootFolder(
- module, ds, ds.getDeployFolder(),
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- }
-
- public IStatus publishModule(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor) throws CoreException {
- // Build all parts together at once.
- // When a call for [ear, childWar] comes in, ignore it.
- IStatus status = Status.OK_STATUS;
-
- if( module.length > 1 )
- return null;
-
- if( DeploymentMarkerUtils.supportsJBoss7MarkerDeployment(server)) {
- requiresTransfer = false;
- status = handleJBoss7Deployment(method, server, module, publishType, delta, monitor);
- } else {
- Trace.trace(Trace.STRING_FINER, "Using as<=6 publishModule logic in WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
- requiresTransfer = true;
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- String deployRoot = getDeployRoot(module, ds);
- LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
- status = util.publishModule(server, deployRoot, module, publishType, delta, monitor);
- Trace.trace(Trace.STRING_FINER, "Zipping complete for module " + module[module.length-1].getName() ); //$NON-NLS-1$ monitor.done();
- }
- return status;
- }
-
- public IStatus handleJBoss7Deployment(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor) throws CoreException {
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- String deployRoot = getDeployRoot(module, ds);
- if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
- Trace.trace(Trace.STRING_FINER, "Removing .dodeploy marker in WTPZippedPublisher to undeploy module " + module[module.length-1].getName() ); //$NON-NLS-1$
- DeploymentMarkerUtils.removeDeployedMarkerIfExists(method, ds, module, monitor);
- } else {
- Trace.trace(Trace.STRING_FINER, "Zipping module in WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
- LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
- IStatus s = util.publishModule(server, deployRoot, module, publishType, delta, monitor);
- IPath outPath = util.getOutputFilePath();
- if( util.hasBeenChanged()) {
- Trace.trace(Trace.STRING_FINER, "Output zip changed. Copying file to destination. WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
-
- // Copy out file
- IPath depPath = PublishUtil.getDeployPath(method, module, ds);
- IPath folder = depPath.removeLastSegments(1);
- IPublishCopyCallbackHandler callback = method.getCallbackHandler(folder, server);
- IModuleFile mf = new ModuleFile(outPath.toFile(), "", new Path("/")); //$NON-NLS-1$ //$NON-NLS-2$
- callback.copyFile(mf, new Path(depPath.lastSegment()), monitor);
-
- // Add marker
- DeploymentMarkerUtils.addDoDeployMarker(method, ds, module, new NullProgressMonitor());
- }
- monitor.done();
- return s;
- }
- monitor.done();
- return Status.OK_STATUS;
- }
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -120,11 +120,11 @@
* @return
*/
protected IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
- return PublishUtil.getDeployPath(publishMethod, moduleTree, server);
+ return server.getDeploymentLocation(moduleTree, true);
}
protected IPath getTempDeployPath(IModule[] moduleTree, IDeployableServer server) {
- return PublishUtil.getTempDeployPath(publishMethod, moduleTree, server);
+ return server.getTempDeploymentLocation(moduleTree, true);
}
@@ -143,7 +143,7 @@
}
if( tree2.length == 0 )
return new Path(publishMethod.getPublishDefaultRootFolder(server.getServer()));
- return PublishUtil.getDeployPath(publishMethod, tree2, server);
+ return server.getDeploymentLocation(moduleTree, true);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -16,15 +16,12 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.xpl.LocalCopyCallback;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class LocalPublishMethod extends AbstractPublishMethod {
- /**
- * TODO: refactor to "LOCAL" since we have local publishing and local
- * launching/stopping which both have to be mapped in equal ways
- */
- public static final String LOCAL_PUBLISH_METHOD = "local"; //$NON-NLS-1$
+ public static final String LOCAL_PUBLISH_METHOD = IJBossToolingConstants.DEFAULT_DEPLOYMENT_METHOD_TYPE;
public String getPublishMethodId() {
return LOCAL_PUBLISH_METHOD;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -44,25 +44,24 @@
*
* This API should be renamed, as it actually gets a value stored at a property key
*
- * @param moduleTree
- * @param server
- * @param defaultFolder
- * @param moduleProperty
+ * Practically, this method will find the deploy root folder or
+ * the temp deploy root folder for a given module by checking
+ * the override model
+ *
+ * @param moduleTree the module
+ * @param server the server
+ * @param defaultFolder the default folder if per-module settings DNE
+ * @param moduleProperty key representing folder or temp folder
* @return
*/
- public static String getDeployRootFolder(IModule[] moduleTree,
- IDeployableServer server, String defaultFolder, String moduleProperty) {
- return getDeployRootFolder(moduleTree, "local", //$NON-NLS-1$
- server, defaultFolder, moduleProperty);
- }
-
/* This api should be renamed */
- public static String getDeployRootFolder(IModule[] moduleTree, String publishMethod,
+ private static String getDeployRootFolder(IModule[] moduleTree,
IDeployableServer server, String defaultFolder, String moduleProperty) {
String folder = defaultFolder;
// TODO bug 286699
DeploymentPreferences prefs = DeploymentPreferenceLoader.loadPreferencesFromServer(server.getServer());
- DeploymentTypePrefs typePrefs = prefs.getOrCreatePreferences(publishMethod);
+ DeploymentTypePrefs typePrefs = prefs.getOrCreatePreferences(
+ IJBossToolingConstants.DEFAULT_DEPLOYMENT_METHOD_TYPE);
DeploymentModulePrefs modPrefs = typePrefs.getModulePrefs(moduleTree[0]);
if( modPrefs != null ) {
String loc = modPrefs.getProperty(moduleProperty);
@@ -78,33 +77,45 @@
}
return folder;
}
-
- public static IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
- String folder = getDeployRootFolder(
- moduleTree, server,
- server.getDeployFolder(),
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- return getDeployPath(moduleTree, folder, server);
- }
- public static IPath getDeployRootFolder(IModule[] moduleTree, IDeployableServer server) {
- String folder = getDeployRootFolder(
- moduleTree, server,
- server.getDeployFolder(),
+ public static boolean DEEP = true;
+ public static boolean ROOT = false;
+ public static IPath getDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree, IDeployableServer server, boolean deep) {
+ String defaultFolder = method.getPublishDefaultRootFolder(server.getServer());
+ String folder = PublishUtil.getDeployRootFolder(
+ moduleTree, server, defaultFolder,
IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- return new Path(folder);
+ if( deep == ROOT )
+ return new Path(folder);
+ return getModuleNestedDeployPath(moduleTree, folder, server);
}
- public static IPath getTempDeployFolder(IModule[] moduleTree, IDeployableServer server) {
- String folder = getDeployRootFolder(
- moduleTree, server,
- server.getTempDeployFolder(),
+ public static IPath getTempDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree,
+ IDeployableServer server, boolean deep) {
+ String defaultFolder = method.getPublishDefaultRootTempFolder(server.getServer());
+ String folder = PublishUtil.getDeployRootFolder(
+ moduleTree, server, defaultFolder,
IJBossToolingConstants.LOCAL_DEPLOYMENT_TEMP_LOC);
- return new Path(folder);
+ if( deep == ROOT )
+ return new Path(folder);
+ return getModuleNestedDeployPath(moduleTree, folder, server);
}
+
- public static IPath getDeployPath(IModule[] moduleTree, String deployFolder, IDeployableServer server) {
- IPath root = new Path( deployFolder );
+ /**
+ * Given a folder to deploy this module, append the various
+ * subparts of this module[] into the name. For example, if we
+ * know that this specific module should be published to
+ * /home/user/custom/path, then append the module names to yield
+ * a return value of /home/user/custom/path/some.ear/some.war
+ *
+ * @param moduleTree
+ * @param deployFolder
+ * @param server
+ * @return
+ */
+ public static IPath getModuleNestedDeployPath(IModule[] moduleTree, String rootFolder, IDeployableServer server) {
+ IPath root = new Path( rootFolder );
String type, modName, name, uri, suffixedName;
for( int i = 0; i < moduleTree.length; i++ ) {
boolean found = false;
@@ -136,22 +147,6 @@
return root;
}
- public static IPath getDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree, IDeployableServer server) {
- String defaultFolder = method.getPublishDefaultRootFolder(server.getServer());
- String folder = PublishUtil.getDeployRootFolder(
- moduleTree, server, defaultFolder,
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- return PublishUtil.getDeployPath(moduleTree, folder, server);
- }
-
- public static IPath getTempDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree, IDeployableServer server) {
- String defaultFolder = method.getPublishDefaultRootTempFolder(server.getServer());
- String folder = PublishUtil.getDeployRootFolder(
- moduleTree, server, defaultFolder,
- IJBossToolingConstants.LOCAL_DEPLOYMENT_TEMP_LOC);
- return PublishUtil.getDeployPath(moduleTree, folder, server);
- }
-
public static String getSuffix(String type) {
// TODO
// VirtualReferenceUtilities.INSTANCE. has utility methods to help!!
@@ -275,4 +270,36 @@
}
}
}
+
+ /* Deprecated */
+ @Deprecated
+ public static IPath getLocalDeployPath(IModule[] moduleTree, IDeployableServer server) {
+ return server.getDeploymentLocation(moduleTree, true);
+ }
+
+ @Deprecated
+ public static IPath getLocalDeployRootFolder(IModule[] moduleTree, IDeployableServer server) {
+ return server.getDeploymentLocation(moduleTree, false);
+ }
+
+ @Deprecated
+ public static IPath getLocalTempDeployPath(IModule[] moduleTree, IDeployableServer server) {
+ return server.getTempDeploymentLocation(moduleTree, true);
+ }
+
+ @Deprecated
+ public static IPath getLocalTempDeployRootFolder(IModule[] moduleTree, IDeployableServer server) {
+ return server.getTempDeploymentLocation(moduleTree, false);
+ }
+
+ @Deprecated
+ public static IPath getDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree, IDeployableServer server) {
+ return server.getDeploymentLocation(moduleTree, true);
+ }
+
+ @Deprecated
+ public static IPath getTempDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree,
+ IDeployableServer server) {
+ return server.getTempDeploymentLocation(moduleTree, true);
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -13,6 +13,8 @@
import java.util.regex.Pattern;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
@@ -42,7 +44,10 @@
public boolean zipsWTPDeployments();
public void setZipWTPDeployments(boolean val);
+ public IPath getDeploymentLocation(IModule[] module, boolean deep);
+ public IPath getTempDeploymentLocation(IModule[] module, boolean deep);
+
public String getConfigDirectory();
public ServerAttributeHelper getAttributeHelper();
public IServer getServer();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -187,7 +187,7 @@
return;
IJBossServerPublishMethod method = createPublishMethod();
- IPath depPath = PublishUtil.getDeployPath(method, module, ds);
+ IPath depPath = ds.getDeploymentLocation(module, true);
if( ServerModelUtilities.isBinaryModule(module[module.length-1]) || ds.zipsWTPDeployments()) {
// touch the file
method.getCallbackHandler(depPath.removeLastSegments(1), getServer())
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -16,6 +16,7 @@
import java.util.regex.PatternSyntaxException;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
@@ -28,10 +29,14 @@
import org.eclipse.wst.server.core.ServerPort;
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+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.IDeployableServerBehaviour;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.IMultiModuleURLProvider;
import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
@@ -222,5 +227,18 @@
} catch( MalformedURLException murle) { return null; }
}
-
+ protected IJBossServerPublishMethod createPublishMethod() {
+ IDeployableServerBehaviour beh = ServerConverter.getDeployableServerBehavior(getServer());
+ if( beh != null ) {
+ IJBossServerPublishMethod method = ((DeployableServerBehavior)beh).createPublishMethod();
+ return method;
+ }
+ return null;
+ }
+ public IPath getDeploymentLocation(IModule[] module, boolean deep) {
+ return PublishUtil.getDeployPath(createPublishMethod(), module, this, deep);
+ }
+ public IPath getTempDeploymentLocation(IModule[] module, boolean deep) {
+ return PublishUtil.getTempDeployPath(createPublishMethod(), module, this, deep);
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -119,7 +119,7 @@
return;
IJBossServerPublishMethod method = createPublishMethod();
- IPath depPath = PublishUtil.getDeployPath(method, module, ds);
+ IPath depPath = ds.getDeploymentLocation(module, true);
createDoDeployMarker(method, Arrays.asList(new IPath[]{depPath}), monitor);
setModuleState(module, IServer.STATE_STARTING);
ServerExtendedProperties props = (ServerExtendedProperties)getServer()
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -67,7 +67,7 @@
*/
public static IStatus addDoDeployMarker(IJBossServerPublishMethod method, IDeployableServer server,
IModule[] moduleTree, IProgressMonitor monitor) throws CoreException {
- IPath depPath = PublishUtil.getDeployPath(method, moduleTree, server);
+ IPath depPath = server.getDeploymentLocation(moduleTree, true);
return addDoDeployMarker(method, server.getServer(), depPath, monitor);
}
@@ -138,7 +138,7 @@
public static IStatus removeDeployedMarkerIfExists(IJBossServerPublishMethod method, IServer server,
IModule[] module, IProgressMonitor monitor) throws CoreException {
IDeployableServer deployableServer = ServerConverter.getDeployableServer(server);
- IPath deployPath = PublishUtil.getDeployPath(method, module, deployableServer);
+ IPath deployPath = deployableServer.getDeploymentLocation(module, true);
return removeDeployedMarkerIfExists(method, server, deployPath, monitor);
}
@@ -156,7 +156,7 @@
public static IStatus removeDeployedMarkerIfExists(IJBossServerPublishMethod method, IDeployableServer jbServer,
IModule[] moduleTree, IProgressMonitor monitor)
throws CoreException {
- IPath deployPath = PublishUtil.getDeployPath(method, moduleTree, jbServer);
+ IPath deployPath = jbServer.getDeploymentLocation(moduleTree, true);
return removeDeployedMarkerIfExists(method, jbServer.getServer(), deployPath, monitor);
}
@@ -198,7 +198,7 @@
public static IStatus removeDeployFailedMarkerIfExists(IJBossServerPublishMethod method, IServer server,
IModule[] module, IProgressMonitor monitor) throws CoreException {
IDeployableServer deployableServer = ServerConverter.getDeployableServer(server);
- IPath deployPath = PublishUtil.getDeployPath(method, module, deployableServer);
+ IPath deployPath = deployableServer.getDeploymentLocation(module, true);
return removeFile(FAILED_DEPLOY, server, deployPath, method, monitor);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -50,7 +50,7 @@
Trace.trace(Trace.STRING_FINER, "Using AS7 publishModule logic in JBoss7JSTPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- DeploymentMarkerUtils.removeDeployFailedMarker(method, server, PublishUtil.getDeployPath(method, module, ds), monitor);
+ DeploymentMarkerUtils.removeDeployFailedMarker(method, server, ds.getDeploymentLocation(module, true), monitor);
if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
IStatus s = DeploymentMarkerUtils.removeDeployedMarkerIfExists(method, ds, module, monitor);
@@ -85,7 +85,7 @@
private void doDeployRequired(IJBossServerPublishMethod method,IDeployableServer server,
IModule[] moduleTree, IProgressMonitor monitor ) throws CoreException {
- IPath p = PublishUtil.getDeployPath(method, moduleTree, server);
+ IPath p = server.getDeploymentLocation(moduleTree, true);
Trace.trace(Trace.STRING_FINER, "Marking path " + p + " as requiring a .dodeploy marker, but NOT creating the file yet"); //$NON-NLS-1$ //$NON-NLS-2$
DelegatingJBoss7ServerBehavior beh = ServerConverter.getJBoss7ServerBehavior(server.getServer());
beh.markDoDeploy(p);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -73,7 +73,8 @@
private boolean isRootModuleStarted(IServer server, IModule root, IProgressMonitor monitor) throws Exception {
JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server, JBoss7Server.class);
IJBoss7ManagerService service = JBoss7ManagerUtil.getService(server);
- IPath deployPath = PublishUtil.getDeployPath(new IModule[]{root}, jbossServer);
+ // TODO does this need to change??
+ IPath deployPath = jbossServer.getDeploymentLocation(new IModule[]{root}, true);
return isRootModuleStarted(server, root, service, deployPath, monitor);
}
@@ -94,7 +95,8 @@
try {
JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server, JBoss7Server.class);
IJBoss7ManagerService service = JBoss7ManagerUtil.getService(server);
- IPath deployPath = PublishUtil.getDeployPath(new IModule[]{module[0]}, jbossServer);
+ // TODO DOES THIS NEED TO CHANGE?
+ IPath deployPath = jbossServer.getDeploymentLocation(new IModule[]{module[0]}, true);
boolean waitedOnce = false;
while (!monitor.isCanceled()) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -166,7 +166,7 @@
IModule[] module = new IModule[] { modules2[i] };
IStatus status = server.canModifyModules(module, null, null);
if (status != null && status.getSeverity() != IStatus.ERROR) {
- String tempFolder = PublishUtil.getDeployRootFolder(module, ds).toString();
+ String tempFolder = ds.getDeploymentLocation(module, false).toString();
if( !folders.contains(tempFolder))
folders.add(tempFolder);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -146,6 +146,8 @@
public static final String EXPOSE_MANAGEMENT_SERVICE = "org.jboss.ide.eclipse.as.core.server.EXPOSE_MANAGEMENT_SERVICE"; //$NON-NLS-1$
+ public static final String DEFAULT_DEPLOYMENT_METHOD_TYPE = "local"; //$NON-NLS-1$
+
public static final String LOCAL_DEPLOYMENT_NAME = "name"; //$NON-NLS-1$
public static final String LOCAL_DEPLOYMENT_LOC = "location"; //$NON-NLS-1$
public static final String LOCAL_DEPLOYMENT_TEMP_LOC = "tempLocation"; //$NON-NLS-1$
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -100,7 +100,7 @@
RSEPublishMethod method = (RSEPublishMethod)type.createPublishMethod();
method.setBehaviour(ServerConverter.getDeployableServerBehavior(server));
if( module != null ) {
- remoteFolder = PublishUtil.getDeployPath(method, module, ds);
+ remoteFolder = ds.getDeploymentLocation(module, true);
}
try {
method.getFileService();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -26,9 +26,12 @@
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
/**
+ *
+ * The utilities in this class are only useful for
+ * exploring LOCALLY.
+ *
* @author snjeza
*
*/
@@ -129,7 +132,7 @@
public static boolean canExplore(IServer server, IModule[] modules) {
IDeployableServer ds = ServerConverter.getDeployableServer(server);
if( ds != null ) {
- IPath p = PublishUtil.getDeployRootFolder(modules, ds);
+ IPath p = ds.getDeploymentLocation(modules, false);
if (p == null || !p.toFile().exists() || ExploreUtils.getExploreCommand() == null)
return false;
return true;
@@ -178,16 +181,4 @@
}
}
}
-
- public static IPath getDeployPath(IDeployableServer server,IModule[] moduleTree) {
- IPath fullPath = PublishUtil.getDeployPath(moduleTree, server);
- if (Platform.getOS().equals(Platform.OS_WIN32)) {
- return fullPath;
- }
- if( !ServerModelUtilities.isBinaryModule(moduleTree)) {
- return fullPath;
- }
- return fullPath.removeLastSegments(1);
- }
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -10,10 +10,8 @@
******************************************************************************/
package org.jboss.tools.as.wst.server.ui.xpl;
-import java.io.File;
import java.util.HashMap;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
@@ -32,7 +30,6 @@
import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.actions.ExploreUtils;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.CommonActionProviderUtils;
@@ -43,41 +40,9 @@
}
public static HashMap<String, IExploreBehavior> exploreBehaviorMap = new HashMap<String, IExploreBehavior>();
static {
- exploreBehaviorMap.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new IExploreBehavior() {
- public boolean canExplore(IServer server, IModule[] module) {
- if( module != null )
- return ExploreUtils.canExplore(server, module);
- return ExploreUtils.canExplore(server);
- }
- public void openExplorer(IServer server, IModule[] module) {
- if( module != null )
- runExploreModuleServer(server, module);
- else
- runExploreServer(server);
- }
- public void runExploreServer(IServer server) {
- String deployDirectory = ExploreUtils.getDeployDirectory(server);
- if (deployDirectory != null && deployDirectory.length() > 0) {
- ExploreUtils.explore(deployDirectory);
- }
- }
-
- public void runExploreModuleServer(IServer server, IModule[] module) {
- IPath path = getModuleDeployPath(server, module);
- if (path != null) {
- File file = path.toFile();
- if (file.exists()) {
- ExploreUtils.explore(file.getAbsolutePath());
- }
- }
- }
- private IPath getModuleDeployPath(IServer server, IModule[] module) {
- IDeployableServer deployableServer = ServerConverter.getDeployableServer(server);
- if( deployableServer != null )
- return ExploreUtils.getDeployPath(deployableServer, module);
- return null;
- }
- });
+ exploreBehaviorMap.put(
+ LocalPublishMethod.LOCAL_PUBLISH_METHOD,
+ new LocalExploreBehavior());
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/LocalExploreBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/LocalExploreBehavior.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/LocalExploreBehavior.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -0,0 +1,62 @@
+package org.jboss.tools.as.wst.server.ui.xpl;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+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.util.ServerConverter;
+import org.jboss.ide.eclipse.as.ui.actions.ExploreUtils;
+import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
+import org.jboss.tools.as.wst.server.ui.xpl.ExploreActionProvider.IExploreBehavior;
+
+public class LocalExploreBehavior implements IExploreBehavior {
+ public boolean canExplore(IServer server, IModule[] module) {
+ if( module != null )
+ return ExploreUtils.canExplore(server, module);
+ return ExploreUtils.canExplore(server);
+ }
+ public void openExplorer(IServer server, IModule[] module) {
+ if( module != null )
+ runExploreModuleServer(server, module);
+ else
+ runExploreServer(server);
+ }
+ public void runExploreServer(IServer server) {
+ String deployDirectory = ExploreUtils.getDeployDirectory(server);
+ if (deployDirectory != null && deployDirectory.length() > 0) {
+ ExploreUtils.explore(deployDirectory);
+ }
+ }
+
+ public void runExploreModuleServer(IServer server, IModule[] module) {
+ IPath path = getModuleDeployPath(server, module);
+ if (path != null) {
+ File file = path.toFile();
+ if (file.exists()) {
+ ExploreUtils.explore(file.getAbsolutePath());
+ }
+ }
+ }
+ private IPath getModuleDeployPath(IServer server, IModule[] module) {
+ IDeployableServer deployableServer = ServerConverter.getDeployableServer(server);
+ if( deployableServer != null )
+ return getDeployPath(deployableServer, module);
+ return null;
+ }
+
+ private static IPath getDeployPath(IDeployableServer server,IModule[] moduleTree) {
+ IPath fullPath = server.getDeploymentLocation(moduleTree, true);
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ return fullPath;
+ }
+ if( !ServerModelUtilities.isBinaryModule(moduleTree)) {
+ return fullPath;
+ }
+ return fullPath.removeLastSegments(1);
+ }
+
+}
Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -324,7 +324,7 @@
}
protected IPath getLocalPublishMethodDeployRoot() {
DeployableServer ds = (DeployableServer)server.loadAdapter(DeployableServer.class, new NullProgressMonitor());
- IPath path = PublishUtil.getDeployPath(new LocalPublishMethod(), new IModule[]{primaryModule}, ds);
+ IPath path = ds.getDeploymentLocation(new IModule[]{primaryModule}, true);
return path;
}
Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/defect/PublishWeb2DeletesWeb1LibsTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/defect/PublishWeb2DeletesWeb1LibsTest.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/defect/PublishWeb2DeletesWeb1LibsTest.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -97,14 +97,14 @@
private void verifyEJBAndJarExist() {
// Make sure ejb and libs exist
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- IPath fullPath = PublishUtil.getDeployPath(findArrayForProject("UserForum1EJB1"), ds);
+ IPath fullPath = ds.getDeploymentLocation(findArrayForProject("UserForum1EJB1"), true);
assertTrue(fullPath.toFile().exists());
assertTrue(fullPath.append("UserForum1Util1.jar").toFile().exists());
}
private void verifyWeb1AndLibsExist() {
// Make sure ejb and libs exist
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- IPath fullPath = PublishUtil.getDeployPath(findArrayForProject("UserForum1Web1"), ds);
+ IPath fullPath = ds.getDeploymentLocation(findArrayForProject("UserForum1Web1"), true);
assertTrue(fullPath.toFile().exists());
assertTrue(fullPath.append("WEB-INF").append("lib").append("UserForum1Util1.jar").toFile().exists());
assertTrue(fullPath.append("WEB-INF").append("lib").append("UserForum1Util2.jar").toFile().exists());
@@ -112,7 +112,7 @@
private void verifyWeb2AndLibsExist() {
// Make sure ejb and libs exist
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- IPath fullPath = PublishUtil.getDeployPath(findArrayForProject("UserForum1Web2"), ds);
+ IPath fullPath = ds.getDeploymentLocation(findArrayForProject("UserForum1Web2"), true);
assertTrue(fullPath.toFile().exists());
assertTrue(fullPath.append("WEB-INF").append("lib").append("UserForum1Util1.jar").toFile().exists());
assertTrue(fullPath.append("WEB-INF").append("lib").append("UserForum1Util2.jar").toFile().exists());
Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -38,8 +38,6 @@
import org.jboss.ide.eclipse.archives.webtools.modules.LocalZippedPublisherUtil;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
-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;
@@ -48,6 +46,7 @@
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
+import org.jboss.ide.eclipse.as.core.util.ModuleResourceUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.tools.bpel.runtimes.IBPELModuleFacetConstants;
import org.jboss.tools.jmx.core.IMemento;
@@ -70,7 +69,7 @@
}
public boolean accepts(String method, IServer server, IModule[] module) {
- if( LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(method)
+ if(IJBossToolingConstants.DEFAULT_DEPLOYMENT_METHOD_TYPE.equals(method)
&& module != null && module.length > 0
&& module[module.length-1] != null
&& (
@@ -128,8 +127,8 @@
IDeployableServer ds = ServerConverter.getDeployableServer(server);
IModule last = moduleTree[moduleTree.length -1];
IPath deployPath = getDeployPath(moduleTree, ds);
- IPath tempDeployPath = PublishUtil.getTempDeployFolder(moduleTree, ds);
- IModuleResource[] members = PublishUtil.getResources(last, new NullProgressMonitor());
+ IPath tempDeployPath = ds.getTempDeploymentLocation(moduleTree, false);
+ IModuleResource[] members = ModuleResourceUtil.getResources(last, new NullProgressMonitor());
// https://issues.jboss.org/browse/JBDS-1573
// make sure the project has a deploy.xml (bpel-deploy.xml for backward compatibility).
boolean hasDeployXML = false;
@@ -147,16 +146,14 @@
return ms;
}
if( shouldZip() ) {
- String deployRoot = PublishUtil.getDeployRootFolder(
- moduleTree, ds, ds.getDeployFolder(),
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
+ IPath deployRoot = ds.getDeploymentLocation(moduleTree, false);
BPELZippedPublisherUtil util = new BPELZippedPublisherUtil(deployPath);
- IStatus ret = util.publishModule(server, deployRoot, moduleTree, publishType, delta, monitor);
+ IStatus ret = util.publishModule(server, deployRoot.toString(), moduleTree, publishType, delta, monitor);
resultList.add(ret);
} else {
LocalCopyCallback handler = new LocalCopyCallback(server, deployPath, tempDeployPath);
PublishCopyUtil util = new PublishCopyUtil(handler);
- resultList.addAll(Arrays.asList(util.initFullPublish(members, monitor)));
+ resultList.addAll(Arrays.asList(util.initFullPublish(members, null, monitor)));
}
addDeployedPathToDescriptor(server, last.getProject(), deployPath); // persist it
pruneList(resultList);
@@ -185,7 +182,7 @@
}
public static IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
- IPath path = PublishUtil.getDeployPath(moduleTree, server);
+ IPath path = server.getDeploymentLocation(moduleTree, true);
path = path.removeLastSegments(1).append(getNewLastSegment(moduleTree));
return path;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -53,8 +53,7 @@
return 0;
IDeployableServer depServ = ServerConverter.getDeployableServer(behaviour.getServer());
- IPath dest = PublishUtil.getDeployRootFolder(module, depServ);
- //PublishUtil.getDeployPath(this, module, depServ);
+ IPath dest = depServ.getDeploymentLocation(module, false);
if( module.length == 0 ) return IServer.PUBLISH_STATE_NONE;
int modulePublishState = behaviour.getServer().getModulePublishState(module);
13 years, 6 months