001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.taglib.ui;
016    
017    import com.liferay.portal.kernel.util.DiffResult;
018    import com.liferay.taglib.util.IncludeTag;
019    
020    import java.util.List;
021    
022    import javax.servlet.http.HttpServletRequest;
023    
024    /**
025     * @author Bruno Farache
026     */
027    public class DiffTag extends IncludeTag {
028    
029            public void setDiffResults(List<DiffResult>[] diffResults) {
030                    _diffResults = diffResults;
031            }
032    
033            public void setSourceName(String sourceName) {
034                    _sourceName = sourceName;
035            }
036    
037            public void setTargetName(String targetName) {
038                    _targetName = targetName;
039            }
040    
041            protected void cleanUp() {
042                    _diffResults = null;
043                    _sourceName = null;
044                    _targetName = null;
045            }
046    
047            protected String getPage() {
048                    return _PAGE;
049            }
050    
051            protected void setAttributes(HttpServletRequest request) {
052                    request.setAttribute("liferay-ui:diff:diffResults", _diffResults);
053                    request.setAttribute("liferay-ui:diff:sourceName", _sourceName);
054                    request.setAttribute("liferay-ui:diff:targetName", _targetName);
055            }
056    
057            private static final String _PAGE = "/html/taglib/ui/diff/page.jsp";
058    
059            private List<DiffResult>[] _diffResults;
060            private String _sourceName;
061            private String _targetName;
062    
063    }