View Javadoc
1   /**
2    * This file Copyright (c) 2013-2018 Magnolia International
3    * Ltd.  (http://www.magnolia-cms.com). All rights reserved.
4    *
5    *
6    * This file is dual-licensed under both the Magnolia
7    * Network Agreement and the GNU General Public License.
8    * You may elect to use one or the other of these licenses.
9    *
10   * This file is distributed in the hope that it will be
11   * useful, but AS-IS and WITHOUT ANY WARRANTY; without even the
12   * implied warranty of MERCHANTABILITY or FITNESS FOR A
13   * PARTICULAR PURPOSE, TITLE, or NONINFRINGEMENT.
14   * Redistribution, except as permitted by whichever of the GPL
15   * or MNA you select, is prohibited.
16   *
17   * 1. For the GPL license (GPL), you can redistribute and/or
18   * modify this file under the terms of the GNU General
19   * Public License, Version 3, as published by the Free Software
20   * Foundation.  You should have received a copy of the GNU
21   * General Public License, Version 3 along with this program;
22   * if not, write to the Free Software Foundation, Inc., 51
23   * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24   *
25   * 2. For the Magnolia Network Agreement (MNA), this file
26   * and the accompanying materials are made available under the
27   * terms of the MNA which accompanies this distribution, and
28   * is available at http://www.magnolia-cms.com/mna.html
29   *
30   * Any modifications to this file must keep this entire header
31   * intact.
32   *
33   */
34  package info.magnolia.ui.form.field.definition;
35  
36  import info.magnolia.annotation.deprecation.MgnlDeprecated;
37  
38  import info.magnolia.ui.form.field.transformer.Transformer;
39  import info.magnolia.ui.form.field.transformer.item.FileTransformer;
40  
41  /**
42   * Field definition for a the basic upload field.
43   *
44   * @deprecated since 6.2 - use {@link info.magnolia.ui.field.UploadFieldDefinition} instead.
45   *
46   * @see <a href="https://documentation.magnolia-cms.com/display/DOCS62/Upgrading+to+Magnolia+6.2.x">Upgrading to Magnolia 6.2.x</a>
47   */
48  @Deprecated
49  @MgnlDeprecated(since = "6.2", description = "Use new framework and info.magnolia.ui.field.UploadFieldDefinition instead.")
50  public class BasicUploadFieldDefinition extends ConfiguredFieldDefinition {
51  
52      // Define the upload Binary Node name.
53      private String binaryNodeName = "binaryNodeName";
54      // Define the maximum file size in bite.
55      private long maxUploadSize = Long.MAX_VALUE;
56      // Define allowed uploadMimeType
57      private String allowedMimeTypePattern = ".*";
58      // Define if the File Name can be edited
59      private boolean editFileName = false;
60      // Define if the File Format can be edited
61      private boolean editFileFormat = false;
62  
63      // Define the Captions
64      private String selectNewCaption = "field.upload.basic.select.new";
65      private String selectAnotherCaption = "field.upload.basic.select.another";
66      private String deleteCaption = "field.upload.basic.select.delete";
67      private String dropZoneCaption = "field.upload.basic.drop.hint";
68      private String inProgressCaption = "field.upload.basic.uploading.file";
69      private String inProgressRatioCaption = "field.upload.basic.uploaded.file";
70      private String fileDetailHeaderCaption = "field.upload.basic.file.detail.header";
71      private String fileDetailNameCaption = "field.upload.basic.file.detail.name";
72      private String fileDetailSizeCaption = "field.upload.basic.file.detail.size";
73      private String fileDetailFormatCaption = "field.upload.basic.file.detail.format";
74      private String fileDetailSourceCaption = "field.upload.basic.file.detail.source";
75      private String successNoteCaption = "field.upload.basic.note.success";
76      private String warningNoteCaption = "field.upload.basic.note.warning";
77      private String errorNoteCaption = "field.upload.basic.note.error";
78      private String sizeInterruption = "field.upload.interupted.size";
79      private String typeInterruption = "field.upload.interupted.type";
80      private String userInterruption = "field.upload.interupted.user";
81  
82      public BasicUploadFieldDefinition() {
83          setTransformerClass((Class<? extends Transformer<?>>) (Object) FileTransformer.class);
84      }
85  
86      public String getBinaryNodeName() {
87          return binaryNodeName;
88      }
89  
90      public void setBinaryNodeName(String binaryNodeName) {
91          this.binaryNodeName = binaryNodeName;
92      }
93  
94      public long getMaxUploadSize() {
95          return maxUploadSize;
96      }
97  
98      public void setMaxUploadSize(long maxUploadSize) {
99          this.maxUploadSize = maxUploadSize;
100     }
101 
102     public String getAllowedMimeTypePattern() {
103         return allowedMimeTypePattern;
104     }
105 
106     public void setAllowedMimeTypePattern(String allowedMimeTypePattern) {
107         this.allowedMimeTypePattern = allowedMimeTypePattern;
108     }
109 
110     public String getSelectNewCaption() {
111         return selectNewCaption;
112     }
113 
114     public void setSelectNewCaption(String selectNewCaption) {
115         this.selectNewCaption = selectNewCaption;
116     }
117 
118     public String getSelectAnotherCaption() {
119         return selectAnotherCaption;
120     }
121 
122     public void setSelectAnotherCaption(String selectAnotherCaption) {
123         this.selectAnotherCaption = selectAnotherCaption;
124     }
125 
126     public String getDropZoneCaption() {
127         return dropZoneCaption;
128     }
129 
130     public void setDropZoneCaption(String dropZoneCaption) {
131         this.dropZoneCaption = dropZoneCaption;
132     }
133 
134     public String getInProgressCaption() {
135         return inProgressCaption;
136     }
137 
138     public void setInProgressCaption(String inProgressCaption) {
139         this.inProgressCaption = inProgressCaption;
140     }
141 
142     public String getInProgressRatioCaption() {
143         return inProgressRatioCaption;
144     }
145 
146     public void setInProgressRatioCaption(String inProgressRatioCaption) {
147         this.inProgressRatioCaption = inProgressRatioCaption;
148     }
149 
150     public String getFileDetailHeaderCaption() {
151         return fileDetailHeaderCaption;
152     }
153 
154     public void setFileDetailHeaderCaption(String fileDetailHeaderCaption) {
155         this.fileDetailHeaderCaption = fileDetailHeaderCaption;
156     }
157 
158     public String getFileDetailNameCaption() {
159         return fileDetailNameCaption;
160     }
161 
162     public void setFileDetailNameCaption(String fileDetailNameCaption) {
163         this.fileDetailNameCaption = fileDetailNameCaption;
164     }
165 
166     public String getFileDetailSizeCaption() {
167         return fileDetailSizeCaption;
168     }
169 
170     public void setFileDetailSizeCaption(String fileDetailSizeCaption) {
171         this.fileDetailSizeCaption = fileDetailSizeCaption;
172     }
173 
174     public String getFileDetailFormatCaption() {
175         return fileDetailFormatCaption;
176     }
177 
178     public void setFileDetailFormatCaption(String fileDetailFormatCaption) {
179         this.fileDetailFormatCaption = fileDetailFormatCaption;
180     }
181 
182     public String getFileDetailSourceCaption() {
183         return fileDetailSourceCaption;
184     }
185 
186     public void setFileDetailSourceCaption(String fileDetailSourceCaption) {
187         this.fileDetailSourceCaption = fileDetailSourceCaption;
188     }
189 
190     public String getSuccessNoteCaption() {
191         return successNoteCaption;
192     }
193 
194     public void setSuccessNoteCaption(String successNoteCaption) {
195         this.successNoteCaption = successNoteCaption;
196     }
197 
198     public String getWarningNoteCaption() {
199         return warningNoteCaption;
200     }
201 
202     public void setWarningNoteCaption(String warningNoteCaption) {
203         this.warningNoteCaption = warningNoteCaption;
204     }
205 
206     public String getErrorNoteCaption() {
207         return errorNoteCaption;
208     }
209 
210     public void setErrorNoteCaption(String errorNoteCaption) {
211         this.errorNoteCaption = errorNoteCaption;
212     }
213 
214     public String getDeleteCaption() {
215         return deleteCaption;
216     }
217 
218     public void setDeleteCaption(String deleteCaption) {
219         this.deleteCaption = deleteCaption;
220     }
221 
222     public boolean isEditFileName() {
223         return editFileName;
224     }
225 
226     public void setEditFileName(boolean editFileName) {
227         this.editFileName = editFileName;
228     }
229 
230     public boolean isEditFileFormat() {
231         return editFileFormat;
232     }
233 
234     public void setEditFileFormat(boolean editFileFormat) {
235         this.editFileFormat = editFileFormat;
236     }
237 
238     public String getSizeInterruption() {
239         return sizeInterruption;
240     }
241 
242     public void setSizeInterruption(String sizeInterruption) {
243         this.sizeInterruption = sizeInterruption;
244     }
245 
246     public String getTypeInterruption() {
247         return typeInterruption;
248     }
249 
250     public void setTypeInterruption(String typeInterruption) {
251         this.typeInterruption = typeInterruption;
252     }
253 
254     public String getUserInterruption() {
255         return userInterruption;
256     }
257 
258     public void setUserInterruption(String userInterruption) {
259         this.userInterruption = userInterruption;
260     }
261 }