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.gwt.shared.property;
029
030import com.google.gwt.user.client.rpc.IsSerializable;
031
032/**
033 * Sitemap initialization data.<p>
034 *
035 * @since 8.0
036 */
037public class CmsClientTemplateBean implements IsSerializable {
038
039    /** The description. */
040    private String m_description;
041
042    /** The image path. */
043    private String m_imgPath;
044
045    /** True if the template should be displayed with weak text. */
046    private boolean m_showWeakText;
047
048    /** The site path. */
049    private String m_sitePath;
050
051    /** The title. */
052    private String m_title;
053
054    /**
055     * Constructor.<p>
056     */
057    public CmsClientTemplateBean() {
058
059        // empty
060    }
061
062    /**
063     * Constructor.<p>
064     *
065     * @param title the title
066     * @param description the description
067     * @param sitePath the site path
068     * @param imgPath the image path
069     */
070    public CmsClientTemplateBean(String title, String description, String sitePath, String imgPath) {
071
072        m_title = title;
073        m_description = description;
074        m_sitePath = sitePath;
075        m_imgPath = imgPath;
076    }
077
078    /**
079     * Returns a dummy template object which represents an empty selection.<p>
080     *
081     * @return a dummy template object
082     */
083    public static CmsClientTemplateBean getNullTemplate() {
084
085        String imagePath = "/system/workplace/resources/commons/notemplate.png";
086        CmsClientTemplateBean result = new CmsClientTemplateBean("No template", "", "", imagePath);
087        result.setShowWeakText(true);
088        return result;
089    }
090
091    /**
092     * Returns the description.<p>
093     *
094     * @return the description
095     */
096    public String getDescription() {
097
098        return m_description;
099    }
100
101    /**
102     * Returns the image path.<p>
103     *
104     * @return the image path
105     */
106    public String getImgPath() {
107
108        return m_imgPath;
109    }
110
111    /**
112     * Returns the site path.<p>
113     *
114     * @return the site path
115     */
116    public String getSitePath() {
117
118        return m_sitePath;
119    }
120
121    /**
122     * Returns the title.<p>
123     *
124     * @return the title
125     */
126    public String getTitle() {
127
128        return m_title;
129    }
130
131    /**
132     * Returns true if the template should be shown with weak text.<p>
133     *
134     * @return true if the template should be shown with weak text
135     */
136    public boolean isShowWeakText() {
137
138        return m_showWeakText;
139    }
140
141    /**
142     * Sets the display of weak text to true or false.<p>
143     *
144     * @param showWeakText if true, the template should be displayed with weak text
145     */
146    public void setShowWeakText(boolean showWeakText) {
147
148        m_showWeakText = showWeakText;
149    }
150
151}