portletsToImport.add(exportedPortlet);
}
}
final WSRPConsumer consumer = getConsumer();
ImportInfo info = consumer.importPortlets(currentExport.getExport(), WSRPUtils.transform(portletsToImport, SELECTABLE_TO_HANDLE));
ConsumerStructureProvider structureProvider = consumer.getMigrationService().getStructureProvider();
int importCount = 0;
for (SelectablePortletHandle importedPortlet : portletsToImport)
{
String handle = importedPortlet.getHandle();
PortletContext portletContext = info.getPortletContextFor(handle);
if (portletContext != null)
{
structureProvider.assignPortletToWindow(portletContext, importedPortlet.getWindow(), importedPortlet.getPage(), handle);
importCount++;
}
}
// only display success message if we have imported at least one portlet successfully
if (importCount > 0)
{
beanContext.createLocalizedMessage(BeanContext.STATUS, IMPORT_SUCCESS, beanContext.getInfoSeverity(), importCount);
}
SortedMap<QName, List<String>> errorCodesToFailedPortletHandlesMapping = info.getErrorCodesToFailedPortletHandlesMapping();
if (!errorCodesToFailedPortletHandlesMapping.isEmpty())
{
for (Map.Entry<QName, List<String>> entry : errorCodesToFailedPortletHandlesMapping.entrySet())
{
QName errorCode = entry.getKey();