Package org.campware.dream.om

Examples of org.campware.dream.om.DinboxEvent


    protected boolean getEntry(Criteria criteria, Context context)
    {
        try
        {
            DinboxEvent entry = (DinboxEvent) DinboxEventPeer.doSelect(criteria).get(0);
            context.put("entry", entry);
            context.put("created", formatDateTime(entry.getCreated()));
            context.put("modified", formatDateTime(entry.getModified()));
            context.put("issueddate", formatDate(entry.getIssuedDate()));
           
            return true;
        }
        catch (Exception e)
        {
View Full Code Here


    protected boolean getNew(Context context)
    {
        try
        {
            DinboxEvent entry = new DinboxEvent();
            context.put("entry", entry);
            return true;
        }
        catch (Exception e)
        {
View Full Code Here

      email=  ((InternetAddress)messages[i].getFrom()[0]).getAddress();
      name=  ((InternetAddress)messages[i].getFrom()[0]).getPersonal();
      subject= messages[i].getSubject();
      content= messages[i].getContent().toString();

      DinboxEvent entry = new DinboxEvent();

      Criteria criteria = new Criteria();
      criteria.add(DistributorPeer.EMAIL, (Object)email, Criteria.EQUAL);
      if (DistributorPeer.doSelect(criteria).size()>0){
        Distributor myDistrib = (Distributor) DistributorPeer.doSelect(criteria).get(0);
        entry.setDistributorId(myDistrib.getDistributorId());
      }else{
        if (name!=null){
          entry.setBody("From: " + name + " " + email + "\n\n" + content);
        }else{
          entry.setBody("From: " + email + "\n\n" + content);
        }
      }

      entry.setDinboxEventCode(getTempCode());

      entry.setEventType(10);
      entry.setEventChannel(10);
      entry.setSubject(subject);
       
      entry.setIssuedDate(new Date());
      entry.setCreatedBy("scheduler");
      entry.setCreated(new Date());
      entry.setModifiedBy("scheduler");
      entry.setModified(new Date());
       
      Connection conn = Transaction.begin(DinboxEventPeer.DATABASE_NAME);
      boolean success = false;
      try {
        entry.save(conn);
        entry.setDinboxEventCode(getRowCode("IE", entry.getDinboxEventId()));
        entry.save(conn);
        Transaction.commit(conn);
        success = true;

      } finally {
        if (!success) Transaction.safeRollback(conn);
View Full Code Here

     * wouldn't be secure.
     */
    public void doInsert(RunData data, Context context)
        throws Exception
    {
        DinboxEvent entry = new DinboxEvent();
        data.getParameters().setProperties(entry);

        String myCode=data.getParameters().getString("dinboxeventcode");

        entry.setDinboxEventCode(getTempCode());

        entry.setIssuedDate(parseDate(data.getParameters().getString("issueddate")));
        entry.setClosedDate(parseDate(data.getParameters().getString("closeddate")));
        entry.setCreatedBy(data.getUser().getUserName());
        entry.setCreated(new Date());
        entry.setModifiedBy(data.getUser().getUserName());
        entry.setModified(new Date());
       
        Connection conn = Transaction.begin(DinboxEventPeer.DATABASE_NAME);
        boolean success = false;
        try {
            entry.save(conn);
            entry.setDinboxEventCode(getRowCode("IE", entry.getDinboxEventId()));
            entry.save(conn);
            Transaction.commit(conn);
            success = true;

        } finally {
            if (!success) Transaction.safeRollback(conn);
View Full Code Here

     * into the database.
     */
    public void doUpdate(RunData data, Context context)
        throws Exception
    {
        DinboxEvent entry = new DinboxEvent();
        data.getParameters().setProperties(entry);

        entry.setIssuedDate(parseDate(data.getParameters().getString("issueddate")));
        entry.setClosedDate(parseDate(data.getParameters().getString("closeddate")));
        entry.setCreated(parseDateTime(data.getParameters().getString("created")));
        entry.setModifiedBy(data.getUser().getUserName());
        entry.setModified(new Date());

        entry.setModified(true);
        entry.setNew(false);
        entry.save();
    }
View Full Code Here

  {
    try
    {
      Criteria criteria = new Criteria();
      criteria.add(DinboxEventPeer.DINBOX_EVENT_ID, relid);
      DinboxEvent relEntry = (DinboxEvent) DinboxEventPeer.doSelect(criteria).get(0);

      DoutboxEvent entry = new DoutboxEvent();

      entry.setDistributorId(relEntry.getDistributorId());
      entry.setProductId(relEntry.getProductId());
      entry.setProjectId(relEntry.getProjectId());
      String oldSubject= relEntry.getSubject();
      if (oldSubject.startsWith("Re:")){
        entry.setSubject(oldSubject);
      }else{
        entry.setSubject("Re: " + oldSubject);
      }
      entry.setBody("\n\n\n----- Original Message -----\n" + relEntry.getBody());

      context.put("entry", entry);
           
      return true;
    }
View Full Code Here

TOP

Related Classes of org.campware.dream.om.DinboxEvent

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.