static {
   ResourceBundle resourceBundle = null;
   try {
     resourceBundle = ResourceBundle.getBundle("common.drfirst");
   } catch (MissingResourceException e) {
   }
   try {
     m_AppPath = resourceBundle.getString("signature_form_app_path");
   } catch (Exception e) {
     System.out.println("Error when getting the resource bundle " + e);
   }
   try {
     m_DrFirstLogoPath = SystemProperties.getPropertyValue("signature_form_drfirst_logo");
     m_DrFirstPhone = SystemProperties.getPropertyValue("signature_form_drfirst_phone");
   } catch (Exception e) {
   }
   try {
     m_Fax = SystemProperties.getPropertyValue("signature_form_fax");
   } catch (Exception e) {
   }
   try {
     UserValidationBean uBean = new UserValidationBean();
     SERVER_PREFIX = uBean.getServerPrefix();
     uBean = null;
   } catch (Exception e) {
   }
 }
  public static String generateFormContent(
      HttpServletRequest request,
      HttpServletResponse response,
      String form_type,
      String provider_last_name,
      String provider_first_name,
      String drwebid,
      String state) {

    // String strTitle = "Rcopia Provider Registration";
    String strImage1 = m_DrFirstLogoPath; // "D:\\newweb\\webapps\\dfdev\\img\\drFirstLogoBlue.gif";
    String strSigBox =
        m_AppPath + "urs_temp/img/sigBox.gif"; // "D:\\newweb\\webapps\\dfdev\\img\\sigBox.gif";

    // String strHeader="Rcopia Provider Registration";

    String strCompany = "DrFirst";

    String strFax = m_Fax; // "(240) 331-9195";
    String strPhone = m_DrFirstPhone; // "(888) 271-9898 x4";
    String strRcopia = "Rcopia";
    // String strstrPartner =
    // StringFunctions.objectToString(request.getParameter("strPartner"));
    System.out.println(
        "####################### SignatureFormGenerator.generateFormContent()  state = " + state);
    String strSignatureExplaination = UserConstants.getSignatureExplaintion(state);
    String strDAWStatement = UserConstants.getDAWStatement(state);
    String strDAWSign = UserConstants.getDAWSign(state);

    String practiceName =
        (String) request.getSession().getAttribute(urs.valueobject.UserConstants.PRACTICE_NAME);
    String practiceId =
        (String) request.getSession().getAttribute(urs.valueobject.UserConstants.PRACTICE_ID);
    String private_label_loaded =
        (String)
            request
                .getSession()
                .getAttribute(urs.valueobject.UserConstants.PRIVATE_LABEL_LOADED + practiceId);
    PrivateLabel private_label = null;
    // Added by Channpreet for Task OR31-004 starts
    StringBuffer providerAgentsName = new StringBuffer();
    String currentUser =
        (String) request.getSession().getAttribute(UserConstants.CURRENT_USER_NAME);
    MemberDBBean dbBean = new MemberDBBean();
    String practice_username = dbBean.getUsername(Long.parseLong(practiceId));
    // Added by Channpreet for Task OR31-004 ends

    System.out.println(
        "#################### in SignatureFormGenerator  private_label_loaded = "
            + private_label_loaded);
    System.out.println(
        "#################### in SignatureFormGenerator  practiceId = " + practiceId);
    if (private_label_loaded == null) {
      UserValidationBean uBean = new UserValidationBean();
      private_label = uBean.getPrivateLabelByPracticeID(Long.parseLong(practiceId));
      request
          .getSession()
          .setAttribute(urs.valueobject.UserConstants.PRIVATE_LABEL_LOADED + practiceId, "y");
      if (private_label != null)
        request
            .getSession()
            .setAttribute(urs.valueobject.UserConstants.PRIVATE_LABEL + practiceId, private_label);
    } else {
      private_label =
          (PrivateLabel)
              request
                  .getSession()
                  .getAttribute(urs.valueobject.UserConstants.PRIVATE_LABEL + practiceId);
    }
    System.out.println(
        "#################### in SignatureFormGenerator  private_label = " + private_label);
    if (private_label != null) {
      strCompany = private_label.getCompanyName();
      strPhone = private_label.getContactPhone();
      strRcopia = private_label.getApplicationName();
      strImage1 = m_AppPath + private_label.getLogoUrl();
    }
    System.out.println(
        "#################### in SignatureFormGenerator  strCompany = " + strCompany);
    System.out.println("#################### in SignatureFormGenerator  strPhone = " + strPhone);
    System.out.println("#################### in SignatureFormGenerator  strRcopia = " + strRcopia);
    System.out.println("#################### in SignatureFormGenerator  strImage1 = " + strImage1);
    String sigFormBuf = UserConstants.getSignatureForm();
    String provAgentFormBuf = UserConstants.getProviderAgentForm();
    String dawBuff = UserConstants.getDawForm();

    StringBuffer mFormBuff = new StringBuffer();
    String outBuff = "";

    if (practiceName == null) {
      practiceName = "unknown";
    }
    try {
      if (!form_type.equals("PAT")) mFormBuff = new StringBuffer(sigFormBuf);
      else mFormBuff = new StringBuffer(provAgentFormBuf);

      String outBuff2 = "";
      String form_id = "F01-";
      System.out.println("*********************form_type: " + form_type);
      System.out.println(
          "*********************strDAWStatement.length():" + strDAWStatement.length());
      if (!form_type.equals("PAT") && strDAWStatement.length() > 0) {

        outBuff2 = StringFunctions.replace(dawBuff, "$strDAWStatement", strDAWStatement);
        outBuff2 = StringFunctions.replace(outBuff2.toString(), "$strDAWSign", strDAWSign);
        form_id = "F02-";
      } else if (form_type.equals("PAT")) {
        // Added by Channpreet for Task OR31-004 starts
        List providerAgentsList =
            (List) request.getSession().getAttribute("urs_provider_agent_print_list");
        if (providerAgentsList != null) {
          int size = providerAgentsList.size();
          for (int x = 0; x < size; x++) {
            List rv = (List) providerAgentsList.get(x);
            String firstName = StringFunctions.objectToString(rv.get(2));
            String lastName = StringFunctions.objectToString(rv.get(1));
            String name = firstName + " " + lastName;
            // providerAgentsName.append("<input type=\"radio\" name=\"providerAgents\"
            // value=\""+name+"\" />"+name+"<br> \n");
            providerAgentsName.append("&nbsp;&nbsp;" + name + "<br> \n");
          }
        }
        // Added by Channpreet for Task OR31-004 ends

        form_id = "A01-";
      }
      Linear linear = new Linear();
      String barcode_value = form_id;
      if (!state.equals("")) barcode_value += state + "-";
      barcode_value += SERVER_PREFIX + "-" + drwebid;
      System.out.println("barcodevalue===" + barcode_value);
      linear.setData(barcode_value);
      System.out.println("setData===" + barcode_value);
      linear.setType(Linear.CODE39);
      linear.setAddCheckSum(true);
      // X - 2; Y -90; BarcodeWidth 650
      linear.setY(75);
      linear.setX(2);
      linear.setBarcodeWidth(750);
      String barcodeimage = "barcodes/barcode-" + drwebid + ".gif";
      System.out.println("renderBarcode ===");
      linear.renderBarcode(m_AppPath + "urs_temp/barcodes/barcode-" + drwebid + ".gif");
      System.out.println("renderBarcode === done");

      // outBuff = StringFunctions.replace(mFormBuff.toString(),
      // "$strTitle", strTitle);

      outBuff =
          StringFunctions.replace(
              mFormBuff.toString(), "$strSignatureExplaination", strSignatureExplaination);
      outBuff = StringFunctions.replace(outBuff, "$SignDAW", outBuff2);
      outBuff = StringFunctions.replace(outBuff, "$practiceId", practiceId);
      outBuff = StringFunctions.replace(outBuff, "$practiceName", practiceName);
      outBuff = StringFunctions.replace(outBuff, "$drWebId", drwebid);
      outBuff = StringFunctions.replace(outBuff, "$providerLast", provider_last_name);
      outBuff = StringFunctions.replace(outBuff, "$providerFirst", provider_first_name);
      outBuff = StringFunctions.replace(outBuff, "$strImage1", strImage1);
      // outBuff = StringFunctions.replace(outBuff, "$strHeader",
      // strHeader);
      outBuff = StringFunctions.replace(outBuff, "$strCompany", strCompany);
      outBuff = StringFunctions.replace(outBuff, "$strFax", strFax);
      outBuff = StringFunctions.replace(outBuff, "$strPhone", strPhone);
      outBuff = StringFunctions.replace(outBuff, "$barcodeimage", barcodeimage);
      outBuff = StringFunctions.replace(outBuff, "$strRcopia", strRcopia);
      outBuff = StringFunctions.replace(outBuff, "$signBox", strSigBox);
      // Added by Channpreet for Task OR31-004 starts
      outBuff =
          StringFunctions.replace(outBuff, "$provider_agent_names", providerAgentsName.toString());
      outBuff = StringFunctions.replace(outBuff, "$logonUser", currentUser.toString());
      outBuff = StringFunctions.replace(outBuff, "$practiceUsername", practice_username);
      // Added by Channpreet for Task OR31-004 ends

    } catch (Exception e) {
      e.printStackTrace();
    } finally {
    }
    return outBuff;
  }