String appXmppAddress = "something@" + versionId + ".latest." +
appId + ".appspotchat.com";
req.setAttribute("appId", appId);
req.setAttribute("appXmppAddress", appXmppAddress);
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
req.setAttribute("user", user);
req.setAttribute("signoutUrl", userService.createLogoutURL("/"));
req.setAttribute("isUserAdmin", userService.isUserAdmin());
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Query q = new Query("ChatUser").addSort("jid");
PreparedQuery pq = datastore.prepare(q);
List<Entity> results = pq.asList(FetchOptions.Builder.withLimit(100));