001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (C) Alkacon Software (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.gwt.shared.alias;
029
030import java.util.List;
031
032import com.google.gwt.user.client.rpc.IsSerializable;
033
034/**
035 * The class used to transfer validation results from the server to the client.<p>
036 */
037public class CmsAliasEditValidationReply implements IsSerializable {
038
039    /** The rows which need to be changed. */
040    private List<CmsAliasTableRow> m_changedRows;
041
042    /** The error for the new entry alias path text box. */
043    private String m_newEntryAliasError;
044
045    /** The error for the new entry resource path text box. */
046    private String m_newEntryPathError;
047
048    /** The validated new entry. */
049    private CmsAliasTableRow m_validatedNewEntry;
050
051    /**
052     * Default constructor.<p>
053     */
054    public CmsAliasEditValidationReply() {
055
056    }
057
058    /**
059     * Gets the changed rows.<p>
060     *
061     * @return the changed row list
062     */
063    public List<CmsAliasTableRow> getChangedRows() {
064
065        return m_changedRows;
066    }
067
068    /**
069     * Gets the error message for the new entry alias path text box.<p>
070     *
071     * @return an error message
072     */
073    public String getNewEntryAliasError() {
074
075        return m_newEntryAliasError;
076    }
077
078    /**
079     * Gets the error message for the new entry resource path text box.<p>
080     *
081     * @return an error message
082     */
083    public String getNewEntryPathError() {
084
085        return m_newEntryPathError;
086    }
087
088    /**
089     * Gets the validated new entry.<p>
090     *
091     * @return the validated new entry
092     */
093    public CmsAliasTableRow getValidatedNewEntry() {
094
095        return m_validatedNewEntry;
096    }
097
098    /**
099     * Check if this validation result has any errors.<p>
100     *
101     * @return true if the validation result has errors
102     */
103    public boolean hasErrors() {
104
105        if ((m_validatedNewEntry != null) && m_validatedNewEntry.hasErrors()) {
106            return true;
107        }
108        for (CmsAliasTableRow row : m_changedRows) {
109            if (row.hasErrors()) {
110                return true;
111            }
112        }
113        return false;
114    }
115
116    /**
117     * Sets the changed rows.<p>
118     *
119     * @param changedRows the changed rows
120     */
121    public void setChangedRows(List<CmsAliasTableRow> changedRows) {
122
123        m_changedRows = changedRows;
124    }
125
126    /**
127     * Sets the error message for the new entry alias path text box.<p>
128     *
129     * @param newEntryAliasError the error message
130     */
131    public void setNewEntryAliasError(String newEntryAliasError) {
132
133        m_newEntryAliasError = newEntryAliasError;
134    }
135
136    /**
137     * Sets the error message for the new entry resource path text box.<p>
138     *
139     * @param newEntryPathError the error message
140     */
141    public void setNewEntryPathError(String newEntryPathError) {
142
143        m_newEntryPathError = newEntryPathError;
144    }
145
146    /**
147     * Sets the validated new entry.<p>
148     *
149     * @param validatedNewEntry the validated new entry
150     */
151    public void setValidatedNewEntry(CmsAliasTableRow validatedNewEntry) {
152
153        m_validatedNewEntry = validatedNewEntry;
154    }
155
156}