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.ade.postupload.shared;
029
030import org.opencms.gwt.shared.CmsListInfoBean;
031import org.opencms.gwt.shared.property.CmsClientProperty;
032import org.opencms.util.CmsUUID;
033import org.opencms.xml.content.CmsXmlContentProperty;
034
035import java.util.Map;
036
037import com.google.gwt.user.client.rpc.IsSerializable;
038
039/**
040 * A bean representing the state of a single resource to be edited in the upload property dialog.<p>
041 */
042public class CmsPostUploadDialogPanelBean implements IsSerializable {
043
044    /** The high-res preview link. */
045    private String m_highResPreviewLink;
046
047    /** The page info for displaying the CmsListItemWidget. */
048    private CmsListInfoBean m_infoBean;
049
050    /** The full-size preview link. */
051    private String m_permalink;
052
053    /** The first image preview info text. */
054    private String m_previewInfo1;
055
056    /** The second preview info text. */
057    private String m_previewInfo2;
058
059    /** The image preview URL. */
060    private String m_previewLink;
061
062    /** The properties of the resource. */
063    private Map<String, CmsClientProperty> m_properties;
064
065    /** The property definitions for the resource type of the resource. */
066    private Map<String, CmsXmlContentProperty> m_propertyDefinitions;
067
068    /** The structure id of the resource. */
069    private CmsUUID m_structureId;
070
071    /** The warning to display. */
072    private String m_warning;
073
074    /**
075     * Creates a new instance.<p>
076     */
077    public CmsPostUploadDialogPanelBean() {
078
079    }
080
081    /**
082     * Creates a new instance.<p>
083     *
084     * @param structureId the structure id of the resource
085     * @param infoBean the list info bean
086     */
087    public CmsPostUploadDialogPanelBean(CmsUUID structureId, CmsListInfoBean infoBean) {
088
089        m_structureId = structureId;
090        m_infoBean = infoBean;
091
092    }
093
094    /**
095     * Gets the high-res preview link.
096     * 
097     * @return the high-res preview link
098     */
099    public String getHighResPreviewLink() {
100
101        return m_highResPreviewLink;
102    }
103
104    /**
105     * Gets the info bean for the resource.<p>
106     *
107     * @return the info bean for the resource
108     */
109    public CmsListInfoBean getInfoBean() {
110
111        return m_infoBean;
112    }
113
114    /**
115     * Gets the full size preview permalink.
116     *
117     * @return the full size preview link
118     */
119    public String getPermalink() {
120
121        return m_permalink;
122    }
123
124    /**
125     * Gets the first preview info text to display.
126     *
127     * @return a preview info text
128     */
129    public String getPreviewInfo1() {
130
131        return m_previewInfo1;
132    }
133
134    /**
135     * Gets the second preview info text to display.
136     *
137     * @return a preview info text
138     */
139    public String getPreviewInfo2() {
140
141        return m_previewInfo2;
142    }
143
144    /**
145     * Gets the image preview URL.
146     *
147     * @return the image preview URL, if it exists, and null otherwise
148     */
149    public String getPreviewLink() {
150
151        return m_previewLink;
152    }
153
154    /**
155     * Gets the properties for the resource.<p>
156     *
157     * @return the map of properties by property name
158     */
159    public Map<String, CmsClientProperty> getProperties() {
160
161        return m_properties;
162    }
163
164    /**
165     * Gets the property definitions for the type of the resource.<p>
166     *
167     * @return the map of property definitions by property names
168     */
169    public Map<String, CmsXmlContentProperty> getPropertyDefinitions() {
170
171        return m_propertyDefinitions;
172    }
173
174    /**
175     * Gets the structure id of the resource.<p>
176     *
177     * @return the user id
178     */
179    public CmsUUID getStructureId() {
180
181        return m_structureId;
182    }
183
184    /**
185     * Gets the warning to display.
186     *
187     * @return the warning to display
188     */
189    public String getWarning() {
190
191        return m_warning;
192    }
193
194    /**
195     * Sets the high-res preview link.
196     * 
197     * @param highResPreviewLink the high-res preview link
198     */
199    public void setHighResPreviewLink(String highResPreviewLink) {
200
201        m_highResPreviewLink = highResPreviewLink;
202    }
203
204    /**
205     * Sets the list info bean for the resource.<p>
206     *
207     * @param info the list info bean for the resource
208     */
209    public void setInfoBean(CmsListInfoBean info) {
210
211        m_infoBean = info;
212    }
213
214    /**
215     * Sets the full-size preview permalink.
216     * 
217     * @param permalink the full-size preview permalink
218     */
219    public void setPermalink(String permalink) {
220
221        m_permalink = permalink;
222    }
223
224    /**
225     * Sets the first preview info text.
226     *
227     * @param text the preview info text
228     *
229     */
230    public void setPreviewInfo1(String text) {
231
232        this.m_previewInfo1 = text;
233    }
234
235    /**
236     * Sets the second preview info text.
237     *
238     * @param text the preview info text
239     */
240    public void setPreviewInfo2(String text) {
241
242        this.m_previewInfo2 = text;
243    }
244
245    /**
246     * Sets the image preview URL.
247     *
248     * @param previewLink the image preview URL
249     */
250    public void setPreviewLink(String previewLink) {
251
252        m_previewLink = previewLink;
253    }
254
255    /**
256     * Sets the properties for the resource.<p>
257     *
258     * @param properties the properties for the resource
259     */
260    public void setProperties(Map<String, CmsClientProperty> properties) {
261
262        m_properties = properties;
263
264    }
265
266    /**
267     * Sets the property definitions for the type of the resource.<p>
268     *
269     * @param propertyDefinitions the map of property definitions
270     */
271    public void setPropertyDefinitions(Map<String, CmsXmlContentProperty> propertyDefinitions) {
272
273        m_propertyDefinitions = propertyDefinitions;
274    }
275
276    /**
277     * Sets the structure id of the resource.<p>
278     *
279     * @param structureId the structure id of the resource
280     */
281    public void setStructureId(CmsUUID structureId) {
282
283        m_structureId = structureId;
284    }
285
286    /**
287     * Sets the warning to display.
288     *
289     * @param warning the warning to display
290     */
291    public void setWarning(String warning) {
292
293        m_warning = warning;
294    }
295
296}