001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.workplace.comparison; 029 030import org.opencms.jsp.CmsJspActionElement; 031 032import javax.servlet.http.HttpServletRequest; 033import javax.servlet.http.HttpServletResponse; 034import javax.servlet.jsp.PageContext; 035 036/** 037 * Provides a GUI for the file comparison dialog.<p> 038 * 039 * @since 6.0.0 040 */ 041public class CmsDifferenceDialog extends A_CmsDiffViewDialog { 042 043 /** The content of the second file to compare. */ 044 private String m_copySource; 045 046 /** The content of the first file to compare. */ 047 private String m_originalSource; 048 049 /** Parameter value indicating wether to compare properties, attributes or elements. */ 050 private String m_paramCompare; 051 052 /** Parameter value for the element name. */ 053 private String m_paramElement; 054 055 /** Parameter value for the locale. */ 056 private String m_paramLocale; 057 058 /** Parameter value for the structure id of the first file. */ 059 private String m_paramId1; 060 061 /** Parameter value for the structure id of the second file. */ 062 private String m_paramId2; 063 064 /** Parameter value for the tag id of the first file. */ 065 private String m_paramTagId1; 066 067 /** Parameter value for the tag id of the second file. */ 068 private String m_paramTagId2; 069 070 /** Parameter value for the text mode. */ 071 private String m_paramTextmode; 072 073 /** Parameter value for the version of the first file. */ 074 private String m_paramVersion1; 075 076 /** Parameter value for the version of the second file. */ 077 private String m_paramVersion2; 078 079 /** 080 * Default constructor.<p> 081 * 082 * @param jsp an initialized JSP action element 083 */ 084 public CmsDifferenceDialog(CmsJspActionElement jsp) { 085 086 super(jsp); 087 } 088 089 /** 090 * Public constructor with JSP variables.<p> 091 * 092 * @param context the JSP page context 093 * @param req the JSP request 094 * @param res the JSP response 095 */ 096 public CmsDifferenceDialog(PageContext context, HttpServletRequest req, HttpServletResponse res) { 097 098 this(new CmsJspActionElement(context, req, res)); 099 } 100 101 /** 102 * Returns the paramCompare.<p> 103 * 104 * @return the paramCompare 105 */ 106 public String getParamCompare() { 107 108 return m_paramCompare; 109 } 110 111 /** 112 * Returns the paramElement.<p> 113 * 114 * @return the paramElement 115 */ 116 public String getParamElement() { 117 118 return m_paramElement; 119 } 120 121 /** 122 * Returns the paramLocale.<p> 123 * 124 * @return the paramLocale 125 */ 126 public String getParamLocale() { 127 128 return m_paramLocale; 129 } 130 131 /** 132 * Returns the paramId1.<p> 133 * 134 * @return the paramId1 135 */ 136 public String getParamId1() { 137 138 return m_paramId1; 139 } 140 141 /** 142 * Returns the paramId2.<p> 143 * 144 * @return the paramId2 145 */ 146 public String getParamId2() { 147 148 return m_paramId2; 149 } 150 151 /** 152 * Returns the paramTagId1.<p> 153 * 154 * @return the paramTagId1 155 */ 156 public String getParamTagId1() { 157 158 return m_paramTagId1; 159 } 160 161 /** 162 * Returns the paramTagId2.<p> 163 * 164 * @return the paramTagId2 165 */ 166 public String getParamTagId2() { 167 168 return m_paramTagId2; 169 } 170 171 /** 172 * Returns the paramTextmode.<p> 173 * 174 * @return the paramTextmode 175 */ 176 public String getParamTextmode() { 177 178 return m_paramTextmode; 179 } 180 181 /** 182 * Returns the paramVersion1.<p> 183 * 184 * @return the paramVersion1 185 */ 186 public String getParamVersion1() { 187 188 return m_paramVersion1; 189 } 190 191 /** 192 * Returns the paramVersion2.<p> 193 * 194 * @return the paramVersion2 195 */ 196 public String getParamVersion2() { 197 198 return m_paramVersion2; 199 } 200 201 /** 202 * Sets the copySource.<p> 203 * 204 * @param copySource the copySource to set 205 */ 206 public void setCopySource(String copySource) { 207 208 m_copySource = copySource; 209 } 210 211 /** 212 * Sets the originalSource.<p> 213 * 214 * @param originalSource the originalSource to set 215 */ 216 public void setOriginalSource(String originalSource) { 217 218 m_originalSource = originalSource; 219 } 220 221 /** 222 * Sets the paramCompare.<p> 223 * 224 * @param paramCompare the paramCompare to set 225 */ 226 public void setParamCompare(String paramCompare) { 227 228 m_paramCompare = paramCompare; 229 } 230 231 /** 232 * Sets the paramElement.<p> 233 * 234 * @param paramElement the paramElement to set 235 */ 236 public void setParamElement(String paramElement) { 237 238 m_paramElement = paramElement; 239 } 240 241 /** 242 * Sets the paramLocale.<p> 243 * 244 * @param paramLocale the paramLocale to set 245 */ 246 public void setParamLocale(String paramLocale) { 247 248 m_paramLocale = paramLocale; 249 } 250 251 /** 252 * Sets the paramId1.<p> 253 * 254 * @param paramId1 the paramId1 to set 255 */ 256 public void setParamId1(String paramId1) { 257 258 m_paramId1 = paramId1; 259 } 260 261 /** 262 * Sets the paramId2.<p> 263 * 264 * @param paramId2 the paramId2 to set 265 */ 266 public void setParamId2(String paramId2) { 267 268 m_paramId2 = paramId2; 269 } 270 271 /** 272 * Sets the paramTagId1.<p> 273 * 274 * @param paramTagId1 the paramTagId1 to set 275 */ 276 public void setParamTagId1(String paramTagId1) { 277 278 m_paramTagId1 = paramTagId1; 279 } 280 281 /** 282 * Sets the paramTagId2.<p> 283 * 284 * @param paramTagId2 the paramTagId2 to set 285 */ 286 public void setParamTagId2(String paramTagId2) { 287 288 m_paramTagId2 = paramTagId2; 289 } 290 291 /** 292 * Sets the paramTextmode.<p> 293 * 294 * @param paramTextmode the paramTextmode to set 295 */ 296 public void setParamTextmode(String paramTextmode) { 297 298 m_paramTextmode = paramTextmode; 299 } 300 301 /** 302 * Sets the paramVersion1.<p> 303 * 304 * @param paramVersion1 the paramVersion1 to set 305 */ 306 public void setParamVersion1(String paramVersion1) { 307 308 m_paramVersion1 = paramVersion1; 309 } 310 311 /** 312 * Sets the paramVersion2.<p> 313 * 314 * @param paramVersion2 the paramVersion2 to set 315 */ 316 public void setParamVersion2(String paramVersion2) { 317 318 m_paramVersion2 = paramVersion2; 319 } 320 321 /** 322 * 323 * @see org.opencms.workplace.comparison.A_CmsDiffViewDialog#getCopySource() 324 */ 325 @Override 326 protected String getCopySource() { 327 328 return m_copySource; 329 } 330 331 /** 332 * 333 * @see org.opencms.workplace.comparison.A_CmsDiffViewDialog#getLinesBeforeSkip() 334 */ 335 @Override 336 protected int getLinesBeforeSkip() { 337 338 return 2; 339 } 340 341 /** 342 * 343 * @see org.opencms.workplace.comparison.A_CmsDiffViewDialog#getOriginalSource() 344 */ 345 @Override 346 protected String getOriginalSource() { 347 348 return m_originalSource; 349 } 350 351 /** 352 * 353 * @see org.opencms.workplace.comparison.A_CmsDiffViewDialog#validateParamaters() 354 */ 355 @Override 356 protected void validateParamaters() { 357 358 // noop 359 } 360}