001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.dynamicdatamapping.util;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    import java.util.List;
020    
021    /**
022     * @author Eduardo Garcia
023     */
024    public class DDMDisplayRegistryUtil {
025    
026            public static DDMDisplay getDDMDisplay(String portletId) {
027                    return getDDMDisplayRegistry().getDDMDisplay(portletId);
028            }
029    
030            public static DDMDisplayRegistry getDDMDisplayRegistry() {
031                    PortalRuntimePermission.checkGetBeanProperty(
032                            DDMDisplayRegistryUtil.class);
033    
034                    return _ddmDisplayRegistry;
035            }
036    
037            public static List<DDMDisplay> getDDMDisplays() {
038                    return getDDMDisplayRegistry().getDDMDisplays();
039            }
040    
041            public static String[] getPortletIds() {
042                    return getDDMDisplayRegistry().getPortletIds();
043            }
044    
045            public static void register(DDMDisplay ddmDisplay) {
046                    getDDMDisplayRegistry().register(ddmDisplay);
047            }
048    
049            public static void unregister(DDMDisplay ddmDisplay) {
050                    getDDMDisplayRegistry().unregister(ddmDisplay);
051            }
052    
053            public void setDDMDisplayRegistry(DDMDisplayRegistry ddmDisplayRegistry) {
054                    PortalRuntimePermission.checkSetBeanProperty(getClass());
055    
056                    _ddmDisplayRegistry = ddmDisplayRegistry;
057            }
058    
059            private static DDMDisplayRegistry _ddmDisplayRegistry;
060    
061    }