コード例 #1
0
  private Document prepareInputXMLToSearch() {
    Element eleSearchCriteria = getTargetModel("DivisionSearchCriteria");
    eleSearchCriteria.setAttribute("IsNode", "Y");
    if (!YRCPlatformUI.isVoid(
        YRCXmlUtils.getAttributeValue(eleSearchCriteria, "Organization/Extn/@ExtnBrandCode"))) {

      YRCXmlUtils.setAttributeValue(
          eleSearchCriteria, "Organization/Extn/@ExtnBrandCodeQryType", "LIKE");
    }

    String strDivision = eleSearchCriteria.getAttribute("OrganizationCodeOrName");
    if (!YRCPlatformUI.isVoid(strDivision)) {
      Element eleCQ = YRCXmlUtils.createChild(eleSearchCriteria, "ComplexQuery");
      Element eleOr = YRCXmlUtils.createChild(eleCQ, "Or");

      Element eleExpCode = YRCXmlUtils.createChild(eleOr, "Exp");
      eleExpCode.setAttribute("Name", "OrganizationCode");
      eleExpCode.setAttribute("Value", strDivision);
      eleExpCode.setAttribute("QryType", "LIKE");

      Element eleExpName = YRCXmlUtils.createChild(eleOr, "Exp");
      eleExpName.setAttribute("Name", "OrganizationName");
      eleExpName.setAttribute("Value", strDivision);
      eleExpName.setAttribute("QryType", "LIKE");

    } else {
      if (eleSearchCriteria.hasAttribute("OrganizationCodeOrName")) {
        eleSearchCriteria.removeAttribute("OrganizationCodeOrName");
      }
    }

    return eleSearchCriteria.getOwnerDocument();
  }