Package com.centraview.customfield

Examples of com.centraview.customfield.CustomFieldLocal


    ArrayList validFields = new ArrayList();
    try
    {
      InitialContext ic = CVUtility.getInitialContext();
      CustomFieldLocalHome home = (CustomFieldLocalHome)ic.lookup("local/CustomField");
      CustomFieldLocal remote = home.create();
      remote.setDataSource(this.dataSource);

      if (fieldType.equals("Both") || fieldType.equals("Individual"))
      {
        // Collections of hashmaps
        Collection individualCustomFields = remote.getCustomFieldImportData("individual");
        if (individualCustomFields != null && individualCustomFields.size() > 0)
        {
          Iterator indivIter = individualCustomFields.iterator();
          while (indivIter.hasNext())
          {
            HashMap field = (HashMap)indivIter.next();
            // hashmap to be added to the arraylist returned from this method
            HashMap fieldMap = new HashMap();
            String fieldName = (String)field.get("name");
            Number fieldID = (Number)field.get("customfieldid");
            fieldMap.put("fieldID", fieldID);
           
            fieldMap.put("name", fieldName);
            // strip all non-alphanumeric chars from fieldName
            fieldName = fieldName.replaceAll("[^\\w]", "");
            // prepend fieldname with "cf_" so we know this is a custom field
            fieldMap.put("fieldName", "cf_" + fieldName);
            validFields.add(fieldMap);
          }
        }
      }
     
      if (fieldType.equals("Both") || fieldType.equals("Entity"))
      {
        Collection entityCustomFields = remote.getCustomFieldImportData("entity");
        if (entityCustomFields != null && entityCustomFields.size() > 0)
        {
          Iterator entityIter = entityCustomFields.iterator();
          while (entityIter.hasNext())
          {
View Full Code Here


        // Save CustomFields
        Vector custfieldVec = inventoryVO.getCustomFieldsVec();
        InitialContext ic = CVUtility.getInitialContext();
        if(custfieldVec != null && custfieldVec.size() != 0){
          CustomFieldLocalHome custHome = (CustomFieldLocalHome)ic.lookup("local/CustomField");
          CustomFieldLocal custRemote = custHome.create();
          custRemote.setDataSource(this.dataSource);
          for (int i =0;i<custfieldVec.size();i++)
          {
            CustomFieldVO custFieldVO = (CustomFieldVO)custfieldVec.get(i);
            custFieldVO.setRecordID(pKey);
            custRemote.addCustomField(custFieldVO);
          }
        }
        // Save CustomFields ends here

        AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
View Full Code Here

      // Save CustomFields
      Vector custfieldVec = inventoryVO.getCustomFieldsVec();
      InitialContext ic = CVUtility.getInitialContext();
      CustomFieldLocalHome custHome = (CustomFieldLocalHome)ic.lookup("local/CustomField");
      CustomFieldLocal custRemote = custHome.create();
      custRemote.setDataSource(this.dataSource);
      for (int i =0;i<custfieldVec.size();i++)
      {
        CustomFieldVO custFieldVO = (CustomFieldVO)custfieldVec.get(i);
        custFieldVO.setRecordID(pKey);
        custRemote.updateCustomField(custFieldVO);
      }
      // Save CustomFields ends here

      cvdl.clearParameters();
View Full Code Here

      remoteContact = null;
      homeContact = null;

      // Collect all the CustomfieldValue
      CustomFieldLocalHome homeCustomField = (CustomFieldLocalHome)ic.lookup("local/CustomField");
      CustomFieldLocal remoteCustomField =  homeCustomField.create();
      remoteCustomField.setDataSource(this.dataSource);

      HashMap CustomFieldValues = remoteCustomField.getCustomFieldValue();
      homeCustomField = null;
      remoteCustomField = null;

      ArrayList newEntityList = new ArrayList();
      ArrayList newIndividualList = new ArrayList();
View Full Code Here

  {
    try {

      InitialContext ic = CVUtility.getInitialContext();
      CustomFieldLocalHome homeCustomField = (CustomFieldLocalHome) ic.lookup("local/CustomField");
      CustomFieldLocal remoteCustomField = homeCustomField.create();
      Collection customFieldNames = remoteCustomField.getCustomFieldImportData(tableName);

      if (customFieldNames != null) {
        HashMap hm = null;
        customFields = new ArrayList();
        for (Iterator iter = customFieldNames.iterator(); iter.hasNext();) {
View Full Code Here

  {
    CustomFieldList customFieldValues = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      CustomFieldLocalHome homeCustomField = (CustomFieldLocalHome) ic.lookup("local/CustomField");
      CustomFieldLocal remoteCustomField = homeCustomField.create();
      customFieldValues = remoteCustomField.getCustomFieldList(tableName, recordId);

      // HashMap hm = customFieldValues.getColumnMap();
      DDNameValue fieldName = null;
      // CustomFieldListElement listElement = null;
      Set st = null;
View Full Code Here

      }

      // Save CustomFields from the Form
      Vector custfieldVec = individualDetail.getCustomField();
      CustomFieldLocalHome custHome = (CustomFieldLocalHome)ic.lookup("local/CustomField");
      CustomFieldLocal custRemote = custHome.create();
      custRemote.setDataSource(ds);
      for (int i = 0; i < custfieldVec.size(); i++) {
        CustomFieldVO custFieldVO = (CustomFieldVO)custfieldVec.get(i);
        custFieldVO.setRecordID(individualID);
        custRemote.addCustomField(custFieldVO);
      }
      // Everything is created now apply the default permissions for this user.
      AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
      AuthorizationLocal authorizationLocal = authorizationHome.create();
      authorizationLocal.setDataSource(ds);
View Full Code Here

        }

        // update CustomFields
        Vector custfieldVec = this.indVo.getCustomField();
        CustomFieldLocalHome custHome = (CustomFieldLocalHome)ic.lookup("local/CustomField");
        CustomFieldLocal custRemote = custHome.create();
        custRemote.setDataSource(this.dataSource);

        boolean customFieldAdd = false;

        dl.setSql("contact.checkindividualcustomfield");
        //ALLSQL.put("contact.checkindividualcustomfield"," select recordid
        // from customfieldmultiple where recordid = ? union select recordid
        // from customfieldscalar where recordid = ? ");
        dl.setInt(1, indVo.getContactID());
        dl.setInt(2, indVo.getContactID());

        Collection col = dl.executeQuery();
        Iterator it = col.iterator();
        if (!it.hasNext()) {
          customFieldAdd = true;
        }

        dl.clearParameters();
        dl.destroy();

        for (int i = 0; i < custfieldVec.size(); i++) {
          CustomFieldVO custFieldVO = (CustomFieldVO)custfieldVec.get(i);
          custFieldVO.setRecordID(indVo.getContactID());

          if (customFieldAdd) {
            custRemote.addCustomField(custFieldVO);
          } else {
            custRemote.updateCustomField(custFieldVO);
          }
        }

        ContactHelperLocalHome home = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
        ContactHelperLocal remote = home.create();
View Full Code Here

        individualVO.setEntityID(newEntityID);
        ih.create(individualVO, individualID, dataSource);
      }
      // Save CustomFields from the Form (which is only the 3 on the form)
      CustomFieldLocalHome custHome = (CustomFieldLocalHome)ic.lookup("local/CustomField");
      CustomFieldLocal custRemote = custHome.create();
      custRemote.setDataSource(dataSource);

      Vector custfieldVec = entityVO.getCustomField();
      for (int i = 0; i < custfieldVec.size(); i++) {
        CustomFieldVO custFieldVO = (CustomFieldVO)custfieldVec.get(i);
        custFieldVO.setRecordID(newEntityID);
        custRemote.addCustomField(custFieldVO);
      }

      // Everything is created now apply the default permissions for this user.
      AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
      AuthorizationLocal authorizationLocal = authorizationHome.create();
View Full Code Here

      }

      try {
        // update CustomFields
        CustomFieldLocalHome custHome = (CustomFieldLocalHome)ic.lookup("local/CustomField");
        CustomFieldLocal custRemote = custHome.create();
        custRemote.setDataSource(this.dataSource);

        Vector custfieldVec = this.envo.getCustomField();

        for (int i = 0; i < custfieldVec.size(); i++) {
          CustomFieldVO custFieldVO = (CustomFieldVO)custfieldVec.get(i);
          custFieldVO.setRecordID(entId);
          custRemote.updateCustomField(custFieldVO);
        }

        ContactHelperLocalHome home = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
        ContactHelperLocal remote = home.create();
        remote.setDataSource(this.dataSource);
View Full Code Here

TOP

Related Classes of com.centraview.customfield.CustomFieldLocal

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.