@Override public Contests getListOfContestsByDate(long date) throws RegisterException { ISearchController search = LogicFacade.getSearchController(user); Contests result = new Contests(); SimpleDateFormat fmt = new SimpleDateFormat("yyyy.MM.dd"); String searchDate = fmt.format(new Date(date)); try { search.start(); List<ITransferContest> contests = search.getContests(); List<CTOContest> tmps = new LinkedList<CTOContest>(); for (int i = 0; i < contests.size(); i++) { if (fmt.format(contests.get(i).getStart()).equals(searchDate)) { tmps.add(SVMCorbaServer.getInstance().addCTOContest(new CTOContestImpl(contests.get(i)))); } } result.contests = (CTOContest[]) tmps.toArray(new CTOContest[0]); search.commit(); } catch (IllegalGetInstanceException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (NoSessionFoundException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (NotAllowException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (RemoteException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (ExistingTransactionException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (InstantiationException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (NoTransactionException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (IllegalAccessException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (NotSupportedException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } return result; }
@Override public Teams getListOfTeams() throws RegisterException { ISearchController search = LogicFacade.getSearchController(user); Teams result = new Teams(); try { search.start(); List<ITransferTeam> teams = search.getTeams(); result.teams = new CTOTeam[teams.size()]; for (int i = 0; i < teams.size(); i++) { result.teams[i] = SVMCorbaServer.getInstance().addCTOTeam(new CTOTeamImpl(teams.get(i))); } search.commit(); } catch (IllegalGetInstanceException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (NoSessionFoundException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (NotAllowException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (RemoteException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (ExistingTransactionException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (InstantiationException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (NoTransactionException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (IllegalAccessException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } catch (NotSupportedException e) { e .printStackTrace(); // To change body of catch statement use File | Settings | File // Templates. } return result; }