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.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    }