Package com.centraview.contact.contactfacade

Examples of com.centraview.contact.contactfacade.ContactFacade


    if (flag == false) {
      try {
        ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
            "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
        HashMap hm = new HashMap();
        ContactFacade remote = (ContactFacade)aa.create();
        remote.setDataSource(this.dataSource);

        DL = remote.getAllIndividualList(individualID, hm);

        DL.setIndividualId(individualID);
        DL.setListType("Individual");
        DL.setDirtyFlag(false);
        DL.setTotalNoOfRecords(DL.size());
View Full Code Here


    String searchString = DLparam.getSearchString() == null ? "" : DLparam.getSearchString();
    // This will hold the parameters being passed to the EJB
    // primarily just the searchString if any.
    HashMap parameters = new HashMap();
    // Get the EJB stuff ready
    ContactFacade contactFacade = null;
    ContactFacadeHome contactFacadeHome = (ContactFacadeHome)CVUtility.getHomeObject(
        "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
    try {
      contactFacade = (ContactFacade)contactFacadeHome.create();
      contactFacade.setDataSource(this.dataSource);
    } catch (Exception e) {
      logger.error("[getIndividualList] Exception thrown.", e);
    }
    // This will do Simple search
    if (searchString.equals("") || searchString.startsWith("SIMPLE :")) {
      try {
        // If it is a simple search I don't send in anything as a parameter. I
        // just want an unaltered list. And I think the marketing list will
        // default to 1 which sucks too.
        DL = contactFacade.getAllIndividualList(DLparam.getIndividualId(), parameters);
      } catch (RemoteException e) {
        logger.error("[getIndividualList] Exception thrown.", e);
      }
      DL.setTotalNoOfRecords(DL.size());
      DL.setListType("Individual");
      DL.setSortMember(displayListParameters.getSortMember());
      DL.setDirtyFlag(false);
      if (DL.getTotalNoOfRecords() == DL.getEndIndex()) {
        globalLists.put("Individual", DL.clone());
      }
      IndividualList DL1 = new IndividualList();
      DL.setSortMember(displayListParameters.getSortMember());
      DL.setSortType(displayListParameters.getSortType());
      DL.setSearchString(searchString);
      DL.setListType("Individual");
      DL.setIndividualId(displayListParameters.getIndividualId());
      DL = (IndividualList)this.Sort(DL, DL);
      if (!searchString.equals("")) {
        DL.search();
      }
      DL.setTotalNoOfRecords(DL.size());
      DL.setListID(DLparam.getListID());
      return DL1;
    } else { // for ADVANCE:
      String powerString = DLparam.getPowerString();
      try {
        parameters.put("ADVANCESEARCHSTRING", searchString);
        DL = contactFacade.getAllIndividualList(DLparam.getIndividualId(), parameters);
        DL.setTotalNoOfRecords(DL.size());
        DL.setListType("Individual");
        DL.setDirtyFlag(false);
      } catch (Exception e) {
        logger.error("[getIndividualList] Exception thrown.", e);
View Full Code Here

    if (searchString.equals("") || searchString.startsWith("SIMPLE :")) {
      ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
          "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      try {

        ContactFacade remote = (ContactFacade)aa.create();
        remote.setDataSource(this.dataSource);

        HashMap hm = new HashMap();

        if (DLparam.getSortMember() != null) {
          hm.put("sortColumn", DLparam.getSortMember());
        }
        hm.put("sortDirection", DLparam.getSortType() + "");

        if (dbID != 0) {
          hm.put("ListID", new Integer(dbID));
        }
        hm.put("dbID", new Integer(dbID));

        DL = remote.getAllIndividualList(DLparam.getIndividualId(), hm);

        DL.setTotalNoOfRecords(DL.size());
        DL.setListType("Individual");
        DL.setSortMember(DL2.getSortMember());
        DL.setDirtyFlag(false);
        DL.setDbID(dbID);

        if (DL.getTotalNoOfRecords() == DL.getEndIndex()) {
          globalLists.put("Individual", DL);
        }
      } catch (Exception e) {
        System.out
            .println("[Exception][ListGenerator] Exception thrown in getIndividualList(DisplayList, int):2304 :"
                + e);
        e.printStackTrace();
      }

      DL.setSortType(DL2.getSortType());
      DL.setStartAT(DL2.getStartAT());
      DL.setEndAT(DL2.getEndAT());
      DL.setDbID(DL2.getDbID());
      DL.setSearchString(searchString);
      DL.setListType("Individual");

      int beginIndex = 0;
      int endIndex = 0;
      int startAT = DL2.getStartAT();
      int EndAt = DL2.getEndAT();
      int tnorec = DL.size();

      if (tnorec > EndAt) {
        if (tnorec > EndAt + 100) {
          beginIndex = startAT - 100;
        }
        if (beginIndex < 1) {
          beginIndex = 1;

        }
        endIndex = EndAt + 100;
      } else {
        beginIndex = 1;
        endIndex = EndAt;
      }

      DL.setBeginIndex(beginIndex);
      DL.setEndIndex(endIndex);

      DL2.setBeginIndex(0);
      DL2.setEndIndex(0);

      DL.setSearchString(searchString);
      if (!searchString.equals("")) {
        DL.search("Name");
      }

      DL.setTotalNoOfRecords(DL.size());
      DL.setListID(DLparam.getListID());

      return DL;
    }// end of if SIMPLE :
    else // for ADVANCE:
    {
      String powerString = DLparam.getPowerString();
      try {
        ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
            "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
        HashMap hm = new HashMap();

        if (DLparam.getSortMember() != null) {
          hm.put("sortColumn", DLparam.getSortMember());
        }
        hm.put("sortDirection", DLparam.getSortType() + "");

        hm.put("ADVANCESEARCHSTRING", searchString);
        ContactFacade remote = (ContactFacade)aa.create();
        remote.setDataSource(this.dataSource);

        DL = remote.getAllIndividualList(DLparam.getIndividualId(), hm);

        DL.setTotalNoOfRecords(DL.size());
        DL.setListType("Individual");
        DL.setDirtyFlag(false);
      } catch (Exception e) {
View Full Code Here

      if (flag == false) {
        ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
            "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
        try {
          HashMap hm = new HashMap();
          ContactFacade remote = (ContactFacade)aa.create();
          remote.setDataSource(this.dataSource);
          DL = remote.getAllGroupList(DLparam.getIndividualId(), hm);
          DL.setListType("Group");
          DL.setTotalNoOfRecords(DL.size());

          if (DL.getTotalNoOfRecords() == DL.getEndIndex()) {

            globalLists.put("Group", DL);
          }
        } catch (Exception e) {
          System.out.println("[Exception] ListGenerator.getGroupList: " + e.toString());
        }
        flag = true;
      }

      // end synchronized

      GroupList DL1 = new GroupList();
      DL1.setSortMember(DL2.getSortMember());
      DL1.setSortType(DL2.getSortType());
      DL1.setStartAT(DL2.getStartAT());
      DL1.setEndAT(DL2.getEndAT());
      DL1.setSearchString(searchString);
      DL1.setListType("Group");

      // write the logic for begin index, endindex for this specific list type
      // here

      int beginIndex = 0;
      int endIndex = 0;
      int startAT = DL2.getStartAT();
      int EndAt = DL2.getEndAT();

      int tnorec = DL.size();

      if (tnorec > EndAt) {
        if (tnorec > EndAt + 100)
          beginIndex = startAT - 100;
        if (beginIndex < 1)
          beginIndex = 1;
        endIndex = EndAt + 100;
      } else {

        beginIndex = 1;
        endIndex = EndAt;
      }

      DL1.setBeginIndex(beginIndex);
      DL1.setEndIndex(endIndex);

      DL2.setBeginIndex(0);
      DL2.setEndIndex(0);

      // search String

      // check for serach string simple or in multiple tables
      // and if the global list is complete
      // if simple search in same GL and make DL1
      // sort

      DL1 = (GroupList)Sort(DL1, DL);

      DL1.setSearchString(searchString);
      if (!searchString.equals(""))
        DL1.search();

      DL1.setTotalNoOfRecords(DL1.size());
      DL1.setListID(DLparam.getListID());

      return DL1;
    }// end of else SIMPLE :
    else // for ADVANCE:
    {
      String powerString = DLparam.getPowerString();
      try {
        ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
            "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
        HashMap hm = new HashMap();
        hm.put("ADVANCESEARCHSTRING", searchString);
        ContactFacade remote = (ContactFacade)aa.create();
        remote.setDataSource(this.dataSource);

        DL = remote.getAllGroupList(DLparam.getIndividualId(), hm);
        DL.setTotalNoOfRecords(DL.size());
        DL.setListType("Group");
        DL.setDirtyFlag(false);
      } catch (Exception e) {
        System.out.println("[Exception] ListGenerator.getGroupList: " + e.toString());
View Full Code Here

    if (searchString == null) {
      searchString = "";
    }
    ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
        "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
    ContactFacade remote = null;
    try {
      remote = (ContactFacade)aa.create();
      remote.setDataSource(this.dataSource);
    } catch (Exception e) {
      logger.error("[getEntityList] Exception thrown.", e);
    }
    HashMap hm = new HashMap();
    if (marketingListId > 0) {
      hm.put("ListID", new Integer(marketingListId));
    }
    if (searchString.startsWith("ADVANCE:")) {
      hm.put("ADVANCESEARCHSTRING", searchString);
    }
    try {
      DL = remote.getAllEntityList(DL2.getIndividualId(), hm);
    } catch (RemoteException e) {
      logger.error("[getEntityList] Exception thrown.", e);
    }
    DL.setDbID(marketingListId);
    DL.setTotalNoOfRecords(DL.size());
View Full Code Here

      if (flag == false) {
        ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
            "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
        try {
          HashMap hm = new HashMap();
          ContactFacade remote = (ContactFacade)aa.create();
          remote.setDataSource(this.dataSource);
          DL = remote.getAllGroupList(userID, hm);
          DL.setIndividualId(userID);
          DL.setSortMember(sortColumn);
          DL.setListType("Group");
          DL.setDirtyFlag(false);
          if (DL.getTotalNoOfRecords() == DL.getEndIndex()) {
            globalLists.put("Group", DL);
          }

        } catch (Exception e) {
          System.out.println("[Exception][MarketingListEJB] Exception thrown in x: " + e);
        }
        flag = true;
      }

      GroupList DL1 = new GroupList();
      DL1.setListType("Group");
      DL1.setSortMember(sortColumn);
      DL1.setStartAT(startAT);
      DL1.setEndAT(EndAt);
      DL1.setSearchString(searchString);

      int beginIndex = 0;
      int endIndex = 0;
      int tnorec = DL.size();

      if (tnorec > EndAt) {
        beginIndex = startAT - 5;
        if (beginIndex < 1)
          beginIndex = 1;
        endIndex = EndAt + 5;

      } else {
        beginIndex = 1;
        endIndex = EndAt;
      }

      DL1.setBeginIndex(beginIndex);
      DL1.setEndIndex(endIndex);

      /** *** sort function *** */
      DL1 = (GroupList)Sort(DL1, DL);
      DL1.setTotalNoOfRecords(DL.size());

      // getFilteredList( DL1.getBeginIndex() , DL1.getEndIndex() , DL1 );

      long currentListID = this.getNextListID();
      DL1.setListID(currentListID);

      GroupList DL2 = createEmptyObject(DL1);
      DL2.setTotalNoOfRecords(DL.size());
      DL2.setListID(currentListID);
      DL2.setSortMember(sortColumn);
      DL2.setListType("Group");
      DL2.setStartAT(startAT);
      DL2.setEndAT(EndAt);
      displayLists.put(new Long(currentListID), DL2);

      Set s = DL.keySet();
      Iterator it = s.iterator();
      int i = 0;

      // IQ adde to filter only those records which the user has right to see
      Vector allAccRec = new Vector();
      try {
        ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
            "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
        ContactFacade remote = (ContactFacade)aa.create();
        remote.setDataSource(this.dataSource);
        allAccRec = remote.getGroupAccessRecords(userID);
      } catch (Exception e) {}

      while (it.hasNext()) {
        String lem = (String)it.next();
        ListElement ele = (ListElement)DL.get(lem);
View Full Code Here

      IndividualList DL = null;
      ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
          "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      try {
        HashMap hm = new HashMap();
        ContactFacade remote = (ContactFacade)aa.create();
        remote.setDataSource(this.dataSource);
        hm.put("sortDirection", "A");
        DL = remote.getAllIndividualList(individualId, hm);
        DL.setIndividualId(individualId);
        DL.setSortMember(sortColumn);
        DL.setListType("Individual");
        DL.setDirtyFlag(false);
      } catch (Exception e) {
View Full Code Here

      ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
          "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      try {
        HashMap hm = new HashMap();
        ContactFacade remote = (ContactFacade)aa.create();
        remote.setDataSource(this.dataSource);
        hm.put("dbID", new Integer(dbID));
        DL = remote.getAllIndividualList(individualID, hm);
        DL.setIndividualId(individualID);
        DL.setSortMember(sortColumn);
        DL.setListType("Individual");
        DL.setDirtyFlag(false);
        DL.setDbID(dbID);
View Full Code Here

    EntityList DL = null;
    try {
      ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
          "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      HashMap hm = new HashMap();
      ContactFacade remote = (ContactFacade)aa.create();
      remote.setDataSource(this.dataSource);
      DL = remote.getAllEntityList(individualID, hm);
      DL.setIndividualId(individualID);
      DL.setListType("Entity");

      if (DL.getTotalNoOfRecords() == DL.getEndIndex()) {
        globalLists.put("Entity", DL);
View Full Code Here

    try {
      ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
          "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      HashMap hm = new HashMap();
      hm.put("dbID", new Integer(dbID));
      ContactFacade remote = (ContactFacade)aa.create();
      remote.setDataSource(this.dataSource);
      DL = remote.getAllIndividualList(userID, hm);
      DL.setIndividualId(userID);
      // DL.setSortMember( sortColumn );
      DL.setListType("Individual");
      DL.setDirtyFlag(false);
View Full Code Here

TOP

Related Classes of com.centraview.contact.contactfacade.ContactFacade

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.