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.ade.contenteditor.shared;
029
030import org.opencms.acacia.shared.CmsValidationResult;
031
032import com.google.gwt.user.client.rpc.IsSerializable;
033
034/**
035 * Stores the editor save result information.<p>
036 */
037public class CmsSaveResult implements IsSerializable {
038
039    /** If container element settings where changed. */
040    private boolean m_hasChangedSettings;
041
042    /** The validation result. */
043    private CmsValidationResult m_validationResult;
044
045    /**
046     * Constructor.<p>
047     *
048     * @param hasChangedSettings if container element settings where changed
049     * @param validationResult the validation result
050     */
051    public CmsSaveResult(boolean hasChangedSettings, CmsValidationResult validationResult) {
052
053        m_hasChangedSettings = hasChangedSettings;
054        m_validationResult = validationResult;
055    }
056
057    /**
058     * Constructor for serialization only.<p>
059     */
060    protected CmsSaveResult() {}
061
062    /**
063     * Returns the validation result.<p>
064     *
065     * @return the validation result
066     */
067    public CmsValidationResult getValidationResult() {
068
069        return m_validationResult;
070    }
071
072    /**
073     * Returns whether the validation result has errors.<p>
074     *
075     * @return <code>true</code> in case the validation result has errors
076     */
077    public boolean hasErrors() {
078
079        return (m_validationResult != null) && m_validationResult.hasErrors();
080    }
081
082    /**
083     * Returns whether container element settings where changed.<p>
084     *
085     * @return <ode>true</code> in case container element settings where changed
086     */
087    public boolean isHasChangedSettings() {
088
089        return m_hasChangedSettings;
090    }
091}