Package models

Examples of models.User$UserMapper


    if(message.owner.id.longValue() != current.id.longValue()) forbidden();
    renderTemplate("api/message.json",message);
  }
*/ 
  public static void get(Long id) {
    User current = getCurrentUser();
    OutboxMessage message = OutboxMessage.getSent(id, current);
    if(message==null) notFound();
    //if(message.owner.id.longValue() != current.id.longValue()) forbidden();
    renderTemplate("api/message.json",message);
  }
View Full Code Here


    //if(message.owner.id.longValue() != current.id.longValue()) forbidden();
    renderTemplate("api/message.json",message);
  }
 
  public static void delete(Long id) {
    User current = getCurrentUser();
    OutboxMessage message = OutboxMessage.getSent(id, current);
    if(message==null) notFound();
    //if(message.owner.id.longValue() != current.id.longValue()) forbidden();
    message.delete();
 
View Full Code Here

  public static void list(Integer offset, Integer limit) {
    if(offset == null) offset = 0;
    if(limit==null || limit > LIMIT || limit==0) {
      limit = LIMIT;
    }
    User current = getCurrentUser();
    Data<Notification> data = new Data<Notification>();
    List<Notification> notifications = Notification.paginate(Notification.all(current), offset, limit);
    data.total = Notification.count(current);
    data.data = notifications;
    Type dataType = new TypeToken<Data<Notification>>(){}.getType();
View Full Code Here

  }
 
  public static void get(Long id) {
    Notification notification = Notification.findById(id);
    if(notification == null) notFound();
    User current = getCurrentUser();
    if(notification.owner.id.longValue() != current.id.longValue()) forbidden();
    renderJSON(gson().toJson(notification));
  }
View Full Code Here

  }
 
  public static void delete(Long id) {
    Notification notification = Notification.findById(id);
    if(notification == null) notFound();
    User current = getCurrentUser();
    if(notification.owner.id.longValue() != current.id.longValue()) forbidden();
    notification.delete();
    response.status = StatusCode.NO_RESPONSE;
  }
View Full Code Here

public class TaskController extends BaseController {
  private static final String EMAIL_DOMAIN_SUFFIX = "@talkmefy.appspotmail.com";
  private static final String APP_DOMAIN_SUFFIX = "http://talkmefy.appspot.com/a/";
 
  public static void notificateByMail(String fromId, String dstId, String msgContent, String numberAttach, String residenceDomain) {
    User from = User.findById(Long.parseLong(fromId));
    User dst = User.findById(Long.parseLong(dstId));
   
    String fromName = from.basic_information.firstName + " " + from.basic_information.lastName;
    String dstName = dst.basic_information.firstName + " " + dst.basic_information.lastName;
   
    Logger.info("Sending email from: ", from);
View Full Code Here

       if(servletPath.equals("/users/show")) {
                page += "_show";

            String[] tokens = request.getRequestURI().split("/");
            User user = User.getById(new Integer(tokens[tokens.length - 1]));
            List<Feedback> to = Feedback.getByToId(new Integer(tokens[tokens.length - 1]));
            List<Auction>  auctions = Auction.getByUserId(user.getId());
            List<Auction>  auctions_now = Auction.getByLastUserId(user.getId());
            List<Auction>  auctions_win = Auction.getWin(user.getId());
            request.setAttribute("user", user);
            request.setAttribute("to", to);
            request.setAttribute("auctions", auctions);
            request.setAttribute("auctions_now", auctions_now);
            request.setAttribute("auctions_win", auctions_win);
View Full Code Here

      response.sendRedirect(request.getContextPath());
    }
   
    if(servletPath.equals("/users/save")) {
                if(user != null && pass != null && mail != null) {
      User newUser = new User();


      newUser.setUsername(user);
      newUser.setPassword(pass);
                        newUser.setMail(mail);
                        newUser.save();

      response.sendRedirect(request.getContextPath());
    }
    }
        } catch (Exception e) {
View Full Code Here

            else if(servletPath.equals("/admin/users/edit")) {
      if(session.getAttribute("admin") != null && session.getAttribute("admin").equals("true")) {
        page += "_edit";

        String[] tokens = request.getRequestURI().split("/");
        User user = User.getById(new Integer(tokens[tokens.length - 1]));

        request.setAttribute("user", user);
      }
    }
            else if(servletPath.equals("/admin/users/delete")) {
View Full Code Here

   

    if(servletPath.equals("/admin/users/save")) {
      if(session.getAttribute("admin") != null && session.getAttribute("admin").equals("true")) {
        User user = new User();

       
        user.setUsername(request.getParameter("newUsername"));
        user.setPassword(request.getParameter("newPassword"));
                                user.setMail(request.getParameter("newMail"));
                                user.save();
      }
          }
                        else if(servletPath.equals("/admin/users/update")) {
      if(session.getAttribute("admin") != null && session.getAttribute("admin").equals("true")) {

        User user = new User();

                                user.setId(new Integer(request.getParameter("editId")));
        user.setUsername(request.getParameter("editUsername"));
        user.setPassword(request.getParameter("editPassword"));
                                user.setMail(request.getParameter("editMail"));
                                user.update();
      }
    }

                response.sendRedirect(request.getContextPath() + "/admin/users");
    }
View Full Code Here

TOP

Related Classes of models.User$UserMapper

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.