001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (C) Alkacon Software (https://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: https://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: https://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 long 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    /** Custom error message to display in the relation sources tab. */
119    private String m_sourcesError;
120
121    /** Custom error message to display in the relation targets tab. */
122    private String m_targetsError;
123
124    private String m_formattedSize;
125
126    /**
127     * Returns the additional resource attributes to display.<p>
128     * @return the additional resource attributes
129     */
130    public Map<String, String> getAdditionalAttributes() {
131
132        return m_additionalAttributes;
133    }
134
135    /**
136     * Gets the date created.
137     *
138     * @return the date created
139     */
140    public String getDateCreated() {
141
142        return m_dateCreated;
143    }
144
145    /**
146     * Gets the date expired.
147     *
148     * @return the date expired
149     */
150    public String getDateExpired() {
151
152        return m_dateExpired;
153    }
154
155    /**
156     * Gets the date last modified.
157     *
158     * @return the date last modified
159     */
160    public String getDateLastModified() {
161
162        return m_dateLastModified;
163    }
164
165    /**
166     * Gets the date released.
167     *
168     * @return the date released
169     */
170    public String getDateReleased() {
171
172        return m_dateReleased;
173    }
174
175    /**
176     * Gets the size formatted as a string.
177     *
178     * @return the formatted size
179     */
180    public String getFormattedSize() {
181
182        return m_formattedSize;
183    }
184
185    /**
186     * Gets the last project.
187     *
188     * @return the last project
189     */
190    public String getLastProject() {
191
192        return m_lastProject;
193    }
194
195    /**
196     * Gets the list info.
197     *
198     * @return the list info
199     */
200    public CmsListInfoBean getListInfo() {
201
202        return m_listInfo;
203    }
204
205    /**
206     * Gets the locales.
207     *
208     * @return the locales
209     */
210    public List<String> getLocales() {
211
212        return m_locales;
213    }
214
215    /**
216     * Gets the lock state.
217     *
218     * @return the lock state
219     */
220    public String getLockState() {
221
222        return m_lockState;
223    }
224
225    /**
226     * Gets the nav text.
227     *
228     * @return the nav text
229     */
230    public String getNavText() {
231
232        return m_navText;
233    }
234
235    /**
236     * Gets relation sources for other sites.<p>
237     *
238     * @return relation sources for other sites
239     */
240    public ArrayList<CmsResourceStatusRelationBean> getOtherSiteRelationSources() {
241
242        return m_otherSiteRelationSources;
243    }
244
245    /**
246     * Gets the permissions.
247     *
248     * @return the permissions
249     */
250    public String getPermissions() {
251
252        return m_permissions;
253    }
254
255    /**
256     * Gets the list info beans for the source resources of relations pointing to this resource.<p>
257     *
258     * @return the relation source beans
259     */
260    public ArrayList<CmsResourceStatusRelationBean> getRelationSources() {
261
262        return m_relationSources;
263    }
264
265    /**
266     * Gets the list info beans for the targets of relations pointing away from this resource.<p>
267     *
268     * @return the relation target beans
269     */
270    public ArrayList<CmsResourceStatusRelationBean> getRelationTargets() {
271
272        return m_relationTargets;
273    }
274
275    /**
276     * Gets the resource type.
277     *
278     * @return the resource type
279     */
280    public String getResourceType() {
281
282        return m_resourceType;
283    }
284
285    /**
286     * Gets the sibling information.<p>
287     *
288     * @return the sibling information
289     */
290    public ArrayList<CmsResourceStatusRelationBean> getSiblings() {
291
292        return m_siblings;
293    }
294
295    /**
296     * Gets the size.
297     *
298     * @return the size
299     */
300    public long getSize() {
301
302        return m_size;
303    }
304
305    /**
306     * Gets the custom error message for the relation sources tab.
307     *
308     * @return the custom error message for the relation sources tab
309     */
310    public String getSourcesError() {
311
312        return m_sourcesError;
313    }
314
315    /**
316     * Gets the start tab.<p>
317     *
318     * @return the start tab
319     */
320    public CmsResourceStatusTabId getStartTab() {
321
322        return m_startTab;
323    }
324
325    /**
326     * Gets the resource state object.<p>
327     *
328     * @return the resource state object
329     */
330    public CmsResourceState getStateBean() {
331
332        return m_stateBean;
333    }
334
335    /**
336     * Gets the structure id of the resource.<p>
337     *
338     * @return the structure id of the resource
339     */
340    public CmsUUID getStructureId() {
341
342        return m_structureId;
343    }
344
345    /**
346     * Gets the tab configuration, which is an ordered map defining the tabs to display and their order, with the tab labels as values.
347     *
348     * @return the tab configuration
349     */
350    public LinkedHashMap<CmsResourceStatusTabId, String> getTabs() {
351
352        return m_tabs;
353    }
354
355    /**
356     * Gets the custom error message for the relation targets tab.
357     *
358     * @return the custom error message for the relation target tab
359     */
360    public String getTargetsError() {
361
362        return m_targetsError;
363    }
364
365    /**
366     * Gets the title.
367     *
368     * @return the title
369     */
370    public String getTitle() {
371
372        return m_title;
373    }
374
375    /**
376     * Gets the user created.
377     *
378     * @return the user created
379     */
380    public String getUserCreated() {
381
382        return m_userCreated;
383    }
384
385    /**
386     * Gets the user last modified.
387     *
388     * @return the user last modified
389     */
390    public String getUserLastModified() {
391
392        return m_userLastModified;
393    }
394
395    /**
396     * Sets the additional resource attributes.<p>
397     *
398     * @param additionalAttributes the additional resource attributes
399     */
400    public void setAdditionalAttributes(Map<String, String> additionalAttributes) {
401
402        m_additionalAttributes = additionalAttributes;
403    }
404
405    /**
406     * Sets the date created.
407     *
408     * @param dateCreated the new date created
409     */
410    public void setDateCreated(String dateCreated) {
411
412        m_dateCreated = dateCreated;
413    }
414
415    /**
416     * Sets the date expired.
417     *
418     * @param dateExpired the new date expired
419     */
420    public void setDateExpired(String dateExpired) {
421
422        m_dateExpired = dateExpired;
423    }
424
425    /**
426     * Sets the date last modified.
427     *
428     * @param dateLastModified the new date last modified
429     */
430    public void setDateLastModified(String dateLastModified) {
431
432        m_dateLastModified = dateLastModified;
433    }
434
435    /**
436     * Sets the date released.
437     *
438     * @param dateReleased the new date released
439     */
440    public void setDateReleased(String dateReleased) {
441
442        m_dateReleased = dateReleased;
443    }
444
445    /**
446     * Sets the size formatted as a string.
447     *
448     * @param formattedSize the formatted size
449     */
450    public void setFormattedSize(String formattedSize) {
451
452        m_formattedSize = formattedSize;
453    }
454
455    /**
456     * Sets the last project.
457     *
458     * @param lastProject the new last project
459     */
460    public void setLastProject(String lastProject) {
461
462        m_lastProject = lastProject;
463    }
464
465    /**
466     * Sets the list info.
467     *
468     * @param listInfo the new list info
469     */
470    public void setListInfo(CmsListInfoBean listInfo) {
471
472        m_listInfo = listInfo;
473    }
474
475    /**
476     * Sets the locales.
477     *
478     * @param locales the new locales
479     */
480    public void setLocales(List<String> locales) {
481
482        m_locales = locales;
483    }
484
485    /**
486     * Sets the lock state.
487     *
488     * @param lockState the new lock state
489     */
490    public void setLockState(String lockState) {
491
492        m_lockState = lockState;
493    }
494
495    /**
496     * Sets the nav text.
497     *
498     * @param navText the new nav text
499     */
500    public void setNavText(String navText) {
501
502        m_navText = navText;
503    }
504
505    /**
506     * Sets the permissions.
507     *
508     * @param permissions the new permissions
509     */
510    public void setPermissions(String permissions) {
511
512        m_permissions = permissions;
513    }
514
515    /**
516     * Sets the resource type.
517     *
518     * @param resourceType the new resource type
519     */
520    public void setResourceType(String resourceType) {
521
522        m_resourceType = resourceType;
523    }
524
525    /**
526     * Sets the size.
527     *
528     * @param size the new size
529     */
530    public void setSize(long size) {
531
532        m_size = size;
533    }
534
535    /**
536     * Sets the custom error message for the relation sources tab.
537     *
538     * @param sourcesError the custom error message
539     */
540    public void setSourcesError(String sourcesError) {
541
542        m_sourcesError = sourcesError;
543    }
544
545    /**
546     * Sets the start tab.<p>
547     *
548     * @param startTab the start tab id
549     */
550    public void setStartTab(CmsResourceStatusTabId startTab) {
551
552        m_startTab = startTab;
553    }
554
555    /**
556     * Sets the resource state object.<p>
557     *
558     * @param stateBean the new resource state object
559     */
560    public void setStateBean(CmsResourceState stateBean) {
561
562        m_stateBean = stateBean;
563    }
564
565    /**
566     * Sets the structure id of the resource.<p>
567     *
568     * @param structureId the structure id of the resource
569     */
570    public void setStructureId(CmsUUID structureId) {
571
572        m_structureId = structureId;
573    }
574
575    /**
576     * Sets the tab configuration.<p>
577     *
578     * @param tabs the tab configuration
579     */
580    public void setTabs(LinkedHashMap<CmsResourceStatusTabId, String> tabs) {
581
582        m_tabs = tabs;
583    }
584
585    /**
586     * Sets the custom error message for the relation target tab.
587     *
588     * @param targetsError the custom error message
589     */
590    public void setTargetsError(String targetsError) {
591
592        m_targetsError = targetsError;
593    }
594
595    /**
596     * Sets the title.
597     *
598     * @param title the new title
599     */
600    public void setTitle(String title) {
601
602        m_title = title;
603    }
604
605    /**
606     * Sets the user created.
607     *
608     * @param userCreated the new user created
609     */
610    public void setUserCreated(String userCreated) {
611
612        m_userCreated = userCreated;
613    }
614
615    /**
616    * Sets the user last modified.
617    *
618    * @param userLastModified the new user last modified
619    */
620    public void setUserLastModified(String userLastModified) {
621
622        m_userLastModified = userLastModified;
623    }
624
625}