{
try
{
if (portletHandles == null)
{
final WSRPConsumer consumer = getConsumer();
Collection<Portlet> portlets = consumer.getProducerInfo().getPortletMap().values();
List<SelectablePortletHandle> selectableHandles = Collections.emptyList();
if (ParameterValidation.existsAndIsNotEmpty(portlets))
{
selectableHandles = new ArrayList<SelectablePortletHandle>(portlets.size());
for (Portlet portlet : portlets)
{
selectableHandles.add(new SelectablePortletHandle(portlet.getContext().getId(), consumer.getMigrationService().getStructureProvider()));
}
}
Collections.sort(selectableHandles);
portletHandles = new ListDataModel(selectableHandles);
}