View Javadoc
1   /*
2    * Copyright 2012-2021 CodeLibs Project and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.codelibs.fess.app.web.admin.reqheader;
17  
18  import javax.validation.constraints.Size;
19  
20  import org.codelibs.fess.app.web.CrudMode;
21  import org.codelibs.fess.util.ComponentUtil;
22  import org.lastaflute.web.validation.Required;
23  import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
24  
25  /**
26   * @author codelibs
27   * @author Shunji Makino
28   * @author Keiichi Watanabe
29   */
30  public class CreateForm {
31  
32      @ValidateTypeFailure
33      public Integer crudMode;
34  
35      @Required
36      @Size(max = 100)
37      public String name;
38  
39      @Required
40      @Size(max = 1000)
41      public String value;
42  
43      @Required
44      @Size(max = 1000)
45      public String webConfigId;
46  
47      @Size(max = 1000)
48      public String createdBy;
49  
50      @ValidateTypeFailure
51      public Long createdTime;
52  
53      public void initialize() {
54          crudMode = CrudMode.CREATE;
55          createdBy = ComponentUtil.getSystemHelper().getUsername();
56          createdTime = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
57      }
58  }