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
42 public class UserSearchTag extends TagSupport {
43
44 public int doStartTag() throws JspException {
45 try {
46 HttpServletRequest request =
47 (HttpServletRequest)pageContext.getRequest();
48
49 request.setAttribute(
50 "liferay-ui:user-search:portletURL", _portletURL);
51 request.setAttribute(
52 "liferay-ui:user-search:rowChecker", _rowChecker);
53 request.setAttribute(
54 "liferay-ui:user-search:userParams", _userParams);
55
56 PortalIncludeUtil.include(pageContext, getStartPage());
57
58 return EVAL_BODY_INCLUDE;
59 }
60 catch (Exception e) {
61 throw new JspException(e);
62 }
63 }
64
65 public int doEndTag() throws JspException {
66 try {
67 PortalIncludeUtil.include(pageContext, getEndPage());
68
69 return EVAL_PAGE;
70 }
71 catch (Exception e) {
72 throw new JspException(e);
73 }
74 }
75
76 public String getStartPage() {
77 if (Validator.isNull(_startPage)) {
78 return _START_PAGE;
79 }
80 else {
81 return _startPage;
82 }
83 }
84
85 public void setStartPage(String startPage) {
86 _startPage = startPage;
87 }
88
89 public String getEndPage() {
90 if (Validator.isNull(_endPage)) {
91 return _END_PAGE;
92 }
93 else {
94 return _endPage;
95 }
96 }
97
98 public void setEndPage(String endPage) {
99 _endPage = endPage;
100 }
101
102 public void setPortletURL(PortletURL portletURL) {
103 _portletURL = portletURL;
104 }
105
106 public void setRowChecker(RowChecker rowChecker) {
107 _rowChecker = rowChecker;
108 }
109
110 public void setUserParams(LinkedHashMap<String, Object> userParams) {
111 _userParams = userParams;
112 }
113
114 private static final String _START_PAGE =
115 "/html/taglib/ui/user_search/start.jsp";
116
117 private static final String _END_PAGE =
118 "/html/taglib/ui/user_search/end.jsp";
119
120 private String _startPage;
121 private String _endPage;
122 private PortletURL _portletURL;
123 private RowChecker _rowChecker;
124 private LinkedHashMap<String, Object> _userParams;
125
126 }