//@RequestMapping(value="/hra.do")
public String test(Model model){
String userId = new String("aaa");
String token = new String("token");
final UserService userService = UserServiceFactory.getUserService();
final ChannelService channelService = ChannelServiceFactory.getChannelService();
//vytvoreni ID pro uzivatele
if(!userService.isUserLoggedIn()){
model.addAttribute("link", userService.createLoginURL("/hra.do"));
return "login";
}
else {
if(userService != null) {
userId = userService.getCurrentUser().getUserId();
}
//asi vytvoreni kanalu a prirazeni tokenu
if (channelService != null){
token = channelService.createChannel(userId);
}
String login = userService.getCurrentUser().getNickname();
String email = userService.getCurrentUser().getEmail();
//ted musime predat token do stranky uzivatele (asi :-) )
//v googlu vemou obsah indexu a tam si daji nejaky tag ktery pak nahradi tim tokenem
//viz index=index.replaceAll("\\{\\{ token \\}\\}",token);
//pak nasleduje odeslani predelane stranky s tokenemn