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.crawlinginfo;
17
18 import org.lastaflute.web.validation.Required;
19 import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
20
21 import jakarta.validation.constraints.Size;
22
23 /**
24 * Form class for editing crawling information in the admin interface.
25 * This form handles the editing of crawling session data, which tracks
26 * the status and metadata of web crawling operations.
27 *
28 */
29 public class EditForm {
30
31 /**
32 * Creates a new EditForm instance.
33 */
34 public EditForm() {
35 // Default constructor
36 }
37
38 /**
39 * The CRUD operation mode for this form.
40 * Indicates whether this is a create, read, update, or delete operation.
41 */
42 @ValidateTypeFailure
43 public int crudMode;
44
45 /**
46 * The unique identifier of the crawling information entry being edited.
47 * This is a required field for identifying which crawling info to update.
48 */
49 @Required
50 @Size(max = 1000)
51 public String id;
52
53 /**
54 * The session identifier of the crawling session.
55 * This is a required field that identifies the specific crawling session.
56 * Maximum length is 20 characters.
57 */
58 @Required
59 @Size(max = 20)
60 public String sessionId;
61
62 /**
63 * The name or description of the crawling session.
64 * This is an optional descriptive field with a maximum length of 20 characters.
65 */
66 @Size(max = 20)
67 public String name;
68
69 /**
70 * The expiration time for the crawling session.
71 * This field indicates when the crawling session should expire or be cleaned up.
72 */
73 public String expiredTime;
74
75 /**
76 * The timestamp when this crawling session was created.
77 * Stored as a long value representing milliseconds since epoch.
78 */
79 @ValidateTypeFailure
80 public Long createdTime;
81
82 /**
83 * Initializes the form with default null values.
84 * This method resets all fields to their default state for creating a new entry.
85 */
86 public void initialize() {
87
88 id = null;
89 sessionId = null;
90 name = null;
91 expiredTime = null;
92 createdTime = null;
93
94 }
95 }