001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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    }