	public List<CalScheduleEntry> getCalendarEntries(String login, String password, String instanceId, Integer cacheTime, boolean remoteMode) {
		if (instanceId == null) {
			return null;
		}
		if (remoteMode && (login == null || password == null)) {
			return null;
		}
		IWContext iwc = CoreUtil.getIWContext();
		if (iwc == null) {
			return null;
		}
		GroupService groupService = getGroupService(iwc);
		if (groupService == null) {
			return null;
		}
		if (remoteMode && !groupService.isUserLoggedOn(iwc, login, password)) {
			return null;
		}
		List<String> groupsIds = null;
		try {
			groupsIds = groupService.getUniqueIds(calendarCacheName).get(instanceId);
		} catch(Exception e) {
			e.printStackTrace();
			return null;
		}
		List<String> ledgersIds = null;
		try {
			ledgersIds = groupService.getUniqueIds(ledgersCacheName).get(instanceId);
		} catch(Exception e) {
			e.printStackTrace();
			return null;
		}
		List<String> eventsIds = null;
		try {
			eventsIds = groupService.getUniqueIds(eventsCacheName).get(instanceId);
		} catch(Exception e) {
			e.printStackTrace();
			return null;
		}
		if (groupsIds == null) {
			return null;
		}
		boolean useCache = cacheTime == null ? false : true;
		CalBusiness calBusiness = getCalBusiness(iwc);
		if (calBusiness == null) {
			return null;
		}
		GroupBusiness groupBusiness = getGroupBusiness(iwc);
		if (groupBusiness == null) {
			return null;
		}
		List<CalendarEntry> entriesByGroup = new ArrayList<CalendarEntry>();
		Group group = null;
		Collection groupEntries = null;
		for (int i = 0; i < entriesByGroup.size(); i++) {
			group = null;
			groupEntries = null;
			try {
				group = groupBusiness.getGroupByUniqueId(groupsIds.get(i));
			} catch (RemoteException e) {
				e.printStackTrace();
			} catch (FinderException e) {
				e.printStackTrace();
			}
			if (group != null) {
				try {
					groupEntries = calBusiness.getEntriesByICGroup(Integer.valueOf(group.getId()).intValue());
				} catch(Exception e) {
					e.printStackTrace();
				}
			}
			if (groupEntries != null) {
				entriesByGroup.addAll(groupEntries);
			}
		}
		List<CalendarEntry> entriesByEvents = new ArrayList<CalendarEntry>();
		if (eventsIds != null) {
			Collection entries = null;
			try {
				entries = calBusiness.getEntriesByEvents(eventsIds);
			} catch(Exception e) {
				e.printStackTrace();
			}
			if (entries != null) {
				entriesByEvents.addAll(entries);
			}
		}
		List<CalendarEntry> entriesByLedgers = new ArrayList<CalendarEntry>();
		if (ledgersIds != null) {
			Collection entries = null;
			for (int i = 0; i < ledgersIds.size(); i++) {
				entries = null;
				try {
					entries = calBusiness.getEntriesByLedgerID(Integer.valueOf(ledgersIds.get(i)).intValue());
				} catch(Exception e) {
					e.printStackTrace();
				}
				if (entries != null) {
					entriesByLedgers.addAll(entries);
				}
			}
		}
		List<CalendarEntry> allEntries = new ArrayList<CalendarEntry>();
		allEntries.addAll(entriesByGroup);
		allEntries = getFilteredEntries(entriesByEvents, allEntries);
		allEntries = getFilteredEntries(entriesByLedgers, allEntries);
		return getConvertedEntries(allEntries, iwc.getCurrentLocale());
	}

	public List<CalScheduleEntry> getCalendarEntries(String login, String password, String instanceId, Integer cacheTime, boolean remoteMode) {
		if (instanceId == null) {
			return null;
		}
		if (remoteMode && (login == null || password == null)) {
			return null;
		}
		IWContext iwc = CoreUtil.getIWContext();
		if (iwc == null) {
			return null;
		}
		GroupService groupService = getGroupService(iwc);
		if (groupService == null) {
			return null;
		}
		if (remoteMode && !groupService.isUserLoggedOn(iwc, login, password)) {
			return null;
		}
		List<String> groupsIds = null;
		try {
			groupsIds = groupService.getUniqueIds(calendarCacheName).get(instanceId);
		} catch(Exception e) {
			e.printStackTrace();
			return null;
		}
		List<String> ledgersIds = null;
		try {
			ledgersIds = groupService.getUniqueIds(ledgersCacheName).get(instanceId);
		} catch(Exception e) {
			e.printStackTrace();
			return null;
		}
		List<String> eventsIds = null;
		try {
			eventsIds = groupService.getUniqueIds(eventsCacheName).get(instanceId);
		} catch(Exception e) {
			e.printStackTrace();
			return null;
		}
		if (groupsIds == null) {
			return null;
		}
		boolean useCache = cacheTime == null ? false : true;
		CalBusiness calBusiness = getCalBusiness(iwc);
		if (calBusiness == null) {
			return null;
		}
		GroupBusiness groupBusiness = getGroupBusiness(iwc);
		if (groupBusiness == null) {
			return null;
		}
		List<CalendarEntry> entriesByGroup = new ArrayList<CalendarEntry>();
		Group group = null;
		Collection groupEntries = null;
		for (int i = 0; i < groupsIds.size(); i++) {
			group = null;
			groupEntries = null;
			try {
				group = groupBusiness.getGroupByUniqueId(groupsIds.get(i));
			} catch (RemoteException e) {
				e.printStackTrace();
			} catch (FinderException e) {
				e.printStackTrace();
			}
			if (group != null) {
				try {
					groupEntries = calBusiness.getEntriesByICGroup(Integer.valueOf(group.getId()).intValue());
				} catch(Exception e) {
					e.printStackTrace();
				}
			}
			if (groupEntries != null) {
				entriesByGroup.addAll(groupEntries);
			}
		}
		List<CalendarEntry> entriesByEvents = new ArrayList<CalendarEntry>();
		if (eventsIds != null) {
			Collection entries = null;
			try {
				entries = calBusiness.getEntriesByEvents(eventsIds);
			} catch(Exception e) {
				e.printStackTrace();
			}
			if (entries != null) {
				entriesByEvents.addAll(entries);
			}
		}
		List<CalendarEntry> entriesByLedgers = new ArrayList<CalendarEntry>();
		if (ledgersIds != null) {
			Collection entries = null;
			for (int i = 0; i < ledgersIds.size(); i++) {
				entries = null;
				try {
					entries = calBusiness.getEntriesByLedgerID(Integer.valueOf(ledgersIds.get(i)).intValue());
				} catch(Exception e) {
					e.printStackTrace();
				}
				if (entries != null) {
					entriesByLedgers.addAll(entries);
				}
			}
		}
		List<CalendarEntry> allEntries = new ArrayList<CalendarEntry>();
		allEntries.addAll(entriesByGroup);
		allEntries = getFilteredEntries(entriesByEvents, allEntries);
		allEntries = getFilteredEntries(entriesByLedgers, allEntries);
		return getConvertedEntries(allEntries, iwc.getCurrentLocale());
	}
