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 void setActivities(List<SocialActivity> activities) {
33          _activities = activities;
34      }
35  
36      public void setClassName(String className) {
37          _className = className;
38      }
39  
40      public void setClassPK(long classPK) {
41          _classPK = classPK;
42      }
43  
44      public void setFeedEnabled(boolean feedEnabled) {
45          _feedEnabled = feedEnabled;
46      }
47  
48      public void setFeedLink(String feedLink) {
49          _feedLink = feedLink;
50      }
51  
52      public void setFeedLinkMessage(String feedLinkMessage) {
53          _feedLinkMessage = feedLinkMessage;
54      }
55  
56      public void setFeedTitle(String feedTitle) {
57          _feedTitle = feedTitle;
58      }
59  
60      protected void cleanUp() {
61          _activities = null;
62          _className = StringPool.BLANK;
63          _classPK = 0;
64          _feedEnabled = false;
65          _feedLink = StringPool.BLANK;
66          _feedLinkMessage = StringPool.BLANK;
67          _feedTitle = null;
68      }
69  
70      protected String getPage() {
71          return _PAGE;
72      }
73  
74      protected void setAttributes(HttpServletRequest request) {
75          request.setAttribute(
76              "liferay-ui:social-activities:activities", _activities);
77          request.setAttribute(
78              "liferay-ui:social-activities:className", _className);
79          request.setAttribute(
80              "liferay-ui:social-activities:classPK", String.valueOf(_classPK));
81          request.setAttribute(
82              "liferay-ui:social-activities:feedEnabled",
83              String.valueOf(_feedEnabled));
84          request.setAttribute(
85              "liferay-ui:social-activities:feedLink", _feedLink);
86          request.setAttribute(
87              "liferay-ui:social-activities:feedLinkMessage", _feedLinkMessage);
88          request.setAttribute(
89              "liferay-ui:social-activities:feedTitle", _feedTitle);
90      }
91  
92      private static final String _PAGE =
93          "/html/taglib/ui/social_activities/page.jsp";
94  
95      private List<SocialActivity> _activities;
96      private String _className = StringPool.BLANK;
97      private long _classPK;
98      private boolean _feedEnabled;
99      private String _feedLink = StringPool.BLANK;
100     private String _feedLinkMessage = StringPool.BLANK;
101     private String _feedTitle;
102 
103 }