001    /**
002     * Copyright (c) 2000-2010 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.taglib.ui;
016    
017    import com.liferay.taglib.util.IncludeTag;
018    
019    import javax.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Raymond Augé
023     */
024    public class JournalArticleTag extends IncludeTag {
025    
026            public void setArticleId(String articleId) {
027                    _articleId = articleId;
028            }
029    
030            public void setArticlePage(int articlePage) {
031                    _articlePage = articlePage;
032            }
033    
034            public void setArticleResourcePrimKey(long articleResourcePrimKey) {
035                    _articleResourcePrimKey = articleResourcePrimKey;
036            }
037    
038            public void setGroupId(long groupId) {
039                    _groupId = groupId;
040            }
041    
042            public void setLanguageId(String languageId) {
043                    _languageId = languageId;
044            }
045    
046            public void setShowAvailableLocales(boolean showAvailableLocales) {
047                    _showAvailableLocales = showAvailableLocales;
048            }
049    
050            public void setShowTitle(boolean showTitle) {
051                    _showTitle = showTitle;
052            }
053    
054            public void setTemplateId(String templateId) {
055                    _templateId = templateId;
056            }
057    
058            public void setXmlRequest(String xmlRequest) {
059                    _xmlRequest = xmlRequest;
060            }
061    
062            protected void cleanUp() {
063                    _articleId = null;
064                    _articlePage = 1;
065                    _articleResourcePrimKey = 0;
066                    _groupId = 0;
067                    _languageId = null;
068                    _showAvailableLocales = false;
069                    _showTitle = false;
070                    _templateId = null;
071                    _xmlRequest = null;
072            }
073    
074            protected String getPage() {
075                    return _PAGE;
076            }
077    
078            protected void setAttributes(HttpServletRequest request) {
079                    request.setAttribute(
080                            "liferay-ui:journal-article:articleId", _articleId);
081                    request.setAttribute(
082                            "liferay-ui:journal-article:articlePage",
083                            String.valueOf(_articlePage));
084                    request.setAttribute(
085                            "liferay-ui:journal-article:articleResourcePrimKey",
086                            String.valueOf(_articleResourcePrimKey));
087                    request.setAttribute(
088                            "liferay-ui:journal-article:groupId", String.valueOf(_groupId));
089                    request.setAttribute(
090                            "liferay-ui:journal-article:languageId", _languageId);
091                    request.setAttribute(
092                            "liferay-ui:journal-article:showAvailableLocales",
093                            String.valueOf(_showAvailableLocales));
094                    request.setAttribute(
095                            "liferay-ui:journal-article:showTitle", String.valueOf(_showTitle));
096                    request.setAttribute(
097                            "liferay-ui:journal-article:templateId", _templateId);
098                    request.setAttribute(
099                            "liferay-ui:journal-article:xmlRequest", _xmlRequest);
100            }
101    
102            private static final String _PAGE =
103                    "/html/taglib/ui/journal_article/page.jsp";
104    
105            private String _articleId;
106            private int _articlePage = 1;
107            private long _articleResourcePrimKey;
108            private long _groupId;
109            private String _languageId;
110            private boolean _showAvailableLocales;
111            private boolean _showTitle;
112            private String _templateId;
113            private String _xmlRequest;
114    
115    }