1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.taglib.ui;
24  
25  import com.liferay.taglib.util.IncludeTag;
26  
27  import javax.servlet.http.HttpServletRequest;
28  
29  /**
30   * <a href="JournalArticleTag.java.html"><b><i>View Source</i></b></a>
31   *
32   * @author Raymond Augé
33   *
34   */
35  public class JournalArticleTag extends IncludeTag {
36  
37      public int doStartTag() {
38          HttpServletRequest request =
39              (HttpServletRequest)pageContext.getRequest();
40  
41          request.setAttribute(
42              "liferay-ui:journal-article:articleResourcePrimKey",
43              String.valueOf(_articleResourcePrimKey));
44          request.setAttribute(
45              "liferay-ui:journal-article:groupId", String.valueOf(_groupId));
46          request.setAttribute(
47              "liferay-ui:journal-article:articleId", _articleId);
48          request.setAttribute(
49              "liferay-ui:journal-template:templateId", _templateId);
50          request.setAttribute(
51              "liferay-ui:journal-article:languageId", _languageId);
52          request.setAttribute(
53              "liferay-ui:journal-article:articlePage",
54              String.valueOf(_articlePage));
55          request.setAttribute(
56              "liferay-ui:journal-article:xmlRequest", _xmlRequest);
57          request.setAttribute(
58              "liferay-ui:journal-article:showTitle", String.valueOf(_showTitle));
59          request.setAttribute(
60              "liferay-ui:journal-article:showAvailableLocales",
61              String.valueOf(_showAvailableLocales));
62  
63          return EVAL_BODY_BUFFERED;
64      }
65  
66      public void setArticleResourcePrimKey(long articleResourcePrimKey) {
67          _articleResourcePrimKey = articleResourcePrimKey;
68      }
69  
70      public void setGroupId(long groupId) {
71          _groupId = groupId;
72      }
73  
74      public void setArticleId(String articleId) {
75          _articleId = articleId;
76      }
77  
78      public void setTemplateId(String templateId) {
79          _templateId = templateId;
80      }
81  
82      public void setLanguageId(String languageId) {
83          _languageId = languageId;
84      }
85  
86      public void setArticlePage(int articlePage) {
87          _articlePage = articlePage;
88      }
89  
90      public void setXmlRequest(String xmlRequest) {
91          _xmlRequest = xmlRequest;
92      }
93  
94      public void setShowTitle(boolean showTitle) {
95          _showTitle = showTitle;
96      }
97  
98      public void setShowAvailableLocales(boolean showAvailableLocales) {
99          _showAvailableLocales = showAvailableLocales;
100     }
101 
102     protected String getDefaultPage() {
103         return _PAGE;
104     }
105 
106     private static final String _PAGE =
107         "/html/taglib/ui/journal_article/page.jsp";
108 
109     private long _articleResourcePrimKey;
110     private long _groupId;
111     private String _articleId;
112     private String _templateId;
113     private String _languageId;
114     private int _articlePage = 1;
115     private String _xmlRequest;
116     private boolean _showTitle;
117     private boolean _showAvailableLocales;
118 
119 }