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.ui.form.field.transformer.Transformer;
37  import info.magnolia.ui.form.field.transformer.item.FileTransformer;
38  
39  /**
40   * Field definition for a the basic upload field.
41   *
42   * @deprecated since 6.2 - use {@link info.magnolia.ui.field.UploadFieldDefinition} instead.
43   *
44   * @see <a href="https://documentation.magnolia-cms.com/display/DOCS62/Upgrading+to+Magnolia+6.2.x">Upgrading to Magnolia 6.2.x</a>
45   */
46  @Deprecated
47  public class BasicUploadFieldDefinition extends ConfiguredFieldDefinition {
48  
49      // Define the upload Binary Node name.
50      private String binaryNodeName = "binaryNodeName";
51      // Define the maximum file size in bite.
52      private long maxUploadSize = Long.MAX_VALUE;
53      // Define allowed uploadMimeType
54      private String allowedMimeTypePattern = ".*";
55      // Define if the File Name can be edited
56      private boolean editFileName = false;
57      // Define if the File Format can be edited
58      private boolean editFileFormat = false;
59  
60      // Define the Captions
61      private String selectNewCaption = "field.upload.basic.select.new";
62      private String selectAnotherCaption = "field.upload.basic.select.another";
63      private String deleteCaption = "field.upload.basic.select.delete";
64      private String dropZoneCaption = "field.upload.basic.drop.hint";
65      private String inProgressCaption = "field.upload.basic.uploading.file";
66      private String inProgressRatioCaption = "field.upload.basic.uploaded.file";
67      private String fileDetailHeaderCaption = "field.upload.basic.file.detail.header";
68      private String fileDetailNameCaption = "field.upload.basic.file.detail.name";
69      private String fileDetailSizeCaption = "field.upload.basic.file.detail.size";
70      private String fileDetailFormatCaption = "field.upload.basic.file.detail.format";
71      private String fileDetailSourceCaption = "field.upload.basic.file.detail.source";
72      private String successNoteCaption = "field.upload.basic.note.success";
73      private String warningNoteCaption = "field.upload.basic.note.warning";
74      private String errorNoteCaption = "field.upload.basic.note.error";
75      private String sizeInterruption = "field.upload.interupted.size";
76      private String typeInterruption = "field.upload.interupted.type";
77      private String userInterruption = "field.upload.interupted.user";
78  
79      public BasicUploadFieldDefinition() {
80          setTransformerClass((Class<? extends Transformer<?>>) (Object) FileTransformer.class);
81      }
82  
83      public String getBinaryNodeName() {
84          return binaryNodeName;
85      }
86  
87      public void setBinaryNodeName(String binaryNodeName) {
88          this.binaryNodeName = binaryNodeName;
89      }
90  
91      public long getMaxUploadSize() {
92          return maxUploadSize;
93      }
94  
95      public void setMaxUploadSize(long maxUploadSize) {
96          this.maxUploadSize = maxUploadSize;
97      }
98  
99      public String getAllowedMimeTypePattern() {
100         return allowedMimeTypePattern;
101     }
102 
103     public void setAllowedMimeTypePattern(String allowedMimeTypePattern) {
104         this.allowedMimeTypePattern = allowedMimeTypePattern;
105     }
106 
107     public String getSelectNewCaption() {
108         return selectNewCaption;
109     }
110 
111     public void setSelectNewCaption(String selectNewCaption) {
112         this.selectNewCaption = selectNewCaption;
113     }
114 
115     public String getSelectAnotherCaption() {
116         return selectAnotherCaption;
117     }
118 
119     public void setSelectAnotherCaption(String selectAnotherCaption) {
120         this.selectAnotherCaption = selectAnotherCaption;
121     }
122 
123     public String getDropZoneCaption() {
124         return dropZoneCaption;
125     }
126 
127     public void setDropZoneCaption(String dropZoneCaption) {
128         this.dropZoneCaption = dropZoneCaption;
129     }
130 
131     public String getInProgressCaption() {
132         return inProgressCaption;
133     }
134 
135     public void setInProgressCaption(String inProgressCaption) {
136         this.inProgressCaption = inProgressCaption;
137     }
138 
139     public String getInProgressRatioCaption() {
140         return inProgressRatioCaption;
141     }
142 
143     public void setInProgressRatioCaption(String inProgressRatioCaption) {
144         this.inProgressRatioCaption = inProgressRatioCaption;
145     }
146 
147     public String getFileDetailHeaderCaption() {
148         return fileDetailHeaderCaption;
149     }
150 
151     public void setFileDetailHeaderCaption(String fileDetailHeaderCaption) {
152         this.fileDetailHeaderCaption = fileDetailHeaderCaption;
153     }
154 
155     public String getFileDetailNameCaption() {
156         return fileDetailNameCaption;
157     }
158 
159     public void setFileDetailNameCaption(String fileDetailNameCaption) {
160         this.fileDetailNameCaption = fileDetailNameCaption;
161     }
162 
163     public String getFileDetailSizeCaption() {
164         return fileDetailSizeCaption;
165     }
166 
167     public void setFileDetailSizeCaption(String fileDetailSizeCaption) {
168         this.fileDetailSizeCaption = fileDetailSizeCaption;
169     }
170 
171     public String getFileDetailFormatCaption() {
172         return fileDetailFormatCaption;
173     }
174 
175     public void setFileDetailFormatCaption(String fileDetailFormatCaption) {
176         this.fileDetailFormatCaption = fileDetailFormatCaption;
177     }
178 
179     public String getFileDetailSourceCaption() {
180         return fileDetailSourceCaption;
181     }
182 
183     public void setFileDetailSourceCaption(String fileDetailSourceCaption) {
184         this.fileDetailSourceCaption = fileDetailSourceCaption;
185     }
186 
187     public String getSuccessNoteCaption() {
188         return successNoteCaption;
189     }
190 
191     public void setSuccessNoteCaption(String successNoteCaption) {
192         this.successNoteCaption = successNoteCaption;
193     }
194 
195     public String getWarningNoteCaption() {
196         return warningNoteCaption;
197     }
198 
199     public void setWarningNoteCaption(String warningNoteCaption) {
200         this.warningNoteCaption = warningNoteCaption;
201     }
202 
203     public String getErrorNoteCaption() {
204         return errorNoteCaption;
205     }
206 
207     public void setErrorNoteCaption(String errorNoteCaption) {
208         this.errorNoteCaption = errorNoteCaption;
209     }
210 
211     public String getDeleteCaption() {
212         return deleteCaption;
213     }
214 
215     public void setDeleteCaption(String deleteCaption) {
216         this.deleteCaption = deleteCaption;
217     }
218 
219     public boolean isEditFileName() {
220         return editFileName;
221     }
222 
223     public void setEditFileName(boolean editFileName) {
224         this.editFileName = editFileName;
225     }
226 
227     public boolean isEditFileFormat() {
228         return editFileFormat;
229     }
230 
231     public void setEditFileFormat(boolean editFileFormat) {
232         this.editFileFormat = editFileFormat;
233     }
234 
235     public String getSizeInterruption() {
236         return sizeInterruption;
237     }
238 
239     public void setSizeInterruption(String sizeInterruption) {
240         this.sizeInterruption = sizeInterruption;
241     }
242 
243     public String getTypeInterruption() {
244         return typeInterruption;
245     }
246 
247     public void setTypeInterruption(String typeInterruption) {
248         this.typeInterruption = typeInterruption;
249     }
250 
251     public String getUserInterruption() {
252         return userInterruption;
253     }
254 
255     public void setUserInterruption(String userInterruption) {
256         this.userInterruption = userInterruption;
257     }
258 }