<% /** * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ %> <% List portletsList = new ArrayList(); Set portletIdsSet = new HashSet(); List exportLayouts = new ArrayList(); if (selLayout != null) { exportLayouts.add(selLayout); } else { exportLayouts = LayoutLocalServiceUtil.getLayouts(selGroup.getGroupId(), privateLayout); } Iterator itr1 = exportLayouts.iterator(); while (itr1.hasNext()) { Layout curLayout = (Layout)itr1.next(); if (curLayout.getType().equals(LayoutConstants.TYPE_PORTLET)) { LayoutTypePortlet curLayoutTypePortlet = (LayoutTypePortlet)curLayout.getLayoutType(); Iterator itr2 = curLayoutTypePortlet.getPortletIds().iterator(); while (itr2.hasNext()) { Portlet curPortlet = PortletLocalServiceUtil.getPortletById(company.getCompanyId(), (String)itr2.next()); if (curPortlet != null) { PortletDataHandler portletDataHandler = curPortlet.getPortletDataHandlerInstance(); if ((portletDataHandler != null) && !portletIdsSet.contains(curPortlet.getRootPortletId())) { portletIdsSet.add(curPortlet.getRootPortletId()); portletsList.add(curPortlet); } } } } } List alwaysExportablePortlets = LayoutExporter.getAlwaysExportablePortlets(company.getCompanyId()); for (Portlet alwaysExportablePortlet : alwaysExportablePortlets) { if (!portletIdsSet.contains(alwaysExportablePortlet.getRootPortletId())) { portletIdsSet.add(alwaysExportablePortlet.getRootPortletId()); portletsList.add(alwaysExportablePortlet); } } portletsList = ListUtil.sort(portletsList, new PortletTitleComparator(application, locale)); %>
<%@ include file="/html/portlet/communities/render_controls.jspf" %>