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.db.CmsResourceState;
031import org.opencms.util.CmsUUID;
032
033import java.util.ArrayList;
034import java.util.LinkedHashMap;
035import java.util.List;
036import java.util.Map;
037
038import com.google.common.collect.Lists;
039import com.google.gwt.user.client.rpc.IsSerializable;
040
041/**
042 * Information used to display the resource info dialog.
043 */
044public class CmsResourceStatusBean implements IsSerializable {
045
046    /** Resource state object. */
047    CmsResourceState m_stateBean;
048
049    /** Additional resource attributes to display. */
050    private Map<String, String> m_additionalAttributes;
051
052    /** Creation date.*/
053    private String m_dateCreated;
054
055    /** Expiration date. */
056    private String m_dateExpired;
057
058    /** Modification date.**/
059    private String m_dateLastModified;
060
061    /** Release date. */
062    private String m_dateReleased;
063
064    /** Last project. */
065    private String m_lastProject;
066
067    /** List info. */
068    private CmsListInfoBean m_listInfo;
069
070    /** Locales of XML content. */
071    private List<String> m_locales;
072
073    /** Lock state. */
074    private String m_lockState;
075
076    /** Navigation text. */
077    private String m_navText;
078
079    /** Relation sources from other sites. */
080    private ArrayList<CmsResourceStatusRelationBean> m_otherSiteRelationSources = Lists.newArrayList();
081
082    /** Permissions. */
083    private String m_permissions;
084
085    /** List of beans representing resources which have relations toward this resource. */
086    private ArrayList<CmsResourceStatusRelationBean> m_relationSources = new ArrayList<CmsResourceStatusRelationBean>();
087
088    /** List of relation target beans. */
089    private ArrayList<CmsResourceStatusRelationBean> m_relationTargets = new ArrayList<CmsResourceStatusRelationBean>();
090
091    /** Resource type. */
092    private String m_resourceType;
093
094    /** Beans representing siblings. */
095    private ArrayList<CmsResourceStatusRelationBean> m_siblings = new ArrayList<CmsResourceStatusRelationBean>();
096
097    /** Size. */
098    private int m_size;
099
100    /** The start tab id. */
101    private CmsResourceStatusTabId m_startTab;
102
103    /** Structure id of the resource. */
104    private CmsUUID m_structureId;
105
106    /** An ordered map defining the tabs to display and their order, with the tab labels as values. */
107    private LinkedHashMap<CmsResourceStatusTabId, String> m_tabs;
108
109    /** Title property. */
110    private String m_title;
111
112    /** Creator. */
113    private String m_userCreated;
114
115    /** Last modifier. */
116    private String m_userLastModified;
117
118    /**
119     * Returns the additional resource attributes to display.<p>
120     * @return the additional resource attributes
121     */
122    public Map<String, String> getAdditionalAttributes() {
123
124        return m_additionalAttributes;
125    }
126
127    /**
128     * Gets the date created.
129     *
130     * @return the date created
131     */
132    public String getDateCreated() {
133
134        return m_dateCreated;
135    }
136
137    /**
138     * Gets the date expired.
139     *
140     * @return the date expired
141     */
142    public String getDateExpired() {
143
144        return m_dateExpired;
145    }
146
147    /**
148     * Gets the date last modified.
149     *
150     * @return the date last modified
151     */
152    public String getDateLastModified() {
153
154        return m_dateLastModified;
155    }
156
157    /**
158     * Gets the date released.
159     *
160     * @return the date released
161     */
162    public String getDateReleased() {
163
164        return m_dateReleased;
165    }
166
167    /**
168     * Gets the last project.
169     *
170     * @return the last project
171     */
172    public String getLastProject() {
173
174        return m_lastProject;
175    }
176
177    /**
178     * Gets the list info.
179     *
180     * @return the list info
181     */
182    public CmsListInfoBean getListInfo() {
183
184        return m_listInfo;
185    }
186
187    /**
188     * Gets the locales.
189     *
190     * @return the locales
191     */
192    public List<String> getLocales() {
193
194        return m_locales;
195    }
196
197    /**
198     * Gets the lock state.
199     *
200     * @return the lock state
201     */
202    public String getLockState() {
203
204        return m_lockState;
205    }
206
207    /**
208     * Gets the nav text.
209     *
210     * @return the nav text
211     */
212    public String getNavText() {
213
214        return m_navText;
215    }
216
217    /**
218     * Gets relation sources for other sites.<p>
219     *
220     * @return relation sources for other sites
221     */
222    public ArrayList<CmsResourceStatusRelationBean> getOtherSiteRelationSources() {
223
224        return m_otherSiteRelationSources;
225    }
226
227    /**
228     * Gets the permissions.
229     *
230     * @return the permissions
231     */
232    public String getPermissions() {
233
234        return m_permissions;
235    }
236
237    /**
238     * Gets the list info beans for the source resources of relations pointing to this resource.<p>
239     *
240     * @return the relation source beans
241     */
242    public ArrayList<CmsResourceStatusRelationBean> getRelationSources() {
243
244        return m_relationSources;
245    }
246
247    /**
248     * Gets the list info beans for the targets of relations pointing away from this resource.<p>
249     *
250     * @return the relation target beans
251     */
252    public ArrayList<CmsResourceStatusRelationBean> getRelationTargets() {
253
254        return m_relationTargets;
255    }
256
257    /**
258     * Gets the resource type.
259     *
260     * @return the resource type
261     */
262    public String getResourceType() {
263
264        return m_resourceType;
265    }
266
267    /**
268     * Gets the sibling information.<p>
269     *
270     * @return the sibling information
271     */
272    public ArrayList<CmsResourceStatusRelationBean> getSiblings() {
273
274        return m_siblings;
275    }
276
277    /**
278     * Gets the size.
279     *
280     * @return the size
281     */
282    public int getSize() {
283
284        return m_size;
285    }
286
287    /**
288     * Gets the start tab.<p>
289     *
290     * @return the start tab
291     */
292    public CmsResourceStatusTabId getStartTab() {
293
294        return m_startTab;
295    }
296
297    /**
298     * Gets the resource state object.<p>
299     *
300     * @return the resource state object
301     */
302    public CmsResourceState getStateBean() {
303
304        return m_stateBean;
305    }
306
307    /**
308     * Gets the structure id of the resource.<p>
309     *
310     * @return the structure id of the resource
311     */
312    public CmsUUID getStructureId() {
313
314        return m_structureId;
315    }
316
317    /**
318     * Gets the tab configuration, which is an ordered map defining the tabs to display and their order, with the tab labels as values.
319     *
320     * @return the tab configuration
321     */
322    public LinkedHashMap<CmsResourceStatusTabId, String> getTabs() {
323
324        return m_tabs;
325    }
326
327    /**
328     * Gets the title.
329     *
330     * @return the title
331     */
332    public String getTitle() {
333
334        return m_title;
335    }
336
337    /**
338     * Gets the user created.
339     *
340     * @return the user created
341     */
342    public String getUserCreated() {
343
344        return m_userCreated;
345    }
346
347    /**
348     * Gets the user last modified.
349     *
350     * @return the user last modified
351     */
352    public String getUserLastModified() {
353
354        return m_userLastModified;
355    }
356
357    /**
358     * Sets the additional resource attributes.<p>
359     *
360     * @param additionalAttributes the additional resource attributes
361     */
362    public void setAdditionalAttributes(Map<String, String> additionalAttributes) {
363
364        m_additionalAttributes = additionalAttributes;
365    }
366
367    /**
368     * Sets the date created.
369     *
370     * @param dateCreated the new date created
371     */
372    public void setDateCreated(String dateCreated) {
373
374        m_dateCreated = dateCreated;
375    }
376
377    /**
378     * Sets the date expired.
379     *
380     * @param dateExpired the new date expired
381     */
382    public void setDateExpired(String dateExpired) {
383
384        m_dateExpired = dateExpired;
385    }
386
387    /**
388     * Sets the date last modified.
389     *
390     * @param dateLastModified the new date last modified
391     */
392    public void setDateLastModified(String dateLastModified) {
393
394        m_dateLastModified = dateLastModified;
395    }
396
397    /**
398     * Sets the date released.
399     *
400     * @param dateReleased the new date released
401     */
402    public void setDateReleased(String dateReleased) {
403
404        m_dateReleased = dateReleased;
405    }
406
407    /**
408     * Sets the last project.
409     *
410     * @param lastProject the new last project
411     */
412    public void setLastProject(String lastProject) {
413
414        m_lastProject = lastProject;
415    }
416
417    /**
418     * Sets the list info.
419     *
420     * @param listInfo the new list info
421     */
422    public void setListInfo(CmsListInfoBean listInfo) {
423
424        m_listInfo = listInfo;
425    }
426
427    /**
428     * Sets the locales.
429     *
430     * @param locales the new locales
431     */
432    public void setLocales(List<String> locales) {
433
434        m_locales = locales;
435    }
436
437    /**
438     * Sets the lock state.
439     *
440     * @param lockState the new lock state
441     */
442    public void setLockState(String lockState) {
443
444        m_lockState = lockState;
445    }
446
447    /**
448     * Sets the nav text.
449     *
450     * @param navText the new nav text
451     */
452    public void setNavText(String navText) {
453
454        m_navText = navText;
455    }
456
457    /**
458     * Sets the permissions.
459     *
460     * @param permissions the new permissions
461     */
462    public void setPermissions(String permissions) {
463
464        m_permissions = permissions;
465    }
466
467    /**
468     * Sets the resource type.
469     *
470     * @param resourceType the new resource type
471     */
472    public void setResourceType(String resourceType) {
473
474        m_resourceType = resourceType;
475    }
476
477    /**
478     * Sets the size.
479     *
480     * @param size the new size
481     */
482    public void setSize(int size) {
483
484        m_size = size;
485    }
486
487    /**
488     * Sets the start tab.<p>
489     *
490     * @param startTab the start tab id
491     */
492    public void setStartTab(CmsResourceStatusTabId startTab) {
493
494        m_startTab = startTab;
495    }
496
497    /**
498     * Sets the resource state object.<p>
499     *
500     * @param stateBean the new resource state object
501     */
502    public void setStateBean(CmsResourceState stateBean) {
503
504        m_stateBean = stateBean;
505    }
506
507    /**
508     * Sets the structure id of the resource.<p>
509     *
510     * @param structureId the structure id of the resource
511     */
512    public void setStructureId(CmsUUID structureId) {
513
514        m_structureId = structureId;
515    }
516
517    /**
518     * Sets the tab configuration.<p>
519     *
520     * @param tabs the tab configuration
521     */
522    public void setTabs(LinkedHashMap<CmsResourceStatusTabId, String> tabs) {
523
524        m_tabs = tabs;
525    }
526
527    /**
528     * Sets the title.
529     *
530     * @param title the new title
531     */
532    public void setTitle(String title) {
533
534        m_title = title;
535    }
536
537    /**
538     * Sets the user created.
539     *
540     * @param userCreated the new user created
541     */
542    public void setUserCreated(String userCreated) {
543
544        m_userCreated = userCreated;
545    }
546
547    /**
548    * Sets the user last modified.
549    *
550    * @param userLastModified the new user last modified
551    */
552    public void setUserLastModified(String userLastModified) {
553
554        m_userLastModified = userLastModified;
555    }
556
557}