001    /**
002     * Copyright (c) 2000-2012 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.portal.kernel.portletdisplaytemplate;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    import java.util.List;
020    
021    /**
022     * @author Juan Fernández
023     */
024    public class PortletDisplayTemplateHandlerRegistryUtil {
025    
026            public static long[] getClassNameIds() {
027                    return getPortletDisplayTemplateRegistry().getClassNameIds();
028            }
029    
030            public static PortletDisplayTemplateHandler
031                    getPortletDisplayTemplateHandler(long classNameId) {
032    
033                    return getPortletDisplayTemplateRegistry().
034                            getPortletDisplayTemplateHandler(classNameId);
035            }
036    
037            public static PortletDisplayTemplateHandler
038                    getPortletDisplayTemplateHandler(String className) {
039    
040                    return getPortletDisplayTemplateRegistry().
041                            getPortletDisplayTemplateHandler(className);
042            }
043    
044            public static List<PortletDisplayTemplateHandler>
045                    getPortletDisplayTemplateHandlers() {
046    
047                    return getPortletDisplayTemplateRegistry().
048                            getPortletDisplayTemplateHandlers();
049            }
050    
051            public static PortletDisplayTemplateHandlerRegistry
052                    getPortletDisplayTemplateRegistry() {
053    
054                    PortalRuntimePermission.checkGetBeanProperty(
055                            PortletDisplayTemplateHandlerRegistryUtil.class);
056    
057                    return _portletDisplayTemplateHandlerRegistry;
058            }
059    
060            public static void register(
061                    PortletDisplayTemplateHandler portletDisplayTemplateHandler) {
062    
063                    getPortletDisplayTemplateRegistry().register(
064                            portletDisplayTemplateHandler);
065            }
066    
067            public static void unregister(
068                    PortletDisplayTemplateHandler portletDisplayTemplateHandler) {
069    
070                    getPortletDisplayTemplateRegistry().unregister(
071                            portletDisplayTemplateHandler);
072            }
073    
074            public void setPortletDisplayTemplateHandlerRegistry(
075                    PortletDisplayTemplateHandlerRegistry
076                            portletDisplayTemplateHandlerRegistry) {
077    
078                    PortalRuntimePermission.checkSetBeanProperty(getClass());
079    
080                    _portletDisplayTemplateHandlerRegistry =
081                            portletDisplayTemplateHandlerRegistry;
082            }
083    
084            private static PortletDisplayTemplateHandlerRegistry
085                    _portletDisplayTemplateHandlerRegistry;
086    
087    }