*
* @return list of portlet context
*/
@SuppressWarnings("unchecked")
public List<PortletContextImpl> getPortletApplications() {
final PortletRegistryService portletRegistryService = optionalContainerServices.getPortletRegistryService();
List<PortletContextImpl> contexts = new ArrayList<PortletContextImpl>();
for (Iterator iter = portletRegistryService.getRegisteredPortletApplications(); iter.hasNext();) {
PortletContextImpl context = (PortletContextImpl) iter.next();
final List<PortletDD> portlets = context.getPortletApplicationDefinition().getPortlets();
Collections.sort(portlets, new ComparableExtractingComparator<PortletDD, String>(String.CASE_INSENSITIVE_ORDER) {
@Override