Examples of InboxMessage


Examples of com.infoclinika.mssharing.model.internal.entity.InboxMessage

        throw new IllegalStateException("Not applicable operation");
    }

    @Override
    void remove(long actor, String request) {
        InboxMessage message = messageRepository.findOne(Long.valueOf(getInternalId(request)));
        if (message.getTo().getId() != actor) {
            throw new AccessDenied("Could not remove inbox item owned by other user");
        }
        messageRepository.delete(message);
    }
View Full Code Here

Examples of com.infoclinika.mssharing.model.internal.entity.InboxMessage

    @Override
    public void notify(long from, long to, String message) {
        User fromUser = Util.USER_FROM_ID.apply(from);
        User toUser = Util.USER_FROM_ID.apply(to);
        messageRepository.save(new InboxMessage(fromUser, toUser, new Date(), message));
    }
View Full Code Here

Examples of models.InboxMessage

    renderTemplate("api/messageList.json",data);
  }
 
  public static void get(Long id) {
    User current = getCurrentUser();
    InboxMessage message = InboxMessage.getReceived(id, current);
    if(message==null) notFound();
    //if(message.owner.id.longValue() != current.id.longValue()) forbidden();
    if(!message.readed) {
      message.readed = Boolean.TRUE;
      message.update();
    }
    renderTemplate("api/message.json",message);
  }
View Full Code Here

Examples of models.InboxMessage

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

Examples of models.InboxMessage

    message.delete();
  }
 
  public static void edit(Long id, JsonObject body) {
    User current = getCurrentUser();
    InboxMessage message = InboxMessage.getReceived(id, current);
    //Message msgJSON = gson().fromJson(body, Message.class);
    if(message==null) notFound();
    //if(message.id != msgJSON.id) notFound();
    //if(message.to.id.longValue() != current.id.longValue()) forbidden();
    // Copy updateable properties from the JSON object to the original.
    message.readed = body.get("readed").getAsBoolean();
    message.update();
    response.status = StatusCode.OK;
    Map map = new HashMap();
    map.put("id", message.id);
    String url = Router.reverse("api.Subscribers.get", map).url;// GET /clients/1541
    response.setHeader("location", url);
View Full Code Here

Examples of models.InboxMessage

   
       
    //Se inserta un mensaje que pertenece al receptor
     
    for(User receiver : receivers)  {
      InboxMessage inbox = new InboxMessage(receiver, message);
      inbox.save();
     
       Tag sharedTag = Tag.findOrCreateByName("shared", receiver);
        for(SharedContent sharedContent : sharedContents) {
          if(Content.ContentType.PHOTO == sharedContent.type) {
            ContentTag contentTag = new ContentTag(sharedContent.id, Content.ContentType.PHOTO, sharedTag);
View Full Code Here

Examples of org.apache.lenya.inbox.InboxMessage

        super.doCheckPreconditions();

        String id = getParameterAsString("messageId");
        if (id != null) {
            org.apache.lenya.inbox.Inbox inbox = (org.apache.lenya.inbox.Inbox) getParameter("inbox");
            InboxMessage message = inbox.getMessage(id);
            message.markAsRead(true);
        }
       
    }
View Full Code Here

Examples of org.apache.lenya.inbox.InboxMessage

        super.doExecute();
       
        String deleteId = getParameterAsString("deleteMessageId");
        if (deleteId != null) {
            org.apache.lenya.inbox.Inbox inbox = (org.apache.lenya.inbox.Inbox) getParameter("inbox");
            InboxMessage message = inbox.getMessage(deleteId);
            inbox.remove(message);
        }
    }
View Full Code Here

Examples of org.apache.lenya.inbox.InboxMessage

        this.manager = manager;
        this.user = user;
    }

    public synchronized InboxMessage add(Message message) {
        InboxMessage msg = new XmlSourceInboxMessage(this, generateId(), message, false);
        messages().add(msg);
        save();
        return msg;
    }
View Full Code Here

Examples of org.apache.lenya.inbox.InboxMessage

                    }
                    boolean read = Boolean.valueOf(readString).booleanValue();

                    Message message = new Message(subject, subjectParams, body, bodyParams, sender,
                            recipients);
                    InboxMessage msg = new XmlSourceInboxMessage(this, id, message, read);
                    this.messages.add(msg);
                }
            }

        } catch (Exception e) {
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.