private void invokeCalendar( final Object arg ) throws Exception {
CalendarArguments args = null;
if( arg instanceof CalendarArgumentsObject ) {
final CalendarArgumentsObject c = (CalendarArgumentsObject) arg;
// get View parameter
final int view = c.getView();
String viewArg = null;
switch( view ) {
case CalendarArgumentsConstructor.VIEW_NEW:
viewArg = CalendarArguments.ARG_NEW;
break;
case CalendarArgumentsConstructor.VIEW_DAY:
viewArg = CalendarArguments.ARG_VIEW_DAY;
break;
case CalendarArgumentsConstructor.VIEW_WEEK:
viewArg = CalendarArguments.ARG_VIEW_WEEK;
break;
case CalendarArgumentsConstructor.VIEW_MONTH:
viewArg = CalendarArguments.ARG_VIEW_MONTH;
break;
case CalendarArgumentsConstructor.VIEW_DEFAULT:
viewArg = CalendarArguments.ARG_VIEW_DEFAULT;
break;
case CalendarArgumentsConstructor.VIEW_AGENDA:
viewArg = CalendarArguments.ARG_VIEW_AGENDA;
break;
case CalendarArgumentsConstructor.VIEW_VIEW:
viewArg = CalendarArguments.ARG_VIEW_DEFAULT;
break;
default:
viewArg = CalendarArguments.ARG_NEW;
break;
}
final AppointmentObject ao = c.getAppointmentObject();
if( ao != null ) {
ao.update();
}
final Event event = c.getEvent();
final Calendar calendar = c.getCalendar();
if( event != null ) {
args = new CalendarArguments( viewArg, event );
} else if( calendar != null ) {
args = new CalendarArguments( viewArg, calendar );