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