fix replace with id
@@ -129,7 +129,9 @@ public class AdminSchedulerAction extends FessAdminAction {
@Secured({ ROLE })
public HtmlResponse createnewjob(final String type, final String id, final String name) {
saveToken();
- return asHtml(path_AdminScheduler_AdminSchedulerEditJsp).useForm(CreateForm.class, op -> {
+ return asHtml(path_AdminScheduler_AdminSchedulerEditJsp).useForm(
+ CreateForm.class,
+ op -> {
op.setup(scheduledJobForm -> {
scheduledJobForm.initialize();
scheduledJobForm.crudMode = CrudMode.CREATE;
@@ -140,15 +142,15 @@ public class AdminSchedulerAction extends FessAdminAction {
final String decodedName = new String(Base64.getUrlDecoder().decode(name), Constants.CHARSET_UTF_8);
scheduledJobForm.name = MessageFormat.format(fessConfig.getJobTemplateTitle(type), decodedName);
final String[] ids = new String[] { "", "", "" };
- final String configId = id.replace('-', '_');
if (Constants.WEB_CRAWLER_TYPE.equals(type)) {
- ids[0] = "\"" + configId + "\"";
+ ids[0] = "\"" + id + "\"";
} else if (Constants.FILE_CRAWLER_TYPE.equals(type)) {
- ids[1] = "\"" + configId + "\"";
+ ids[1] = "\"" + id + "\"";
} else if (Constants.DATA_CRAWLER_TYPE.equals(type)) {
- ids[2] = "\"" + configId + "\"";
+ ids[2] = "\"" + id + "\"";
}
- scheduledJobForm.scriptData = MessageFormat.format(fessConfig.getJobTemplateScript(), ids[0], ids[1], ids[2], configId);
+ scheduledJobForm.scriptData =
+ MessageFormat.format(fessConfig.getJobTemplateScript(), ids[0], ids[1], ids[2], id.replace('-', '_'));
});
});
}
