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.portal.util;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    import java.util.Set;
020    
021    /**
022     * @author Ryan Park
023     * @author Brian Wing Shun Chan
024     */
025    public class CustomJspRegistryUtil {
026    
027            public static String getCustomJspFileName(
028                    String servletContextName, String fileName) {
029    
030                    return getCustomJspRegistry().getCustomJspFileName(
031                            servletContextName, fileName);
032            }
033    
034            public static CustomJspRegistry getCustomJspRegistry() {
035                    PortalRuntimePermission.checkGetBeanProperty(
036                            CustomJspRegistryUtil.class);
037    
038                    return _customJspRegistry;
039            }
040    
041            public static String getDisplayName(String servletContextName) {
042                    return getCustomJspRegistry().getDisplayName(servletContextName);
043            }
044    
045            public static Set<String> getServletContextNames() {
046                    return getCustomJspRegistry().getServletContextNames();
047            }
048    
049            public static void registerServletContextName(
050                    String servletContextName, String displayName) {
051    
052                    getCustomJspRegistry().registerServletContextName(
053                            servletContextName, displayName);
054            }
055    
056            public static void unregisterServletContextName(String servletContextName) {
057                    getCustomJspRegistry().unregisterServletContextName(servletContextName);
058            }
059    
060            public void setCustomJspRegistry(CustomJspRegistry customJspRegistry) {
061                    PortalRuntimePermission.checkSetBeanProperty(getClass());
062    
063                    _customJspRegistry = customJspRegistry;
064            }
065    
066            private static CustomJspRegistry _customJspRegistry;
067    
068    }