Package com.google.appengine.api.users

Examples of com.google.appengine.api.users.UserService


  }
 
  public void doGet(HttpServletRequest req, HttpServletResponse res)
      throws ServletException, IOException {
    // Get an instance of the UserService
    UserService userService = UserServiceFactory.getUserService();
    String userEmail = userService.getCurrentUser().getEmail();
    RightsManagementController rightsController = RightsManagementController
        .getInstance();
    User user = rightsController.getUser(userEmail);
    Comment newc = new Comment(req.getParameter("newcomment"), user, "Later Interpretation");
    ArrayList<Comment> comList = new ArrayList<Comment>();
View Full Code Here


    patient = new Patient(first, last, DoB, gender);

    // Gets the active user.
   
    // Get an instance of the UserService
    UserService userService = UserServiceFactory.getUserService();
    String userEmail = userService.getCurrentUser().getEmail();
   
    User user = rightsController.getUser(userEmail);
    ArrayList<Comment> comments = new ArrayList<Comment>();

    // Makes sure there is a value in complaint.
View Full Code Here

  private List<VerifiedAccount> verifiedAccounts = null;

  @Override
  public int doStartTag() throws JspException {
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    if (user == null) {
      return SKIP_BODY;
    }

    DataManager dataManager = DataManager.getInstance();
View Full Code Here

  private String defaultValue;

  @Override
  public void doTag() throws JspException, IOException {
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();

    if (user == null) {
      getJspContext().getOut().print(getDefaultValue());
    } else {
      getJspContext().getOut().print(user.getNickname());
View Full Code Here

public class UserEmailTag extends SimpleTagSupport {

  @Override
  public void doTag() throws JspException, IOException {
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();

    if (user == null) {
      throw new JspException("User not logged in to a Google Account");
    }
View Full Code Here

public class GoogleAccountsAuthenticationEntryPoint implements AuthenticationEntryPoint {

    public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException)
            throws IOException, ServletException {
        UserService userService = UserServiceFactory.getUserService();

        response.sendRedirect(userService.createLoginURL(request.getRequestURI()));
    }
View Full Code Here

   
    // TODO #11: implement login helper methods in service implementation   

    @Override
    public LoginInfo login(final String requestUri) {
        final UserService userService = UserServiceFactory.getUserService();
        final User user = userService.getCurrentUser();
        final LoginInfo loginInfo = new LoginInfo();
        if (user != null) {
            loginInfo.setLoggedIn(true);
            loginInfo.setName(user.getEmail());
            loginInfo.setLogoutUrl(userService.createLogoutURL(requestUri));
        } else {
            loginInfo.setLoggedIn(false);
            loginInfo.setLoginUrl(userService.createLoginURL(requestUri));
        }
        return loginInfo;
    }
View Full Code Here

            helper.tearDown();
        }

        @Test
        public void testIsAdmin() {
            UserService userService = UserServiceFactory.getUserService();
            assertTrue(userService.isUserAdmin());
        }
View Full Code Here

        throws IOException, ServletException {

        SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.SSSSSS");
        fmt.setTimeZone(new SimpleTimeZone(0, ""));

        UserService userService = UserServiceFactory.getUserService();
        User user = userService.getCurrentUser();
        String loginUrl = userService.createLoginURL("/");
        String logoutUrl = userService.createLogoutURL("/");

        Entity userPrefs = null;
        if (user != null) {
            DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
            MemcacheService memcache = MemcacheServiceFactory.getMemcacheService();
View Full Code Here

@SuppressWarnings("serial")
public class PrefsServlet extends HttpServlet {
    public void doPost(HttpServletRequest req,
            HttpServletResponse resp)
          throws IOException {
        UserService userService = UserServiceFactory.getUserService();
        User user = userService.getCurrentUser();

        DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
        Key userKey = KeyFactory.createKey("UserPrefs", user.getUserId());
        Entity userPrefs = new Entity(userKey);
View Full Code Here

TOP

Related Classes of com.google.appengine.api.users.UserService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.