Package jvalidations.cookbook

Examples of jvalidations.cookbook.Cookbook$Section_ValidatingAssociatedObjects$Address


            (OrderService) new XFireProxyFactory().create(serviceModel, url);
       
        PurchaseOrderDocument poDoc = PurchaseOrderDocument.Factory.newInstance();
        PurchaseOrderType po = poDoc.addNewPurchaseOrder();
       
        Address add = Address.Factory.newInstance();
        add.setName("Jane Doe");
        add.setStreet("123 Main St");
        add.setCountry("USA");
       
        po.setBillTo(add);
        po.setShipTo(add);
       
        po.setOrderDate(Calendar.getInstance());
View Full Code Here


      // address info
      String[] addrTypes = getChannelRuntimeData().getParameterValues("Address@type");
      for (int i=0; i<addrTypes.length; i++) {
        String type = addrTypes[i];
        if (type == null || type.length() == 0) { continue; }
        Address addr = bp.newAddress();
        addr.setType(addrTypes[i]);
        addr.setStreet1(getChannelRuntimeData().getParameterValues("Street1")[i]);
        addr.setCityOrLocality(getChannelRuntimeData().getParameterValues("CityOrLocality")[i]);
        addr.setStateOrProvince(getChannelRuntimeData().getParameterValues("StateOrProvince")[i]);
        /*
        String stateFormValue = getChannelRuntimeData().getParameterValues("StateOrPovince")[i];
        if (stateFormValue != null) {
          addr.setStateOrProvince(stateFormValue);
        }
        */
        com.any_erp_vendor.moa.objects.resources.v1_0.Date effDate = addr.newEffectiveDate();
        effDate.setMonth(getChannelRuntimeData().getParameterValues("EffectiveDate/Month")[i]);
        effDate.setDay(getChannelRuntimeData().getParameterValues("EffectiveDate/Day")[i]);
        effDate.setYear(getChannelRuntimeData().getParameterValues("EffectiveDate/Year")[i]);
        addr.setEffectiveDate(effDate);
        bp.addAddress(addr);
      }

      bp.getXmlEnterpriseObject().setBaseline(baselineBp.getXmlEnterpriseObject());
     
View Full Code Here

          // get the addresses associated to the basic person
          java.util.List addrs = bp.getAddress();
          java.util.Vector vAddr = new java.util.Vector();
          if (addrs.size() > 0) {
            for (int j=0; j<addrs.size(); j++) {
              Address addr = bp.getAddress(j);
              vAddr.add(addr);
            }
          }
          bp_addressList.setListData(vAddr);
          bp_addressList.updateUI();
View Full Code Here

   * Retrieves the Address object stored in the List at the selected index and populates the Address
   * form items with information contained in that Address object.
   **/
  protected void bp_addressList_mouseClicked(MouseEvent e)
  {
    Address a = (Address)bp_addressList.getSelectedValue();
    if (a != null) {
      bp_addressType.setSelectedItem(a.getType());
      bp_street1.setText(a.getStreet1());
      bp_city.setText(a.getCityOrLocality());
      bp_stateList.setSelectedItem(a.getStateOrProvince());
      bp_zip.setText(a.getZipOrPostalCode());
      bp_effectiveDate.setText(a.getEffectiveDate().getMonth() + "/" +
          a.getEffectiveDate().getDay() + "/" +
          a.getEffectiveDate().getYear());
    }
   
  }
View Full Code Here

      // have to determine if we need to insert, delete or update any
      logger.info("Starting Address update process...");
      java.util.List newAddresses = newData.getAddress();
      java.util.List oldAddresses = baselinePerson.getAddress();
      for (int i=0; i<newAddresses.size(); i++) {
        Address newAddress = (Address)newAddresses.get(i);
        String newAddressKey = newAddress.getCombinedKeyValue();
        boolean foundMatch = false;
        for (int j=0; j<oldAddresses.size(); j++) {
          Address oldAddress = (Address)oldAddresses.get(j);
          String oldAddressKey = oldAddress.getCombinedKeyValue();
          if (oldAddressKey.equalsIgnoreCase(newAddressKey)) {
            // found a match, might have to update...
            foundMatch = true;
            if (newAddress.equals(oldAddress) == false) {
              // need to update individual address
              logger.info("updating existing address object.");
              updateAddress(conn, msgCategory, msgObject, msgRelease, instId, newAddress);
            }
          }
        }
        if (foundMatch == false) {
          // need to create address
          logger.info("creating new address object.");
          createAddress(conn, msgCategory, msgObject, msgRelease, instId, newAddress);
        }
      }
      // now we need to check the oldAddresses and delete any that don't
      // exist in the newAddress list
      for (int i=0; i<oldAddresses.size(); i++) {
        Address oldAddress = (Address)oldAddresses.get(i);
        String oldAddressKey = oldAddress.getCombinedKeyValue();
        boolean foundMatch = false;
        for (int j=0; j<newAddresses.size(); j++) {
          Address newAddress = (Address)newAddresses.get(j);
          String newAddressKey = newAddress.getCombinedKeyValue();
          if (oldAddressKey.equalsIgnoreCase(newAddressKey)) {
            // found a match, don't delete
            foundMatch = true;
          }
        }
View Full Code Here

  protected void bp_addressAdd_mouseClicked(MouseEvent e)
  {
    String messageObjectName = BASIC_PERSON;
    org.openeai.OpenEaiObject.logger.info("Message Object Name is: " + messageObjectName);
    try {
      Address addr = null;
      int index = bp_addressList.getSelectedIndex();
      if (index == -1) {
        BasicPerson bPerson = (BasicPerson)APP_CONFIG.getObject(messageObjectName);
        org.openeai.OpenEaiObject.logger.info("got " + messageObjectName + " from AppConfig");
        addr = bPerson.newAddress();
      }
      else {
        addr = (Address)bp_addressList.getSelectedValue();
      }
      addr.setType((String)bp_addressType.getSelectedItem());
      addr.setStreet1(bp_street1.getText());
      addr.setCityOrLocality(bp_city.getText());
      addr.setStateOrProvince((String)bp_stateList.getSelectedItem());
      addr.setZipOrPostalCode(bp_zip.getText());
     
      // get the effective date and verify it's format, then populate the
      // address' effective date information with it.
      SimpleDateFormat formatter = new SimpleDateFormat( "MM/dd/yyyy" );
      String sDate = bp_effectiveDate.getText();
      try {
        java.util.Date d = formatter.parse(sDate);
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(d);
        Date effDate = new Date("EffectiveDate");
        effDate.setMonth(Integer.toString(calendar.get(Calendar.MONTH)+1));
        effDate.setDay(Integer.toString(calendar.get(Calendar.DAY_OF_MONTH)));
        effDate.setYear(Integer.toString(calendar.get(Calendar.YEAR)));
        addr.setEffectiveDate(effDate);
      } catch (Exception exc) {
        org.openeai.OpenEaiObject.logger.fatal(exc.getMessage(), exc);
        bp_resultsTextArea.setText("Invalid EffectiveDate '" + sDate + "'  " + exc.getMessage());
        return;
      }
View Full Code Here

    }

    try {
      // first the address(s), using the same connection
      for (int i=0; i<bPerson.getAddress().size(); i++) {
        Address a = bPerson.getAddress(i);
        deleteAddress(conn, msgCategory, msgObject, msgRelease, instId, a);
      }

      // now the phone(s), using the same connection
      for (int i=0; i<bPerson.getPhone().size(); i++) {
View Full Code Here

      }
      ec_relation.setSelectedItem(ec.getRelationship());
      ec_priority.setSelectedItem(ec.getPriority());
      ec_firstName.setText(ec.getName().getFirstName());
      ec_lastName.setText(ec.getName().getLastName());
      Address a = ec.getAddress();
      if (a != null) {
        ec_street1.setText(a.getStreet1());
        ec_city.setText(a.getCityOrLocality());
        ec_stateList.setSelectedItem(a.getStateOrProvince());
        ec_zip.setText(a.getZipOrPostalCode());
      }
      Phone p = ec.getPhone();
      if (p != null) {
        ec_phone.setText(p.getPhoneNumber());
      }
View Full Code Here

      logger.info("Inserted " + msgObject + " record for InstitutionalId: " + instId);
      insertStmt.close();

      // now the address(s), using the same connection
      for (int i=0; i<bPerson.getAddress().size(); i++) {
        Address a = bPerson.getAddress(i);
        createAddress(conn, msgCategory, msgObject, msgRelease, instId, a);
      }

      // now the phone(s), using the same connection
      for (int i=0; i<bPerson.getPhone().size(); i++) {
View Full Code Here

        Name name = ec.newName();
        name.setFirstName(ec_firstName.getText());
        name.setLastName(ec_lastName.getText());
        ec.setName(name);
       
        Address a = ec.newAddress();
        // get the effective date and verify it's format, then populate the
        // address' effective date information with it.
        // since emergency contacts don't care about effective date, we'll just use today's date.
        try {
          Calendar calendar = new GregorianCalendar();
          calendar.setTime(new java.util.Date());
          Date effDate = new Date("EffectiveDate");
          effDate.setMonth(Integer.toString(calendar.get(Calendar.MONTH)+1));
          effDate.setDay(Integer.toString(calendar.get(Calendar.DAY_OF_MONTH)));
          effDate.setYear(Integer.toString(calendar.get(Calendar.YEAR)));
          a.setEffectiveDate(effDate);
        } catch (Exception exc) {
          org.openeai.OpenEaiObject.logger.fatal(exc.getMessage(), exc);
          //        ec_textArea.setText("Invalid EffectiveDate '" + sDate + "'  " + exc.getMessage());
          return;
        }
        // our system, doesn't care about the address types associated to emergency contacts so,
        // we're going to hard code it...
        a.setType("Home");
        a.setStreet1(ec_street1.getText());
        a.setCityOrLocality(ec_city.getText());
        a.setStateOrProvince((String)ec_stateList.getSelectedItem());
        a.setZipOrPostalCode(ec_zip.getText());
        ec.setAddress(a);
       
        if (ec_phone.getText() != null && ec_phone.getText().length() > 0) {
          Phone p = ec.newPhone();
          ec_phone.setText(p.getPhoneNumber());
View Full Code Here

TOP

Related Classes of jvalidations.cookbook.Cookbook$Section_ValidatingAssociatedObjects$Address

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.