001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }