Author: snjeza
Date: 2010-11-24 14:41:48 -0500 (Wed, 24 Nov 2010)
New Revision: 26891
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/internal/project/facet/PortletPostInstallListener.java
Log:
JBIDE-7702 Richfaces libraries not added to new project
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 2010-11-24
19:41:40 UTC (rev 26890)
+++
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/IPortletConstants.java 2010-11-24
19:41:48 UTC (rev 26891)
@@ -52,6 +52,8 @@
static final String JSF_SECTION = "jsfSection"; //$NON-NLS-1$
static final String WEB_INF_LIB = "WEB-INF/lib"; //$NON-NLS-1$
+
+ static final String LIB = "lib"; //$NON-NLS-1$
static final String JBOSS_PORTLET_FILE = "WEB-INF/jboss-portlet.xml";
//$NON-NLS-1$
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletPostInstallListener.java
===================================================================
---
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletPostInstallListener.java 2010-11-24
19:41:40 UTC (rev 26890)
+++
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletPostInstallListener.java 2010-11-24
19:41:48 UTC (rev 26891)
@@ -433,6 +433,9 @@
deleteOldRichFacesApi(folder);
destPath = folder.getFullPath();
ZipEntry root = zipFile.getEntry(IPortletConstants.WEB_INF_LIB);
+ if (root == null) {
+ root = zipFile.getEntry(IPortletConstants.LIB);
+ }
op = new ImportOperation( destPath,
root, structureProvider, OVERWRITE_NONE_QUERY,
list );
@@ -446,14 +449,30 @@
}
private File getRichFacesExamples(File examplesHome) {
- File file = new File(examplesHome,"RichFacesPortlet.war"); //$NON-NLS-1$
- if (file.exists() && file.isFile()) {
+ File file = getExampleFile(examplesHome,"RichFacesPortlet", "war");
//$NON-NLS-1$ //$NON-NLS-2$
+ if (file != null && file.isFile()) {
return file;
}
+ file = getExampleFile(examplesHome, "richFacesPortlet", ".war");
//$NON-NLS-1$//$NON-NLS-2$
+ if (file != null && file.isFile()) {
+ return file;
+ }
+ file = getExampleFile(examplesHome, "seamPortlet", ".war");
//$NON-NLS-1$//$NON-NLS-2$
+ if (file != null && file.isFile()) {
+ return file;
+ }
+ file = getExampleFile(examplesHome, "seam", ".ear");
//$NON-NLS-1$//$NON-NLS-2$
+ if (file != null && file.isFile()) {
+ return file;
+ }
+ return null;
+ }
+
+ private File getExampleFile(File examplesHome, final String prefix, final String suffix)
{
File[] listFiles = examplesHome.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
- if (name.startsWith("seamPortlet") &&
name.endsWith(".war")) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (name.startsWith(prefix) && name.endsWith(suffix)) {
return true;
}
return false;
Show replies by date