View Javadoc
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.mapping;
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 mapping dictionary entries.
26   * Mapping dictionaries allow administrators to define synonym mappings
27   * where multiple input terms can be mapped to a single output term for search normalization.
28   *
29   */
30  public class CreateForm {
31  
32      /**
33       * Creates a new CreateForm instance.
34       */
35      public CreateForm() {
36          // Default constructor
37      }
38  
39      /** Dictionary identifier */
40      @Required
41      public String dictId;
42  
43      /** CRUD operation mode (CREATE, EDIT, etc.) */
44      @ValidateTypeFailure
45      public Integer crudMode;
46  
47      /** Input terms (comma-separated) that will be mapped to the output term */
48      @Required
49      @Size(max = 1000)
50      public String inputs;
51  
52      /** Output term that input terms will be mapped to */
53      @Size(min = 1, max = 1000)
54      public String output;
55  
56      /**
57       * Initializes the form with default values for creating a new mapping dictionary entry.
58       */
59      public void initialize() {
60          crudMode = CrudMode.CREATE;
61      }
62  }