001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (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.ade.sitemap.shared;
029
030import org.opencms.gwt.shared.CmsListInfoBean;
031import org.opencms.util.CmsUUID;
032
033/**
034 * A bean representing a resource type for use in the detail page creation menu.<p>
035 *
036 * @since 8.0.0
037 */
038public class CmsNewResourceInfo extends CmsListInfoBean {
039
040    /** The navigation level create parameter. */
041    public static final String NAVIGATION_LEVEL_PARAMETER = "new_navigation_level";
042
043    /** The structure id of the copy resource. */
044    private CmsUUID m_copyResourceId;
045
046    /** The additional parameter used for creating new resources. */
047    private String m_createParameter;
048
049    /** Date. */
050    private String m_date;
051
052    /** The description. */
053    private String m_description;
054
055    /** True if the user can edit the resource. */
056    private boolean m_editable;
057
058    /** The id. */
059    private int m_id;
060
061    /** If the default flag is set. */
062    private boolean m_isDefault;
063
064    /** The flag which determines whether this bean is for a function page or for a normal detail page. */
065    private boolean m_isFunction;
066
067    /** Navigation position, used for ordering. */
068    private Float m_navPos;
069
070    /** VFS path. */
071    private String m_vfsPath;
072
073    /**
074     * Instantiates a new resource type information bean.
075     *
076     * @param id the id
077     * @param typeName the type name
078     * @param title the title
079     * @param description the description
080     * @param copyResourceId the structure id of the copy resource
081     * @param editable true if the model resource is editable
082     * @param subTitle the subtitle to display
083     */
084    public CmsNewResourceInfo(
085        int id,
086        String typeName,
087        String title,
088        String description,
089        CmsUUID copyResourceId,
090        boolean editable,
091        String subTitle) {
092
093        super(title, subTitle, null);
094        setResourceType(typeName);
095        m_id = id;
096        m_copyResourceId = copyResourceId;
097        m_description = description;
098        m_editable = editable;
099    }
100
101    /**
102     * Empty default constructor for serialization.<p>
103     */
104    protected CmsNewResourceInfo() {
105
106        // do nothing
107    }
108
109    /**
110     * Returns the structure id of the copy resource.<p>
111     *
112     * @return the structure id of the copy resource
113     */
114    public CmsUUID getCopyResourceId() {
115
116        return m_copyResourceId;
117    }
118
119    /**
120     * Gets the additional parameter for creating new resources.<p>
121     *
122     * @return the additional parameter for creating new resources
123     */
124    public String getCreateParameter() {
125
126        return m_createParameter;
127    }
128
129    /**
130     * Returns the date to display.<p>
131     *
132     * @return the date to display
133     */
134    public String getDate() {
135
136        return m_date;
137    }
138
139    /**
140     * Returns the description.<p>
141     *
142     * @return the description
143     */
144    public String getDescription() {
145
146        return m_description;
147    }
148
149    /**
150     * Gets the id.
151     *
152     * @return the id
153     */
154    public int getId() {
155
156        return m_id;
157    }
158
159    /**
160     * Gets the navigation position (used for ordering).<p>
161     *
162     * @return the navigation position
163     */
164    public Float getNavPos() {
165
166        return m_navPos;
167    }
168
169    /**
170     * Gets the VFS path.<p>
171     *
172     * @return the VFS path
173     */
174    public String getVfsPath() {
175
176        return m_vfsPath;
177    }
178
179    /**
180     * Returns the default flag.<p>
181     *
182     * @return the default flag
183     */
184    public boolean isDefault() {
185
186        return m_isDefault;
187    }
188
189    /**
190     * Returns true if the model resource is editable.<p>
191     *
192     * @return true if the model resource is editable
193     */
194    public boolean isEditable() {
195
196        return m_editable;
197    }
198
199    /**
200     * Returns true if this is a resource info bean for a function page.<p>
201     *
202     * @return true if this is a resource info bean for a function page
203     */
204    public boolean isFunction() {
205
206        return m_isFunction;
207    }
208
209    /**
210     * Sets the create parameter used for new pages.<p>
211     *
212     * @param createParameter the create parameter used for new pages
213     */
214    public void setCreateParameter(String createParameter) {
215
216        m_createParameter = createParameter;
217    }
218
219    /**
220     * Sets the modification date string.<p>
221     *
222     * @param date the modification date string
223     */
224    public void setDate(String date) {
225
226        m_date = date;
227    }
228
229    /**
230     * Sets the default flag.<p>
231     *
232     * @param isDefault the default flag to set
233     */
234    public void setDefault(boolean isDefault) {
235
236        m_isDefault = isDefault;
237    }
238
239    /**
240     * Sets the "function page" flag.<p>
241     *
242     * @param isFunction the new value for the function page flag
243     */
244    public void setIsFunction(boolean isFunction) {
245
246        m_isFunction = isFunction;
247    }
248
249    /**
250     * Sets the navigation position.<p>
251     *
252     * @param navPos the navigation position
253     */
254    public void setNavPos(Float navPos) {
255
256        m_navPos = navPos;
257    }
258
259    /**
260     * Sets the VFS path.<p>
261     *
262     * @param vfsPath the VFS path
263     */
264    public void setVfsPath(String vfsPath) {
265
266        m_vfsPath = vfsPath;
267    }
268}