Package com.centraview.marketing.marketingfacade

Examples of com.centraview.marketing.marketingfacade.MarketingFacade


    int individualId = ((UserObject)session.getAttribute("userobject")).getIndividualID();
    ArrayList deleteLog = new ArrayList();
    String rowId[] = request.getParameterValues("rowId");
    try {
      MarketingFacade ejb = (MarketingFacade)CVUtility.setupEJB("MarketingFacade", "com.centraview.marketing.marketingfacade.MarketingFacadeHome", dataSource);
      for (int i=0; i<rowId.length; i++) {
        if(rowId[i] != null && !rowId[i].equals("")) {         
          int elementId = Integer.parseInt(rowId[i]);
          ejb.deletePromotion(individualId, elementId);
        }
      }
    } catch(Exception e) {
      logger.error("[execute] Exception thrown.", e);
      throw new CommunicationException(e.getMessage());
View Full Code Here


    try
    {
      HashMap hm = new HashMap();
      hm.put("individualid",individualID);
      hm.put("eventid", new Integer( eventId ));
      MarketingFacade remote =(MarketingFacade)marketingFacadeHome.create();
      remote.setDataSource(this.dataSource);

      int i = remote.deleteEventRegister( hm );
    }
    catch( Exception e )
    {
      logger.error("[Exception] EventAtendeesList.deleteElement( int indvID, String key )", e);
    }
View Full Code Here

      HashMap hm = new HashMap();
      hm.put("individualid",individualID+"");
      hm.put("eventid", new Integer( eventId ));
     
      //call to EJB server
      MarketingFacade remote =(MarketingFacade)marketingFacadeHome.create();
      remote.setDataSource(this.dataSource);
      for (int i=0; i<recordID.length; i++)
      {
        if(recordID[i] != null && !recordID[i].equals("")){
          int elementID = Integer.parseInt(recordID[i]);
          try{
            int k = remote.deleteEventRegister( hm );
          }//end of try block
          catch(AuthorizationFailedException ae){
            String errorMessage = ae.getExceptionDescription();
            resultDeleteLog.add(errorMessage);
          }//end of catch block
View Full Code Here

      if (rowID != null && !rowID.equals(""))
      {
        int eventID = Integer.parseInt(rowID);

        MarketingFacadeHome home = (MarketingFacadeHome)CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome", "MarketingFacade");
        MarketingFacade remote = home.create();
        remote.setDataSource(dataSource);
        EventDetails oldEvent = remote.getEventDetails(individualId, eventID);

        if (oldEvent != null)
        {
          HashMap newEventHashMap = new HashMap();
          newEventHashMap.put("Creator", Integer.toString(individualId));
          newEventHashMap.put("Name", oldEvent.getName());
          newEventHashMap.put("Description", oldEvent.getDetail());
          newEventHashMap.put("WhoShouldAttend", oldEvent.getWhoshouldattend());
          newEventHashMap.put("MaxAttendees", Integer.toString(oldEvent.getMaxattendees()));
          newEventHashMap.put("Moderator", Integer.toString(oldEvent.getModeratorid()));
          //newEventHashMap.put("StartDate", (Timestamp) oldEvent.getStartdate());
          //newEventHashMap.put("EndDate", (Timestamp) oldEvent.getEnddate());
          Timestamp startTimestamp = (Timestamp)oldEvent.getStartdate();
          Timestamp endTimestamp = (Timestamp)oldEvent.getEnddate();

          //This section SHOULD NOT NEED TO BE DONE.
          //The way Timestamps are currently handled means I have to do this this way.
          Calendar tempCalendar = new GregorianCalendar();
          //fix the start time
          tempCalendar.setTimeInMillis(startTimestamp.getTime());
          tempCalendar.add(Calendar.YEAR, 1900);
          startTimestamp.setTime(tempCalendar.getTimeInMillis());

          //fix the end time
          tempCalendar.setTimeInMillis(endTimestamp.getTime());
          tempCalendar.add(Calendar.YEAR, 1900);
          endTimestamp.setTime(tempCalendar.getTimeInMillis());
          //End of This section SHOULD NOT NEED TO BE DONE.

          newEventHashMap.put("StartDate", startTimestamp);
          newEventHashMap.put("EndDate", endTimestamp);

          //Add the attachment here
          MailMessage mailmessage = null;
          EmailFacadeHome cfh = (EmailFacadeHome)CVUtility.getHomeObject("com.centraview.email.emailfacade.EmailFacadeHome", "EmailFacade");
          EmailFacade facade = (EmailFacade)cfh.create();
          HashMap hm = new HashMap();
          hm.put("MessageID", new Integer(eventID));

          mailmessage = facade.getAttachment(individualId, hm);

          ArrayList attachments = mailmessage.getAttachmentID();
          HashMap newAttachments = new HashMap();
          if (attachments != null)
          {
            Iterator attachmentIterator = attachments.iterator();
            while (attachmentIterator.hasNext())
            {
              Attachment attachment = (Attachment)attachmentIterator.next();
              newAttachments.put(Integer.toString(attachment.getFileID()), attachment.getFilename());
            } //end of while loop (attachmentIterator.hasNext())
          } //end of if statement (attachments != null)

          newEventHashMap.put("Attachment", newAttachments);

          newEventID = remote.addEvent(newEventHashMap, individualId);
        } //end of if statement (eventDetails != null)

        Collection oldEventAttendees = remote.getAttendeesForEvent(individualId, eventID);
        if (oldEventAttendees != null)
        {
          HashMap map = new HashMap();
          Iterator iterator = oldEventAttendees.iterator();
          String[] individualIDs = new String[oldEventAttendees.size()];

          map.put("EventId", Integer.toString(newEventID));
          map.put("Accepted", "NO");
          int i = 0;

          while (iterator.hasNext())
          {
            EventAttendeeVO eventAttendeeVO = (EventAttendeeVO)iterator.next();
            individualIDs[i] = Integer.toString(eventAttendeeVO.getIndividualID());
            i++;
          } //end of while loop (iterator.hasNext())
          map.put("IndividualId", individualIDs);

          remote.addEventRegister(map, individualId);

        } //end of if statement (oldEventAttendees != null)

        request.setAttribute("eventid", Integer.toString(newEventID));
View Full Code Here

      EventDetails eventDetails = new EventDetails();


      MarketingFacadeHome home = (MarketingFacadeHome)CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome", "MarketingFacade");
      MarketingFacade remote = home.create();
      remote.setDataSource(dataSource);

      int eventid = 0;
      boolean duplicateEvent = false;

      if(request.getParameter(MarketingConstantKeys.TYPEOFOPERATION)!= null
         && (request.getParameter(MarketingConstantKeys.TYPEOFOPERATION)).equals("DUPLICATE")){
           duplicateEvent = true;
      }
     
      DynaActionForm dynaForm = (DynaActionForm)form;

      String eventID = (String)dynaForm.get("eventid");
      if (eventID != null && !eventID.equals(""))
      {
        eventid = Integer.parseInt(eventID);
      }
      eventID = (String)request.getParameter("eventid");
      if (eventid == 0 &&  eventID != null && !eventID.equals(""))
      {
        eventid = Integer.parseInt(eventID);
      } //end of if statement  (eventid == 0)
      eventID = (String)request.getAttribute("eventid");
      if (eventid == 0 &&  eventID != null && !eventID.equals(""))
      {
        eventid = Integer.parseInt(eventID);
      }
      request.setAttribute("eventid",eventid+"");

      eventDetails = remote.getEventDetails(individualId, eventid);
      eventDetails.setEventid(eventid);
      dynaForm.set("eventid", "" + eventid);
      dynaForm.set("name", eventDetails.getName());
      dynaForm.set("description", eventDetails.getDetail());
      dynaForm.set("whoshouldattend", eventDetails.getWhoshouldattend());
      dynaForm.set("maxattendees", "" + eventDetails.getMaxattendees());
      dynaForm.set("moderatorid", "" + eventDetails.getModeratorid());
      dynaForm.set("moderatorname", eventDetails.getModeratorname());

      Calendar calendar = new GregorianCalendar();

      if (eventDetails.getStartdate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getStartdate();
        calendar.setTimeInMillis(date.getTime());

        int[] hhmm = new int[2];
        hhmm[0] = calendar.get(Calendar.HOUR_OF_DAY);
        hhmm[1] = calendar.get(Calendar.MINUTE);

        String strTime = CVUtility.convertTime24HrsFormatToStr(hhmm);
        dynaForm.set("startmonth", Integer.toString(calendar.get(Calendar.MONTH) + 1));
        dynaForm.set("startday", Integer.toString(calendar.get(Calendar.DATE)));
        dynaForm.set("startyear", Integer.toString(calendar.get(Calendar.YEAR)));
        dynaForm.set("starttime", strTime);
      }

      if (eventDetails.getEnddate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getEnddate();
        calendar.setTimeInMillis(date.getTime());

        int[] hhmm = new int[2];
        hhmm[0] = calendar.get(Calendar.HOUR_OF_DAY);
        hhmm[1] = calendar.get(Calendar.MINUTE);

        String strTime = CVUtility.convertTime24HrsFormatToStr(hhmm);
        dynaForm.set("endmonth", Integer.toString(calendar.get(Calendar.MONTH) + 1));
        dynaForm.set("endday", Integer.toString(calendar.get(Calendar.DATE)));
        dynaForm.set("endyear", Integer.toString(calendar.get(Calendar.YEAR)));
        dynaForm.set("endtime", strTime);
      }

      if (eventDetails.getCreateddate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getCreateddate();
        calendar.setTimeInMillis(date.getTime());

        String month = getCalenderMonth(calendar.get(Calendar.MONTH) + 1);

        dynaForm.set("createddate", month + " " + Integer.toString(calendar.get(Calendar.DATE)) + ", " + Integer.toString(calendar.get(Calendar.YEAR)));
      }

      if (eventDetails.getModifieddate() != null)
      {
        Timestamp date = (Timestamp)eventDetails.getModifieddate();

        calendar.setTimeInMillis(date.getTime());

        String month = getCalenderMonth(calendar.get(Calendar.MONTH) + 1);

        dynaForm.set("modifieddate", month + " " + Integer.toString(calendar.get(Calendar.DATE)) + ", " + Integer.toString(calendar.get(Calendar.YEAR)));
      }

          if (!duplicateEvent)
          {
        try
        {
          boolean accepted = remote.hasUserAcceptedEvent(eventid, individualId);
          request.setAttribute("showRegisterButton", new Boolean(true));
          request.setAttribute("hasAccepted", new Boolean(accepted));
        }
        catch (IndividualNotInvitedException inie)
        {
View Full Code Here

    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    int listid = 0;
    MarketingFacadeHome aa = (MarketingFacadeHome)CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome", "MarketingFacade");
    try
    {
      MarketingFacade remote = (MarketingFacade)aa.create();
      remote.setDataSource(dataSource);
  ListMemberForm listMemberForm = (ListMemberForm) form;
  ListVO listVO = new ListVO();
  listVO.setTitle(listMemberForm.getListname());
  listVO.setDescription(listMemberForm.getListdescription());
  if(listMemberForm.getOwner() != null){
    int ownerID = Integer.parseInt(listMemberForm.getOwner());
    listVO.setOwnerID(ownerID);
  }
      listid = remote.addList(userid, listVO);
    }catch (Exception e){
      logger.error("[Exception] AddListHandler.Execute Handler ", e);
    }
    return listid;
  }   // end saveList() method
View Full Code Here

  public void run()
  {
    try {
      MarketingFacadeHome marketingFacadeHome = (MarketingFacadeHome) CVUtility.getHomeObject(
          "com.centraview.marketing.marketingfacade.MarketingFacadeHome", "MarketingFacade");
      MarketingFacade remote = marketingFacadeHome.create();
      remote.setDataSource(this.dataSource);
      this.importMessage = remote.getImportList(this.importList, this.headerRow, this.listID, this.individualID, this.CustomEntList,
          this.CustomIndList, this.tabDelimiter, this.lineDelimiter, this.headLine);

    } catch (Exception e) {
      logger.error("[run] Exception thrown.", e);
    }
View Full Code Here

  {
    MarketingFacadeHome marketingFacadeHome = (MarketingFacadeHome)CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome","MarketingFacade");
    try
    {
      int elementID = Integer.parseInt(key);
      MarketingFacade remote =(MarketingFacade)marketingFacadeHome.create();
      remote.setDataSource(this.dataSource);
      HashMap mapPromotion = new HashMap();
      mapPromotion.put("PromotionID" ,""+elementID);
      remote.deletePromotion(indvID, elementID);
    }
    catch( Exception e )
    {
      logger.error("[Exception] PromotionList.deleteElement( int indvID, String key )", e);
    }
View Full Code Here

    ArrayList resultDeleteLog = new ArrayList();
    MarketingFacadeHome marketingFacadeHome = (MarketingFacadeHome)CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome","MarketingFacade");
    try
    {
      //call to EJB server
      MarketingFacade remote =(MarketingFacade)marketingFacadeHome.create();
      remote.setDataSource(this.dataSource);
      for (int i=0; i<recordID.length; i++)
      {
        if(recordID[i] != null && !recordID[i].equals("")){
          int elementID = Integer.parseInt(recordID[i]);
          try{
            HashMap mapPromotion = new HashMap();
            mapPromotion.put("PromotionID" ,""+elementID);
            remote.deletePromotion(individualID, elementID);
          }//end of try block
          catch(AuthorizationFailedException ae){
            String errorMessage = ae.getExceptionDescription();
            resultDeleteLog.add(errorMessage);
          }//end of catch block
View Full Code Here

        mapPromotion.put("PromotionID", promotionid);
      }

      MarketingFacadeHome mfh = (MarketingFacadeHome)CVUtility.getHomeObject(
          "com.centraview.marketing.marketingfacade.MarketingFacadeHome", "MarketingFacade");
      MarketingFacade remote = mfh.create();
      remote.setDataSource(dataSource);
      if (request.getParameter("operation") != null) {
        if (request.getParameter("operation").equals("Add")) {
          mapPromotion.put("PromotionVo", promotionVO);
          promotionid = remote.addPromotion(individualId, mapPromotion);
          promotionDetailListForm.setPromotionid(promotionid);
          request.setAttribute("promotionid", promotionid);
        } else if (request.getParameter("operation").equals("Edit")) {

          promotionVO.setPromotionid(Integer.parseInt(promotionid));
          mapPromotion.put("PromotionVo", promotionVO);
          remote.updatePromotion(individualId, mapPromotion);
        }
      }

      request.setAttribute(MarketingConstantKeys.CURRENTTAB, MarketingConstantKeys.DETAIL);
      request.setAttribute(MarketingConstantKeys.TYPEOFOPERATION, MarketingConstantKeys.ADD);
View Full Code Here

TOP

Related Classes of com.centraview.marketing.marketingfacade.MarketingFacade

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.