1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.taglib.ui;
16  
17  import com.liferay.taglib.util.IncludeTag;
18  
19  import javax.servlet.http.HttpServletRequest;
20  
21  /**
22   * <a href="JournalArticleTag.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Raymond Augé
25   */
26  public class JournalArticleTag extends IncludeTag {
27  
28      public int doStartTag() {
29          HttpServletRequest request =
30              (HttpServletRequest)pageContext.getRequest();
31  
32          request.setAttribute(
33              "liferay-ui:journal-article:articleResourcePrimKey",
34              String.valueOf(_articleResourcePrimKey));
35          request.setAttribute(
36              "liferay-ui:journal-article:groupId", String.valueOf(_groupId));
37          request.setAttribute(
38              "liferay-ui:journal-article:articleId", _articleId);
39          request.setAttribute(
40              "liferay-ui:journal-article:templateId", _templateId);
41          request.setAttribute(
42              "liferay-ui:journal-article:languageId", _languageId);
43          request.setAttribute(
44              "liferay-ui:journal-article:articlePage",
45              String.valueOf(_articlePage));
46          request.setAttribute(
47              "liferay-ui:journal-article:xmlRequest", _xmlRequest);
48          request.setAttribute(
49              "liferay-ui:journal-article:showTitle", String.valueOf(_showTitle));
50          request.setAttribute(
51              "liferay-ui:journal-article:showAvailableLocales",
52              String.valueOf(_showAvailableLocales));
53  
54          return EVAL_BODY_BUFFERED;
55      }
56  
57      public void setArticleResourcePrimKey(long articleResourcePrimKey) {
58          _articleResourcePrimKey = articleResourcePrimKey;
59      }
60  
61      public void setGroupId(long groupId) {
62          _groupId = groupId;
63      }
64  
65      public void setArticleId(String articleId) {
66          _articleId = articleId;
67      }
68  
69      public void setTemplateId(String templateId) {
70          _templateId = templateId;
71      }
72  
73      public void setLanguageId(String languageId) {
74          _languageId = languageId;
75      }
76  
77      public void setArticlePage(int articlePage) {
78          _articlePage = articlePage;
79      }
80  
81      public void setXmlRequest(String xmlRequest) {
82          _xmlRequest = xmlRequest;
83      }
84  
85      public void setShowTitle(boolean showTitle) {
86          _showTitle = showTitle;
87      }
88  
89      public void setShowAvailableLocales(boolean showAvailableLocales) {
90          _showAvailableLocales = showAvailableLocales;
91      }
92  
93      protected String getDefaultPage() {
94          return _PAGE;
95      }
96  
97      private static final String _PAGE =
98          "/html/taglib/ui/journal_article/page.jsp";
99  
100     private long _articleResourcePrimKey;
101     private long _groupId;
102     private String _articleId;
103     private String _templateId;
104     private String _languageId;
105     private int _articlePage = 1;
106     private String _xmlRequest;
107     private boolean _showTitle;
108     private boolean _showAvailableLocales;
109 
110 }