Package models

Examples of models.Notification


          if(Content.ContentType.PHOTO == sharedContent.type) {
            ContentTag contentTag = new ContentTag(sharedContent.id, Content.ContentType.PHOTO, sharedTag);
            contentTag.save();
          }
        }
        Notification notification = new Notification();
        if(from.basic_information != null) {
          StringBuffer textSb = new StringBuffer();
          textSb.append(from.basic_information.firstName).append(" ").
          append(from.basic_information.lastName).append(" te ha enviado un mensaje.");
         
          if(sharedContents.size() > 0) {
            textSb.append(" Tiene ").append(sharedContents.size()).append(" contenidos.");
          }
          notification.message = textSb.toString();
         
        } else {
          notification.message =  "El administrador ha compartido contigo "
              + sharedContents.size() + " contenidos.";
        }
        notification.owner = receiver;
        notification.type = Notification.NotificationType.INBOX;
        notification.insert();
       
        // Creating a task for send an email with the notification.
        Queue queue = QueueFactory.getDefaultQueue();
        String residenceDomain = null;
        String username = Session.current().get(SessionConstants.USER);
View Full Code Here


    Type dataType = new TypeToken<Data<Notification>>(){}.getType();
    renderJSON(gson().toJson(data, dataType));
  }
 
  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

    if(notification.owner.id.longValue() != current.id.longValue()) forbidden();
    renderJSON(gson().toJson(notification));
  }
 
  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

TOP

Related Classes of models.Notification

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.