ItEr55S07AdaptacionServiciosRESTItEr54S09: Using a more human friendly code for CalendarExceptionType predefined entities.

This commit is contained in:
Manuel Rego Casasnovas 2010-04-23 21:21:15 +02:00 committed by Javier Moran Rua
parent 55c73b3d08
commit d795fe6270
3 changed files with 14 additions and 7 deletions

View file

@ -37,6 +37,12 @@ public class CalendarExceptionType extends IntegrationEntity {
return create(new CalendarExceptionType(name, color, notAssignable));
}
public static CalendarExceptionType create(String code, String name,
String color, Boolean notAssignable) {
return create(new CalendarExceptionType(name, color, notAssignable),
code);
}
private String name;
private String color;

View file

@ -37,7 +37,8 @@ public enum PredefinedCalendarExceptionTypes {
private PredefinedCalendarExceptionTypes(String name, String color,
Boolean notAssignable) {
calendarExceptionType = CalendarExceptionType.create(name, color,
// Using the name as code in order to be more human friendly
calendarExceptionType = CalendarExceptionType.create(name, name, color,
notAssignable);
}

View file

@ -3,10 +3,10 @@
<base-calendar parent="000-000" name="Spain Calendar"
code="000-001">
<calendar-exception-list>
<calendar-exception calendar-exception-type-code="holiday-001"
<calendar-exception calendar-exception-type-code="HOLIDAY"
hours="8" date="2010-04-07"
code="000-004" />
<calendar-exception calendar-exception-type-code="holiday-001"
<calendar-exception calendar-exception-type-code="HOLIDAY"
hours="7" date="2010-04-12"
code="000-005" />
</calendar-exception-list>
@ -25,16 +25,16 @@
name="Galician Calendar"
code="000-001">
<calendar-exception-list>
<calendar-exception calendar-exception-type-code="holiday-001"
<calendar-exception calendar-exception-type-code="HOLIDAY"
hours="0" date="2011-05-31"
code="000-000" />
<calendar-exception calendar-exception-type-code="leave-001"
<calendar-exception calendar-exception-type-code="LEAVE"
hours="8" date="2010-04-11"
code="000-001" />
<calendar-exception calendar-exception-type-code="strike-001"
<calendar-exception calendar-exception-type-code="STRIKE"
hours="8" date="2010-05-17"
code="000-002" />
<calendar-exception calendar-exception-type-code="holiday-001"
<calendar-exception calendar-exception-type-code="HOLIDAY"
hours="7" date="2010-04-22"
code="000-003" />
</calendar-exception-list>