Package com.centraview.common

Examples of com.centraview.common.DDNameValue


    try {
      if (locationCollection != null) {
        StringBuffer stringBuffer = new StringBuffer();
        Iterator it = locationCollection.iterator();
        while (it.hasNext()) {
          DDNameValue sourceObject = (DDNameValue) it.next();
          // System.out.println("[DEBUG] [AppSettingsEJB]: sourceObject: " +
          // sourceObject.toString());
          if (sourceObject.getName() != null && sourceObject.getId() == -1) {
            // create a new Source Record
            cvdl.setSqlQueryToNull();
            cvdl.setSqlQuery("INSERT INTO location (title) VALUES (?)");
            cvdl.setString(1, sourceObject.getName());
            cvdl.executeUpdate();
            int newId = cvdl.getAutoGeneratedKey();
            stringBuffer.append(newId);
          } // end of if statement (sourceObject.getName() != null ...
          else if (sourceObject.getName() != null) {
            // update the existing Source Record
            cvdl.setSqlQueryToNull();
            cvdl.setSqlQuery("UPDATE location SET title = ? WHERE locationid = ?");
            cvdl.setString(1, sourceObject.getName());
            cvdl.setInt(2, sourceObject.getId());
            cvdl.executeUpdate();
            stringBuffer.append(sourceObject.getId());
          } // end of else if statement (sourceObject.getName() != null)
          if (stringBuffer.length() > 0 && it.hasNext()) {
            stringBuffer.append(", ");
          }
        } // end of while loop (it.hasNext())
View Full Code Here


    try {
      if (resourceCollection != null) {
        StringBuffer stringBuffer = new StringBuffer();
        Iterator it = resourceCollection.iterator();
        while (it.hasNext()) {
          DDNameValue resourceObject = (DDNameValue) it.next();
          // System.out.println("[DEBUG] [AppSettingsEJB]: resourceObject: " +
          // resourceObject.toString());
          if (resourceObject.getName() != null && resourceObject.getId() == -1) {
            // create a new Source Record
            cvdl.setSqlQueryToNull();
            cvdl.setSqlQuery("INSERT INTO activityresources (Name) VALUES (?)");
            cvdl.setString(1, resourceObject.getName());
            cvdl.executeUpdate();
            int newId = cvdl.getAutoGeneratedKey();
            stringBuffer.append(newId);
          } // end of if statement (resourceObject.getName() != null ...
          else if (resourceObject.getName() != null) {
            // update the existing Resource Record
            cvdl.setSqlQueryToNull();
            cvdl.setSqlQuery("UPDATE activityresources SET Name = ? WHERE ActivityResourceID = ?");
            cvdl.setString(1, resourceObject.getName());
            cvdl.setInt(2, resourceObject.getId());
            cvdl.executeUpdate();
            stringBuffer.append(resourceObject.getId());
          } // end of else if statement (resourceObject.getName() != null)
          if (stringBuffer.length() > 0 && it.hasNext()) {
            stringBuffer.append(", ");
          }
        } // end of while loop (it.hasNext())
View Full Code Here

      Number tableID = (Number) resultsHashMap.get("SearchTableID");
      String tableDisplayName = (String) resultsHashMap.get("DisplayName");
      String tableName = (String) resultsHashMap.get("TableName");
      if(tableID != null && tableName != null && !tableName.equals("") + tableDisplayName != null && !tableDisplayName.equals("")){
        String keyValue = tableID.toString() + "#" + tableName;
        DDNameValue tableInfo = new DDNameValue(keyValue,tableDisplayName);
        replaceTablesList.add(tableInfo);
      }
      } //end of while statement (resultsIterator.hasNext())
    } //end of if statement (resultsCollection != null)
    } //end of try block
View Full Code Here

        Number tableID = (Number) fieldsHashMap.get("SearchTableID");
        Number fieldID = (Number) fieldsHashMap.get("SearchFieldID");
        Number fieldType = (Number) fieldsHashMap.get("FieldType");
        String fieldDisplayName = (String) fieldsHashMap.get("DisplayName");
        String keyValue = tableID.toString() + "*" + fieldID.toString()+ "*" + fieldType.toString();
        DDNameValue tableInfo = new DDNameValue(keyValue,fieldDisplayName);
        replaceFieldsList.add(tableInfo);
      } //end of while statement (fieldsIterator.hasNext())
    } //end of if statement (fieldCollections != null)

    // If we found the tableId for the customfield associated to the selected table.
    // We must have to get all the fields associated to the table.
    if(flagCustomFields){
      cvdal.setSqlQueryToNull();
      cvdal.clearParameters();

      sqlQuery = "SELECT CustomFieldID , Name, FieldType FROM" +
             " customfield where RecordType = ?;";
      cvdal.setSqlQuery(sqlQuery);
      cvdal.setInt(1,replaceTableID);
      fieldCollections = cvdal.executeQuery();
      if (fieldCollections != null)
      {
        Iterator fieldsIterator = fieldCollections.iterator();
        while (fieldsIterator.hasNext())
        {
        HashMap fieldsHashMap = (HashMap) fieldsIterator.next();
        Number customFieldID = (Number) fieldsHashMap.get("CustomFieldID");
        String fieldDisplayName = (String) fieldsHashMap.get("Name");
        String fieldType = (String) fieldsHashMap.get("FieldType");
        int scalarOrMultiple = 0;
        if(fieldType != null && fieldType.equals("MULTIPLE")){
          scalarOrMultiple = GlobalReplaceConstantKeys.FIELD_TYPE_MULTIPLE;
        }
        String keyValue = GlobalReplaceConstantKeys.CUSTOM_FIELD_TABLEID  + "*" + customFieldID.toString() + "*" + scalarOrMultiple;
        DDNameValue tableInfo = new DDNameValue(keyValue,fieldDisplayName);
        replaceFieldsList.add(tableInfo);
        } //end of while statement (fieldsIterator.hasNext())
      } //end of if statement (fieldCollections != null)
    }
    } //end of try block
View Full Code Here

        HashMap resultsHashMap = (HashMap) resultsIterator.next();
        Number valueID = (Number) resultsHashMap.get("ValueID");
        String value = (String) resultsHashMap.get("Value");
        if(valueID != null && value != null && !value.equals("")){
          String keyValue = valueID.toString();
          DDNameValue tableInfo = new DDNameValue(keyValue,value);
          fieldsValueList.add(tableInfo);
        }
        } //end of while statement (resultsIterator.hasNext())
      } //end of if statement (resultsCollection != null)
      }//end of if(tableID == GlobalReplaceConstantKeys.CUSTOM_FIELD_TABLEID )
      else{
        // We must have to put a unique entry for the tableID and fieldId in the globalreplacerelate table.
        // which should have the fieldname and tablename.
        // fieldname should be like this for Example StatusID as ValueID and StatusTitle As Value
      String sqlQuery = "SELECT fieldName,tableName " +
        " FROM Globalreplacevalue WHERE tableID = ? and fieldID= ?";
      cvdal.setSqlQuery(sqlQuery);
      cvdal.setInt(1,tableID);
      cvdal.setInt(2,fieldID);
      String fieldName = null;
      String tableName = null;
      Collection resultsCollection = cvdal.executeQuery();
      if (resultsCollection != null)
      {
        Iterator resultsIterator = resultsCollection.iterator();
        while (resultsIterator.hasNext())
        {
        HashMap resultsHashMap = (HashMap) resultsIterator.next();
        fieldName = (String) resultsHashMap.get("fieldName");
        tableName = (String) resultsHashMap.get("tableName");
        } //end of while statement (resultsIterator.hasNext())
      } //end of if statement (resultsCollection != null)
      if(fieldName != null && tableName != null){
        sqlQuery = "SELECT " + fieldName + " FROM " + tableName;
        cvdal.setSqlQuery(sqlQuery);
        resultsCollection = cvdal.executeQuery();
        if (resultsCollection != null)
        {
          Iterator resultsIterator = resultsCollection.iterator();
          while (resultsIterator.hasNext())
          {
          HashMap resultsHashMap = (HashMap) resultsIterator.next();
          Number valueID = (Number) resultsHashMap.get("ValueID");
          String value = (String) resultsHashMap.get("Value");
          if(valueID != null && value != null && !value.equals("")){
            String keyValue = valueID.toString();
            DDNameValue tableInfo = new DDNameValue(keyValue,value);
            fieldsValueList.add(tableInfo);
          }//end of if(valueID != null && value != null && !value.equals(""))
          } //end of while statement (resultsIterator.hasNext())
        } //end of if statement (resultsCollection != null)
      }//end of if(fieldName != null && tableName != null)
View Full Code Here

      Vector supportSendAccountList = new Vector();
      int i = 0;
      boolean removed = false;
      while (i < sizeOfAccountList) {
        removed = false;
        DDNameValue ddEmailAccountInfo = (DDNameValue) accountList.get(i);
        int accountID = ddEmailAccountInfo.getId();
        if (supportMailIds != null && supportMailIds.contains(String.valueOf(accountID))) {
          supportSendAccountList.add(ddEmailAccountInfo);
          accountList.remove(i);
          sizeOfAccountList--;
          removed = true;
        }
        if (!removed) {
          i++;
        }
      }

      String searchStr = request.getParameter("search");

      if (searchStr != null && !searchStr.equals("")){
        if (accountList != null) {
          int accountSize = accountList.size();
          i = 0;
          while (i < accountSize) {
            DDNameValue tempAccountListInfo = (DDNameValue) accountList.elementAt(i);
            int emailAccountID = tempAccountListInfo.getId();
            String emailAddress = tempAccountListInfo.getName();
           
            String tempEmailAddress = emailAddress.toUpperCase();
            String tempSearchEmailAddress = searchStr.toUpperCase();
            int occuranceVALUESearch = (tempEmailAddress).indexOf(tempSearchEmailAddress);
            if (occuranceVALUESearch == -1) {
View Full Code Here

      GlobalMasterLists gml = GlobalMasterLists.getGlobalMasterLists(dataSource);
      Vector salesStatusList = (Vector) gml.get("AllSaleStatus");
      Iterator it = salesStatusList.iterator();
     
      while (it.hasNext()) {
        DDNameValue thisStatus = (DDNameValue) it.next();
        if ((thisStatus.getName()).equalsIgnoreCase("Pending")) {
          opportunityform.setStatusid(Integer.toString(thisStatus.getId()));
          opportunityform.setStatusname(thisStatus.getName());
          break;
        }
      }

      request.setAttribute("opportunityform", opportunityform);
View Full Code Here

        termsID = Integer.parseInt(paymentTerms);
      }

      while (itTerms.hasNext())
      {
        DDNameValue nameValue = (DDNameValue) itTerms.next();
        // if name matches, then...
        if (termsID == nameValue.getId())
        {
          // ... get the ID
          PaymentTerms = nameValue.getName();
        }
      }


      String AccountManager = "";
View Full Code Here

      if (hasHeader.equals("Yes") || (hasHeader.equals("No"))) {
        readline = ral.readLine();
        String[] sFileFieldName = readline.split(tabDelimiter);
        for (int k = 0; k < sFileFieldName.length; k++) {
          v.add(new DDNameValue(sFileFieldName[k], sFileFieldName[k]));
        }
      }

      dyn.setHeadervector(v);
      dyn.setFilePath(path);

      Collection importEntityList = new ArrayList();
      Collection importIndividualList = new ArrayList();

      Collection mapImport = new ArrayList();
      mapImport.add(new DDNameValue("1", "--- Select ---"));
      mapImport.add(new DDNameValue("2", "First Name"));
      mapImport.add(new DDNameValue("3", "Middle Name"));
      mapImport.add(new DDNameValue("4", "Last Name"));
      mapImport.add(new DDNameValue("5", "Entity Name"));
      mapImport.add(new DDNameValue("6", "ExternalID (Entity)"));
      mapImport.add(new DDNameValue("6", "ExternalID (Individual)"));
      mapImport.add(new DDNameValue("7", "Street1"));
      mapImport.add(new DDNameValue("8", "Street2"));
      mapImport.add(new DDNameValue("9", "City"));
      mapImport.add(new DDNameValue("10", "State"));
      mapImport.add(new DDNameValue("11", "Zipcode"));
      mapImport.add(new DDNameValue("12", "Country"));
      mapImport.add(new DDNameValue("13", "Title"));
      mapImport.add(new DDNameValue("14", "Source (Individual)"));
      mapImport.add(new DDNameValue("14", "Source (Entity)"));
      mapImport.add(new DDNameValue("15", "Home Phone"));
      mapImport.add(new DDNameValue("16", "Fax Phone"));
      mapImport.add(new DDNameValue("17", "Main Phone"));
      mapImport.add(new DDNameValue("18", "Mobile Phone"));
      mapImport.add(new DDNameValue("19", "Other Phone"));
      mapImport.add(new DDNameValue("20", "Pager Phone"));
      mapImport.add(new DDNameValue("21", "Work Phone"));
      mapImport.add(new DDNameValue("22", "Email"));
      mapImport.add(new DDNameValue("23", "Website"));
      mapImport.add(new DDNameValue("24", "Account Manager"));
      mapImport.add(new DDNameValue("25", "Account Team"));

      CustomField remote = cfh.create();
      remote.setDataSource(dataSource);

      Collection entityCustomFieldList = remote.getCustomFieldImportData("entity");
      Collection individualCustomFieldList = remote.getCustomFieldImportData("individual");

      if (entityCustomFieldList != null) {
        Vector entityCustomField = new Vector(entityCustomFieldList);

        if (entityCustomField != null) {
          for (Enumeration e = entityCustomField.elements(); e.hasMoreElements();) {
            HashMap hm = (HashMap) e.nextElement();

            String title = hm.get("name").toString() + "(Entity)";
            String listID = hm.get("customfieldid").toString();
            String type = hm.get("fieldtype").toString();
            mapImport.add(new DDNameValue(listID, title));
            importEntityList.add(new DDNameValue(title, listID + "*" + type));
          }
          dyn.setCustomEntityList(importEntityList);

        }
      }

      if (individualCustomFieldList != null) {
        Vector indivdualCustomField = new Vector(individualCustomFieldList);

        if (indivdualCustomField != null) {
          for (Enumeration e = indivdualCustomField.elements(); e.hasMoreElements();) {
            HashMap hm = (HashMap) e.nextElement();

            String title = hm.get("name").toString() + "(Individual)";
            String listID = hm.get("customfieldid").toString();
            String type = hm.get("fieldtype").toString();
            mapImport.add(new DDNameValue(listID, title));
            importIndividualList.add(new DDNameValue(title, listID + "*" + type));
          }
          dyn.setCustomIndividualList(importIndividualList);
        }
      }
      request.setAttribute("mapImport", mapImport);
View Full Code Here

      request.setAttribute("typeofsubmodule", AdministrationConstantKeys.USERADMINISTRATION_USER);
      FORWARD_final = FORWARD_NEWUSER;
      UserSettingsForm userForm = (UserSettingsForm)form;
      Vector userTypeList = new Vector();
      if (userForm != null && userForm.getEntityID() != 1 && userForm != null && userForm.getEntityID() != 0) {
        userTypeList.add(new DDNameValue("CUSTOMER", "Customer"));
      } else {
        userTypeList.add(new DDNameValue("EMPLOYEE", "Employee"));
        userTypeList.add(new DDNameValue("ADMINISTRATOR", "Administrator"));
      }
      userForm.setUserTypeList(userTypeList);
    } catch (Exception e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
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.