001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (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.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        super(title, subTitle, null);
093        setResourceType(typeName);
094        m_id = id;
095        m_copyResourceId = copyResourceId;
096        m_description = description;
097        m_editable = editable;
098    }
099
100    /**
101     * Empty default constructor for serialization.<p>
102     */
103    protected CmsNewResourceInfo() {
104
105        // do nothing
106    }
107
108    /**
109     * Returns the structure id of the copy resource.<p>
110     *
111     * @return the structure id of the copy resource
112     */
113    public CmsUUID getCopyResourceId() {
114
115        return m_copyResourceId;
116    }
117
118    /**
119     * Gets the additional parameter for creating new resources.<p>
120     *
121     * @return the additional parameter for creating new resources
122     */
123    public String getCreateParameter() {
124
125        return m_createParameter;
126    }
127
128    /**
129     * Returns the date to display.<p>
130     *
131     * @return the date to display
132     */
133    public String getDate() {
134
135        return m_date;
136    }
137
138    /**
139     * Returns the description.<p>
140     *
141     * @return the description
142     */
143    public String getDescription() {
144
145        return m_description;
146    }
147
148    /**
149     * Gets the id.
150     *
151     * @return the id
152     */
153    public int getId() {
154
155        return m_id;
156    }
157
158    /**
159     * Gets the navigation position (used for ordering).<p>
160     *
161     * @return the navigation position
162     */
163    public Float getNavPos() {
164
165        return m_navPos;
166    }
167
168    /**
169     * Gets the VFS path.<p>
170     *
171     * @return the VFS path
172     */
173    public String getVfsPath() {
174
175        return m_vfsPath;
176    }
177
178    /**
179     * Returns the default flag.<p>
180     *
181     * @return the default flag
182     */
183    public boolean isDefault() {
184
185        return m_isDefault;
186    }
187
188    /**
189     * Returns true if the model resource is editable.<p>
190     *
191     * @return true if the model resource is editable
192     */
193    public boolean isEditable() {
194
195        return m_editable;
196    }
197
198    /**
199     * Returns true if this is a resource info bean for a function page.<p>
200     *
201     * @return true if this is a resource info bean for a function page
202     */
203    public boolean isFunction() {
204
205        return m_isFunction;
206    }
207
208    /**
209     * Sets the create parameter used for new pages.<p>
210     *
211     * @param createParameter the create parameter used for new pages
212     */
213    public void setCreateParameter(String createParameter) {
214
215        m_createParameter = createParameter;
216    }
217
218    /**
219     * Sets the modification date string.<p>
220     *
221     * @param date the modification date string
222     */
223    public void setDate(String date) {
224
225        m_date = date;
226    }
227
228    /**
229     * Sets the default flag.<p>
230     *
231     * @param isDefault the default flag to set
232     */
233    public void setDefault(boolean isDefault) {
234
235        m_isDefault = isDefault;
236    }
237
238    /**
239     * Sets the "function page" flag.<p>
240     *
241     * @param isFunction the new value for the function page flag
242     */
243    public void setIsFunction(boolean isFunction) {
244
245        m_isFunction = isFunction;
246    }
247
248    /**
249     * Sets the navigation position.<p>
250     *
251     * @param navPos the navigation position
252     */
253    public void setNavPos(Float navPos) {
254
255        m_navPos = navPos;
256    }
257
258    /**
259     * Sets the VFS path.<p>
260     *
261     * @param vfsPath the VFS path
262     */
263    public void setVfsPath(String vfsPath) {
264
265        m_vfsPath = vfsPath;
266    }
267}