1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.taglib.ui;
16  
17  import com.liferay.portal.kernel.util.DiffResult;
18  import com.liferay.taglib.util.IncludeTag;
19  
20  import java.util.List;
21  
22  import javax.servlet.http.HttpServletRequest;
23  
24  /**
25   * <a href="DiffTag.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Bruno Farache
28   */
29  public class DiffTag extends IncludeTag {
30  
31      public void setDiffResults(List<DiffResult>[] diffResults) {
32          _diffResults = diffResults;
33      }
34  
35      public void setSourceName(String sourceName) {
36          _sourceName = sourceName;
37      }
38  
39      public void setTargetName(String targetName) {
40          _targetName = targetName;
41      }
42  
43      protected void cleanUp() {
44          _diffResults = null;
45          _sourceName = null;
46          _targetName = null;
47      }
48  
49      protected String getPage() {
50          return _PAGE;
51      }
52  
53      protected void setAttributes(HttpServletRequest request) {
54          request.setAttribute("liferay-ui:diff:diffResults", _diffResults);
55          request.setAttribute("liferay-ui:diff:sourceName", _sourceName);
56          request.setAttribute("liferay-ui:diff:targetName", _targetName);
57      }
58  
59      private static final String _PAGE = "/html/taglib/ui/diff/page.jsp";
60  
61      private List<DiffResult>[] _diffResults;
62      private String _sourceName;
63      private String _targetName;
64  
65  }