Author: chris.laprun(a)jboss.com
Date: 2010-09-13 16:45:09 -0400 (Mon, 13 Sep 2010)
New Revision: 4176
Modified:
components/wsrp/trunk/api/pom.xml
components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/PortalStructureProvider.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/ImportInfo.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
Log:
- GTNWSRP-61: More work on import capability.
+ Changed signature of PortalStructureProvider.assignPortletToWindow to use a
PortletContext instead of a portlet handle and fixed typo.
+ Fixed NPE in importPortlets and promoted method to WSRPConsumer interface.
+ Added ImportInfo.getPortletContextFor method.
Modified: components/wsrp/trunk/api/pom.xml
===================================================================
--- components/wsrp/trunk/api/pom.xml 2010-09-13 15:24:42 UTC (rev 4175)
+++ components/wsrp/trunk/api/pom.xml 2010-09-13 20:45:09 UTC (rev 4176)
@@ -35,6 +35,11 @@
<dependencies>
<dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-api</artifactId>
+ <version>2.2.0-Beta01-SNAPSHOT</version>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
Modified:
components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/PortalStructureProvider.java
===================================================================
---
components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/PortalStructureProvider.java 2010-09-13
15:24:42 UTC (rev 4175)
+++
components/wsrp/trunk/api/src/main/java/org/gatein/wsrp/api/PortalStructureProvider.java 2010-09-13
20:45:09 UTC (rev 4176)
@@ -23,6 +23,8 @@
package org.gatein.wsrp.api;
+import org.gatein.pc.api.PortletContext;
+
import java.util.List;
/**
@@ -33,7 +35,7 @@
{
List<String> getPageIdentifiers();
- List<String> getWindowIndentifiersFor(String pageId);
+ List<String> getWindowIdentifiersFor(String pageId);
- void assignPortletToWindow(String portletId, String windowId, String pageId);
+ void assignPortletToWindow(PortletContext portletContext, String windowId, String
pageId);
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java
===================================================================
---
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java 2010-09-13
15:24:42 UTC (rev 4175)
+++
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/WSRPConsumer.java 2010-09-13
20:45:09 UTC (rev 4176)
@@ -31,6 +31,7 @@
import org.gatein.wsrp.consumer.RefreshResult;
import org.gatein.wsrp.consumer.handlers.ProducerSessionInformation;
import org.gatein.wsrp.consumer.migration.ExportInfo;
+import org.gatein.wsrp.consumer.migration.ImportInfo;
import org.gatein.wsrp.consumer.migration.MigrationService;
import javax.servlet.http.HttpSession;
@@ -132,4 +133,6 @@
MigrationService getMigrationService();
boolean isSupportsExport();
+
+ ImportInfo importPortlets(ExportInfo exportInfo, List<String> portlets) throws
PortletInvokerException;
}
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
---
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-09-13
15:24:42 UTC (rev 4175)
+++
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-09-13
20:45:09 UTC (rev 4176)
@@ -911,7 +911,7 @@
resourceListHolder, new Holder<List<Extension>>());
List<ImportedPortlet> importedPortlets = importedPortletsHolder.value;
- SortedMap<String, PortletContext> importIdToPortletContext = null;
+ SortedMap<String, PortletContext> importIdToPortletContext = new
TreeMap<String, PortletContext>();
if (ParameterValidation.existsAndIsNotEmpty(importedPortlets))
{
for (ImportedPortlet importedPortlet : importedPortlets)
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/ImportInfo.java
===================================================================
---
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/ImportInfo.java 2010-09-13
15:24:42 UTC (rev 4175)
+++
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/ImportInfo.java 2010-09-13
20:45:09 UTC (rev 4176)
@@ -1,24 +1,25 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
package org.gatein.wsrp.consumer.migration;
@@ -52,5 +53,8 @@
}
}
-
+ public PortletContext getPortletContextFor(String id)
+ {
+ return importIdToPortletContext.get(id);
+ }
}
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java
===================================================================
---
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java 2010-09-13
15:24:42 UTC (rev 4175)
+++
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java 2010-09-13
20:45:09 UTC (rev 4176)
@@ -24,10 +24,10 @@
package org.gatein.wsrp.consumer.migration;
import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.PortletContext;
import org.gatein.wsrp.api.PortalStructureProvider;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -45,6 +45,7 @@
private PortalStructureProvider structureProvider = new PortalStructureProvider()
{
private Map<String, List<String>> pagesToWindows = new
HashMap<String, List<String>>(7);
+
{
List<String> windows = new ArrayList<String>(3);
windows.add("p1w1");
@@ -65,14 +66,14 @@
return new ArrayList<String>(pagesToWindows.keySet());
}
- public List<String> getWindowIndentifiersFor(String pageId)
+ public List<String> getWindowIdentifiersFor(String pageId)
{
return pagesToWindows.get(pageId);
}
- public void assignPortletToWindow(String portletId, String windowId, String
pageId)
+ public void assignPortletToWindow(PortletContext portletContext, String windowId,
String pageId)
{
- System.out.println("Assigned portlet " + portletId + " to window
" + windowId + " on page " + pageId);
+ System.out.println("Assigned portlet " + portletContext + " to
window " + windowId + " on page " + pageId);
}
};
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java 2010-09-13
15:24:42 UTC (rev 4175)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java 2010-09-13
20:45:09 UTC (rev 4176)
@@ -39,6 +39,7 @@
import org.gatein.wsrp.consumer.RefreshResult;
import org.gatein.wsrp.consumer.handlers.ProducerSessionInformation;
import org.gatein.wsrp.consumer.migration.ExportInfo;
+import org.gatein.wsrp.consumer.migration.ImportInfo;
import org.gatein.wsrp.consumer.migration.MigrationService;
import javax.servlet.http.HttpSession;
@@ -179,6 +180,11 @@
return false;
}
+ public ImportInfo importPortlets(ExportInfo exportInfo, List<String> portlets)
throws PortletInvokerException
+ {
+ throw new NotYetImplemented();
+ }
+
public void destroy()
{
}