All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opencms.workplace.comparison.CmsImageComparisonDialog Maven / Gradle / Ivy

Go to download

OpenCms is an enterprise-ready, easy to use website content management system based on Java and XML technology. Offering a complete set of features, OpenCms helps content managers worldwide to create and maintain beautiful websites fast and efficiently.

There is a newer version: 18.0
Show newest version
/*
 * This library is part of OpenCms -
 * the Open Source Content Management System
 *
 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * For further information about Alkacon Software, please see the
 * company website: http://www.alkacon.com
 *
 * For further information about OpenCms, please see the
 * project website: http://www.opencms.org
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package org.opencms.workplace.comparison;

import org.opencms.jsp.CmsJspActionElement;
import org.opencms.util.CmsUUID;
import org.opencms.workplace.CmsDialog;

import javax.servlet.jsp.JspWriter;

/**
 * Provides a GUI for displaying two images.

* * @since 6.0.0 */ public class CmsImageComparisonDialog extends CmsDialog { /** Parameter value for the structure id of the first file. */ private String m_paramId1; /** Parameter value for the structure id of the second file. */ private String m_paramId2; /** Parameter value for the version of the first file. */ private String m_paramVersion1; /** Parameter value for the version of the second file. */ private String m_paramVersion2; /** * Default constructor.

* * @param jsp an initialized JSP action element */ public CmsImageComparisonDialog(CmsJspActionElement jsp) { super(jsp); } /** * Performs the dialog actions depending on the initialized action and displays the dialog form.

* * @throws Exception if writing to the JSP out fails */ public void displayDialog() throws Exception { if (getAction() == ACTION_CANCEL) { actionCloseDialog(); } String link1 = CmsHistoryListUtil.getHistoryLink(getCms(), new CmsUUID(m_paramId1), m_paramVersion1); String link2 = CmsHistoryListUtil.getHistoryLink(getCms(), new CmsUUID(m_paramId2), m_paramVersion2); JspWriter out = getJsp().getJspContext().getOut(); out.println(dialogBlockStart(key(Messages.GUI_COMPARE_CONTENT_0))); out.println(dialogContentStart(null)); out.println("

"); out.println(""); out.println("\t\n"); out.println("\t\t\n"); out.println("\t\t\n"); out.println("\t"); out.println("
"); out.println( key( Messages.GUI_COMPARE_VERSION_1, new String[] {CmsHistoryListUtil.getDisplayVersion(m_paramVersion1, getLocale())})); out.println(""); out.println( key( Messages.GUI_COMPARE_VERSION_1, new String[] {CmsHistoryListUtil.getDisplayVersion(m_paramVersion2, getLocale())})); out.println("
  
");
        out.print(
            key(
                Messages.GUI_COMPARE_VERSION_1,
                new String[] {CmsHistoryListUtil.getDisplayVersion(m_paramVersion1, getLocale())}));
        out.print("");
        out.print(
            key(
                Messages.GUI_COMPARE_VERSION_1,
                new String[] {CmsHistoryListUtil.getDisplayVersion(m_paramVersion2, getLocale())}));
        out.print("
"); out.println(dialogBlockEnd()); out.println(dialogContentEnd()); out.println(dialogEnd()); out.println(bodyEnd()); out.println(htmlEnd()); } /** * Returns the paramId1.

* * @return the paramId1 */ public String getParamId1() { return m_paramId1; } /** * Returns the paramId2.

* * @return the paramId2 */ public String getParamId2() { return m_paramId2; } /** * Returns the paramVersion1.

* * @return the paramVersion1 */ public String getParamVersion1() { return m_paramVersion1; } /** * Returns the paramVersion2.

* * @return the paramVersion2 */ public String getParamVersion2() { return m_paramVersion2; } /** * Sets the paramId1.

* * @param paramId1 the paramId1 to set */ public void setParamId1(String paramId1) { m_paramId1 = paramId1; } /** * Sets the paramId2.

* * @param paramId2 the paramId2 to set */ public void setParamId2(String paramId2) { m_paramId2 = paramId2; } /** * Sets the paramVersion1.

* * @param paramVersion1 the paramVersion1 to set */ public void setParamVersion1(String paramVersion1) { m_paramVersion1 = paramVersion1; } /** * Sets the paramVersion2.

* * @param paramVersion2 the paramVersion2 to set */ public void setParamVersion2(String paramVersion2) { m_paramVersion2 = paramVersion2; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy