1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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 void setArticleId(String articleId) {
29          _articleId = articleId;
30      }
31  
32      public void setArticlePage(int articlePage) {
33          _articlePage = articlePage;
34      }
35  
36      public void setArticleResourcePrimKey(long articleResourcePrimKey) {
37          _articleResourcePrimKey = articleResourcePrimKey;
38      }
39  
40      public void setGroupId(long groupId) {
41          _groupId = groupId;
42      }
43  
44      public void setLanguageId(String languageId) {
45          _languageId = languageId;
46      }
47  
48      public void setShowAvailableLocales(boolean showAvailableLocales) {
49          _showAvailableLocales = showAvailableLocales;
50      }
51  
52      public void setShowTitle(boolean showTitle) {
53          _showTitle = showTitle;
54      }
55  
56      public void setTemplateId(String templateId) {
57          _templateId = templateId;
58      }
59  
60      public void setXmlRequest(String xmlRequest) {
61          _xmlRequest = xmlRequest;
62      }
63  
64      protected void cleanUp() {
65          _articleId = null;
66          _articlePage = 1;
67          _articleResourcePrimKey = 0;
68          _groupId = 0;
69          _languageId = null;
70          _showAvailableLocales = false;
71          _showTitle = false;
72          _templateId = null;
73          _xmlRequest = null;
74      }
75  
76      protected String getPage() {
77          return _PAGE;
78      }
79  
80      protected void setAttributes(HttpServletRequest request) {
81          request.setAttribute(
82              "liferay-ui:journal-article:articleId", _articleId);
83          request.setAttribute(
84              "liferay-ui:journal-article:articlePage",
85              String.valueOf(_articlePage));
86          request.setAttribute(
87              "liferay-ui:journal-article:articleResourcePrimKey",
88              String.valueOf(_articleResourcePrimKey));
89          request.setAttribute(
90              "liferay-ui:journal-article:groupId", String.valueOf(_groupId));
91          request.setAttribute(
92              "liferay-ui:journal-article:languageId", _languageId);
93          request.setAttribute(
94              "liferay-ui:journal-article:showAvailableLocales",
95              String.valueOf(_showAvailableLocales));
96          request.setAttribute(
97              "liferay-ui:journal-article:showTitle", String.valueOf(_showTitle));
98          request.setAttribute(
99              "liferay-ui:journal-article:templateId", _templateId);
100         request.setAttribute(
101             "liferay-ui:journal-article:xmlRequest", _xmlRequest);
102     }
103 
104     private static final String _PAGE =
105         "/html/taglib/ui/journal_article/page.jsp";
106 
107     private String _articleId;
108     private int _articlePage = 1;
109     private long _articleResourcePrimKey;
110     private long _groupId;
111     private String _languageId;
112     private boolean _showAvailableLocales;
113     private boolean _showTitle;
114     private String _templateId;
115     private String _xmlRequest;
116 
117 }