1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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.portlet.social.model.SocialActivity;
27  import com.liferay.taglib.util.IncludeTag;
28  
29  import java.util.List;
30  
31  import javax.servlet.http.HttpServletRequest;
32  
33  /**
34   * <a href="SocialActivitiesTag.java.html"><b><i>View Source</i></b></a>
35   *
36   * @author Raymond Augé
37   */
38  public class SocialActivitiesTag extends IncludeTag {
39  
40      public int doStartTag() {
41          HttpServletRequest request =
42              (HttpServletRequest)pageContext.getRequest();
43  
44          request.setAttribute(
45              "liferay-ui:social-activities:className", _className);
46          request.setAttribute(
47              "liferay-ui:social-activities:classPK", String.valueOf(_classPK));
48  
49          if (_activities != null) {
50              request.setAttribute(
51                  "liferay-ui:social-activities:activities", _activities);
52          }
53  
54          request.setAttribute(
55              "liferay-ui:social-activities:feedEnabled",
56              String.valueOf(_feedEnabled));
57          request.setAttribute(
58              "liferay-ui:social-activities:feedTitle", _feedTitle);
59          request.setAttribute(
60              "liferay-ui:social-activities:feedLink", _feedLink);
61          request.setAttribute(
62              "liferay-ui:social-activities:feedLinkMessage", _feedLinkMessage);
63  
64          return EVAL_BODY_BUFFERED;
65      }
66  
67      public void setClassName(String className) {
68          _className = className;
69      }
70  
71      public void setClassPK(long classPK) {
72          _classPK = classPK;
73      }
74  
75      public void setActivities(List<SocialActivity> activities) {
76          _activities = activities;
77      }
78  
79      public void setFeedEnabled(boolean feedEnabled) {
80          _feedEnabled = feedEnabled;
81      }
82  
83      public void setFeedTitle(String feedTitle) {
84          _feedTitle = feedTitle;
85      }
86  
87      public void setFeedLink(String feedLink) {
88          _feedLink = feedLink;
89      }
90  
91      public void setFeedLinkMessage(String feedLinkMessage) {
92          _feedLinkMessage = feedLinkMessage;
93      }
94  
95      protected String getDefaultPage() {
96          return _PAGE;
97      }
98  
99      private static final String _PAGE =
100         "/html/taglib/ui/social_activities/page.jsp";
101 
102     private String _className = StringPool.BLANK;
103     private long _classPK;
104     private List<SocialActivity> _activities;
105     private boolean _feedEnabled;
106     private String _feedTitle;
107     private String _feedLink = StringPool.BLANK;
108     private String _feedLinkMessage = StringPool.BLANK;
109 
110 }