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.portal.kernel.util.StringPool;
18  import com.liferay.portlet.social.model.SocialActivity;
19  import com.liferay.taglib.util.IncludeTag;
20  
21  import java.util.List;
22  
23  import javax.servlet.http.HttpServletRequest;
24  
25  /**
26   * <a href="SocialActivitiesTag.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Raymond Augé
29   */
30  public class SocialActivitiesTag extends IncludeTag {
31  
32      public int doStartTag() {
33          HttpServletRequest request =
34              (HttpServletRequest)pageContext.getRequest();
35  
36          request.setAttribute(
37              "liferay-ui:social-activities:className", _className);
38          request.setAttribute(
39              "liferay-ui:social-activities:classPK", String.valueOf(_classPK));
40  
41          if (_activities != null) {
42              request.setAttribute(
43                  "liferay-ui:social-activities:activities", _activities);
44          }
45  
46          request.setAttribute(
47              "liferay-ui:social-activities:feedEnabled",
48              String.valueOf(_feedEnabled));
49          request.setAttribute(
50              "liferay-ui:social-activities:feedTitle", _feedTitle);
51          request.setAttribute(
52              "liferay-ui:social-activities:feedLink", _feedLink);
53          request.setAttribute(
54              "liferay-ui:social-activities:feedLinkMessage", _feedLinkMessage);
55  
56          return EVAL_BODY_BUFFERED;
57      }
58  
59      public void setClassName(String className) {
60          _className = className;
61      }
62  
63      public void setClassPK(long classPK) {
64          _classPK = classPK;
65      }
66  
67      public void setActivities(List<SocialActivity> activities) {
68          _activities = activities;
69      }
70  
71      public void setFeedEnabled(boolean feedEnabled) {
72          _feedEnabled = feedEnabled;
73      }
74  
75      public void setFeedTitle(String feedTitle) {
76          _feedTitle = feedTitle;
77      }
78  
79      public void setFeedLink(String feedLink) {
80          _feedLink = feedLink;
81      }
82  
83      public void setFeedLinkMessage(String feedLinkMessage) {
84          _feedLinkMessage = feedLinkMessage;
85      }
86  
87      protected String getDefaultPage() {
88          return _PAGE;
89      }
90  
91      private static final String _PAGE =
92          "/html/taglib/ui/social_activities/page.jsp";
93  
94      private String _className = StringPool.BLANK;
95      private long _classPK;
96      private List<SocialActivity> _activities;
97      private boolean _feedEnabled;
98      private String _feedTitle;
99      private String _feedLink = StringPool.BLANK;
100     private String _feedLinkMessage = StringPool.BLANK;
101 
102 }