001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (https://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: https://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: https://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
074        m_uploadType = UploadType.multifile;
075    }
076
077    /**
078     * Returns the dialog title.<p>
079     *
080     * @return the dialog title
081     */
082    public String getDialogTitle() {
083
084        return m_dialogTitle;
085    }
086
087    /**
088     * Returns the structure id of the file to replace.<p>
089     *
090     * @return the structure id of the file to replace
091     */
092    public CmsUUID getReplaceId() {
093
094        return m_replaceId;
095    }
096
097    /**
098     * Returns the target file name.<p>
099     *
100     * @return the target file name
101     */
102    public String getTargetFileName() {
103
104        return m_targetFileName;
105    }
106
107    /**
108     * Returns the target file name prefix.<p>
109     *
110     * @return the target file name prefix
111     */
112    public String getTargetFileNamePrefix() {
113
114        return m_targetFileNamePrefix;
115    }
116
117    /**
118     * Returns the targetFolderRootPath.<p>
119     *
120     * @return the targetFolderRootPath
121     */
122    public String getTargetFolderRootPath() {
123
124        return m_targetFolderRootPath;
125    }
126
127    /**
128     * Returns the upload type.<p>
129     *
130     * @return the upload type
131     */
132    public UploadType getUploadType() {
133
134        return m_uploadType;
135    }
136
137    /**
138     * Sets the dialog title.<p>
139     *
140     * @param dialogTitle the dialog title to set
141     */
142    public void setDialogTitle(String dialogTitle) {
143
144        m_dialogTitle = dialogTitle;
145    }
146
147    /**
148     * Sets the structure id of the file to replace.<p>
149     *
150     * @param replaceId the structure id of the file to replace
151     */
152    public void setReplaceId(CmsUUID replaceId) {
153
154        m_replaceId = replaceId;
155    }
156
157    /**
158     * Sets the target file name.<p>
159     *
160     * @param targetFileName the target file name to set
161     */
162    public void setTargetFileName(String targetFileName) {
163
164        m_targetFileName = targetFileName;
165    }
166
167    /**
168     * Sets the target file name prefix.<p>
169     *
170     * @param targetFileNamePrefix the target file name prefix to set
171     */
172    public void setTargetFileNamePrefix(String targetFileNamePrefix) {
173
174        m_targetFileNamePrefix = targetFileNamePrefix;
175    }
176
177    /**
178     * Sets the targetFolderRootPath.<p>
179     *
180     * @param targetFolderRootPath the targetFolderRootPath to set
181     */
182    public void setTargetFolderRootPath(String targetFolderRootPath) {
183
184        m_targetFolderRootPath = targetFolderRootPath;
185    }
186
187    /**
188     * Sets the upload type.<p>
189     *
190     * @param uploadType the upload type to set
191     */
192    public void setUploadType(UploadType uploadType) {
193
194        m_uploadType = uploadType;
195    }
196
197}