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.taglib.util.IncludeTag;
23  
24  import javax.portlet.PortletURL;
25  
26  import javax.servlet.http.HttpServletRequest;
27  
28  /**
29   * <a href="TagsSummaryTag.java.html"><b><i>View Source</i></b></a>
30   *
31   * @author Brian Wing Shun Chan
32   *
33   */
34  public class TagsSummaryTag extends IncludeTag {
35  
36      public int doStartTag() {
37          HttpServletRequest request =
38              (HttpServletRequest)pageContext.getRequest();
39  
40          request.setAttribute("liferay-ui:tags_summary:className", _className);
41          request.setAttribute(
42              "liferay-ui:tags_summary:classPK", String.valueOf(_classPK));
43          request.setAttribute("liferay-ui:tags_summary:message", _message);
44          request.setAttribute("liferay-ui:tags_summary:portletURL", _portletURL);
45  
46          return EVAL_BODY_BUFFERED;
47      }
48  
49      public void setClassName(String className) {
50          _className = className;
51      }
52  
53      public void setClassPK(long classPK) {
54          _classPK = classPK;
55      }
56  
57      public void setMessage(String message) {
58          _message = message;
59      }
60  
61      public PortletURL getPortletURL() {
62          return _portletURL;
63      }
64  
65      public void setPortletURL(PortletURL portletURL) {
66          _portletURL = portletURL;
67      }
68  
69      protected String getDefaultPage() {
70          return _PAGE;
71      }
72  
73      private static final String _PAGE = "/html/taglib/ui/tags_summary/page.jsp";
74  
75      private String _className;
76      private long _classPK;
77      private String _message;
78      private PortletURL _portletURL;
79  
80  }