1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.codelibs.fess.app.web.admin.dataconfig;
17
18 import javax.validation.constraints.Max;
19 import javax.validation.constraints.Min;
20 import javax.validation.constraints.Size;
21
22 import org.codelibs.fess.app.web.CrudMode;
23 import org.codelibs.fess.util.ComponentUtil;
24 import org.codelibs.fess.validation.CustomSize;
25 import org.lastaflute.web.validation.Required;
26 import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
27
28
29
30
31
32 public class CreateForm {
33
34 public String[] labelTypeIds;
35
36 @ValidateTypeFailure
37 public Integer crudMode;
38
39 @Required
40 @Size(max = 200)
41 public String name;
42
43 @Size(max = 1000)
44 public String description;
45
46 @Required
47 @CustomSize(maxKey = "form.admin.max.input.size")
48 public String handlerName;
49
50 @CustomSize(maxKey = "form.admin.max.input.size")
51 public String handlerParameter;
52
53 @CustomSize(maxKey = "form.admin.max.input.size")
54 public String handlerScript;
55
56 @Required
57 @ValidateTypeFailure
58 public Float boost;
59
60 @Required
61 @Size(max = 5)
62 public String available;
63
64 @CustomSize(maxKey = "form.admin.max.input.size")
65 public String permissions;
66
67 @CustomSize(maxKey = "form.admin.max.input.size")
68 public String virtualHosts;
69
70 @Required
71 @Min(value = 0)
72 @Max(value = 2147483647)
73 @ValidateTypeFailure
74 public Integer sortOrder;
75
76 @Size(max = 1000)
77 public String createdBy;
78
79 @ValidateTypeFailure
80 public Long createdTime;
81
82 public void initialize() {
83 crudMode = CrudMode.CREATE;
84 boost = 1.0f;
85 sortOrder = 0;
86 createdBy = ComponentUtil.getSystemHelper().getUsername();
87 createdTime = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
88 permissions = ComponentUtil.getFessConfig().getSearchDefaultDisplayPermission();
89 }
90 }