/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.frontend.taglib.servlet.taglib;
import com.liferay.frontend.taglib.internal.servlet.ServletContextUtil;
import com.liferay.portal.kernel.diff.DiffResult;
import com.liferay.taglib.util.IncludeTag;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.PageContext;
/**
* @author Bruno Farache
*/
public class DiffTag extends IncludeTag {
public void setDiffResults(List<DiffResult>[] diffResults) {
_diffResults = diffResults;
}
@Override
public void setPageContext(PageContext pageContext) {
super.setPageContext(pageContext);
servletContext = ServletContextUtil.getServletContext();
}
public void setSourceName(String sourceName) {
_sourceName = sourceName;
}
public void setTargetName(String targetName) {
_targetName = targetName;
}
@Override
protected void cleanUp() {
_diffResults = null;
_sourceName = null;
_targetName = null;
}
@Override
protected String getPage() {
return _PAGE;
}
@Override
protected void setAttributes(HttpServletRequest request) {
request.setAttribute("liferay-frontend:diff:diffResults", _diffResults);
request.setAttribute("liferay-frontend:diff:sourceName", _sourceName);
request.setAttribute("liferay-frontend:diff:targetName", _targetName);
}
private static final String _PAGE = "/diff/page.jsp";
private List<DiffResult>[] _diffResults;
private String _sourceName;
private String _targetName;
}