Examples of UserService


Examples of com.apress.prospring3.springblog.service.UserService

    ctx.load("classpath:mybatis-app-context.xml");
    ctx.refresh();
   
    System.out.println("App context initialized successfully");       

    UserService userService = ctx.getBean("userService", UserService.class);
   
    AppUser appUser = userService.findByUserName("clarence");
   
    System.out.println("User name: " + appUser.getUserName());
  }
View Full Code Here

Examples of com.commafeed.backend.service.UserService

    SessionHelper sessionHelper = mock(SessionHelper.class);
    when(sessionHelper.getLoggedInUser()).thenReturn(Optional.of(userInSession));

    PostLoginActivities postLoginActivities = mock(PostLoginActivities.class);

    UserService service = new UserService(null, null, null, null, null, postLoginActivities);

    SecurityCheckFactory factory = new SecurityCheckFactory(null, false);
    factory.userService = service;
    factory.cookieSessionLogin(sessionHelper);
View Full Code Here

Examples of com.github.api.v2.services.UserService

   * @param args
   *            the arguments
   */
  public static void main(String[] args) {
    GitHubServiceFactory factory = GitHubServiceFactory.newInstance();
    UserService service = factory.createUserService();
    List<User> users = service.searchUsersByName("john");
    for (User user : users) {
      printResult(user);     
    }
    User user = service.getUserByEmail("nabeelmukhtar@yahoo.com");
    printResult(user);
  }
View Full Code Here

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

import com.googlecode.objectify.Objectify;

public class HomeServlet extends HttpServlet {
  @Override
  protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    UserService userService = UserServiceFactory.getUserService();
    Principal p = req.getUserPrincipal();
    User u = userService.getCurrentUser();
    if (p != null) {
      WebdavUser wu = ofy.find(WebdavUser.class, u.getUserId());
      String username = req.getParameter("username");
      String password = req.getParameter("password");
      wu.setUsername(username);
View Full Code Here

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

  private static final long serialVersionUID = 1L;
  @Inject Objectify ofy;

  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    UserService userService = UserServiceFactory.getUserService();
    String thisURL = req.getRequestURI();
    Principal p = req.getUserPrincipal();
    User u = userService.getCurrentUser();
    if (p != null) {
      WebdavUser wu = ofy.find(WebdavUser.class, u.getUserId());
      if (wu == null) {
        wu = new WebdavUser();
        wu.setPassword((new RandPass(RandPass.NONCONFUSING_ALPHABET).getPass(6)));
        wu.setUserId(u.getUserId());
        wu.setUsername(u.getNickname());
        Key<WebdavUser> wuKey = ofy.put(wu);

        WebdavFolder root = new WebdavFolder();
        root.setParent(wuKey);
        ofy.put(root);
      }
     
      resp.getWriter().println(
          String.format(
          "<p>Hello, %s! You can log in to http://freewebdav.appspot.com/webdav/ as %s/%s" +
          "<br><br> You can <a href=\"%s\">sign out</a>.</p>",
          u.toString(),
          wu.getUsername(),
          wu.getPassword(),         
          userService.createLogoutURL(thisURL) ));
    } else {
      resp.sendRedirect("login");
    }
  }
View Full Code Here

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

  private static final long serialVersionUID = 1L;
  @Inject Objectify ofy;

  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    UserService userService = UserServiceFactory.getUserService();
    String thisURL = req.getRequestURI();
    if (req.getUserPrincipal() != null) {
      resp.sendRedirect("home");
    } else {
      resp.getWriter().println("<p>Please <a href=\"" + userService.createLoginURL(thisURL) +
          "\">sign in</a>.</p>");
    }
  }
View Full Code Here

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

public class ProbeController {

  @RequestMapping(value = "/probe.htm", method = RequestMethod.GET)
  public ModelAndView index(HttpServletRequest req, HttpServletResponse resp) throws IOException {
   
       UserService userService = UserServiceFactory.getUserService();
       User user = userService.getCurrentUser();
 
        if (user != null ){
          if (!userService.isUserAdmin()) {
            resp.sendRedirect("/index.htm");
          }
        } else {
          resp.sendRedirect(userService.createLoginURL(req.getRequestURI()));
        }

    ModelAndView mav = new ModelAndView("probe/index");

    int nbusers = UserPresence.listUsers().size();
View Full Code Here

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

  @SuppressWarnings("unused")
  protected void doGet(HttpServletRequest request,
      HttpServletResponse response) throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    String path = ((HttpServletRequest) request).getRequestURI();
    String action = "";
    String[] splittedURI = path.split("/");
    // if length = 3, this is for action request.
    if (splittedURI.length == 4) {
View Full Code Here

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

  @SuppressWarnings("unused")
  @Override
  protected void doPost(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    resp.setContentType("text/html;charset=UTF-8");
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    // if (user != null) {
    String action = req.getParameter("action");
    if (action.equalsIgnoreCase("create")) {
      Category cate = new Category();
      if (req.getParameter("title") != null) {
View Full Code Here

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

  @SuppressWarnings("unused")
  protected void doGet(HttpServletRequest request,
      HttpServletResponse response) throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    String path = ((HttpServletRequest) request).getRequestURI();
    String action = "";
    String[] splittedURI = path.split("/");
    // if length = 3, this is for action request.
    if (splittedURI.length == 4) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.