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