1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
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 int doStartTag() {
32          HttpServletRequest request =
33              (HttpServletRequest)pageContext.getRequest();
34  
35          request.setAttribute("liferay-ui:diff:diffResults", _diffResults);
36          request.setAttribute("liferay-ui:diff:sourceName", _sourceName);
37          request.setAttribute("liferay-ui:diff:targetName", _targetName);
38  
39          return EVAL_BODY_BUFFERED;
40      }
41  
42      public void setDiffResults(List<DiffResult>[] diffResults) {
43          _diffResults = diffResults;
44      }
45  
46      public void setSourceName(String sourceName) {
47          _sourceName = sourceName;
48      }
49  
50      public void setTargetName(String targetName) {
51          _targetName = targetName;
52      }
53  
54      protected String getDefaultPage() {
55          return _PAGE;
56      }
57  
58      private static final String _PAGE = "/html/taglib/ui/diff/page.jsp";
59  
60      private List<DiffResult>[] _diffResults;
61      private String _sourceName;
62      private String _targetName;
63  
64  }