001    /**
002     * Copyright (c) 2000-present 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.layoutsadmin.util;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
019    import com.liferay.portal.theme.ThemeDisplay;
020    
021    /**
022     * @author Raymond Aug??
023     */
024    public class SitemapUtil {
025    
026            public static String encodeXML(String input) {
027                    return getSitemap().encodeXML(input);
028            }
029    
030            public static Sitemap getSitemap() {
031                    PortalRuntimePermission.checkGetBeanProperty(SitemapUtil.class);
032    
033                    return _sitemap;
034            }
035    
036            public static String getSitemap(
037                            long groupId, boolean privateLayout, ThemeDisplay themeDisplay)
038                    throws PortalException {
039    
040                    return getSitemap().getSitemap(groupId, privateLayout, themeDisplay);
041            }
042    
043            public void setSitemap(Sitemap sitemap) {
044                    PortalRuntimePermission.checkSetBeanProperty(getClass());
045    
046                    _sitemap = sitemap;
047            }
048    
049            private static Sitemap _sitemap;
050    
051    }