Package com.centraview.common

Examples of com.centraview.common.DDNameValue


          // attachmentMap
          fileVO.setFileId(newFileID);
          String strFileID = String.valueOf(newFileID);
          String strFileName = "OriginalMessage_" + messageID.intValue();

          attachmentMap.add(new DDNameValue(strFileID + "#" + strFileName, strFileName));
        }
      } // end if (saveOrigBodyAsAttachment)

      if (!attachmentMap.isEmpty()) {
        emailForm.set("attachmentList", attachmentMap);
View Full Code Here


              int indexOfHash = fileKeyName.indexOf("#");
              if (indexOfHash != -1) {
                int lenString = fileKeyName.length();
                String fileID = fileKeyName.substring(0, indexOfHash);
                String fileName = fileKeyName.substring(indexOfHash + 1, lenString);
                attachments.add(new DDNameValue(fileID + "#" + fileName, fileName));
              }
            }
          }// end of for(int i = 0; i < tempAttachmentMap.length; i++)
        }// end of if (tempAttachmentMap != null && tempAttachmentMap.size() >
          // 0)
View Full Code Here

      else if (FileConstantKeys.PERMISSION.equals(previousTab))
      {
        // view permission
        String[] viewPermissionS = previousForm.getViewpermission()
        Vector viewPermisionV = new Vector();
        DDNameValue viewPermissionListBox = null;
        String idName = "";
        String displayName = "";
        // if user have selected records
        if (previousForm.getViewpermission() != null
        {
          int sizeOfListBox = viewPermissionS.length;
          for (int i=0;i<sizeOfListBox;i++)
          {
            int indexOfHash = viewPermissionS[i].indexOf("#");
            idName = viewPermissionS[i].substring(0, indexOfHash);
            displayName = viewPermissionS[i].substring(indexOfHash+1, viewPermissionS[i].length());
            viewPermissionListBox = new DDNameValue(viewPermissionS[i], displayName);
            viewPermisionV.add(viewPermissionListBox);
          }
          previousForm.setViewpermissionvec(viewPermisionV);
        }
        // if user have not selected records
        else
        {
          previousForm.setViewpermissionvec(new Vector());
        }       

        // modify permission       
        String[] modifyPermissionS = previousForm.getViewpermission()
        Vector modifyPermisionV = new Vector();
        DDNameValue modifyPermissionListBox = null;
        idName = "";
        displayName = "";
        // if user have selected records
        if (previousForm.getViewpermission() != null
        {
          int sizeOfListBox = modifyPermissionS.length;
          for (int i=0;i<sizeOfListBox;i++)
          {
            int indexOfHash = modifyPermissionS[i].indexOf("#");
            idName = modifyPermissionS[i].substring(0, indexOfHash);
            displayName = modifyPermissionS[i].substring(indexOfHash+1, modifyPermissionS[i].length());
            modifyPermissionListBox = new DDNameValue(modifyPermissionS[i], displayName);
            modifyPermisionV.add(modifyPermissionListBox);
          }
          previousForm.setViewpermissionvec(modifyPermisionV);
        }
        // if user have not selected records
        else
        {
          previousForm.setViewpermissionvec(new Vector());
        }       

        // delete permission       
        String[] deletePermissionS = previousForm.getViewpermission()
        Vector deletePermisionV = new Vector();
        DDNameValue deletePermissionListBox = null;
        idName = "";
        displayName = "";
        // if user have selected records
        if (previousForm.getViewpermission() != null
        {
          int sizeOfListBox = deletePermissionS.length;
          for (int i=0;i<sizeOfListBox;i++)
          {
            int indexOfHash = deletePermissionS[i].indexOf("#");
            idName = deletePermissionS[i].substring(0, indexOfHash);
            displayName = deletePermissionS[i].substring(indexOfHash+1, deletePermissionS[i].length());
            deletePermissionListBox = new DDNameValue(deletePermissionS[i], displayName);
            deletePermisionV.add(deletePermissionListBox);
          }
          previousForm.setViewpermissionvec(deletePermisionV);
        }
        // if user have not selected records
View Full Code Here

        flvo.setFileSize((float) ff.getFileSize());

        CvFolderVO homeFolder = cvfile.getHomeFolder(userid, dataSource);
        int fileId = cvfile.addFile(userid, homeFolder.getFolderId(), flvo, im, dataSource);
        ArrayList fileList = new ArrayList();
        fileList.add(new DDNameValue(fileId+"#"+fileName,fileName));

        String[] files = fileform.getFileList();
        if(files != null){
          for(int i=0; i<files.length;i++){
            String fileKeyName = files[i];
            if(fileKeyName != null){
              int indexOfHash = fileKeyName.indexOf("#");
              if (indexOfHash != -1){
                int lenString = fileKeyName.length();
                String fileID = fileKeyName.substring(0,indexOfHash);
                String fileName1 = fileKeyName.substring(indexOfHash+1,lenString);
                fileList.add(new DDNameValue(fileID+"#"+fileName1,fileName1));
              }
            }
          }
        }
        request.setAttribute("fileList",fileList);
      } else {
        String fileId = "";
        String fileName = "";

        if (request.getParameter("fileId") != null) {
          fileId = request.getParameter("fileId");
        }

        if (request.getParameter("fileName") != null) {
          fileName = request.getParameter("fileName");
        }
        
        ArrayList fileList = new ArrayList();
        if (fileId != null && !fileId.equals("") && fileName != null && !fileName.equals(""))
          fileList.add(new DDNameValue(fileId+"#"+fileName,fileName));

        String[] files = (String[])fileform.getFileList();
        if(files != null){
          for(int i=0; i<files.length;i++){
            String fileKeyName = files[i];
            if(fileKeyName != null){
              int indexOfHash = fileKeyName.indexOf("#");
              if (indexOfHash != -1){
                int lenString = fileKeyName.length();
                String fileID = fileKeyName.substring(0,indexOfHash);
                String fileName1 = fileKeyName.substring(indexOfHash+1,lenString);
               
                fileList.add(new DDNameValue(fileID+"#"+fileName1,fileName1));
              }
            }
          }
        }
        request.setAttribute("fileList", fileList);
View Full Code Here

      String searchIndividual = af.getActivityAttendeeSearch();
      AttendeeList gal = AttendeeList.getAttendeeList(individualID, "group", 0, dataSource);

      Vector individualList = new Vector();
      individualList.addElement(new DDNameValue("0#employee", "Employee"));
      individualList.addElement(new DDNameValue("0#allindividual", "All Individual"));

      ContactFacadeHome cfh = (ContactFacadeHome)CVUtility.getHomeObject(
          "com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
      ContactFacade remote = cfh.create();
      remote.setDataSource(dataSource);
      Vector allDBList = remote.getDBList(individualID);
      if (allDBList != null) {
        for (int dbcount = 0; dbcount < allDBList.size(); dbcount++) {
          DDNameValue dbInfo = (DDNameValue)allDBList.get(dbcount);
          String id = dbInfo.getStrid();
          String name = dbInfo.getName();
          individualList.addElement(new DDNameValue(id + "#individual", name));
        }
      }
      request.setAttribute("individualList", individualList);

      DDNameValue dbIDName = null;
      String dbID = "0";
      String tempDBID = "0";
      String dbName = "0";
      if (individualList != null && individualList.size() > 0) {
        dbIDName = (DDNameValue)individualList.get(0);
      }

      if (request.getParameter("dbID") == null
          && ((ActivityForm)form).getActivityAttendeesType() == null) {
        tempDBID = dbIDName.getStrid();
        if (tempDBID != null && tempDBID.length() > 0) {
          dbID = tempDBID.substring(0, tempDBID.indexOf("#"));
          dbName = tempDBID.substring(tempDBID.indexOf("#") + 1, tempDBID.length());
        }
      } else if (((ActivityForm)form).getActivityAttendeesType() != null) {
        tempDBID = ((ActivityForm)form).getActivityAttendeesType();
        if (tempDBID != null && tempDBID.length() > 0) {
          dbID = tempDBID.substring(0, tempDBID.indexOf("#"));
          dbName = tempDBID.substring(tempDBID.indexOf("#") + 1, tempDBID.length());
        }
      }

      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();
          attendeeVec.addElement(new DDNameValue("" + indvID + "#" + indvName, indvName));
        }
      } else if (dbName != null && dbName.equals("individual")) {
        gal = AttendeeList.getAttendeeList(individualID, "individual", Integer.parseInt(dbID),
            dataSource);
        attendeeVec = (Vector)gal.get("attendee");
      } else {
        gal = AttendeeList.getAttendeeList(individualID, "allindividual", 0, dataSource);
        attendeeVec = (Vector)gal.get("allattendee");
      }

      Vector att_required = new Vector();
      if (af.getActivityAttendeeRequiredVector() != null) {
        att_required = af.getActivityAttendeeRequiredVector();
      }

      Vector att_optional = new Vector();
      if (af.getActivityAttendeeOptionalVector() != null) {
        att_optional = af.getActivityAttendeeOptionalVector();
      }

      int sizeOfAttendeeList = attendeeVec.size();
      int sizeOfRequiredAttendee = att_required.size();
      int sizeOfOptionalAttendee = att_optional.size();
      int i = 0;
      int j = 0;
      int k = 0;
      String idOfAttendeeList = "";
      String idOfRequiredAttendee = "";
      String idOfOptionalAttendee = "";
      DDNameValue ddAttendeeListInfo = null;
      DDNameValue ddRequiredAttendeeInfo = null;
      DDNameValue ddOptionalAttendeeInfo = null;
      boolean removed = false;

      while (i < sizeOfAttendeeList) {
        removed = false;
        ddAttendeeListInfo = (DDNameValue)attendeeVec.get(i);
        idOfAttendeeList = ddAttendeeListInfo.getStrid();

        while (j < sizeOfRequiredAttendee) {
          ddRequiredAttendeeInfo = (DDNameValue)att_required.get(j);
          idOfRequiredAttendee = ddRequiredAttendeeInfo.getStrid();

          if (idOfAttendeeList.equals(idOfRequiredAttendee)) {
            attendeeVec.remove(i);
            removed = true;
            sizeOfAttendeeList--;
            break;
          }
          j++;
          ddRequiredAttendeeInfo = null;
        }

        while (k < sizeOfOptionalAttendee) {
          ddOptionalAttendeeInfo = (DDNameValue)att_optional.get(k);
          idOfOptionalAttendee = ddOptionalAttendeeInfo.getStrid();

          if (idOfAttendeeList.equals(idOfOptionalAttendee)) {
            attendeeVec.remove(i);
            removed = true;
            sizeOfAttendeeList--;
            break;
          }
          k++;
          ddOptionalAttendeeInfo = null;
        }
        j = 0;
        k = 0;

        if (!removed) {
          i++;
        }
        ddAttendeeListInfo = null;
        removed = false;
      }

      ((ActivityForm)form).setActivityAttendeeRequiredVector(att_required);
      ((ActivityForm)form).setActivityAttendeeOptionalVector(att_optional);

      if (searchIndividual != null && !searchIndividual.equals("")) {
        if (attendeeVec != null) {
          int attendeeSize = attendeeVec.size();
          i = 0;

          while (i < attendeeSize) {
            DDNameValue tempAttendeeListInfo = (DDNameValue)attendeeVec.elementAt(i);
            String valueAttendee = tempAttendeeListInfo.getName();
            String tempValueAttendee = valueAttendee.toUpperCase();
            String tempSearchIndividual = searchIndividual.toUpperCase();
            int occuranceVALUESearch = (tempValueAttendee).indexOf(tempSearchIndividual);

            if (occuranceVALUESearch == -1) {
View Full Code Here

        int arrView[] = new int[l1 + l2];
        int arrBlank[] = {};
        if (iterRequired != null) {
          while (iterRequired.hasNext()) {
            DDNameValue nvalue = (DDNameValue)iterRequired.next();
            String strID = nvalue.getStrid();
            String arrStrings[] = strID.split("#");
            strID = arrStrings[0].trim();
            int id = Integer.parseInt(strID);
            arrView[arrIndex++] = id;
          }// end of while (iterRequired.hasNext())
        }// end of if (iterRequired != null)

        if (iterOptional != null) {
          while (iterOptional.hasNext()) {
            DDNameValue nvalue = (DDNameValue)iterOptional.next();
            String strID = nvalue.getStrid();
            String arrStrings[] = strID.split("#");
            strID = arrStrings[0].trim();
            int id = Integer.parseInt(strID);
            arrView[arrIndex++] = id;
          }// end of while (iterOptional.hasNext())
View Full Code Here

          Collection stateCol = (Collection)gml.get("States");

          Iterator stateIter = stateCol.iterator();
          while (stateIter.hasNext())
          {
            DDNameValue ddname = (DDNameValue)stateIter.next();

            if ((ddname.getName()).equals(strValue))
            {
              dynaForm.set("state", (new Integer(ddname.getId())).toString());
              break;
            }
          }
        } else if (strhead.equals("zip"))
          dynaForm.set("zip", strValue);
        else if (strhead.equals("country"))
        {
          Collection countryCol = (Collection)gml.get("Country");

          Iterator stateIter = countryCol.iterator();
          while (stateIter.hasNext())
          {
            DDNameValue ddname = (DDNameValue)stateIter.next();

            if ((ddname.getName()).equals(strValue))
              dynaForm.set("country", (new Integer(ddname.getId())).toString());

          }
        } else if (strhead.equals("title"))
          dynaForm.set("title", strValue);
        else if (strhead.equals("source"))
          dynaForm.set("source", strValue);
        else if (strhead.equals("firstname"))
          dynaForm.set("firstname", strValue);
        else if (strhead.equals("lastname"))
          dynaForm.set("lastname", strValue);
        else if (strhead.equals("middlename"))
          dynaForm.set("middlename", strValue);
        else if (strhead.equals("entity"))
          dynaForm.set("entity", strValue);
        else if (strhead.equals("entity1"))
          dynaForm.set("entity1", strValue);
        else if (strhead.equals("Fax"))
        {
          Collection mocFax = (Collection)gml.get("MOC");

          Iterator mocFaxIter = mocFax.iterator();
          while (mocFaxIter.hasNext())
          {
            DDNameValue ddnameFax = (DDNameValue)mocFaxIter.next();

            if ((ddnameFax.getName()).equals(strhead))
            {
              dynaForm.set("mocType1", (new Integer(ddnameFax.getId())).toString());
              dynaForm.set("moc1", strValue);
            }
          }

        } else if (strhead.equals("Phone")) {
          Collection mocPhone = (Collection)gml.get("MOC");

          Iterator mocPhoneIter = mocPhone.iterator();
          while (mocPhoneIter.hasNext())
          {
            DDNameValue ddnamePhone = (DDNameValue)mocPhoneIter.next();

            if ((ddnamePhone.getName()).equals(strhead))
            {
              dynaForm.set("mocType2", (new Integer(ddnamePhone.getId())).toString());
              dynaForm.set("moc2", strValue);
            }
          }
        } else if (strhead.equals("Mobile"))
        {
          Collection mocMobile = (Collection)gml.get("MOC");

          Iterator mocMobileIter = mocMobile.iterator();
          while (mocMobileIter.hasNext())
          {
            DDNameValue ddnameMobile = (DDNameValue)mocMobileIter.next();

            if ((ddnameMobile.getName()).equals(strhead))
            {
              dynaForm.set("mocType3", (new Integer(ddnameMobile.getId())).toString());
              dynaForm.set("moc3", strValue);
            }
          }
        }
      }
View Full Code Here

      Preference prefRemote = prefHome.create();
      prefRemote.setDataSource(dataSource);
      UserPrefererences up = prefRemote.getUserPreferences(individualID);

      if (up.getEmail().equals("YES"))
        vecright.addElement(new DDNameValue("email", AdminConstantKeys.EMAIL));
      else
        vecleft.addElement(new DDNameValue("email", AdminConstantKeys.EMAIL));
      if (up.getTodaysCalendar().equals("YES"))
        vecright.addElement(new DDNameValue("todayscalendar", AdminConstantKeys.TODAYSCALENDAR));
      else
        vecleft.addElement(new DDNameValue("todayscalendar", AdminConstantKeys.TODAYSCALENDAR));
      if (up.getUnscheduledActivities().equals("YES"))
        vecright.addElement(new DDNameValue("unscheduledactivities", AdminConstantKeys.UNSCHEDULEDACTIVITIES));
      else
        vecleft.addElement(new DDNameValue("unscheduledactivities", AdminConstantKeys.UNSCHEDULEDACTIVITIES));
      if (up.getScheduledOpportunities().equals("YES"))
        vecright.addElement(new DDNameValue("scheduledopportunities", AdminConstantKeys.SCHEDULEDOPPORTUNUITIES));
      else
        vecleft.addElement(new DDNameValue("scheduledopportunities", AdminConstantKeys.SCHEDULEDOPPORTUNUITIES));
      if (up.getProjectTasks().equals("YES"))
        vecright.addElement(new DDNameValue("projecttasks", AdminConstantKeys.PROJECTTASKS));
      else
        vecleft.addElement(new DDNameValue("projecttasks", AdminConstantKeys.PROJECTTASKS));
      if (up.getSupportTickets().equals("YES"))
        vecright.addElement(new DDNameValue("supporttickets", AdminConstantKeys.SUPPORTTICKETS));
      else
        vecleft.addElement(new DDNameValue("supporttickets", AdminConstantKeys.SUPPORTTICKETS));
      if (up.getCompanyNews().equals("YES"))
        vecright.addElement(new DDNameValue("companynews", AdminConstantKeys.COMPANYNEWS));
      else
        vecleft.addElement(new DDNameValue("companynews", AdminConstantKeys.COMPANYNEWS));

      request.setAttribute("vecleft", vecleft);
      request.setAttribute("vecright", vecright);
      dynaForm.set("minutes", up.getHomeRefreshMin());
      dynaForm.set("seconds", up.getHomeRefreshSec());
View Full Code Here

      int sizeOfResourceSelected = resourceSelected.size();
      int i = 0;
      int j = 0;
      String idOfResourceList = "";
      String idOfResourceSelected = "";
      DDNameValue ddResourceListInfo = null;
      DDNameValue ddResourceSelectedInfo = null;
      boolean removed = false;

      while (i < sizeOfResourceList) {
        removed = false;
        ddResourceListInfo = (DDNameValue)resourceVec.get(i);
        idOfResourceList = ddResourceListInfo.getStrid();

        while (j < sizeOfResourceSelected) {
          ddResourceSelectedInfo = (DDNameValue)resourceSelected.get(j);
          idOfResourceSelected = ddResourceSelectedInfo.getStrid();

          if (idOfResourceList.equals(idOfResourceSelected)) {
            resourceVec.remove(i);
            removed = true;
            sizeOfResourceList--;
View Full Code Here

    buffer.append("<select class=\"pagingDropDown\" onchange=\"vl_moveTo(this.value);\">\n");
    buffer.append("<option value=\"-1\">Move To</option>\n");
    if (listType == ValueListConstants.ENTITY_LIST_TYPE) {
      Vector buttonValueList = (Vector) pageContext.findAttribute("AllDBList");
      for (int i = 0; i < buttonValueList.size(); i++) {
        DDNameValue ddname = (DDNameValue) buttonValueList.elementAt(i);
        if (!(ddname.getName()).equals("All Lists")) {
          buffer.append("<option value=\"");
          buffer.append(ddname.getStrid());
          buffer.append("\">");
          buffer.append(ddname.getName());
          buffer.append("</option>\n");
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.centraview.common.DDNameValue

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.