Package com.any_erp_vendor.moa.jmsobjects.person.v1_0

Examples of com.any_erp_vendor.moa.jmsobjects.person.v1_0.EmergencyContact


    }

    String updateSubmitBP = request.getParameter("UpdateBP");
    if (updateSubmitBP!=null) {
      // doView() stores the baseline in  the session object
      BasicPerson bpBaseline = (BasicPerson) request.getPortletSession().getAttribute(BASIC_PERSON);
      if (bpBaseline != null) {
        try {
          logger.info("["+portletName+"] Baseline:\n"+bpBaseline.toXmlString());
          BasicPerson bp = (BasicPerson) bpBaseline.clone();
          bp.setBaseline(bpBaseline);
          Name name=bp.getName();
          name.setLastName(lastName);
          name.setFirstName(firstName);
          name.setMiddleName(middleName);
          bp.setName(name);
          if (gender!=null) {
            bp.setGender(gender);
          }
          List addressList = bp.getAddress();
          addressList.clear();
          if (addressType!=null) {
            for (int i=0;i<addressType.length;i++) {
              Address address=bp.newAddress();
              address.setType(addressType[i]);
              address.setStreet1(addressStreet[i]);
              address.setCityOrLocality(addressCity[i]);
              address.setStateOrProvince(addressState[i]);
              address.setZipOrPostalCode(addressZip[i]);
              address.setEffectiveDate(toDate("EffectiveDate",addressEffective[i]));
              addressList.add(address);
            }
            bp.setAddress(addressList);
          }
          List phoneList = bp.getPhone();
          phoneList.clear();
          if (phoneType!=null) {
            for (int i=0;i<phoneType.length;i++) {
              Phone phone=bp.newPhone();
              phone.setType(phoneType[i]);
              phone.setPhoneArea(phoneAreacode[i]);
              phone.setPhoneNumber(phoneNumber[i]);
              phoneList.add(phone);
            }
            bp.setPhone(phoneList);
          }
          List emailList = bp.getEmail();
          emailList.clear();
          if (emailType!=null) {
            for (int i=0;i<emailType.length;i++) {
              Email email=bp.newEmail();
              email.setType(emailType[i]);
              email.setEmailAddress(emailAddress[i]);
              email.setStatus(emailStatus[i]);
              email.setPreferred(emailPreferred[i]);
              emailList.add(email);
            }
            bp.setEmail(emailList);
          }
          bp.update(p2p);
          response.setRenderParameter("actionMessage","Update successful.");
        } catch (XmlEnterpriseObjectException e) {
          e.printStackTrace();
          throw new PortletException("XmlEnterpriseObjectException");
        } catch (CloneNotSupportedException e) {
View Full Code Here


          new Element("Error","",nameSpace)
            .addContent("No User Id"));
    } else {
     
      try {
        BasicPerson bp = getBasicPerson(instID);
        if (bp!=null) {
          dataRoot = makeResponseMessage(dataRoot,request,instID,"retrieved",bp);

        } else {
          // create the basic person if allowed
View Full Code Here

   * @throws EnterpriseConfigurationObjectException
   * @throws EnterpriseFieldException
   * @throws EnterpriseObjectCreateException
   */
  private BasicPerson createBasicPerson(String instID, String firstName, String lastName, String email) throws EnterpriseConfigurationObjectException, EnterpriseFieldException, EnterpriseObjectCreateException {
        BasicPerson aeo = (BasicPerson)appConfig.getObject(BASIC_PERSON);
        logger.info("["+portletName+"] Got " + BASIC_PERSON + " from AppConfig, performing Create...");
        Name aName = aeo.newName();
        aName.setFirstName(firstName);
        aName.setLastName(lastName);
        aeo.setName(aName);
        aeo.setInstitutionalId(instID);
        if (!"".equals(email)) {
          Email e = aeo.newEmail();
          e.setEmailAddress(email);
          e.setStatus("Active");
          e.setType("SMTP");
          e.setPreferred("No");
          aeo.setEmail(0,e);
        logger.info("["+portletName+"] Email address set to " + email + ".");
        }
        logger.info("["+portletName+"] Creating "+ BASIC_PERSON + " for user ("+instID+") "+firstName+" "+lastName+"...");
        aeo.create(p2p)
        logger.info("["+portletName+"] "+BASIC_PERSON + " created.");
    return aeo;
  }
View Full Code Here

        logger.info("["+portletName+"] Got LightweightPerson...");

        lPerson.setInstitutionalId(instId);
        logger.info("["+portletName+"] Set instid on lightweight person...");
       
        BasicPerson aeo = (BasicPerson)appConfig.getObject(BASIC_PERSON);
        logger.info("["+portletName+"] Got " + BASIC_PERSON + " from AppConfig, performing Query...");

        java.util.List a = aeo.query(lPerson, p2p);
        logger.info("["+portletName+"] Executed Query...");

        StringBuffer results = new StringBuffer();
        if (a.size() == 0) {
          logger.info("["+portletName+"] No rows found matching the query.");
          return null;
        }
        else {
          BasicPerson bp = (BasicPerson)a.get(0);
          return bp;
        }
  }
View Full Code Here

        }
        else {
          ec_textArea.setText(eclist.size() + " EmergencyContacts were found for " + personName);
          java.util.Vector v = new java.util.Vector();
          for (int i=0; i<eclist.size(); i++) {
            EmergencyContact ec = (EmergencyContact)eclist.get(i);
            String ecName = ec.getName().getFirstName() + " " + ec.getName().getLastName();
            v.add(ec);
          }     
          ecList.setListData(v);
          ecList.updateUI();
        }
View Full Code Here

     * This baseline object will be used when a
     * com.any-erp-vendor.Person/EmergencyContact/1.0/Update-Request is sent.
     **/
    protected void ecList_mouseClicked(MouseEvent e)
    {
      EmergencyContact ec = (EmergencyContact)ecList.getSelectedValue();
      try {
        baselineEmergencyContact = (EmergencyContact)ec.clone();
      }
      catch (Exception exc) {
      }
      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

    protected void ec_createButton_mouseClicked(MouseEvent e)
    {
      try {
        String messageObjectName = EMERGENCY_CONTACT;
        org.openeai.OpenEaiObject.logger.info("Message Object Name is: " + messageObjectName);
        EmergencyContact ec = (EmergencyContact)APP_CONFIG.getObject(messageObjectName);
        org.openeai.OpenEaiObject.logger.info("got " + messageObjectName + " from AppConfig, performing Create...");
       
        populateEmergencyContact(ec);
       
        try {
          ec.create((PointToPointProducer)APP_CONFIG.getObject(SELF_SERVICE_PRODUCER));
          org.openeai.OpenEaiObject.logger.info("Executed Create request...");
          ec_textArea.setText("Create was successful.");
          ec_queryButton_mouseClicked(null);
        }
        catch (Exception openeaiExc) {
View Full Code Here

     * Any errors that occur during the request will be logged in the TextArea at the
     * bottom of the form.
     **/
    void ec_deleteButton_mouseClicked(MouseEvent e)
    {
      EmergencyContact ec = (EmergencyContact)ecList.getSelectedValue();
      if (ec != null) {
        try {
          ec.delete("delete", (PointToPointProducer)APP_CONFIG.getObject(SELF_SERVICE_PRODUCER));
          org.openeai.OpenEaiObject.logger.info("Executed Delete request...");
          ec_textArea.setText("Delete was successful.");
          ec_queryButton_mouseClicked(null);
        }
        catch (Exception openeaiExc) {
View Full Code Here

    protected void ec_updateButton_mouseClicked(MouseEvent e)
    {
      try {
        String messageObjectName = EMERGENCY_CONTACT;
        org.openeai.OpenEaiObject.logger.info("Message Object Name is: " + messageObjectName);
        EmergencyContact ec = (EmergencyContact)APP_CONFIG.getObject(messageObjectName);
        org.openeai.OpenEaiObject.logger.info("got " + messageObjectName + " from AppConfig, performing Create...");
       
        populateEmergencyContact(ec);
        ec.setBaseline(baselineEmergencyContact);
       
        try {
          ec.update((PointToPointProducer)APP_CONFIG.getObject(SELF_SERVICE_PRODUCER));
          org.openeai.OpenEaiObject.logger.info("Executed Update request...");
          ec_textArea.setText("Update was successful.");
          ec_queryButton_mouseClicked(null);
        }
        catch (Exception openeaiExc) {
View Full Code Here

TOP

Related Classes of com.any_erp_vendor.moa.jmsobjects.person.v1_0.EmergencyContact

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.