} else {
/*
* Else we use the properties to create the event
*/
BasicEvent basicEvent = new ContainerCalendarEvent(index);
// Set values from property values
if (captionProperty != null
&& item.getItemPropertyIds().contains(captionProperty)) {
basicEvent.setCaption(String.valueOf(item.getItemProperty(
captionProperty).getValue()));
}
if (descriptionProperty != null
&& item.getItemPropertyIds().contains(
descriptionProperty)) {
basicEvent.setDescription(String.valueOf(item
.getItemProperty(descriptionProperty).getValue()));
}
if (startDateProperty != null
&& item.getItemPropertyIds()
.contains(startDateProperty)) {
basicEvent.setStart((Date) item.getItemProperty(
startDateProperty).getValue());
}
if (endDateProperty != null
&& item.getItemPropertyIds().contains(endDateProperty)) {
basicEvent.setEnd((Date) item.getItemProperty(
endDateProperty).getValue());
}
if (styleNameProperty != null
&& item.getItemPropertyIds()
.contains(styleNameProperty)) {
basicEvent.setDescription(String.valueOf(item
.getItemProperty(descriptionProperty).getValue()));
}
event = basicEvent;
}
return event;