Package com.dotmarketing.portlets.communications.model

Examples of com.dotmarketing.portlets.communications.model.Communication


    }

    listArray[7] = String.valueOf(c.getParentCampaign());

    listArray[8] = "false";
    Communication comm = (Communication) InodeFactory.getChildOfClass(c, Communication.class);
    if (comm.getCommunicationType().equalsIgnoreCase("alert")) {
      listArray[8] = "true";
    }

    return listArray;
  }
View Full Code Here


    return getCommunication(inode,userId, "");
  }
 
  public static Communication getCommunication(String inode, String userId, String orderby) {
    HibernateUtil dh = new HibernateUtil(Communication.class);
    Communication commun = null;
    if(!UtilMethods.isSet(orderby)){
      orderby = "mod_date";
    }
    try {
      dh.setQuery(
View Full Code Here

    return commun;
  }
 
  public static Communication getCommunication(String inode) {
    HibernateUtil dh = new HibernateUtil(Communication.class);
    Communication communication = null;
    try {
      dh.setQuery(
      "from inode in class com.dotmarketing.portlets.communications.model.Communication where inode = ?");
      dh.setParam(inode);
      communication = (Communication) dh.load();
View Full Code Here

    }
    return communication;
  }
 
  public static Communication newInstance() {
    Communication c = new Communication();
    c.setType("communication");
    c.setModDate(new java.util.Date());
    return c;
  }
View Full Code Here

    InodeFactory.deleteInode(c);
   
  }
 
  public static void deleteCommunication(String inode) throws DotHibernateException {
    Communication c = getCommunication(inode);
    DotConnect db = new DotConnect();
    db.setSQL("delete from permission where inode_id = ?");
    db.addParam(inode);
    db.getResult();
    InodeFactory.deleteInode(c);
View Full Code Here

  throws Exception {

    Campaign c = (Campaign) req.getAttribute(WebKeys.CAMPAIGN_EDIT);
    MailingList ml = (MailingList) InodeFactory.getChildOfClass(c, MailingList.class);
    HTMLPage page = (HTMLPage) InodeFactory.getChildOfClass(c, HTMLPage.class);
    Communication comm = (Communication) InodeFactory.getChildOfClass(c, Communication.class);
    UserFilter userfilter = (UserFilter) InodeFactory.getChildOfClass(c, UserFilter.class);

    Campaign copy = CampaignFactory.newInstance();

    copy.setTitle( c.getTitle() + " (copy)");
    copy.setFromEmail(c.getFromEmail());
    copy.setFromName(c.getFromName());
    copy.setCStartDate(c.getCStartDate());
    copy.setSubject(c.getSubject());
    copy.setMessage(c.getMessage());
    copy.setOwner(c.getOwner());
    copy.setUserId(c.getUserId());
    copy.setCommunicationInode(c.getCommunicationInode());
    copy.setUserFilterInode(c.getUserFilterInode());

    //no sure if this is needed
    HibernateUtil.saveOrUpdate(copy);

    if(InodeUtils.isSet(ml.getInode())){
      copy.addChild(ml);
    }
    if(InodeUtils.isSet(page.getInode())){
      copy.addChild(page);
    }
    if (InodeUtils.isSet(comm.getInode())) {
      copy.addChild(comm);
    }
    if (InodeUtils.isSet(userfilter.getInode())) {
      copy.addChild(userfilter);
    }
View Full Code Here

      if (InodeUtils.isSet(ml.getInode())) {
        c.addChild(ml);
      }

      // wipe the old communication that was the child
      Communication comm = (Communication) InodeFactory.getChildOfClass(c, Communication.class);
      c.deleteChild(comm);

      //try to get the campaign's new communication
      comm = (Communication) InodeFactory.getInode(String.valueOf(cfform.getCommunicationInode()), Communication.class);
      if (InodeUtils.isSet(comm.getInode())) {
        c.addChild(comm);
      }

      // wipe the old user filter that was the child
      UserFilter userfilter = (UserFilter) InodeFactory.getChildOfClass(c, UserFilter.class);
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.communications.model.Communication

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.