View Javadoc

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