Package java.util

Examples of java.util.Collection


    BindSelectHandler handler = new BindSelectHandler();
    handler.setBeanPropertyIdName("id");

    // create domain class instances with no id
    Collection collection = new ArrayList();
    collection.add(new DomainClass());
    collection.add(new DomainClass());
    collection.add(new DomainClass());

    Map map = handler.createMap(collection);
    assert map.size() == 1;
    assert map.keySet().iterator().next().equals(0);
  }
View Full Code Here


  {

    BindSelectHandler handler = new BindSelectHandler();
    handler.setBeanPropertyIdName("id");

    Collection collection = new ArrayList();
    collection.add(new DomainClass(1));
    collection.add(new DomainClass(3));
    collection.add(new DomainClass(4));
    Map map = handler.getPropertyAsMap(collection);

    assert map.size() == 3;
    assert map instanceof HashMap;
View Full Code Here

      Vector vecView = new Vector();
      Vector vecAll = new Vector();
      Vector vecSchedule = new Vector();
      Vector vecSend = new Vector();

      Collection colview = new ArrayList();
      Collection colAll = new ArrayList();
      Collection colschedule = new ArrayList();
      Collection colsend = new ArrayList();

      String typeofModule = "";

      HttpSession session = request.getSession(true);
      com.centraview.common.UserObject userobjectd = (com.centraview.common.UserObject)session.getAttribute("userobject"); //get the user object
      int individualId = userobjectd.getIndividualID();

      ListGenerator lg = ListGenerator.getListGenerator(dataSource);

      String moduleName = "";
      typeofModule = (String)request.getParameter("TYPEOFMODULE");

      if (typeofModule == null) {
        typeofModule = (String)request.getAttribute("TYPEOFMODULE");
      }
      if (typeofModule == null) {
          typeofModule = Constants.EMAILMODULE;
      }     

      if (typeofModule != null) {
        if (typeofModule.equals(Constants.ACTIVITYMODULE)) {
          moduleName = Constants.ACTIVITYMODULE;
        } else if (typeofModule.equals(Constants.EMAILMODULE)) {
          moduleName = Constants.EMAILMODULE;
        }
      }
     
      PreferenceHome prefHome = (PreferenceHome)CVUtility.getHomeObject("com.centraview.preference.PreferenceHome", "Preference");
      Preference prefRemote = (Preference)prefHome.create();
      prefRemote.setDataSource(dataSource);
     
      if (moduleName.equals(Constants.ACTIVITYMODULE)) {
      hm = prefRemote.getUserDelegation(individualId, moduleName);
        vecView = (Vector)hm.get(Constants.VIEW);
        vecSchedule = (Vector)hm.get(Constants.SCHEDULEACTIVITY);
        vecAll = (Vector)hm.get(Constants.VIEWSCHEDULEACTIVITY);
      } else if (moduleName.equals(Constants.EMAILMODULE)) {
      Vector emailVecSend = prefRemote.getEmailDelegation(individualId);
        vecView = (Vector)hm.get(Constants.VIEW);
        vecSend = emailVecSend;
        vecAll = (Vector)hm.get(Constants.VIEWSENDEMAIL);
      }

      ContactFacadeHome facadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade cfremote = (ContactFacade) facadeHome.create();
      cfremote.setDataSource(dataSource);

      // get the records from the database
      Collection sqlResults = cfremote.getEmployeeListCollection(individualId);

      // now create a DisplayList out of those records
      IndividualList employeeList = new IndividualList();

      // ok, now that we have the results from the database,
      // we need to generate a DisplayList object to pass
      // to the List View code (List.jsp)
      Iterator iter = sqlResults.iterator();

      while (iter.hasNext()) {
        HashMap sqlRow = (HashMap)iter.next();

        String individualName = (String)sqlRow.get("Name");
View Full Code Here

      EntityVO entityVO = ticketVO.getEntityVO();

      if (entityVO != null) {
        String entityName = entityVO.getName();
        ticketForm.setEntityname(entityName);
        Collection mocList = entityVO.getMOC();

        AddressVO primaryAdd = entityVO.getPrimaryAddress();

        if (primaryAdd != null) {
          String address = "";
          if (primaryAdd.getStreet1() != null && !primaryAdd.getStreet1().equals("")) {
            address += primaryAdd.getStreet1();
          }
          if (primaryAdd.getStreet2() != null && !primaryAdd.getStreet2().equals("")) {
            address += ", " + primaryAdd.getStreet2() + "\n";
          } else {
            address += "\n";
          }
          if (primaryAdd.getCity() != null && !primaryAdd.getCity().equals("")) {
            address += primaryAdd.getCity();
          }
          if (primaryAdd.getStateName() != null && !primaryAdd.getStateName().equals("")) {
            address += ", " + primaryAdd.getStateName();
          }
          if (primaryAdd.getZip() != null && !primaryAdd.getZip().equals("")) {
            address += " " + primaryAdd.getZip();
          }
          if (primaryAdd.getCountryName() != null && !primaryAdd.getCountryName().equals("")) {
            address += ", " + primaryAdd.getCountryName();
          }
          ticketForm.setAddress(address);
          if (primaryAdd.getWebsite() != null) {
            ticketForm.setWebsite(primaryAdd.getWebsite());
          }
        }

        Iterator iterator = mocList.iterator();
        while (iterator.hasNext()) {
          MethodOfContactVO moc = (MethodOfContactVO) iterator.next();
          if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
            ticketForm.setEmail(moc.getContent());
          } else if (moc.getMocType() == 4) {
View Full Code Here

      Vector vecview = new Vector();
      Vector vecmodify = new Vector();
      Vector vecdelete = new Vector();

      Collection colview = new ArrayList();
      Collection colmodify = new ArrayList();
      Collection coldelete = new ArrayList();

      int uid = Integer.parseInt(request.getParameter("contactID").toString());
      request.setAttribute("userID",new Integer(uid));

      Authorization authRemote = (Authorization)authHome.create();

      hm = authRemote.getDefaultPermissions(uid);

      if (! authRemote.getUserDefaultPermission(uid).equalsIgnoreCase("Yes")) {
        if (hm != null) {
          vecview = (Vector)hm.get("VIEW");
          vecmodify = (Vector)hm.get("UPDATE");
          vecdelete = (Vector)hm.get("DELETE");
        }
      }else{
        request.setAttribute("isPublic","Yes");
      }


      ContactFacadeHome facadeHome = (ContactFacadeHome)CVUtility.getHomeObject("com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade cfremote = (ContactFacade)facadeHome.create();
      cfremote.setDataSource(dataSource);

      // get the records from the database
      Collection sqlResults = cfremote.getUserListCollection(uid);

      // now create a DisplayList out of those records
      IndividualList employeeList = new IndividualList();

      // ok, now that we have the results from the database,
      // we need to generate a DisplayList object to pass
      // to the List View code (List.jsp)
      Iterator iter = sqlResults.iterator();

      while (iter.hasNext()) {
        HashMap sqlRow = (HashMap)iter.next();

        String individualName = (String)sqlRow.get("Name");
View Full Code Here

      Vector attendeeVec = new Vector();
      if (dbName != null && dbName.equals("employee")) {
        attendeeVec = new Vector();

        Collection sqlResults = remote.getEmployeeListCollection(individualID);

        // ok, now that we have the results from the database,
        // we need to generate a DisplayList object to pass
        // to the List View code (List.jsp)
        Iterator iter = sqlResults.iterator();

        while (iter.hasNext()) {
          HashMap sqlRow = (HashMap)iter.next();
          String indvName = (String)sqlRow.get("Name");
          int indvID = ((Number)sqlRow.get("IndividualID")).intValue();
View Full Code Here

              if (primaryAdd.getWebsite() != null) {
                ticketForm.setWebsite(primaryAdd.getWebsite());
              }
            }
           
            Collection mocList = entityVO.getMOC();
            Iterator iterator = mocList.iterator();
            while (iterator.hasNext()) {
              MethodOfContactVO moc  = (MethodOfContactVO) iterator.next();
              if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) {
                ticketForm.setEmail(moc.getContent());
              } else if (moc.getMocType() == 4) {
View Full Code Here

          if (primaryAdd.getWebsite() != null) {
            dynaForm.setWebsite(primaryAdd.getWebsite());
          }
        }
       
        Collection mocList = entityVO.getMOC();
        Iterator iterator = mocList.iterator();
        while (iterator.hasNext()) {
          MethodOfContactVO moc  = (MethodOfContactVO) iterator.next();
          if (moc.getMocType() == 1 && moc.getIsPrimary().equalsIgnoreCase("YES")) // this is for email
          {
            dynaForm.setEmail(moc.getContent());
View Full Code Here

          hm.put("Line", readline);
          importList.add(hm);
        } // end of for block  used to parse every lineSeprator
      } // end of while

      Collection CustomEntList = dyn.getCustomEntityList();
      Collection CustomIndList = dyn.getCustomIndividualList();

      if (tabDelimiter != null && tabDelimiter.equals("\\t"))
      {
        tabDelimiter = "\t";
      }
View Full Code Here

        String country = primaryAdd.getCountryName();
        printTemplateField.setCountry(country);
        printTemplateField.setWebsite(primaryAdd.getWebsite());
      } // end if (primaryAdd != null)
      // set the Method of Contacts
      Collection mocList = individualVOReference.getMOC();
      Iterator iterator = mocList.iterator();
      while (iterator.hasNext()) {
        MethodOfContactVO moc = (MethodOfContactVO) iterator.next();
        // TODO Should we make an effort to see if the email address is the
        // primary???
        if (moc.getMocType() == 1) // this is for email
View Full Code Here

TOP

Related Classes of java.util.Collection

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.