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.publish.shared;
029
030import org.opencms.util.CmsUUID;
031
032import java.io.Serializable;
033import java.util.Map;
034
035/**
036 * Bean encapsulating all ADE publish options.<p>
037 *
038 * @since 7.6
039 */
040public class CmsPublishOptions implements Serializable {
041
042    /** Parameter name for the collector items. */
043    public static final String PARAM_COLLECTOR_ITEMS = "collectorItems";
044
045    /** The collector information. */
046    public static final String PARAM_COLLECTOR_INFO = "collectorInfo";
047
048    /** Parameter name for the container page structure id. */
049    public static final String PARAM_CONTAINERPAGE = "containerpage";
050
051    /** Parameter name for the content structure id. */
052    public static final String PARAM_CONTENT = "content";
053
054    /** Parameter name for the detail content structure id. */
055    public static final String PARAM_DETAIL = "detail";
056
057    /** Parameter for enabling the 'add contents' check box. */
058    public static final String PARAM_ENABLE_INCLUDE_CONTENTS = "enable_include_contents";
059
060    /** The name of the parameter used for passing in the list of resources. */
061    public static final String PARAM_FILES = "files";
062
063    /** The name of the parameter which controls whether to add sub-resources of folders. */
064    public static final String PARAM_INCLUDE_CONTENTS = "include_contents";
065
066    /** Parameter for indicating that the initial project should be the 'current page' virtual project. */
067    public static final String PARAM_START_WITH_CURRENT_PAGE = "startWithCurrentPage";
068
069    /** The serial version id. */
070    private static final long serialVersionUID = 1L;
071
072    /** Flag to include related resources. */
073    private boolean m_includeRelated;
074
075    /** Flag to include siblings. */
076    private boolean m_includeSiblings;
077
078    /** The additional publish parameters. */
079    private Map<String, String> m_params;
080
081    /** The id of the project to publish. */
082    private CmsUUID m_projectId;
083
084    /**
085     * Creates a new publish options bean.<p>
086     **/
087    public CmsPublishOptions() {
088
089        m_includeRelated = true;
090    }
091
092    /**
093     * Creates a new publish options bean.<p>
094     *
095     * @param includeRelated Flag to include related resources
096     * @param includeSiblings Flag to include siblings
097     * @param projectId The id of the project to publish
098     */
099    public CmsPublishOptions(boolean includeRelated, boolean includeSiblings, CmsUUID projectId) {
100
101        m_includeRelated = includeRelated;
102        m_includeSiblings = includeSiblings;
103        m_projectId = projectId;
104    }
105
106    /**
107     * Creates a new instance.<p>
108     *
109     * @param params the additional publish parameters
110     */
111    public CmsPublishOptions(Map<String, String> params) {
112
113        this();
114        m_params = params;
115    }
116
117    /**
118     * Gets the additional publish parameters.<p>
119     *
120     * @return the additional publish parameters
121     */
122    public Map<String, String> getParameters() {
123
124        return m_params;
125    }
126
127    /**
128     * Returns the project id.<p>
129     *
130     * @return the project id
131     */
132    public CmsUUID getProjectId() {
133
134        return m_projectId;
135    }
136
137    /**
138     * Checks if to include related resources.<p>
139     *
140     * @return <code>true</code> if to include related resources
141     */
142    public boolean isIncludeRelated() {
143
144        return m_includeRelated;
145    }
146
147    /**
148     * Checks if to include siblings.<p>
149     *
150     * @return <code>true</code> if to include siblings
151     */
152    public boolean isIncludeSiblings() {
153
154        return m_includeSiblings;
155    }
156
157    /**
158     * Sets the flag to include related resources.<p>
159     *
160     * @param includeRelated the flag to set
161     */
162    public void setIncludeRelated(boolean includeRelated) {
163
164        m_includeRelated = includeRelated;
165    }
166
167    /**
168     * Sets the flag to include siblings.<p>
169     *
170     * @param includeSiblings the flag to set
171     */
172    public void setIncludeSiblings(boolean includeSiblings) {
173
174        m_includeSiblings = includeSiblings;
175    }
176
177    /**
178     * Sets the additional publish parameters.<p>
179     *
180     * @param params the additional parameters to set
181     */
182    public void setParameters(Map<String, String> params) {
183
184        m_params = params;
185    }
186
187    /**
188     * Sets the id of the project to publish.<p>
189     *
190     * @param projectId the id to set
191     */
192    public void setProjectId(CmsUUID projectId) {
193
194        m_projectId = projectId;
195    }
196}