1
22
23 package com.liferay.taglib.ui;
24
25 import com.liferay.portal.kernel.dao.search.RowChecker;
26 import com.liferay.portal.kernel.servlet.PortalIncludeUtil;
27 import com.liferay.portal.kernel.util.Validator;
28
29 import java.util.LinkedHashMap;
30
31 import javax.portlet.PortletURL;
32
33 import javax.servlet.http.HttpServletRequest;
34 import javax.servlet.jsp.JspException;
35 import javax.servlet.jsp.tagext.TagSupport;
36
37
43 public class GroupSearchTag extends TagSupport {
44
45 public int doStartTag() throws JspException {
46 try {
47 HttpServletRequest request =
48 (HttpServletRequest)pageContext.getRequest();
49
50 request.setAttribute(
51 "liferay-ui:group-search:portletURL", _portletURL);
52 request.setAttribute(
53 "liferay-ui:group-search:rowChecker", _rowChecker);
54 request.setAttribute(
55 "liferay-ui:group-search:groupParams", _groupParams);
56
57 PortalIncludeUtil.include(pageContext, getStartPage());
58
59 return EVAL_BODY_INCLUDE;
60 }
61 catch (Exception e) {
62 throw new JspException(e);
63 }
64 }
65
66 public int doEndTag() throws JspException {
67 try {
68 PortalIncludeUtil.include(pageContext, getEndPage());
69
70 return EVAL_PAGE;
71 }
72 catch (Exception e) {
73 throw new JspException(e);
74 }
75 }
76
77 public String getStartPage() {
78 if (Validator.isNull(_startPage)) {
79 return _START_PAGE;
80 }
81 else {
82 return _startPage;
83 }
84 }
85
86 public void setStartPage(String startPage) {
87 _startPage = startPage;
88 }
89
90 public String getEndPage() {
91 if (Validator.isNull(_endPage)) {
92 return _END_PAGE;
93 }
94 else {
95 return _endPage;
96 }
97 }
98
99 public void setEndPage(String endPage) {
100 _endPage = endPage;
101 }
102
103 public void setPortletURL(PortletURL portletURL) {
104 _portletURL = portletURL;
105 }
106
107 public void setRowChecker(RowChecker rowChecker) {
108 _rowChecker = rowChecker;
109 }
110
111 public void setGroupParams(LinkedHashMap<String, Object> groupParams) {
112 _groupParams = groupParams;
113 }
114
115 private static final String _START_PAGE =
116 "/html/taglib/ui/group_search/start.jsp";
117
118 private static final String _END_PAGE =
119 "/html/taglib/ui/group_search/end.jsp";
120
121 private String _startPage;
122 private String _endPage;
123 private PortletURL _portletURL;
124 private RowChecker _rowChecker;
125 private LinkedHashMap<String, Object> _groupParams;
126
127 }