1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.taglib.ui;
21  
22  import com.liferay.portal.kernel.util.StringPool;
23  import com.liferay.portlet.social.model.SocialActivity;
24  import com.liferay.taglib.util.IncludeTag;
25  
26  import java.util.List;
27  
28  import javax.servlet.http.HttpServletRequest;
29  
30  /**
31   * <a href="SocialActivitiesTag.java.html"><b><i>View Source</i></b></a>
32   *
33   * @author Raymond Augé
34   *
35   */
36  public class SocialActivitiesTag extends IncludeTag {
37  
38      public int doStartTag() {
39          HttpServletRequest request =
40              (HttpServletRequest)pageContext.getRequest();
41  
42          request.setAttribute(
43              "liferay-ui:social-activities:className", _className);
44          request.setAttribute(
45              "liferay-ui:social-activities:classPK", String.valueOf(_classPK));
46  
47          if (_activities != null) {
48              request.setAttribute(
49                  "liferay-ui:social-activities:activities", _activities);
50          }
51  
52          request.setAttribute(
53              "liferay-ui:social-activities:feedEnabled",
54              String.valueOf(_feedEnabled));
55          request.setAttribute(
56              "liferay-ui:social-activities:feedTitle", _feedTitle);
57          request.setAttribute(
58              "liferay-ui:social-activities:feedLink", _feedLink);
59          request.setAttribute(
60              "liferay-ui:social-activities:feedLinkMessage", _feedLinkMessage);
61  
62          return EVAL_BODY_BUFFERED;
63      }
64  
65      public void setClassName(String className) {
66          _className = className;
67      }
68  
69      public void setClassPK(long classPK) {
70          _classPK = classPK;
71      }
72  
73      public void setActivities(List<SocialActivity> activities) {
74          _activities = activities;
75      }
76  
77      public void setFeedEnabled(boolean feedEnabled) {
78          _feedEnabled = feedEnabled;
79      }
80  
81      public void setFeedTitle(String feedTitle) {
82          _feedTitle = feedTitle;
83      }
84  
85      public void setFeedLink(String feedLink) {
86          _feedLink = feedLink;
87      }
88  
89      public void setFeedLinkMessage(String feedLinkMessage) {
90          _feedLinkMessage = feedLinkMessage;
91      }
92  
93      protected String getDefaultPage() {
94          return _PAGE;
95      }
96  
97      private static final String _PAGE =
98          "/html/taglib/ui/social_activities/page.jsp";
99  
100     private String _className = StringPool.BLANK;
101     private long _classPK;
102     private List<SocialActivity> _activities;
103     private boolean _feedEnabled;
104     private String _feedTitle;
105     private String _feedLink = StringPool.BLANK;
106     private String _feedLinkMessage = StringPool.BLANK;
107 
108 }