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;
029
030import org.opencms.util.CmsUUID;
031
032import com.google.gwt.user.client.rpc.IsSerializable;
033
034/**
035 * The bean with the necessary information for the "Restore" dialog.<p>
036 */
037public class CmsRestoreInfoBean implements IsSerializable {
038
039    /** A flag which indicates whether a move operation can be undone. */
040    private boolean m_canUndoMove;
041
042    /** The bean containing the data for the list item widget. */
043    private CmsListInfoBean m_listInfoBean;
044
045    /** The offline modification date. */
046    private String m_offlineDate;
047
048    /** The offline root path of the resource. */
049    private String m_offlinePath;
050
051    /** The online modification date. */
052    private String m_onlineDate;
053
054    /** The online root path of the resource. */
055    private String m_onlinePath;
056
057    /** The structure id of the resource. */
058    private CmsUUID m_structureId;
059
060    /**
061     * Creates a new instance.<p>
062     */
063    public CmsRestoreInfoBean() {
064
065        // empty
066    }
067
068    /**
069     * Returns true if the move operation can be undone.<p>
070     *
071     * @return true if the move operation can be undone
072     */
073    public boolean canUndoMove() {
074
075        return m_canUndoMove;
076    }
077
078    /**
079     * Gets the bean containing the information for the file info box.<p>
080     *
081     * @return the bean with the information for the file info box
082     */
083    public CmsListInfoBean getListInfoBean() {
084
085        return m_listInfoBean;
086    }
087
088    /**
089     * Gets the offline modification date.<p>
090     *
091     * @return the offline modification date
092     */
093    public String getOfflineDate() {
094
095        return m_offlineDate;
096    }
097
098    /**
099     * Gets the offline root path of the resource.<p>
100     *
101     * @return the offline path of the resource
102     */
103    public String getOfflinePath() {
104
105        return m_offlinePath;
106    }
107
108    /**
109     * Gets the online modification date.<p>
110     *
111     * @return the online modification date
112     */
113    public String getOnlineDate() {
114
115        return m_onlineDate;
116    }
117
118    /**
119     * Gets the online root path of the resource.<p>
120     *
121     * @return the online path of the resource
122     */
123    public String getOnlinePath() {
124
125        return m_onlinePath;
126    }
127
128    /**
129     * Gets the structure id of the resource for which changes should be undone.<p>
130     *
131     * @return the structure id of the resource which changes should be undone
132     */
133    public CmsUUID getStructureId() {
134
135        return m_structureId;
136    }
137
138    /**
139     * Returns true if the resource was moved.<p>
140     *
141     * @return true if the resource was moved
142     */
143    public boolean isMoved() {
144
145        return !m_offlinePath.equals(m_onlinePath);
146    }
147
148    /**
149     * Sets the 'canUndoMove' property.<p>
150     *
151     * @param canUndoMove the new value for the 'canUndoMove' property
152     */
153    public void setCanUndoMove(boolean canUndoMove) {
154
155        m_canUndoMove = canUndoMove;
156    }
157
158    /**
159     * Sets the list info bean for the resource.<p>
160     *
161     * @param listInfoBean the list info bean for the resource
162     */
163    public void setListInfoBean(CmsListInfoBean listInfoBean) {
164
165        m_listInfoBean = listInfoBean;
166    }
167
168    /**
169     * Sets the offline modification date.<p>
170     *
171     * @param offlineDate the offline modification date
172     */
173    public void setOfflineDate(String offlineDate) {
174
175        m_offlineDate = offlineDate;
176    }
177
178    /**
179     * Sets the offline root path.<p>
180     *
181     * @param offlinePath the offline path
182     */
183    public void setOfflinePath(String offlinePath) {
184
185        m_offlinePath = offlinePath;
186    }
187
188    /**
189     * Sets the online modification date.<p>
190     *
191     * @param onlineDate the online modification date
192     */
193    public void setOnlineDate(String onlineDate) {
194
195        m_onlineDate = onlineDate;
196    }
197
198    /**
199     * Sets the online root path.<p>
200     *
201     * @param onlinePath the online root path
202     */
203    public void setOnlinePath(String onlinePath) {
204
205        m_onlinePath = onlinePath;
206    }
207
208    /**
209     * Sets the structure id of the resource.<p>
210     *
211     * @param structureId the structure id to set
212     */
213    public void setStructureId(CmsUUID structureId) {
214
215        m_structureId = structureId;
216    }
217
218}