001
014
015 package com.liferay.taglib.ui;
016
017 import com.liferay.taglib.util.IncludeTag;
018
019 import javax.portlet.PortletURL;
020
021 import javax.servlet.http.HttpServletRequest;
022
023
026 public class TrashUndoTag extends IncludeTag {
027
028 @Override
029 public int doStartTag() {
030 return EVAL_BODY_INCLUDE;
031 }
032
033 public void setPortletURL(PortletURL portletURL) {
034 _portletURL = portletURL.toString();
035 }
036
037 public void setPortletURL(String portletURL) {
038 _portletURL = portletURL;
039 }
040
041 public void setRedirect(String redirect) {
042 _redirect = redirect;
043 }
044
045 @Override
046 protected void cleanUp() {
047 _portletURL = null;
048 _redirect = null;
049 }
050
051 @Override
052 protected String getPage() {
053 return _PAGE;
054 }
055
056 @Override
057 protected boolean isCleanUpSetAttributes() {
058 return _CLEAN_UP_SET_ATTRIBUTES;
059 }
060
061 @Override
062 protected void setAttributes(HttpServletRequest request) {
063 request.setAttribute("liferay-ui:trash-undo:portletURL", _portletURL);
064 request.setAttribute("liferay-ui:trash-undo:redirect", _redirect);
065 }
066
067 private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
068
069 private static final String _PAGE = "/html/taglib/ui/trash_undo/page.jsp";
070
071 private String _portletURL;
072 private String _redirect;
073
074 }