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.portlet.journalcontent.util;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    import com.liferay.portal.theme.ThemeDisplay;
019    import com.liferay.portlet.journal.model.JournalArticleDisplay;
020    
021    /**
022     * @author Raymond Aug??
023     */
024    public class JournalContentUtil {
025    
026            public static void clearCache() {
027                    getJournalContent().clearCache();
028            }
029    
030            public static void clearCache(
031                    long groupId, String articleId, String templateId) {
032    
033                    getJournalContent().clearCache(groupId, articleId, templateId);
034            }
035    
036            public static String getContent(
037                    long groupId, String articleId, String viewMode, String languageId,
038                    String xmlRequest) {
039    
040                    return getJournalContent().getContent(
041                            groupId, articleId, viewMode, languageId, xmlRequest);
042            }
043    
044            public static String getContent(
045                    long groupId, String articleId, String templateId, String viewMode,
046                    String languageId, String xmlRequest) {
047    
048                    return getJournalContent().getContent(
049                            groupId, articleId, templateId, viewMode, languageId, xmlRequest);
050            }
051    
052            public static String getContent(
053                    long groupId, String articleId, String templateId, String viewMode,
054                    String languageId, ThemeDisplay themeDisplay) {
055    
056                    return getJournalContent().getContent(
057                            groupId, articleId, templateId, viewMode, languageId, themeDisplay);
058            }
059    
060            public static String getContent(
061                    long groupId, String articleId, String templateId, String viewMode,
062                    String languageId, ThemeDisplay themeDisplay, String xmlRequest) {
063    
064                    return getJournalContent().getContent(
065                            groupId, articleId, templateId, viewMode, languageId, themeDisplay);
066            }
067    
068            public static String getContent(
069                    long groupId, String articleId, String viewMode, String languageId,
070                    ThemeDisplay themeDisplay) {
071    
072                    return getJournalContent().getContent(
073                            groupId, articleId, viewMode, languageId, themeDisplay);
074            }
075    
076            public static JournalArticleDisplay getDisplay(
077                            long groupId, String articleId, double version, String templateId,
078                            String viewMode, String languageId, ThemeDisplay themeDisplay,
079                            int page, String xmlRequest) {
080    
081                    return getJournalContent().getDisplay(
082                            groupId, articleId, version, templateId, viewMode, languageId,
083                            themeDisplay, page, xmlRequest);
084            }
085    
086            public static JournalArticleDisplay getDisplay(
087                    long groupId, String articleId, String viewMode, String languageId,
088                    String xmlRequest) {
089    
090                    return getJournalContent().getDisplay(
091                            groupId, articleId, viewMode, languageId, xmlRequest);
092            }
093    
094            public static JournalArticleDisplay getDisplay(
095                    long groupId, String articleId, String templateId, String viewMode,
096                    String languageId, String xmlRequest) {
097    
098                    return getJournalContent().getDisplay(
099                            groupId, articleId, templateId, viewMode, languageId, xmlRequest);
100            }
101    
102            public static JournalArticleDisplay getDisplay(
103                    long groupId, String articleId, String templateId, String viewMode,
104                    String languageId, ThemeDisplay themeDisplay) {
105    
106                    return getJournalContent().getDisplay(
107                            groupId, articleId, templateId, viewMode, languageId, themeDisplay);
108            }
109    
110            public static JournalArticleDisplay getDisplay(
111                    long groupId, String articleId, String templateId, String viewMode,
112                    String languageId, ThemeDisplay themeDisplay, int page,
113                    String xmlRequest) {
114    
115                    return getJournalContent().getDisplay(
116                            groupId, articleId, templateId, viewMode, languageId, themeDisplay,
117                            page, xmlRequest);
118            }
119    
120            public static JournalArticleDisplay getDisplay(
121                    long groupId, String articleId, String viewMode, String languageId,
122                    ThemeDisplay themeDisplay) {
123    
124                    return getJournalContent().getDisplay(
125                            groupId, articleId, viewMode, languageId, themeDisplay);
126            }
127    
128            public static JournalArticleDisplay getDisplay(
129                    long groupId, String articleId, String viewMode, String languageId,
130                    ThemeDisplay themeDisplay, int page) {
131    
132                    return getJournalContent().getDisplay(
133                            groupId, articleId, viewMode, languageId, themeDisplay, page);
134            }
135    
136            public static JournalContent getJournalContent() {
137                    PortalRuntimePermission.checkGetBeanProperty(JournalContentUtil.class);
138    
139                    return _journalContent;
140            }
141    
142            public void setJournalContent(JournalContent journalContent) {
143                    PortalRuntimePermission.checkSetBeanProperty(getClass());
144    
145                    _journalContent = journalContent;
146            }
147    
148            private static JournalContent _journalContent;
149    
150    }