Package org.any_openeai_enterprise.moa.objects.resources.v1_0

Examples of org.any_openeai_enterprise.moa.objects.resources.v1_0.Name


        if (returnedJeos.size() == 0) {
          // create the BasicPerson using default values from uPortal (givenName, sn)
          LogService.log(LogService.INFO, "[basicPersonQueryHandler] BasicPerson doesn't exist, creating it.");
          BasicPerson bp = (BasicPerson)getAppConfig().getObject(messageObjectName);
          bp.setInstitutionalId(instId);
          Name name = bp.newName();
          name.setFirstName(firstName);
          name.setLastName(lastName);
          bp.setName(name);
          bp.create((PointToPointProducer)getAppConfig().getObject(producerName));
          LogService.log(LogService.INFO, "[basicPersonQueryHandler] BasicPerson was created.");
          xml += bp.getXmlEnterpriseObject().toXmlString();
        }
View Full Code Here



      // where to get the newdata (the form data)?
      BasicPerson bp = (BasicPerson)getAppConfig().getObject(messageObjectName);
      bp.setInstitutionalId(getChannelRuntimeData().getParameter("InstitutionalId"));
      Name name = bp.newName();
      name.setFirstName(getChannelRuntimeData().getParameter("FirstName"));
      name.setLastName(getChannelRuntimeData().getParameter("LastName"));
      bp.setName(name);

      // address info
      String[] addrTypes = getChannelRuntimeData().getParameterValues("Address@type");
      for (int i=0; i<addrTypes.length; i++) {
View Full Code Here

   * the BasicPerson object.
   **/
  protected void populateBasicPerson(BasicPerson bPerson) throws org.openeai.moa.EnterpriseObjectException {
    try {
      String instId = instIdTextField.getText();
      Name aName = bPerson.newName();
      aName.setLastName(bp_lastNameTextField.getText());
      aName.setFirstName(bp_firstNameTextField.getText());
      aName.setMiddleName(bp_middleNameTextField.getText());
     
      bPerson.setInstitutionalId(instId);
      bPerson.setName(aName);
      bPerson.setGender((String)bp_genderComboBox.getSelectedItem());
     
View Full Code Here

    protected void populateEmergencyContact(EmergencyContact ec) throws org.openeai.moa.EnterpriseObjectException {
      try {
        ec.setOwnerId(instIdTextField.getText());
        ec.setPriority((String)ec_priority.getSelectedItem());
        ec.setRelationship((String)ec_relation.getSelectedItem());
        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.
View Full Code Here

      logger.info("Retrieving Person record for InstitutionalId: " + instId);
      ResultSet rs = stmt.executeQuery();
      logger.info("Retreived Person record for InstitutionalId: " + instId);

      BasicPerson bPerson = (BasicPerson)getAppConfig().getObject("BasicPerson.v1_0");
      Name aName = bPerson.newName();
      boolean foundPerson = false;
      while (rs.next()) {
        foundPerson = true;
        bPerson.setInstitutionalId(rs.getString(1));
        aName.setFirstName(rs.getString(2));
        aName.setMiddleName(rs.getString(3));
        aName.setLastName(rs.getString(4));
        bPerson.setName(aName);
        bPerson.setGender(rs.getString(5));
        bPerson.setEthnicity(rs.getString(6));
        com.any_erp_vendor.moa.objects.resources.v1_0.Date bDate = bPerson.newBirthDate();
        java.sql.Date dbDate = rs.getDate(7);
View Full Code Here

    try {
      LightweightPerson lightweightPerson = entUser.getLightweightPerson();
      enterpriseID = lightweightPerson.getInstitutionalId();
      BasicPerson basicPerson = getBasicPerson(enterpriseID);
      Name name = basicPerson.getName();
      String firstName = name.getFirstName();
      String lastName = name.getLastName();
      String middleName = name.getMiddleName();
      updateName (principal, firstName, lastName, middleName);
      List eMails = basicPerson.getEmail();
      updateEmail (principal, eMails);
      List phones = basicPerson.getPhone();
      updatePhone (principal, phones);
View Full Code Here

      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();
View Full Code Here

   * @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);
View Full Code Here

        m_line);
     
      // Get a greeting and a greetee object from AppConfig to use in
      // processing this line.
      Greeting greeting = null;
      Greetee greetee = null;
      try {
        greeting = (Greeting)getAppConfig().getObject("Greeting");
        greetee = (Greetee)getAppConfig().getObject("Greetee");
      }
      catch (EnterpriseConfigurationObjectException ecoe) {
        // An error occurred retrieving an object from AppConfig. Log it,
        // increment the error count, and return.
        String errMsg = "An error occurred retrieving an object from " +
          "AppConfig. The exception is: " + ecoe.getMessage();
        logger.fatal("[ProcessInputLine.run] An error occurred processing " +
          "line number " + m_lineNumber + ": " + errMsg);
        incrementErrorCount();
        return;
      }

      // Set the full name of the greetee.
      try { greetee.setFullName(m_line.trim()); }
      catch (EnterpriseFieldException efe) {
        // An error occurred setting the value of the full name for the
        // greetee. Log it, increment the error count, and return.
        String errMsg = "An error occurred setting the value of the full name "
          + "of the greetee. The exception is: " + efe.getMessage();
        logger.fatal("[ProcessInputLine.run] An error occurred processing " +
          "line number " + m_lineNumber + ": " + errMsg);
        incrementErrorCount();
        return
      }

      // Generate the greeting.
      List results = null;
      try {
        logger.info("[ProcessInputLine.run] Sending a Greeting.Generate-" +
          "Request for: " + greetee.getFullName());
        results = greeting.generate(greetee, m_p2p);
      }    
      catch (EnterpriseObjectGenerateException eoge) {
        if (eoge.getMessage().toLowerCase().indexOf("time") != -1) {
          // The error was a timeout error. Log it.
          String errMsg = "Timed out waiting for reply.";
          logger.fatal("[ProcessInputLine.run] " + errMsg);
        }
        else {
          // An error occurred generating the greeting. Log it.
          String errMsg = "An error occurred generating the greeting. The " +
            "exception is: " + eoge.getMessage();
          logger.fatal("[ProcessInputLine.run] " + errMsg);
          eoge.printStackTrace();
        }
        // Increment the error count and return.
        incrementErrorCount();
        return;
      }

      // Display the greeting that was generated by EGS.
      for (int i=0; i < results.size(); i++) {
        greeting = (Greeting)results.get(i);
        logger.info("[ProcessInputLine.run] Greeting returned for '" +
          greetee.getFullName() + "' is: " + greeting.getText());
      }
     
      logger.debug("[ProcessInputLine.run] Completed processing line " +
        m_lineNumber + ": " + m_line);
View Full Code Here

    }
    catch (EnterpriseConfigurationObjectException eoce) {
      logger.fatal("[GreetingRequestCommand] Error retrieving a Greeting " +
        "object from AppConfig: The exception is: " + eoce.getMessage());
   
    Greetee greetee = new Greetee();
    try {
      greetee = (Greetee)getAppConfig().getObjectByType(greetee.getClass()
        .getName());
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      logger.fatal("[GreetingRequestCommand] Error retrieving a Greeting " +
        "object from AppConfig: The exception is: " + eoce.getMessage());
    }

    // Handle a Generate-Request.
    if (msgAction.equalsIgnoreCase("Generate")) {
      logger.info("[GreetingRequestCommand] Handling an " +
        "org.any-openeai-enterprise.CoreApplication.Greeting.Generate-Request" +
        " message.");
      Element eGreetee = inDoc.getRootElement().getChild("DataArea")
        .getChild("Greetee");

      // Verify that Greetee element is not null; if it is, reply with an error.
      if (eGreetee == null) {     
        String errType = "application";
        String errCode = "OpenEAI-1015";
        String errDesc = "Invalid generate element found in the Generate-" +
          "Request message. This command expects a Greetee.";
        logger.fatal("[GreetingRequestCommand] " + errDesc);
        logger.fatal("Message sent in is: \n" + getMessageBody(inDoc));
        ArrayList errors = new ArrayList();
        errors.add(buildError(errType, errCode, errDesc));
        String replyContents =
          buildReplyDocumentWithErrors(eControlArea, localResponseDoc, errors);
        return getMessage(msg, replyContents);
      }
     
      // Now build a Greetee object from the Greetee element in the message.
      try {
        greetee.buildObjectFromInput(eGreetee);
      }
      catch (EnterpriseLayoutException ele) {
        // There was an error building the Greetee object from a Greetee
        // element.
        String errType = "application";
        String errCode = "EnterpriseGreetingService-1001";
        String errDesc = "An error occurred building Greetee object from the " +
          "Greetee element in the Generate-Request message. The exception " +
          "is: " + ele.getMessage();
        logger.fatal("[GreeteeRequestCommand] " + errDesc);
        logger.fatal("Message sent in is: \n" + getMessageBody(inDoc));
        ArrayList errors = new ArrayList();
        errors.add(buildError(errType, errCode, errDesc));
        String replyContents =
        buildReplyDocumentWithErrors(eControlArea, localResponseDoc, errors);
        return getMessage(msg, replyContents);
      }

      // Generate the greeting.
      try {
        if (greetee.getFullName() != null && greetee.getFullName() != "") {
          // There is a greetee with a name to greet. Prepare the greeting text.
          greeting.setText("Hello, " + greetee.getFullName() + "!");
        }
        else {
          // There is no greetee with a name to greet. Use the default greeting
          // text.
          greeting.setText(getDefaultGreetingText());
        }
      }
      catch (EnterpriseFieldException efe) {
        // An error occurred setting the value of the greeting text. Log it and
        // reply with an error.
        String errType = "application";
        String errCode = "EnterpriseGreetingService-1002";
        String errDesc = "An error occurred setting the value of the " +
          "greeting text. The exception is: " + efe.getMessage();
        logger.fatal("[GreetingRequestCommand " + errDesc);
        ArrayList errors = new ArrayList();
        errors.add(buildError(errType, errCode, errDesc));
        String replyContents =
        buildReplyDocumentWithErrors(eControlArea, localResponseDoc, errors);
        return getMessage(msg, replyContents);
      }

      // Set the TestId.
      greeting.setTestId(greetee.getTestId());

      // Get pub/sub producer to use in this transaction.
      PubSubProducer pub = null;
      try {
        pub = (PubSubProducer)m_pubSubProducerPool.getProducer();
View Full Code Here

TOP

Related Classes of org.any_openeai_enterprise.moa.objects.resources.v1_0.Name

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.