1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.codelibs.fess.app.web.admin.labeltype;
17
18 import org.codelibs.fess.app.web.CrudMode;
19 import org.codelibs.fess.util.ComponentUtil;
20 import org.codelibs.fess.validation.CustomSize;
21 import org.lastaflute.web.validation.Required;
22 import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
23
24 import jakarta.validation.constraints.Max;
25 import jakarta.validation.constraints.Min;
26 import jakarta.validation.constraints.Pattern;
27 import jakarta.validation.constraints.Size;
28
29
30
31
32 public class CreateForm {
33
34
35
36
37 public CreateForm() {
38 }
39
40
41
42
43 @ValidateTypeFailure
44 public Integer crudMode;
45
46
47
48
49 @Required
50 @Size(max = 100)
51 public String name;
52
53
54
55
56 @Required
57 @Size(max = 100)
58 @Pattern(regexp = "^[a-zA-Z0-9_]+$")
59 public String value;
60
61
62
63
64 @CustomSize(maxKey = "form.admin.max.input.size")
65 public String includedPaths;
66
67
68
69
70 @CustomSize(maxKey = "form.admin.max.input.size")
71 public String excludedPaths;
72
73
74
75
76 @CustomSize(maxKey = "form.admin.max.input.size")
77 public String permissions;
78
79
80
81
82 @Size(max = 1000)
83 public String virtualHost;
84
85
86
87
88 @Min(value = 0)
89 @Max(value = 2147483647)
90 @ValidateTypeFailure
91 public Integer sortOrder;
92
93
94
95
96 @Size(max = 1000)
97 public String createdBy;
98
99
100
101
102 @ValidateTypeFailure
103 public Long createdTime;
104
105
106
107
108 public void initialize() {
109 crudMode = CrudMode.CREATE;
110 sortOrder = 0;
111 createdBy = ComponentUtil.getSystemHelper().getUsername();
112 createdTime = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
113 permissions = ComponentUtil.getFessConfig().getSearchDefaultDisplayPermission();
114 }
115 }