Package org.campware.dream.om

Examples of org.campware.dream.om.DoutboxEvent


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

        String myCode=data.getParameters().getString("doutboxeventcode");
    int myStatus= data.getParameters().getInt("status");
   
    boolean bSave=true;

    if (myStatus==30){
      bSave= sendEmail(data, context, entry);
      if (bSave) entry.setStatus(50);
    }

    if (bSave){
          entry.setDoutboxEventCode(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(DoutboxEventPeer.DATABASE_NAME);
          boolean success = false;
          try {
              entry.save(conn);
              entry.setDoutboxEventCode(getRowCode("OE", entry.getDoutboxEventId()));
              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
    {
        DoutboxEvent entry = new DoutboxEvent();
        data.getParameters().setProperties(entry);

    int myStatus= data.getParameters().getInt("status");
   
    boolean bSave=true;

    if (myStatus==30){
      bSave= sendEmail(data, context, entry);
      if (bSave) entry.setStatus(50);
    }

    if (bSave){
          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

    protected boolean getEntry(Criteria criteria, Context context)
    {
        try
        {
            DoutboxEvent entry = (DoutboxEvent) DoutboxEventPeer.doSelect(criteria).get(0);
            context.put("entry", entry);
           
            return true;
        }
        catch (Exception e)
View Full Code Here

    {
      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

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

TOP

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

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.