Author: snjeza
Date: 2008-07-23 18:58:18 -0400 (Wed, 23 Jul 2008)
New Revision: 9256
Added:
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletConfigurationPresetFactory10.java
Removed:
trunk/portlet/plugins/org.jboss.tools.portlet.core/resources/portlet/1.0/portal-common-lib.jar
trunk/portlet/plugins/org.jboss.tools.portlet.core/resources/portlet/2.0/portal-common-lib.jar
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.core/META-INF/MANIFEST.MF
trunk/portlet/plugins/org.jboss.tools.portlet.core/plugin.xml
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/IPortletConstants.java
Log:
JBIDE-2233 Ability to create a new "Portlet" project - Thomas's suggestions
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.core/META-INF/MANIFEST.MF 2008-07-23
22:58:08 UTC (rev 9255)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.core/META-INF/MANIFEST.MF 2008-07-23
22:58:18 UTC (rev 9256)
@@ -11,7 +11,9 @@
org.eclipse.wst.common.frameworks,
org.eclipse.jst.j2ee,
org.eclipse.jdt.core,
- org.jboss.ide.eclipse.as.classpath.core
+ org.jboss.ide.eclipse.as.classpath.core,
+ org.eclipse.jst.j2ee.web,
+ org.eclipse.jst.common.frameworks
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.portlet.core,
org.jboss.tools.portlet.core.internal,
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.core/plugin.xml
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.core/plugin.xml 2008-07-23 22:58:08 UTC
(rev 9255)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.core/plugin.xml 2008-07-23 22:58:18 UTC
(rev 9256)
@@ -53,13 +53,9 @@
<extension
point="org.eclipse.wst.common.project.facet.core.presets">
- <static-preset id="preset.jboss.portlet.v10">
- <label>Portlet Project v1.0</label>
- <facet id="jst.java" version="5.0" />
- <facet id="jst.web" version="2.3"/>
- <facet id="jboss.portlet" version="1.0" />
- <description>Portlet Project v1.0</description>
- </static-preset>
+ <dynamic-preset id="preset.jboss.portlet.v10">
+ <factory
class="org.jboss.tools.portlet.core.internal.project.facet.PortletConfigurationPresetFactory10"/>
+ </dynamic-preset>
</extension>
<extension
point="org.eclipse.wst.common.project.facet.core.runtimes">
Deleted:
trunk/portlet/plugins/org.jboss.tools.portlet.core/resources/portlet/1.0/portal-common-lib.jar
===================================================================
(Binary files differ)
Deleted:
trunk/portlet/plugins/org.jboss.tools.portlet.core/resources/portlet/2.0/portal-common-lib.jar
===================================================================
(Binary files differ)
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/IPortletConstants.java
===================================================================
---
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/IPortletConstants.java 2008-07-23
22:58:08 UTC (rev 9255)
+++
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/IPortletConstants.java 2008-07-23
22:58:18 UTC (rev 9256)
@@ -33,4 +33,6 @@
static final String PORTLET_INSTANCES_FILE = "WEB-INF/portlet-instances.xml";
+ static final String PORTLET_OBJECT_FILE = "WEB-INF/default-object.xml";
+
}
Added:
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletConfigurationPresetFactory10.java
===================================================================
---
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletConfigurationPresetFactory10.java
(rev 0)
+++
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletConfigurationPresetFactory10.java 2008-07-23
22:58:18 UTC (rev 9256)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * Copyright (c) 2008 BEA Systems, 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:
+ * Konstantin Komissarchik
+ ******************************************************************************/
+
+package org.jboss.tools.portlet.core.internal.project.facet;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jst.common.project.facet.JavaFacetUtils;
+import org.eclipse.jst.j2ee.web.project.facet.WebFacetUtils;
+import org.eclipse.wst.common.project.facet.core.IDynamicPreset;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase;
+import org.eclipse.wst.common.project.facet.core.IPresetFactory;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.PresetDefinition;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.portlet.core.IPortletConstants;
+
+/**
+ * @author <a href="mailto:kosta@bea.com">Konstantin
Komissarchik</a>
+ * @author snjeza
+ */
+
+public final class PortletConfigurationPresetFactory10
+
+implements IPresetFactory {
+ public PresetDefinition createPreset(final String presetId,
+ final Map<String, Object> context)
+
+ throws CoreException {
+ final IFacetedProjectBase fproj = (IFacetedProjectBase) context
+ .get(IDynamicPreset.CONTEXT_KEY_FACETED_PROJECT);
+ final IProjectFacetVersion webFacetVersion = fproj
+ .getProjectFacetVersion(WebFacetUtils.WEB_FACET);
+ if (webFacetVersion != null
+ && webFacetVersion.compareTo(WebFacetUtils.WEB_23) >= 0) {
+ final Set<IProjectFacetVersion> facets = new
HashSet<IProjectFacetVersion>();
+ final IProjectFacet portletFacet = ProjectFacetsManager
+ .getProjectFacet(IPortletConstants.PORTLET_FACET_ID);
+ final IProjectFacetVersion portletFacetVersion10 = portletFacet
+ .getVersion(IPortletConstants.PORTLET_FACET_VERSION_10);
+ facets.add(portletFacetVersion10);
+ facets.add(webFacetVersion);
+ facets.add(JavaFacetUtils.JAVA_50);
+ return new PresetDefinition("Portlet Project v1.0",
+ "Portlet Project v1.0", facets);
+ }
+ return null;
+ }
+}