1   /**
2    * Copyright (c) 2000-2008 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.portal.kernel.util.StringPool;
26  import com.liferay.taglib.util.IncludeTag;
27  
28  import javax.servlet.ServletRequest;
29  
30  /**
31   * <a href="JournalArticleTag.java.html"><b><i>View Source</i></b></a>
32   *
33   * @author Raymond Augé
34   *
35   */
36  public class JournalArticleTag extends IncludeTag {
37  
38      public int doStartTag() {
39          ServletRequest req = pageContext.getRequest();
40  
41          req.setAttribute(
42              "liferay-ui:journal-article:classPK", String.valueOf(_classPK));
43          req.setAttribute("liferay-ui:journal-article:languageId", _languageId);
44          req.setAttribute(
45              "liferay-ui:journal-article:articlePage",
46              String.valueOf(_articlePage));
47          req.setAttribute("liferay-ui:journal-article:xmlRequest", _xmlRequest);
48          req.setAttribute(
49              "liferay-ui:journal-article:showTitle", String.valueOf(_showTitle));
50          req.setAttribute(
51              "liferay-ui:journal-article:showAvailableLocales",
52              String.valueOf(_showAvailableLocales));
53  
54          return EVAL_BODY_BUFFERED;
55      }
56  
57      public void setClassPK(long classPK) {
58          _classPK = classPK;
59      }
60  
61      public void setLanguageId(String languageId) {
62          _languageId = languageId;
63      }
64  
65      public void setArticlePage(int articlePage) {
66          _articlePage = articlePage;
67      }
68  
69      public void setXmlRequest(String xmlRequest) {
70          _xmlRequest = xmlRequest;
71      }
72  
73      public void setShowTitle(boolean showTitle) {
74          _showTitle = showTitle;
75      }
76  
77      public void setShowAvailableLocales(boolean showAvailableLocales) {
78          _showAvailableLocales = showAvailableLocales;
79      }
80  
81      protected String getDefaultPage() {
82          return _PAGE;
83      }
84  
85      private static final String _PAGE =
86          "/html/taglib/ui/journal_article/page.jsp";
87  
88      private long _classPK;
89      private String _languageId;
90      private int _articlePage = 1;
91      private String _xmlRequest = StringPool.BLANK;
92      private boolean _showTitle;
93      private boolean _showAvailableLocales;
94  
95  }