001
014
015 package com.liferay.taglib.ui;
016
017 import com.liferay.portal.kernel.util.PortalClassLoaderUtil;
018
019 import javax.servlet.http.HttpServletRequest;
020
021
024 public class SearchIteratorTag<R> extends SearchPaginatorTag<R> {
025
026 public void setPaginate(boolean paginate) {
027 _paginate = paginate;
028 }
029
030 @Override
031 protected void cleanUp() {
032 super.cleanUp();
033
034 _paginate = true;
035 }
036
037 @Override
038 protected String getPage() {
039 return _PAGE;
040 }
041
042 @Override
043 protected void include(String page) throws Exception {
044 Thread currentThread = Thread.currentThread();
045
046 ClassLoader contextClassLoader = currentThread.getContextClassLoader();
047
048 try {
049 currentThread.setContextClassLoader(
050 PortalClassLoaderUtil.getClassLoader());
051
052 super.include(page);
053 }
054 finally {
055 currentThread.setContextClassLoader(contextClassLoader);
056 }
057 }
058
059 @Override
060 protected void setAttributes(HttpServletRequest request) {
061 super.setAttributes(request);
062
063 request.setAttribute(
064 "liferay-ui:search-iterator:paginate", String.valueOf(_paginate));
065 }
066
067 private static final String _PAGE =
068 "/html/taglib/ui/search_iterator/page.jsp";
069
070 private boolean _paginate = true;
071
072 }