shows the validation messages and constraint messages.
FEA: ItEr75S05CalendarAdminInterfaceItEr74S06
This commit is contained in:
parent
00c4e9e285
commit
10ffaf1386
2 changed files with 10 additions and 4 deletions
|
|
@ -448,7 +448,7 @@ public class BaseCalendar extends IntegrationEntity implements ICalendar {
|
|||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
"the new version will be the first one, and the start date must be empty");
|
||||
"Wrong start date : the new version will be the first one, and the start date must be empty");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -480,7 +480,7 @@ public class BaseCalendar extends IntegrationEntity implements ICalendar {
|
|||
if ((calendarData.getExpiringDate() != null)
|
||||
&& (startDate.compareTo(calendarData.getExpiringDate()) <= 0)) {
|
||||
throw new IllegalArgumentException(
|
||||
"Version date must be greater than expiring date of "
|
||||
"Wrong start date : Version date must be greater than expiring date of "
|
||||
+ "all versions of this calendar");
|
||||
}
|
||||
|
||||
|
|
@ -498,8 +498,9 @@ public class BaseCalendar extends IntegrationEntity implements ICalendar {
|
|||
CalendarData firstVersion = getFirstCalendarData();
|
||||
if ((firstVersion.getExpiringDate() != null)
|
||||
&& (expiringDate.compareTo(firstVersion.getExpiringDate()) >= 0)) {
|
||||
|
||||
throw new IllegalArgumentException(
|
||||
"Version expiring date must be lower than expiring date of "
|
||||
"Wrong expiring date : Version expiring date must be lower than expiring date of "
|
||||
+ "all versions of this calendar");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -957,7 +957,12 @@ public abstract class BaseCalendarEditionController extends
|
|||
baseCalendarModel.createNewVersion(startDate, expiringDate,
|
||||
selected);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new WrongValueException(compStartDate, e.getMessage());
|
||||
if (e.getMessage().contains("Wrong expiring date")) {
|
||||
throw new WrongValueException(compExpiringDate, _(e
|
||||
.getMessage()));
|
||||
} else {
|
||||
throw new WrongValueException(compStartDate, _(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
Clients.closeErrorBox(compStartDate);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue