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.ui.shared.components; 029 030import org.opencms.util.CmsUUID; 031 032import com.vaadin.shared.ui.button.ButtonState; 033 034/** 035 * The upload button state.<p> 036 */ 037public class CmsUploadState extends ButtonState { 038 039 /** The upload types. */ 040 public enum UploadType { 041 /** Multi file upload. */ 042 multifile, 043 044 /** Single file upload. */ 045 singlefile 046 } 047 048 /** Serial version id. */ 049 private static final long serialVersionUID = -763395505975462778L; 050 051 /** The structure id of the file to replace. */ 052 private CmsUUID m_replaceId; 053 054 /** The target file name. */ 055 private String m_targetFileName; 056 057 /** The target file name prefix. */ 058 private String m_targetFileNamePrefix; 059 060 /** The upload target folder root path. */ 061 private String m_targetFolderRootPath; 062 063 /** The upload type. */ 064 private UploadType m_uploadType; 065 066 /** The dialog title. */ 067 private String m_dialogTitle; 068 069 /** 070 * Constructor.<p> 071 */ 072 public CmsUploadState() { 073 m_uploadType = UploadType.multifile; 074 } 075 076 /** 077 * Returns the dialog title.<p> 078 * 079 * @return the dialog title 080 */ 081 public String getDialogTitle() { 082 083 return m_dialogTitle; 084 } 085 086 /** 087 * Returns the structure id of the file to replace.<p> 088 * 089 * @return the structure id of the file to replace 090 */ 091 public CmsUUID getReplaceId() { 092 093 return m_replaceId; 094 } 095 096 /** 097 * Returns the target file name.<p> 098 * 099 * @return the target file name 100 */ 101 public String getTargetFileName() { 102 103 return m_targetFileName; 104 } 105 106 /** 107 * Returns the target file name prefix.<p> 108 * 109 * @return the target file name prefix 110 */ 111 public String getTargetFileNamePrefix() { 112 113 return m_targetFileNamePrefix; 114 } 115 116 /** 117 * Returns the targetFolderRootPath.<p> 118 * 119 * @return the targetFolderRootPath 120 */ 121 public String getTargetFolderRootPath() { 122 123 return m_targetFolderRootPath; 124 } 125 126 /** 127 * Returns the upload type.<p> 128 * 129 * @return the upload type 130 */ 131 public UploadType getUploadType() { 132 133 return m_uploadType; 134 } 135 136 /** 137 * Sets the dialog title.<p> 138 * 139 * @param dialogTitle the dialog title to set 140 */ 141 public void setDialogTitle(String dialogTitle) { 142 143 m_dialogTitle = dialogTitle; 144 } 145 146 /** 147 * Sets the structure id of the file to replace.<p> 148 * 149 * @param replaceId the structure id of the file to replace 150 */ 151 public void setReplaceId(CmsUUID replaceId) { 152 153 m_replaceId = replaceId; 154 } 155 156 /** 157 * Sets the target file name.<p> 158 * 159 * @param targetFileName the target file name to set 160 */ 161 public void setTargetFileName(String targetFileName) { 162 163 m_targetFileName = targetFileName; 164 } 165 166 /** 167 * Sets the target file name prefix.<p> 168 * 169 * @param targetFileNamePrefix the target file name prefix to set 170 */ 171 public void setTargetFileNamePrefix(String targetFileNamePrefix) { 172 173 m_targetFileNamePrefix = targetFileNamePrefix; 174 } 175 176 /** 177 * Sets the targetFolderRootPath.<p> 178 * 179 * @param targetFolderRootPath the targetFolderRootPath to set 180 */ 181 public void setTargetFolderRootPath(String targetFolderRootPath) { 182 183 m_targetFolderRootPath = targetFolderRootPath; 184 } 185 186 /** 187 * Sets the upload type.<p> 188 * 189 * @param uploadType the upload type to set 190 */ 191 public void setUploadType(UploadType uploadType) { 192 193 m_uploadType = uploadType; 194 } 195 196}