Package org.openmeetings.app.persistence.beans.user

Examples of org.openmeetings.app.persistence.beans.user.PrivateMessages


                Boolean isRead = importBooleanType(unformatString(pmObject.element("isRead").getText()));
                Boolean isTrash = importBooleanType(unformatString(pmObject.element("isTrash").getText()));
                Users owner = Usermanagement.getInstance().getUserById(getNewId(importLongType(unformatString(pmObject.element("owner").getText())), Maps.USERS));
                Rooms room = Roommanagement.getInstance().getRoomById(getNewId(importLongType(unformatString(pmObject.element("room").getText())), Maps.ROOMS));
               
                PrivateMessages pm = new PrivateMessages();
                pm.setMessage(message);
                pm.setSubject(subject);
                pm.setPrivateMessageFolderId(privateMessageFolderId);
                pm.setUserContactId(userContactId);
                pm.setParentMessage(parentMessage);
                pm.setBookedRoom(bookedRoom);
                pm.setFrom(from);
                pm.setTo(to);
                pm.setInserted(inserted);
                pm.setIsContactRequest(isContactRequest);
                pm.setIsRead(isRead);
                pm.setIsTrash(isTrash);
                pm.setOwner(owner);
                pm.setRoom(room);
               
                pmList.add(pm);
               
              }
             
View Full Code Here


    Element root = document.addElement("root");
   
    Element privatemessages = root.addElement("privatemessages");
   
    for (Iterator<PrivateMessages> it = privateMessages.iterator();it.hasNext();) {
      PrivateMessages pm = it.next();
     
      Element privateMessage = privatemessages.addElement("privatemessage");
     
      privateMessage.addElement("privateMessageId").addCDATA(formatString(""+pm.getPrivateMessageId()));
      privateMessage.addElement("message").addCDATA(formatString(""+pm.getMessage()));
      privateMessage.addElement("subject").addCDATA(formatString(""+pm.getSubject()));
      privateMessage.addElement("privateMessageFolderId").addCDATA(formatString(""+pm.getPrivateMessageFolderId()));
      privateMessage.addElement("userContactId").addCDATA(formatString(""+pm.getUserContactId()));
      privateMessage.addElement("parentMessage").addCDATA(formatString(""+pm.getParentMessage()));
      privateMessage.addElement("bookedRoom").addCDATA(formatString(""+pm.getBookedRoom()));
      if (pm.getFrom() != null) {
        privateMessage.addElement("from").addCDATA(formatString(""+pm.getFrom().getUser_id()));
      } else {
        privateMessage.addElement("from").addCDATA("0");
      }
      if (pm.getTo() != null) {
        privateMessage.addElement("to").addCDATA(formatString(""+pm.getTo().getUser_id()));
      } else {
        privateMessage.addElement("to").addCDATA("0");
      }
      privateMessage.addElement("inserted").addCDATA(formatString(""+CalendarPatterns.getDateWithTimeByMiliSeconds(pm.getInserted())));
      privateMessage.addElement("isContactRequest").addCDATA(formatString(""+pm.getIsContactRequest()));
      privateMessage.addElement("isRead").addCDATA(formatString(""+pm.getIsRead()));
      privateMessage.addElement("isTrash").addCDATA(formatString(""+pm.getIsTrash()));
      if (pm.getOwner() != null) {
        privateMessage.addElement("owner").addCDATA(formatString(""+pm.getOwner().getUser_id()));
      } else {
        privateMessage.addElement("owner").addCDATA("0");
      }
     
      if (pm.getRoom() != null) {
        privateMessage.addElement("room").addCDATA(formatString(""+pm.getRoom().getRooms_id()));
      } else {
        privateMessage.addElement("room").addCDATA("0");
      }
     
    }
View Full Code Here

 
  public Long addPrivateMessage(String subject, String message, Long parentMessageId,
      Users from, Users to, Users owner, Boolean bookedRoom, Rooms room,
      Boolean isContactRequest, Long userContactId) {
    try {
      PrivateMessages privateMessage = new PrivateMessages();
      privateMessage.setInserted(new Date());
      privateMessage.setSubject(subject);
      privateMessage.setMessage(message);
      privateMessage.setFrom(from);
      privateMessage.setTo(to);
      privateMessage.setOwner(owner);
      privateMessage.setBookedRoom(bookedRoom);
      privateMessage.setRoom(room);
      privateMessage.setParentMessage(parentMessageId);
      privateMessage.setIsTrash(false);
      privateMessage.setPrivateMessageFolderId(0L);
      privateMessage.setIsRead(false);
      privateMessage.setIsContactRequest(isContactRequest);
      privateMessage.setUserContactId(userContactId);
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      privateMessage = session.merge(privateMessage);
      Long privateMessageId = privateMessage.getPrivateMessageFolderId();
     
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return privateMessageId;     
View Full Code Here

      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("privateMessageId", privateMessageId);
     
      PrivateMessages privateMessage = null;
      try {
        privateMessage = (PrivateMessages) query.getSingleResult();
        } catch (NoResultException ex) {
        }
      tx.commit();
View Full Code Here

                "where c.privateMessageId = :privateMessageId ";
 
        Query querySel = session.createQuery(hqlSel);
        querySel.setParameter("privateMessageId", privateMessageId);
       
        PrivateMessages privateMessages = null;
        try {
          privateMessages = (PrivateMessages) querySel.getSingleResult();
          } catch (NoResultException ex) {
          }
       
View Full Code Here

                "where c.privateMessageId = :privateMessageId ";
 
        Query querySel = session.createQuery(hqlSel);
        querySel.setParameter("privateMessageId", privateMessageId);
       
        PrivateMessages privateMessages = null;
        try {
          privateMessages = (PrivateMessages) querySel.getSingleResult();
          } catch (NoResultException ex) {
          }
       
View Full Code Here

                "where c.privateMessageId = :privateMessageId ";
 
        Query querySel = session.createQuery(hqlSel);
        querySel.setParameter("privateMessageId", privateMessageId);
       
        PrivateMessages privateMessages = null;
        try {
          privateMessages = (PrivateMessages) querySel.getSingleResult();
          } catch (NoResultException ex) {
          }
       
View Full Code Here

                    "owner").getText())), Maps.USERS));
            Rooms room = roommanagement.getRoomById(getNewId(
                importLongType(unformatString(pmObject.element(
                    "room").getText())), Maps.ROOMS));

            PrivateMessages pm = new PrivateMessages();
            pm.setMessage(message);
            pm.setSubject(subject);
            pm.setPrivateMessageFolderId(privateMessageFolderId);
            pm.setUserContactId(userContactId);
            pm.setParentMessage(parentMessage);
            pm.setBookedRoom(bookedRoom);
            pm.setFrom(from);
            pm.setTo(to);
            pm.setInserted(inserted);
            pm.setIsContactRequest(isContactRequest);
            pm.setIsRead(isRead);
            pm.setIsTrash(isTrash);
            pm.setOwner(owner);
            pm.setRoom(room);

            pmList.add(pm);

          }
View Full Code Here

 
  public Long addPrivateMessage(String subject, String message, Long parentMessageId,
      Users from, Users to, Users owner, Boolean bookedRoom, Rooms room,
      Boolean isContactRequest, Long userContactId, String email) {
    try {
      PrivateMessages privateMessage = new PrivateMessages();
      privateMessage.setInserted(new Date());
      privateMessage.setSubject(subject);
      privateMessage.setMessage(message);
      privateMessage.setFrom(from);
      privateMessage.setTo(to);
      privateMessage.setOwner(owner);
      privateMessage.setBookedRoom(bookedRoom);
      privateMessage.setRoom(room);
      privateMessage.setParentMessage(parentMessageId);
      privateMessage.setIsTrash(false);
      privateMessage.setPrivateMessageFolderId(0L);
      privateMessage.setIsRead(false);
      privateMessage.setIsContactRequest(isContactRequest);
      privateMessage.setUserContactId(userContactId);
      privateMessage.setEmail(email);
     
      privateMessage = em.merge(privateMessage);
      Long privateMessageId = privateMessage.getPrivateMessageFolderId();
     
      return privateMessageId;     
    } catch (Exception e) {
      log.error("[addPrivateMessage]",e);
    }
View Full Code Here

            "where c.privateMessageId = :privateMessageId ";
     
      TypedQuery<PrivateMessages> query = em.createQuery(hql, PrivateMessages.class);
      query.setParameter("privateMessageId", privateMessageId);
     
      PrivateMessages privateMessage = null;
      try {
        privateMessage = query.getSingleResult();
        } catch (NoResultException ex) {
        }
     
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.user.PrivateMessages

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.