1 /*
2 * Copyright 2012-2025 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.dict.synonym;
17
18 import org.codelibs.fess.app.web.CrudMode;
19 import org.lastaflute.web.validation.Required;
20 import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
21
22 import jakarta.validation.constraints.Size;
23
24 /**
25 * Form class for creating new synonym dictionary entries.
26 * This form handles the creation of synonym mappings that expand
27 * search queries to include related terms.
28 *
29 */
30 public class CreateForm {
31
32 /**
33 * Creates a new CreateForm instance.
34 */
35 public CreateForm() {
36 }
37
38 /** The dictionary ID to which this synonym entry belongs */
39 @Required
40 public String dictId;
41
42 /** The CRUD operation mode for form processing */
43 @ValidateTypeFailure
44 public Integer crudMode;
45
46 /** The input terms that should be considered synonymous */
47 @Required
48 @Size(max = 1000)
49 public String inputs;
50
51 /** The output synonyms that should be matched for the input terms */
52 @Required
53 @Size(max = 1000)
54 public String outputs;
55
56 /**
57 * Initializes the form with default values for creating a new synonym entry.
58 */
59 public void initialize() {
60 crudMode = CrudMode.CREATE;
61 }
62 }