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.xml.containerpage;
029
030import org.opencms.ade.configuration.formatters.CmsSettingConfiguration;
031import org.opencms.util.CmsUUID;
032
033import java.util.Collection;
034import java.util.Collections;
035import java.util.HashSet;
036import java.util.List;
037import java.util.Set;
038
039/**
040 * Formatter configuration for flex formatters.<p>
041 */
042public class CmsFlexFormatterBean extends CmsFormatterBean {
043
044    /** The root path to the default content. */
045    private String m_defaultContentRootPath;
046
047    /** The UUID of the default content resource. */
048    private CmsUUID m_defaultContentStructureId;
049
050    /** The placeholder macro input. */
051    private String m_placeholderStringTemplate;
052
053    /** The macro input. */
054    private String m_stringTemplate;
055
056    /**
057     * Constructor for creating a new formatter configuration with resource structure id.<p>
058     *
059     * @param containerTypes the formatter container types
060     * @param jspRootPath the formatter JSP VFS root path
061     * @param jspStructureId the structure id of the formatter JSP
062     * @param key the formatter key
063     * @param minWidth the formatter min width
064     * @param maxWidth the formatter max width
065     * @param searchContent indicates if the content should be searchable in the online index when this formatter is used
066     * @param location the location where this formatter was defined, should be an OpenCms VFS resource path
067     * @param niceName the configuration display name
068     * @param description the help text for the formatter
069     * @param resourceTypeNames the resource type names
070     * @param rank the configuration rank
071     * @param id the configuration id
072     * @param defaultContentRootPath the root path to the default content
073     * @param defaultContentStructureId the UUID of the default content resource
074     * @param settingConfig the settings configuration
075     * @param isDetail <code>true</code> if detail formatter
076     * @param isAutoEnabled <code>true</code> if auto enabled
077     * @param displayType the display type
078     * @param isAllowsSettingsInEditor whether this formatter allows settings to be edited in the content editor
079     * @param stringTemplate the string template
080     * @param placeholderStringTemplate the placeholder string template
081     * @param metaMappings the meta mappings
082     * @param useMetaMappingsForNormalElements if true, meta mappings will be evaluated for normal container elements, not just detail elements
083     */
084    public CmsFlexFormatterBean(
085        Set<String> containerTypes,
086        String jspRootPath,
087        CmsUUID jspStructureId,
088        String key,
089        int minWidth,
090        int maxWidth,
091        boolean searchContent,
092        String location,
093        String niceName,
094        String description,
095        Collection<String> resourceTypeNames,
096        int rank,
097        String id,
098        String defaultContentRootPath,
099        CmsUUID defaultContentStructureId,
100        CmsSettingConfiguration settingConfig,
101        boolean isAutoEnabled,
102        boolean isDetail,
103        String displayType,
104        boolean isAllowsSettingsInEditor,
105        String stringTemplate,
106        String placeholderStringTemplate,
107        List<CmsMetaMapping> metaMappings,
108        boolean useMetaMappingsForNormalElements) {
109
110        super(
111            containerTypes,
112            jspRootPath,
113            jspStructureId,
114            key,
115            new HashSet<>(),
116            minWidth,
117            maxWidth,
118            false,
119            searchContent,
120            location,
121            Collections.<String> emptyList(),
122            "",
123            Collections.<String> emptyList(),
124            "",
125            Collections.emptyList(),
126            niceName,
127            description,
128            resourceTypeNames,
129            rank,
130            id,
131            settingConfig,
132            true,
133            isAutoEnabled,
134            isDetail,
135            displayType,
136            isAllowsSettingsInEditor,
137            false,
138            false,
139            metaMappings,
140            Collections.emptyMap(),
141            useMetaMappingsForNormalElements);
142        m_stringTemplate = stringTemplate;
143        m_placeholderStringTemplate = placeholderStringTemplate;
144        m_defaultContentRootPath = defaultContentRootPath;
145        m_defaultContentStructureId = defaultContentStructureId;
146    }
147
148    /**
149     * Returns the root path to the default content.<p>
150     *
151     * @return the root path to the default content
152     */
153    public String getDefaultContentRootPath() {
154
155        return m_defaultContentRootPath;
156    }
157
158    /**
159     * Returns the UUID of the default content.<p>
160     *
161     * @return the UUID of the default content
162     */
163    public CmsUUID getDefaultContentStructureId() {
164
165        return m_defaultContentStructureId;
166    }
167
168    /**
169     * Returns the placeholder string template.<p>
170     *
171     * @return the placeholder string template
172     */
173    public String getPlaceholderStringTemplate() {
174
175        return m_placeholderStringTemplate;
176    }
177
178    /**
179     * Returns the string template.<p>
180     *
181     * @return the string template
182     */
183    public String getStringTemplate() {
184
185        return m_stringTemplate;
186    }
187}