Example usage for java.lang String compareToIgnoreCase

List of usage examples for java.lang String compareToIgnoreCase

Introduction

In this page you can find the example usage for java.lang String compareToIgnoreCase.

Prototype

public int compareToIgnoreCase(String str) 

Source Link

Document

Compares two strings lexicographically, ignoring case differences.

Usage

From source file:com.vmware.identity.idm.client.TenantManagementTest.java

@TestOrderAnnotation(order = 36)
@Test//from w w  w .j  av a2  s.  co m
public void testADProviderGetNestedParentGroups() throws Exception, IDMException {
    CasIdmClient idmClient = getIdmClient();

    Properties props = getTestProperties();

    String tenantName = props.getProperty(CFG_KEY_IDM_TENANT_1_NAME);

    Assert.assertNotNull(tenantName);

    Tenant tenant = IdmClientTestUtil.ensureTenantExists(idmClient, tenantName);

    Assert.assertNotNull(tenant);

    final String adUserName = props.getProperty(CFG_KEY_IDM_TENANT_1_ADPROVIDER_USER_LOOKUP_ID);

    Assert.assertNotNull(adUserName);

    final String adDomainName = props.getProperty(CFG_KEY_IDM_TENANT_1_AD_PROVIDER_DOMAIN_NAME);

    Assert.assertNotNull(adDomainName);

    PrincipalId principal = new PrincipalId(adUserName, adDomainName);

    Set<Group> nestedGroups = idmClient.findNestedParentGroups(tenantName, principal);
    Assert.assertNotNull("nestedGroups must not be null", nestedGroups);
    Assert.assertFalse("nestedGroups must not be empty", nestedGroups.isEmpty());

    final String candidateGroupName = "Group1";
    boolean foundCandidateGroup = false;
    for (Group g : nestedGroups) {
        if (candidateGroupName.compareToIgnoreCase(g.getName()) == 0) {
            foundCandidateGroup = true;
            break;
        }
    }
    Assert.assertTrue(String.format("nestedGroups must include '%s'", candidateGroupName), foundCandidateGroup);
}

From source file:gov.nih.nci.evs.browser.servlet.AjaxServlet.java

public static void create_vs_tree(HttpServletRequest request, HttpServletResponse response, int view,
        String dictionary, String version) {

    request.getSession().removeAttribute("b");
    request.getSession().removeAttribute("m");

    response.setContentType("text/html");
    PrintWriter out = null;//  w w w  .  j  a  v  a  2 s  .  c  o  m

    String checked_vocabularies = HTTPUtils.cleanXSS((String) request.getParameter("checked_vocabularies"));
    String partial_checked_vocabularies = HTTPUtils
            .cleanXSS((String) request.getParameter("partial_checked_vocabularies"));
    //System.out.println("partial_checked_vocabularies: " + partial_checked_vocabularies);

    try {
        out = response.getWriter();
    } catch (Exception ex) {
        ex.printStackTrace();
        return;
    }

    String message = (String) request.getSession().getAttribute("message");

    out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
    out.println("<html xmlns:c=\"http://java.sun.com/jsp/jstl/core\">");
    out.println("<head>");

    out.println("  <title>" + dictionary + " value set</title>");

    //out.println("  <title>NCI Thesaurus</title>");
    out.println("  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
    out.println("");
    out.println("<style type=\"text/css\">");
    out.println("/*margin and padding on body element");
    out.println("  can introduce errors in determining");
    out.println("  element position and are not recommended;");
    out.println("  we turn them off as a foundation for YUI");
    out.println("  CSS treatments. */");
    out.println("body {");
    out.println("   margin:0;");
    out.println("   padding:0;");
    out.println("}");
    out.println("</style>");
    out.println("");
    out.println(
            "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://yui.yahooapis.com/2.9.0/build/fonts/fonts-min.css\" />");
    out.println(
            "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://yui.yahooapis.com/2.9.0/build/treeview/assets/skins/sam/treeview.css\" />");
    out.println("");
    out.println(
            "<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.9.0/build/yahoo-dom-event/yahoo-dom-event.js\"></script>");
    out.println("<script type=\"text/javascript\" src=\"/ncitbrowser/js/yui/treeview-min.js\" ></script>");
    out.println("");
    out.println("");
    out.println("<!-- Dependency -->");
    out.println("<script src=\"http://yui.yahooapis.com/2.9.0/build/yahoo/yahoo-min.js\"></script>");
    out.println("");
    out.println("<!-- Source file -->");
    out.println("<!--");
    out.println("   If you require only basic HTTP transaction support, use the");
    out.println("   connection_core.js file.");
    out.println("-->");
    out.println(
            "<script src=\"http://yui.yahooapis.com/2.9.0/build/connection/connection_core-min.js\"></script>");
    out.println("");
    out.println("<!--");
    out.println("   Use the full connection.js if you require the following features:");
    out.println("   - Form serialization.");
    out.println("   - File Upload using the iframe transport.");
    out.println("   - Cross-domain(XDR) transactions.");
    out.println("-->");
    out.println("<script src=\"http://yui.yahooapis.com/2.9.0/build/connection/connection-min.js\"></script>");
    out.println("");
    out.println("");
    out.println("");
    out.println("<!--begin custom header content for this example-->");
    out.println("<!--Additional custom style rules for this example:-->");
    out.println("<style type=\"text/css\">");
    out.println("");
    out.println("");
    out.println(
            ".ygtvcheck0 { background: url(/ncitbrowser/images/yui/treeview/check0.gif) 0 0 no-repeat; width:16px; height:20px; float:left; cursor:pointer; }");
    out.println(
            ".ygtvcheck1 { background: url(/ncitbrowser/images/yui/treeview/check1.gif) 0 0 no-repeat; width:16px; height:20px; float:left; cursor:pointer; }");
    out.println(
            ".ygtvcheck2 { background: url(/ncitbrowser/images/yui/treeview/check2.gif) 0 0 no-repeat; width:16px; height:20px; float:left; cursor:pointer; }");
    out.println("");
    out.println("");
    out.println(".ygtv-edit-TaskNode  {   width: 190px;}");
    out.println(".ygtv-edit-TaskNode .ygtvcancel, .ygtv-edit-TextNode .ygtvok  {   border:none;}");
    out.println(".ygtv-edit-TaskNode .ygtv-button-container { float: right;}");
    out.println(".ygtv-edit-TaskNode .ygtv-input  input{   width: 140px;}");
    out.println(".whitebg {");
    out.println("   background-color:white;");
    out.println("}");
    out.println("</style>");
    out.println("");
    out.println("  <link rel=\"stylesheet\" type=\"text/css\" href=\"/ncitbrowser/css/styleSheet.css\" />");
    out.println("  <link rel=\"shortcut icon\" href=\"/ncitbrowser/favicon.ico\" type=\"image/x-icon\" />");
    out.println("");
    out.println("  <script type=\"text/javascript\" src=\"/ncitbrowser/js/script.js\"></script>");
    out.println("  <script type=\"text/javascript\" src=\"/ncitbrowser/js/tasknode.js\"></script>");

    println(out, "  <script type=\"text/javascript\" src=\"/ncitbrowser/js/search.js\"></script>");
    println(out, "  <script type=\"text/javascript\" src=\"/ncitbrowser/js/dropdown.js\"></script>");

    out.println("");
    out.println("  <script type=\"text/javascript\">");
    out.println("");
    out.println("    function refresh() {");
    out.println("");
    out.println(
            "      var selectValueSetSearchOptionObj = document.forms[\"valueSetSearchForm\"].selectValueSetSearchOption;");
    out.println("");
    out.println("      for (var i=0; i<selectValueSetSearchOptionObj.length; i++) {");
    out.println("        if (selectValueSetSearchOptionObj[i].checked) {");
    out.println("            selectValueSetSearchOption = selectValueSetSearchOptionObj[i].value;");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("");
    out.println("      window.location.href=\"/ncitbrowser/pages/value_set_source_view.jsf?refresh=1\"");
    out.println("          + \"&nav_type=valuesets\" + \"&opt=\"+ selectValueSetSearchOption;");
    out.println("");
    out.println("    }");
    out.println("  </script>");
    out.println("");
    out.println("  <script language=\"JavaScript\">");
    out.println("");
    out.println("    var tree;");
    out.println("    var nodeIndex;");
    out.println("    var nodes = [];");
    out.println("");
    out.println("    function load(url,target) {");
    out.println("      if (target != '')");
    out.println("        target.window.location.href = url;");
    out.println("      else");
    out.println("        window.location.href = url;");
    out.println("    }");
    out.println("");
    out.println("    function init() {");
    out.println("       //initTree();");
    out.println("    }");
    out.println("");
    out.println("   //handler for expanding all nodes");
    out.println("   YAHOO.util.Event.on(\"expand_all\", \"click\", function(e) {");
    out.println("        //expandEntireTree();");
    out.println("");
    out.println("        tree.expandAll();");
    out.println("      //YAHOO.util.Event.preventDefault(e);");
    out.println("   });");
    out.println("");
    out.println("   //handler for collapsing all nodes");
    out.println("   YAHOO.util.Event.on(\"collapse_all\", \"click\", function(e) {");
    out.println("      tree.collapseAll();");
    out.println("      //YAHOO.util.Event.preventDefault(e);");
    out.println("   });");
    out.println("");
    out.println("   //handler for checking all nodes");
    out.println("   YAHOO.util.Event.on(\"check_all\", \"click\", function(e) {");
    out.println("      check_all();");
    out.println("      //YAHOO.util.Event.preventDefault(e);");
    out.println("   });");
    out.println("");
    out.println("   //handler for unchecking all nodes");
    out.println("   YAHOO.util.Event.on(\"uncheck_all\", \"click\", function(e) {");
    out.println("      uncheck_all();");
    out.println("      //YAHOO.util.Event.preventDefault(e);");
    out.println("   });");
    out.println("");
    out.println("");
    out.println("");
    out.println("   YAHOO.util.Event.on(\"getchecked\", \"click\", function(e) {");
    out.println(
            "               //alert(\"Checked nodes: \" + YAHOO.lang.dump(getCheckedNodes()), \"info\", \"example\");");
    out.println("      //YAHOO.util.Event.preventDefault(e);");
    out.println("");
    out.println("   });");
    out.println("");
    out.println("");
    out.println("    function addTreeNode(rootNode, nodeInfo) {");
    out.println(
            "      var newNodeDetails = \"javascript:onClickTreeNode('\" + nodeInfo.ontology_node_id + \"');\";");
    out.println("");
    out.println("      if (nodeInfo.ontology_node_id.indexOf(\"TVS_\") >= 0) {");
    out.println("          newNodeData = { label:nodeInfo.ontology_node_name, id:nodeInfo.ontology_node_id };");
    out.println("      } else {");
    out.println(
            "          newNodeData = { label:nodeInfo.ontology_node_name, id:nodeInfo.ontology_node_id, href:newNodeDetails };");
    out.println("      }");
    out.println("");
    out.println("      var newNode = new YAHOO.widget.TaskNode(newNodeData, rootNode, false);");
    out.println("      if (nodeInfo.ontology_node_child_count > 0) {");
    out.println("        newNode.setDynamicLoad(loadNodeData);");
    out.println("      }");
    out.println("    }");
    out.println("");
    out.println("    function buildTree(ontology_node_id, ontology_display_name) {");
    out.println("      var handleBuildTreeSuccess = function(o) {");
    out.println("        var respTxt = o.responseText;");
    out.println("        var respObj = eval('(' + respTxt + ')');");
    out.println("        if ( typeof(respObj) != \"undefined\") {");
    out.println("          if ( typeof(respObj.root_nodes) != \"undefined\") {");
    out.println("            var root = tree.getRoot();");
    out.println("            if (respObj.root_nodes.length == 0) {");
    out.println("              //showEmptyRoot();");
    out.println("            }");
    out.println("            else {");
    out.println("              for (var i=0; i < respObj.root_nodes.length; i++) {");
    out.println("                var nodeInfo = respObj.root_nodes[i];");
    out.println("                var expand = false;");
    out.println("                //addTreeNode(root, nodeInfo, expand);");
    out.println("");
    out.println("                addTreeNode(root, nodeInfo);");
    out.println("              }");
    out.println("            }");
    out.println("");
    out.println("            tree.draw();");
    out.println("          }");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("      var handleBuildTreeFailure = function(o) {");
    out.println("        alert('responseFailure: ' + o.statusText);");
    out.println("      }");
    out.println("");
    out.println("      var buildTreeCallback =");
    out.println("      {");
    out.println("        success:handleBuildTreeSuccess,");
    out.println("        failure:handleBuildTreeFailure");
    out.println("      };");
    out.println("");
    out.println("      if (ontology_display_name!='') {");
    out.println("        var ontology_source = null;");
    out.println("        var ontology_version = document.forms[\"pg_form\"].ontology_version.value;");
    out.println(
            "        var request = YAHOO.util.Connect.asyncRequest('GET','/ncitbrowser/ajax?action=build_src_vs_tree&ontology_node_id=' +ontology_node_id+'&ontology_display_name='+ontology_display_name+'&version='+ontology_version+'&ontology_source='+ontology_source,buildTreeCallback);");
    out.println("      }");
    out.println("    }");
    out.println("");
    out.println("    function resetTree(ontology_node_id, ontology_display_name) {");
    out.println("");
    out.println("      var handleResetTreeSuccess = function(o) {");
    out.println("        var respTxt = o.responseText;");
    out.println("        var respObj = eval('(' + respTxt + ')');");
    out.println("        if ( typeof(respObj) != \"undefined\") {");
    out.println("          if ( typeof(respObj.root_node) != \"undefined\") {");
    out.println("            var root = tree.getRoot();");
    out.println(
            "            var nodeDetails = \"javascript:onClickTreeNode('\" + respObj.root_node.ontology_node_id + \"');\";");
    out.println(
            "            var rootNodeData = { label:respObj.root_node.ontology_node_name, id:respObj.root_node.ontology_node_id, href:nodeDetails };");
    out.println("            var expand = false;");
    out.println("            if (respObj.root_node.ontology_node_child_count > 0) {");
    out.println("              expand = true;");
    out.println("            }");
    out.println("            var ontRoot = new YAHOO.widget.TaskNode(rootNodeData, root, expand);");
    out.println("");
    out.println("            if ( typeof(respObj.child_nodes) != \"undefined\") {");
    out.println("              for (var i=0; i < respObj.child_nodes.length; i++) {");
    out.println("                var nodeInfo = respObj.child_nodes[i];");
    out.println("                addTreeNode(ontRoot, nodeInfo);");
    out.println("              }");
    out.println("            }");
    out.println("            tree.draw();");
    out.println("          }");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("      var handleResetTreeFailure = function(o) {");
    out.println("        alert('responseFailure: ' + o.statusText);");
    out.println("      }");
    out.println("");
    out.println("      var resetTreeCallback =");
    out.println("      {");
    out.println("        success:handleResetTreeSuccess,");
    out.println("        failure:handleResetTreeFailure");
    out.println("      };");
    out.println("      if (ontology_node_id!= '') {");
    out.println("        var ontology_source = null;");
    out.println("        var ontology_version = document.forms[\"pg_form\"].ontology_version.value;");
    out.println(
            "        var request = YAHOO.util.Connect.asyncRequest('GET','/ncitbrowser/ajax?action=reset_vs_tree&ontology_node_id=' +ontology_node_id+'&ontology_display_name='+ontology_display_name + '&version='+ ontology_version +'&ontology_source='+ontology_source,resetTreeCallback);");
    out.println("      }");
    out.println("    }");
    out.println("");
    out.println("    function onClickTreeNode(ontology_node_id) {");
    out.println("        //alert(\"onClickTreeNode \" + ontology_node_id);");
    out.println(
            "        window.location = '/ncitbrowser/pages/value_set_treenode_redirect.jsf?ontology_node_id=' + ontology_node_id;");
    out.println("    }");
    out.println("");
    out.println("");
    out.println("    function onClickViewEntireOntology(ontology_display_name) {");
    out.println("      var ontology_display_name = document.pg_form.ontology_display_name.value;");
    out.println("      tree = new YAHOO.widget.TreeView(\"treecontainer\");");

    out.println("      tree.draw();");

    out.println("    }");
    out.println("");
    out.println("    function initTree() {");
    out.println("");
    out.println("        tree = new YAHOO.widget.TreeView(\"treecontainer\");");

    //out.println("         pre_check();");

    out.println("   tree.setNodesProperty('propagateHighlightUp',true);");
    out.println("   tree.setNodesProperty('propagateHighlightDown',true);");
    out.println("   tree.subscribe('keydown',tree._onKeyDownEvent);");
    out.println("");
    out.println("");
    out.println("");
    out.println("");
    out.println("          tree.subscribe(\"expand\", function(node) {");
    out.println("");
    out.println("         YAHOO.util.UserAction.keydown(document.body, { keyCode: 39 });");

    out.println("");
    out.println("          });");
    out.println("");
    out.println("");
    out.println("");
    out.println("          tree.subscribe(\"collapse\", function(node) {");
    out.println("         //alert(\"Collapsing \" + node.label );");
    out.println("");
    out.println("         YAHOO.util.UserAction.keydown(document.body, { keyCode: 109 });");
    out.println("          });");
    out.println("");
    out.println(
            "          // By default, trees with TextNodes will fire an event for when the label is clicked:");
    out.println("          tree.subscribe(\"checkClick\", function(node) {");
    out.println("         //alert(node.data.myNodeId + \" label was checked\");");
    out.println("          });");
    out.println("");
    out.println("");

    println(out, "            var root = tree.getRoot();");

    HashMap value_set_tree_hmap = DataUtils.getCodingSchemeValueSetTree();

    TreeItem root = (TreeItem) value_set_tree_hmap.get("<Root>");
    new ValueSetUtils().printTree(out, root, Constants.TERMINOLOGY_VIEW, dictionary);

    String contextPath = request.getContextPath();
    //String view_str = new Integer(view).toString();
    String view_str = Integer.valueOf(view).toString();

    //String option = (String) request.getSession().getAttribute("selectValueSetSearchOption");
    //String algorithm = (String) request.getSession().getAttribute("valueset_search_algorithm");

    String option = HTTPUtils.cleanXSS((String) request.getParameter("selectValueSetSearchOption"));
    String algorithm = HTTPUtils.cleanXSS((String) request.getParameter("valueset_search_algorithm"));

    String option_code = "";
    String option_name = "";
    if (DataUtils.isNull(option)) {
        option_name = "checked";

    } else {
        if (option.compareToIgnoreCase("Code") == 0) {
            option_code = "checked";
        }
        if (option.compareToIgnoreCase("Name") == 0) {
            option_name = "checked";
        }
    }

    String algorithm_exactMatch = "";
    String algorithm_startsWith = "";
    String algorithm_contains = "";

    if (DataUtils.isNull(algorithm)) {
        algorithm = "contains";
    }

    if (algorithm.compareToIgnoreCase("exactMatch") == 0) {
        algorithm_exactMatch = "checked";
    }

    if (algorithm.compareToIgnoreCase("startsWith") == 0) {
        algorithm_startsWith = "checked";
        option_name = "checked";
        option_code = "";
    }

    if (algorithm.compareToIgnoreCase("contains") == 0) {
        algorithm_contains = "checked";
        option_name = "checked";
        option_code = "";
    }

    out.println("");
    if (message == null) {
        out.println("       tree.collapseAll();");
    }

    out.println("      initializeNodeCheckState();");

    out.println("      tree.draw();");

    out.println("    }");
    out.println("");
    out.println("");
    out.println("    function onCheckClick(node) {");
    out.println(
            "        YAHOO.log(node.label + \" check was clicked, new state: \" + node.checkState, \"info\", \"example\");");
    out.println("    }");
    out.println("");
    out.println("    function check_all() {");
    out.println("        var topNodes = tree.getRoot().children;");
    out.println("        for(var i=0; i<topNodes.length; ++i) {");
    out.println("            topNodes[i].check();");
    out.println("        }");
    out.println("    }");
    out.println("");
    out.println("    function uncheck_all() {");
    out.println("        var topNodes = tree.getRoot().children;");
    out.println("        for(var i=0; i<topNodes.length; ++i) {");
    out.println("            topNodes[i].uncheck();");
    out.println("        }");
    out.println("    }");
    out.println("");
    out.println("");
    out.println("");
    out.println("    function expand_all() {");
    out.println("        //alert(\"expand_all\");");
    out.println("        var ontology_display_name = document.forms[\"pg_form\"].ontology_display_name.value;");
    out.println("        onClickViewEntireOntology(ontology_display_name);");
    out.println("    }");
    out.println("");

    out.println("    function pre_check() {");
    out.println("        var ontology_display_name = document.forms[\"pg_form\"].ontology_display_name.value;");

    //out.println(" alert(ontology_display_name);");

    out.println("        var topNodes = tree.getRoot().children;");
    out.println("        for(var i=0; i<topNodes.length; ++i) {");
    out.println("            if (topNodes[i].label == ontology_display_name) {");
    out.println("               topNodes[i].check();");
    out.println("            }");
    out.println("        }");
    out.println("    }");

    out.println("");

    // 0=unchecked, 1=some children checked, 2=all children checked

    out.println("    function getCheckedVocabularies(nodes) {");
    out.println("       getCheckedNodes(nodes);");
    out.println("       getPartialCheckedNodes(nodes);");
    out.println("    }");

    writeInitialize(out);
    initializeNodeCheckState(out);

    out.println("   // Gets the labels of all of the fully checked nodes");
    out.println("   // Could be updated to only return checked leaf nodes by evaluating");
    out.println("   // the children collection first.");

    out.println("    function getCheckedNodes(nodes) {");
    out.println("        nodes = nodes || tree.getRoot().children;");
    out.println("        var checkedNodes = [];");
    out.println("        for(var i=0, l=nodes.length; i<l; i=i+1) {");
    out.println("            var n = nodes[i];");
    out.println("            if (n.checkState == 2) {");
    out.println("                checkedNodes.push(n.label); // just using label for simplicity");
    out.println("            }");
    out.println("             if (n.hasChildren()) {");
    out.println("               checkedNodes = checkedNodes.concat(getCheckedNodes(n.children));");
    out.println("             }");
    out.println("        }");
    //out.println("         checkedNodes = checkedNodes.concat(\",\");");
    out.println(
            "        var checked_vocabularies = document.forms[\"valueSetSearchForm\"].checked_vocabularies;");
    out.println("        checked_vocabularies.value = checkedNodes;");
    out.println("        return checkedNodes;");
    out.println("    }");

    out.println("    function getPartialCheckedNodes(nodes) {");
    out.println("        nodes = nodes || tree.getRoot().children;");
    out.println("        var checkedNodes = [];");
    out.println("        for(var i=0, l=nodes.length; i<l; i=i+1) {");
    out.println("            var n = nodes[i];");
    out.println("            if (n.checkState == 1) {");
    out.println("                checkedNodes.push(n.label); // just using label for simplicity");
    out.println("            }");
    out.println("             if (n.hasChildren()) {");
    out.println("               checkedNodes = checkedNodes.concat(getPartialCheckedNodes(n.children));");
    out.println("             }");
    out.println("        }");
    //out.println("         checkedNodes = checkedNodes.concat(\",\");");
    out.println(
            "        var partial_checked_vocabularies = document.forms[\"valueSetSearchForm\"].partial_checked_vocabularies;");
    out.println("        partial_checked_vocabularies.value = checkedNodes;");
    out.println("        return checkedNodes;");
    out.println("    }");

    out.println("");
    out.println("");
    out.println("");
    out.println("");
    out.println("    function loadNodeData(node, fnLoadComplete) {");
    out.println("      var id = node.data.id;");
    out.println("");
    out.println("      var responseSuccess = function(o)");
    out.println("      {");
    out.println("        var path;");
    out.println("        var dirs;");
    out.println("        var files;");
    out.println("        var respTxt = o.responseText;");
    out.println("        var respObj = eval('(' + respTxt + ')');");
    out.println("        var fileNum = 0;");
    out.println("        var categoryNum = 0;");
    out.println("        if ( typeof(respObj.nodes) != \"undefined\") {");
    out.println("          for (var i=0; i < respObj.nodes.length; i++) {");
    out.println("            var name = respObj.nodes[i].ontology_node_name;");
    out.println(
            "            var nodeDetails = \"javascript:onClickTreeNode('\" + respObj.nodes[i].ontology_node_id + \"');\";");
    out.println(
            "            var newNodeData = { label:name, id:respObj.nodes[i].ontology_node_id, href:nodeDetails };");
    out.println("            var newNode = new YAHOO.widget.TaskNode(newNodeData, node, false);");
    out.println("            if (respObj.nodes[i].ontology_node_child_count > 0) {");
    out.println("              newNode.setDynamicLoad(loadNodeData);");
    out.println("            }");
    out.println("          }");
    out.println("        }");
    out.println("        tree.draw();");
    out.println("        fnLoadComplete();");
    out.println("      }");
    out.println("");
    out.println("      var responseFailure = function(o){");
    out.println("        alert('responseFailure: ' + o.statusText);");
    out.println("      }");
    out.println("");
    out.println("      var callback =");
    out.println("      {");
    out.println("        success:responseSuccess,");
    out.println("        failure:responseFailure");
    out.println("      };");
    out.println("");
    out.println("      var ontology_display_name = document.forms[\"pg_form\"].ontology_display_name.value;");
    out.println("      var ontology_version = document.forms[\"pg_form\"].ontology_version.value;");
    out.println(
            "      var cObj = YAHOO.util.Connect.asyncRequest('GET','/ncitbrowser/ajax?action=expand_src_vs_tree&ontology_node_id=' +id+'&ontology_display_name='+ontology_display_name+'&version='+ontology_version,callback);");
    out.println("    }");
    out.println("");
    out.println("");
    out.println("    function searchTree(ontology_node_id, ontology_display_name) {");
    out.println("");
    out.println("        var handleBuildTreeSuccess = function(o) {");
    out.println("");
    out.println("        var respTxt = o.responseText;");
    out.println("        var respObj = eval('(' + respTxt + ')');");
    out.println("        if ( typeof(respObj) != \"undefined\") {");
    out.println("");
    out.println("          if ( typeof(respObj.dummy_root_nodes) != \"undefined\") {");
    out.println("              showNodeNotFound(ontology_node_id);");
    out.println("          }");
    out.println("");
    out.println("          else if ( typeof(respObj.root_nodes) != \"undefined\") {");
    out.println("            var root = tree.getRoot();");
    out.println("            if (respObj.root_nodes.length == 0) {");
    out.println("              //showEmptyRoot();");
    out.println("            }");
    out.println("            else {");
    out.println("              showPartialHierarchy();");
    out.println("              showConstructingTreeStatus();");
    out.println("");
    out.println("              for (var i=0; i < respObj.root_nodes.length; i++) {");
    out.println("                var nodeInfo = respObj.root_nodes[i];");
    out.println("                //var expand = false;");
    out.println("                addTreeBranch(ontology_node_id, root, nodeInfo);");
    out.println("              }");
    out.println("            }");
    out.println("          }");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("      var handleBuildTreeFailure = function(o) {");
    out.println("        alert('responseFailure: ' + o.statusText);");
    out.println("      }");
    out.println("");
    out.println("      var buildTreeCallback =");
    out.println("      {");
    out.println("        success:handleBuildTreeSuccess,");
    out.println("        failure:handleBuildTreeFailure");
    out.println("      };");
    out.println("");
    out.println("      if (ontology_display_name!='') {");
    out.println("        var ontology_source = null;//document.pg_form.ontology_source.value;");
    out.println("        var ontology_version = document.forms[\"pg_form\"].ontology_version.value;");
    out.println(
            "        var request = YAHOO.util.Connect.asyncRequest('GET','/ncitbrowser/ajax?action=search_vs_tree&ontology_node_id=' +ontology_node_id+'&ontology_display_name='+ontology_display_name+'&version='+ontology_version+'&ontology_source='+ontology_source,buildTreeCallback);");
    out.println("");
    out.println("      }");
    out.println("    }");
    out.println("");
    out.println("");
    out.println("");
    out.println("    function expandEntireTree() {");
    out.println("        tree = new YAHOO.widget.TreeView(\"treecontainer\");");
    out.println("        //tree.draw();");
    out.println("");
    out.println("        var ontology_display_name = document.forms[\"pg_form\"].ontology_display_name.value;");
    out.println("        var ontology_node_id = document.forms[\"pg_form\"].ontology_node_id.value;");
    out.println("");
    out.println("        var handleBuildTreeSuccess = function(o) {");
    out.println("");
    out.println("        var respTxt = o.responseText;");
    out.println("        var respObj = eval('(' + respTxt + ')');");
    out.println("        if ( typeof(respObj) != \"undefined\") {");
    out.println("");
    out.println("             if ( typeof(respObj.root_nodes) != \"undefined\") {");
    out.println("");
    out.println("                    //alert(respObj.root_nodes.length);");
    out.println("");
    out.println("                    var root = tree.getRoot();");
    out.println("          if (respObj.root_nodes.length == 0) {");
    out.println("            //showEmptyRoot();");
    out.println("          } else {");
    out.println("");
    out.println("");
    out.println("");
    out.println("");
    out.println("            for (var i=0; i < respObj.root_nodes.length; i++) {");
    out.println("          var nodeInfo = respObj.root_nodes[i];");
    out.println("                    //alert(\"calling addTreeBranch \");");
    out.println("");
    out.println("          addTreeBranch(ontology_node_id, root, nodeInfo);");
    out.println("            }");
    out.println("          }");
    out.println("              }");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("      var handleBuildTreeFailure = function(o) {");
    out.println("        alert('responseFailure: ' + o.statusText);");
    out.println("      }");
    out.println("");
    out.println("      var buildTreeCallback =");
    out.println("      {");
    out.println("        success:handleBuildTreeSuccess,");
    out.println("        failure:handleBuildTreeFailure");
    out.println("      };");
    out.println("");
    out.println("      if (ontology_display_name!='') {");
    out.println("        var ontology_source = null;");
    out.println("        var ontology_version = document.forms[\"pg_form\"].ontology_version.value;");
    out.println(
            "        var request = YAHOO.util.Connect.asyncRequest('GET','/ncitbrowser/ajax?action=expand_entire_vs_tree&ontology_node_id=' +ontology_node_id+'&ontology_display_name='+ontology_display_name+'&version='+ontology_version+'&ontology_source='+ontology_source,buildTreeCallback);");
    out.println("");
    out.println("      }");
    out.println("    }");
    out.println("");
    out.println("");

    /*
          out.println("function initialize_tree() {");
            
          out.println("    alert(\"onload\");");
            
          out.println("    tree = new YAHOO.widget.TreeView(\"treecontainer\");");
          out.println("    tree.expandAll();");
          out.println("    check_all();");
          out.println("    tree.draw();");
          out.println("}");
    */

    out.println("");
    out.println("");
    out.println("    function addTreeBranch(ontology_node_id, rootNode, nodeInfo) {");
    out.println(
            "      var newNodeDetails = \"javascript:onClickTreeNode('\" + nodeInfo.ontology_node_id + \"');\";");
    out.println("");
    out.println("      var newNodeData;");
    out.println("      if (ontology_node_id.indexOf(\"TVS_\") >= 0) {");
    out.println("          newNodeData = { label:nodeInfo.ontology_node_name, id:nodeInfo.ontology_node_id };");
    out.println("      } else {");
    out.println(
            "          newNodeData = { label:nodeInfo.ontology_node_name, id:nodeInfo.ontology_node_id, href:newNodeDetails };");
    out.println("      }");
    out.println("");
    out.println("      var expand = false;");
    out.println("      var childNodes = nodeInfo.children_nodes;");
    out.println("");
    out.println("      if (childNodes.length > 0) {");
    out.println("          expand = true;");
    out.println("      }");
    out.println("      var newNode = new YAHOO.widget.TaskNode(newNodeData, rootNode, expand);");
    out.println("      if (nodeInfo.ontology_node_id == ontology_node_id) {");
    out.println("          newNode.labelStyle = \"ygtvlabel_highlight\";");
    out.println("      }");
    out.println("");
    out.println("      if (nodeInfo.ontology_node_id == ontology_node_id) {");
    out.println("         newNode.isLeaf = true;");
    out.println("         if (nodeInfo.ontology_node_child_count > 0) {");
    out.println("             newNode.isLeaf = false;");
    out.println("             newNode.setDynamicLoad(loadNodeData);");
    out.println("         } else {");
    out.println("             tree.draw();");
    out.println("         }");
    out.println("");
    out.println("      } else {");
    out.println("          if (nodeInfo.ontology_node_id != ontology_node_id) {");
    out.println(
            "          if (nodeInfo.ontology_node_child_count == 0 && nodeInfo.ontology_node_id != ontology_node_id) {");
    out.println("        newNode.isLeaf = true;");
    out.println("          } else if (childNodes.length == 0) {");
    out.println("        newNode.setDynamicLoad(loadNodeData);");
    out.println("          }");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("      tree.draw();");
    out.println("      for (var i=0; i < childNodes.length; i++) {");
    out.println("         var childnodeInfo = childNodes[i];");
    out.println("         addTreeBranch(ontology_node_id, newNode, childnodeInfo);");
    out.println("      }");
    out.println("    }");
    out.println("    YAHOO.util.Event.addListener(window, \"load\", init);");
    out.println("");
    out.println("    YAHOO.util.Event.onDOMReady(initTree);");
    out.println("");
    out.println("");
    out.println("  </script>");
    out.println("");
    out.println("</head>");
    out.println("");
    //out.println("<body>");

    out.println("<body onLoad=\"document.forms.valueSetSearchForm.matchText.focus();\">");

    out.println("  <script type=\"text/javascript\" src=\"/ncitbrowser/js/wz_tooltip.js\"></script>");
    out.println("  <script type=\"text/javascript\" src=\"/ncitbrowser/js/tip_centerwindow.js\"></script>");
    out.println("  <script type=\"text/javascript\" src=\"/ncitbrowser/js/tip_followscroll.js\"></script>");

    out.println("  <!-- Begin Skip Top Navigation -->");
    out.println(
            "  <a href=\"#evs-content\" class=\"hideLink\" accesskey=\"1\" title=\"Skip repetitive navigation links\">skip navigation links</A>");
    out.println("  <!-- End Skip Top Navigation -->");
    out.println("");
    out.println("<!-- nci banner -->");
    out.println("<div class=\"ncibanner\">");
    out.println("  <a href=\"http://www.cancer.gov\" target=\"_blank\">");
    out.println("    <img src=\"/ncitbrowser/images/logotype.gif\"");
    out.println("      width=\"556\" height=\"39\" border=\"0\"");
    out.println("      alt=\"National Cancer Institute\"/>");
    out.println("  </a>");
    out.println("  <a href=\"http://www.cancer.gov\" target=\"_blank\">");
    out.println("    <img src=\"/ncitbrowser/images/spacer.gif\"");
    out.println("      width=\"60\" height=\"39\" border=\"0\"");
    out.println("      alt=\"National Cancer Institute\" class=\"print-header\"/>");
    out.println("  </a>");
    out.println("  <a href=\"http://www.nih.gov\" target=\"_blank\" >");
    out.println("    <img src=\"/ncitbrowser/images/tagline_nologo.gif\"");
    out.println("      width=\"219\" height=\"39\" border=\"0\"");
    out.println("      alt=\"U.S. National Institutes of Health\"/>");
    out.println("  </a>");
    out.println("  <a href=\"http://www.cancer.gov\" target=\"_blank\">");
    out.println("    <img src=\"/ncitbrowser/images/cancer-gov.gif\"");
    out.println("      width=\"125\" height=\"39\" border=\"0\"");
    out.println("      alt=\"www.cancer.gov\"/>");
    out.println("  </a>");
    out.println("</div>");
    out.println("<!-- end nci banner -->");
    out.println("");
    out.println("  <div class=\"center-page_960\">");
    out.println("    <!-- EVS Logo -->");
    out.println("<div>");

    // to be modified
    out.println("  <img src=\"/ncitbrowser/images/evs-logo-swapped.gif\" alt=\"EVS Logo\"");
    out.println("       width=\"941\" height=\"26\" border=\"0\"");
    out.println("       usemap=\"#external-evs\" />");
    out.println("  <map id=\"external-evs\" name=\"external-evs\">");
    out.println("    <area shape=\"rect\" coords=\"0,0,140,26\"");
    out.println("      href=\"/ncitbrowser/start.jsf\" target=\"_self\"");
    out.println("      alt=\"NCI Term Browser\" />");
    out.println("    <area shape=\"rect\" coords=\"520,0,745,26\"");
    out.println("      href=\"http://evs.nci.nih.gov/\" target=\"_blank\"");
    out.println("      alt=\"Enterprise Vocabulary Services\" />");
    out.println("  </map>");

    out.println("</div>");
    out.println("");
    out.println("");
    out.println("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">");
    out.println("  <tr>");
    out.println("    <td width=\"5\"></td>");

    //to be modified
    out.println("    <td><a href=\"/ncitbrowser/pages/multiple_search.jsf?nav_type=terminologies\">");
    out.println("      <img name=\"tab_terms\" src=\"/ncitbrowser/images/tab_terms_clicked.gif\"");
    out.println("        border=\"0\" alt=\"Terminologies\" title=\"Terminologies\" /></a></td>");

    //KLO 031214
    //out.println("    <td><a href=\"/ncitbrowser/ajax?action=create_src_vs_tree\">");
    out.println("    <td><a href=\"/ncitbrowser/ajax?action=create_src_vs_tree&nav_type=valuesets\">");
    out.println("      <img name=\"tab_valuesets\" src=\"/ncitbrowser/images/tab_valuesets.gif\"");
    out.println("        border=\"0\" alt=\"Value Sets\" title=\"ValueSets\" /></a></td>");
    out.println("    <td><a href=\"/ncitbrowser/pages/mapping_search.jsf?nav_type=mappings\">");
    out.println("      <img name=\"tab_map\" src=\"/ncitbrowser/images/tab_map.gif\"");
    out.println("        border=\"0\" alt=\"Mappings\" title=\"Mappings\" /></a></td>");

    out.println("  </tr>");
    out.println("</table>");

    out.println("");
    out.println(
            "<div class=\"mainbox-top\"><img src=\"/ncitbrowser/images/mainbox-top.gif\" width=\"945\" height=\"5\" alt=\"\"/></div>");
    out.println("<!-- end EVS Logo -->");
    out.println("    <!-- Main box -->");
    out.println("    <div id=\"main-area_960\">");
    out.println("");

    out.println("      <!-- Thesaurus, banner search area -->");
    out.println("      <div class=\"bannerarea_960\">");

    JSPUtils.JSPHeaderInfoMore info = new JSPUtils.JSPHeaderInfoMore(request);
    String scheme = info.dictionary;
    String term_browser_version = info.term_browser_version;
    String display_name = info.display_name;
    String basePath = request.getContextPath();

    String release_date = DataUtils.getVersionReleaseDate(scheme, version);
    if (dictionary != null && dictionary.compareTo("NCI Thesaurus") == 0) {

        out.println("<a href=\"/ncitbrowser/pages/home.jsf?version=" + version
                + "\" style=\"text-decoration: none;\">");
        out.println("   <div class=\"vocabularynamebanner_ncit\">");
        out.println("       <span class=\"vocabularynamelong_ncit\">Version: " + version + " (Release date: "
                + release_date + ")</span>");
        out.println("   </div>");
        out.println("</a>");

    } else {

        out.write("\r\n");
        out.write("\r\n");
        out.write("                ");
        if (version == null) {
            out.write("\r\n");
            out.write("                  <a class=\"vocabularynamebanner\" href=\"");
            out.print(request.getContextPath());
            out.write("/pages/vocabulary.jsf?dictionary=");
            out.print(HTTPUtils.cleanXSS(dictionary));
            out.write("\">\r\n");
            out.write("                ");
        } else {
            out.write("\r\n");
            out.write("                  <a class=\"vocabularynamebanner\" href=\"");
            out.print(request.getContextPath());
            out.write("/pages/vocabulary.jsf?dictionary=");
            out.print(HTTPUtils.cleanXSS(dictionary));
            out.write("&version=");
            out.print(HTTPUtils.cleanXSS(version));
            out.write("\">\r\n");
            out.write("                ");
        }
        out.write("\r\n");
        out.write("                    <div class=\"vocabularynamebanner\">\r\n");
        out.write("                      <div class=\"vocabularynameshort\" STYLE=\"font-size: ");
        out.print(HTTPUtils.maxFontSize(display_name));
        out.write("px; font-family : Arial\">\r\n");
        out.write("                          ");
        out.print(HTTPUtils.cleanXSS(display_name));
        out.write("\r\n");
        out.write("                      </div>\r\n");
        out.write("                      \r\n");

        boolean display_release_date = true;
        if (release_date == null || release_date.compareTo("") == 0) {
            display_release_date = false;
        }
        if (display_release_date) {

            out.write("\r\n");
            out.write("    <div class=\"vocabularynamelong\">Version: ");
            out.print(HTTPUtils.cleanXSS(term_browser_version));
            out.write(" (Release date: ");
            out.print(release_date);
            out.write(")</div>\r\n");

        } else {

            out.write("\r\n");
            out.write("    <div class=\"vocabularynamelong\">Version: ");
            out.print(HTTPUtils.cleanXSS(term_browser_version));
            out.write("</div>\r\n");

        }

        out.write("                    \r\n");
        out.write("                      \r\n");
        out.write("                    </div>\r\n");
        out.write("                  </a>\r\n");

    }

    out.println("        <div class=\"search-globalnav_960\">");
    out.println("          <!-- Search box -->");
    out.println(
            "          <div class=\"searchbox-top\"><img src=\"/ncitbrowser/images/searchbox-top.gif\" width=\"352\" height=\"2\" alt=\"SearchBox Top\" /></div>");
    out.println("          <div class=\"searchbox\">");
    out.println("");
    out.println("");

    out.println("<form id=\"valueSetSearchForm\" name=\"valueSetSearchForm\" method=\"post\" action=\""
            + contextPath
            + "/ajax?action=search_value_set\" class=\"search-form-main-area\" enctype=\"application/x-www-form-urlencoded;charset=UTF-8\">");

    out.println("<input type=\"hidden\" name=\"valueSetSearchForm\" value=\"valueSetSearchForm\" />");

    out.println("<input type=\"hidden\" name=\"view\" value=\"" + view_str + "\" />");

    String matchText = (String) request.getSession().getAttribute("matchText");
    if (DataUtils.isNull(matchText)) {
        matchText = "";
    }

    out.println("");
    out.println("");
    out.println("");
    out.println(
            "            <input type=\"hidden\" id=\"checked_vocabularies\" name=\"checked_vocabularies\" value=\"\" />");
    out.println(
            "            <input type=\"hidden\" id=\"partial_checked_vocabularies\" name=\"partial_checked_vocabularies\" value=\"\" />");
    out.println("");
    out.println("");
    out.println("");
    out.println("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin: 2px\" >");
    out.println("  <tr valign=\"top\" align=\"left\">");
    out.println("    <td align=\"left\" class=\"textbody\">");
    out.println("");
    out.println("                  <input CLASS=\"searchbox-input-2\"");
    out.println("                    name=\"matchText\"");
    out.println("                    value=\"" + matchText + "\"");
    out.println("                    onFocus=\"active = true\"");
    out.println("                    onBlur=\"active = false\"");
    out.println(
            "                    onkeypress=\"return submitEnter('valueSetSearchForm:valueset_search',event)\"");
    out.println("                    tabindex=\"1\"/>");
    out.println("");
    out.println("");
    out.println(
            "                <input id=\"valueSetSearchForm:valueset_search\" type=\"image\" src=\"/ncitbrowser/images/search.gif\" name=\"valueSetSearchForm:valueset_search\" alt=\"Search value sets containing matched concepts\" onclick=\"javascript:getCheckedVocabularies();\" tabindex=\"2\" class=\"searchbox-btn\" /><a href=\"/ncitbrowser/pages/help.jsf#searchhelp\" tabindex=\"3\"><img src=\"/ncitbrowser/images/search-help.gif\" alt=\"Search Help\" style=\"border-width:0;\" class=\"searchbox-btn\" /></a>");
    out.println("");
    out.println("");
    out.println("    </td>");
    out.println("  </tr>");
    out.println("");
    out.println("  <tr valign=\"top\" align=\"left\">");
    out.println("    <td>");
    out.println("      <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin: 0px\">");

    out.println("        <tr valign=\"top\" align=\"left\">");
    out.println("        <td align=\"left\" class=\"textbody\">");
    out.println(
            "                     <input type=\"radio\" name=\"valueset_search_algorithm\" value=\"contains\" alt=\"Contains\" "
                    + algorithm_contains + " tabindex=\"3\"  onclick=\"onVSAlgorithmChanged();\">Contains");
    out.println(
            "                     <input type=\"radio\" name=\"valueset_search_algorithm\" value=\"exactMatch\" alt=\"Exact Match\" "
                    + algorithm_exactMatch + " tabindex=\"3\">Exact Match&nbsp;");
    out.println(
            "                     <input type=\"radio\" name=\"valueset_search_algorithm\" value=\"startsWith\" alt=\"Begins With\" "
                    + algorithm_startsWith
                    + " tabindex=\"3\"  onclick=\"onVSAlgorithmChanged();\">Begins With&nbsp;");
    out.println("        </td>");
    out.println("        </tr>");
    out.println("");
    out.println("        <tr align=\"left\">");
    out.println("            <td height=\"1px\" bgcolor=\"#2F2F5F\" align=\"left\"></td>");
    out.println("        </tr>");
    out.println("        <tr valign=\"top\" align=\"left\">");
    out.println("          <td align=\"left\" class=\"textbody\">");
    out.println(
            "                <input type=\"radio\" id=\"selectValueSetSearchOption\" name=\"selectValueSetSearchOption\" value=\"Name\" "
                    + option_name + " alt=\"Name\" checked tabindex=\"4\"  >Name&nbsp;");
    out.println(
            "                <input type=\"radio\" id=\"selectValueSetSearchOption\" name=\"selectValueSetSearchOption\" value=\"Code\" "
                    + option_code
                    + " alt=\"Code\" tabindex=\"4\" onclick=\"onVSCodeButtonPressed();\">Code&nbsp;");
    out.println("          </td>");
    out.println("        </tr>");

    out.println("      </table>");
    out.println("    </td>");
    out.println("  </tr>");
    out.println("</table>");
    out.println(
            "                <input type=\"hidden\" name=\"referer\" id=\"referer\" value=\"http%3A%2F%2Flocalhost%3A8080%2Fncitbrowser%2Fpages%2Fresolved_value_set_search_results.jsf\">");
    out.println(
            "                <input type=\"hidden\" id=\"nav_type\" name=\"nav_type\" value=\"valuesets\" />");
    out.println("                <input type=\"hidden\" id=\"view\" name=\"view\" value=\"source\" />");

    out.println(
            "            <input type=\"hidden\" id=\"ontology_display_name\" name=\"ontology_display_name\" value=\""
                    + dictionary + "\" />");
    out.println(
            "            <input type=\"hidden\" id=\"schema\" name=\"schema\" value=\"" + dictionary + "\" />");
    out.println("            <input type=\"hidden\" id=\"ontology_version\" name=\"ontology_version\" value=\""
            + version + "\" />");

    out.println("");
    out.println(
            "<input type=\"hidden\" name=\"javax.faces.ViewState\" id=\"javax.faces.ViewState\" value=\"j_id22:j_id23\" />");
    out.println("</form>");

    //addHiddenForm(out, checked_vocabularies, partial_checked_vocabularies);

    out.println("          </div> <!-- searchbox -->");
    out.println("");
    out.println(
            "          <div class=\"searchbox-bottom\"><img src=\"/ncitbrowser/images/searchbox-bottom.gif\" width=\"352\" height=\"2\" alt=\"SearchBox Bottom\" /></div>");
    out.println("          <!-- end Search box -->");

    out.println("          <!-- Global Navigation -->");
    out.println("");

    boolean hasValueSet = ValueSetHierarchy.hasValueSet(scheme);
    boolean hasMapping = DataUtils.hasMapping(scheme);

    boolean tree_access_allowed = true;
    if (DataUtils.get_vocabulariesWithoutTreeAccessHashSet().contains(scheme)) {
        tree_access_allowed = false;
    }
    boolean vocabulary_isMapping = DataUtils.isMapping(scheme, null);

    out.write(
            "                  <table class=\"global-nav\" border=\"0\" width=\"100%\" height=\"30px\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
    out.write("                    <tr>\r\n");
    out.write("                      <td valign=\"bottom\">\r\n");
    out.write("                         ");
    Boolean[] isPipeDisplayed = new Boolean[] { Boolean.FALSE };
    out.write("\r\n");
    out.write("                         ");
    if (vocabulary_isMapping) {
        out.write("\r\n");
        out.write("                              ");
        out.print(JSPUtils.getPipeSeparator(isPipeDisplayed));
        out.write("\r\n");
        out.write("                              <a href=\"");
        out.print(request.getContextPath());
        out.write("/pages/mapping.jsf?dictionary=");
        out.print(HTTPUtils.cleanXSS(scheme));
        out.write("&version=");
        out.print(version);
        out.write("\">\r\n");
        out.write("                                Mapping\r\n");
        out.write("                              </a>\r\n");
        out.write("                         ");
    } else if (tree_access_allowed) {
        out.write("\r\n");
        out.write("                              ");
        out.print(JSPUtils.getPipeSeparator(isPipeDisplayed));
        out.write("\r\n");
        out.write("                              <a href=\"#\" onclick=\"javascript:window.open('");
        out.print(request.getContextPath());
        out.write("/pages/hierarchy.jsf?dictionary=");
        out.print(HTTPUtils.cleanXSS(scheme));
        out.write("&version=");
        out.print(HTTPUtils.cleanXSS(version));
        out.write(
                "', '_blank','top=100, left=100, height=740, width=680, status=no, menubar=no, resizable=yes, scrollbars=yes, toolbar=no, location=no, directories=no');\" tabindex=\"12\">\r\n");
        out.write("                                Hierarchy </a>\r\n");
        out.write("                         ");
    }
    out.write("       \r\n");
    out.write("                                \r\n");
    out.write("                                \r\n");
    out.write("      ");
    if (hasValueSet) {
        out.write("\r\n");
        out.write("        ");
        out.print(JSPUtils.getPipeSeparator(isPipeDisplayed));
        out.write("\r\n");
        out.write("        <!--\r\n");
        out.write("        <a href=\"");
        out.print(request.getContextPath());
        out.write("/pages/value_set_hierarchy.jsf?dictionary=");
        out.print(HTTPUtils.cleanXSS(scheme));
        out.write("&version=");
        out.print(HTTPUtils.cleanXSS(version));
        out.write("\" tabindex=\"15\">Value Sets</a>\r\n");
        out.write("        -->\r\n");
        out.write("        <a href=\"");
        out.print(request.getContextPath());
        out.write("/ajax?action=create_cs_vs_tree&dictionary=");
        out.print(HTTPUtils.cleanXSS(scheme));
        out.write("&version=");
        out.print(HTTPUtils.cleanXSS(version));
        out.write("\" tabindex=\"15\">Value Sets</a>\r\n");
        out.write("\r\n");
        out.write("\r\n");
        out.write("      ");
    }
    out.write("\r\n");
    out.write("      \r\n");
    out.write("      ");
    if (hasMapping) {
        out.write("\r\n");
        out.write("          ");
        out.print(JSPUtils.getPipeSeparator(isPipeDisplayed));
        out.write("\r\n");
        out.write("          <a href=\"");
        out.print(request.getContextPath());
        out.write("/pages/cs_mappings.jsf?dictionary=");
        out.print(HTTPUtils.cleanXSS(scheme));
        out.write("&version=");
        out.print(HTTPUtils.cleanXSS(version));
        out.write("\" tabindex=\"15\">Maps</a>      \r\n");
        out.write("      ");
    }

    String cart_size = (String) request.getSession().getAttribute("cart_size");
    if (!DataUtils.isNull(cart_size)) {
        out.write("|");
        out.write("                        <a href=\"");
        out.print(request.getContextPath());
        out.write("/pages/cart.jsf\" tabindex=\"16\">Cart</a>\r\n");
    }

    out.write("                         ");
    out.print(VisitedConceptUtils.getDisplayLink(request, isPipeDisplayed));
    out.write("\r\n");
    out.write("                      </td>\r\n");
    out.write("                      <td align=\"right\" valign=\"bottom\">\r\n");
    out.write("                        <a href=\"");
    out.print(request.getContextPath());
    out.write("/pages/help.jsf\" tabindex=\"16\">Help</a>\r\n");
    out.write("                      </td>\r\n");

    out.write("                      <td width=\"7\" valign=\"bottom\"></td>\r\n");
    out.write("                    </tr>\r\n");
    out.write("                  </table>\r\n");

    out.println("          <!-- end Global Navigation -->");
    out.println("");
    out.println("        </div> <!-- search-globalnav -->");
    out.println("      </div> <!-- bannerarea -->");
    out.println("");
    out.println("      <!-- end Thesaurus, banner search area -->");
    out.println("      <!-- Quick links bar -->");
    out.println("");
    out.println("<div class=\"bluebar\">");
    out.println("  <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
    out.println("  <tr>");
    out.println("    <td><div class=\"quicklink-status\">&nbsp;</div></td>");
    out.println("    <td>");
    out.println("");

    addQuickLink(request, out);

    out.println("");
    out.println("      </td>");
    out.println("    </tr>");
    out.println("  </table>");
    out.println("");
    out.println("</div>");

    if (!ServerMonitorThread.getInstance().isLexEVSRunning()) {
        out.println("    <div class=\"redbar\">");
        out.println("      <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
        out.println("        <tr>");
        out.println("          <td class=\"lexevs-status\">");
        out.println("            " + ServerMonitorThread.getInstance().getMessage());
        out.println("          </td>");
        out.println("        </tr>");
        out.println("      </table>");
        out.println("    </div>");
    }

    out.println("      <!-- end Quick links bar -->");
    out.println("");
    out.println("      <!-- Page content -->");
    out.println("      <div class=\"pagecontent\">");
    out.println("");

    if (!DataUtils.isNullOrBlank(message)) {
        out.println("\r\n");
        out.println("      <p class=\"textbodyred\">");
        out.print(message);
        out.println("</p>\r\n");
        out.println("    ");
        request.getSession().removeAttribute("message");
    }

    out.println("");
    out.println("        <div id=\"popupContentArea\">");
    out.println("          <a name=\"evs-content\" id=\"evs-content\"></a>");
    out.println("");
    out.println("          <table width=\"580px\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">");
    out.println("");
    out.println("");
    out.println("");
    out.println("");
    out.println("            <tr class=\"textbody\">");
    out.println("              <td class=\"textbody\" align=\"left\">");
    out.println("");

    out.println("              </td>");
    out.println("");
    out.println("              <td align=\"right\">");
    out.println("               <font size=\"1\" color=\"red\" align=\"right\">");
    out.println(
            "                 <a href=\"javascript:printPage()\"><img src=\"/ncitbrowser/images/printer.bmp\" border=\"0\" alt=\"Send to Printer\"><i>Send to Printer</i></a>");
    out.println("               </font>");

    out.println("              </td>");
    out.println("            </tr>");
    out.println("          </table>");
    out.println("");
    out.println("          <hr/>");
    out.println("");
    out.println("");
    out.println("");
    out.println("<style>");
    out.println(
            "#expandcontractdiv {border:1px solid #336600; background-color:#FFFFCC; margin:0 0 .5em 0; padding:0.2em;}");
    out.println("#treecontainer { background: #fff }");
    out.println("</style>");
    out.println("");
    out.println("");
    out.println("<div id=\"expandcontractdiv\">");
    out.println("   <a id=\"expand_all\" href=\"#\" tabindex=\"101\" >Expand all</a>");
    out.println("   <a id=\"collapse_all\" href=\"#\" tabindex=\"102\">Collapse all</a>");
    out.println("   <a id=\"check_all\" href=\"#\" tabindex=\"103\">Check all</a>");
    out.println("   <a id=\"uncheck_all\" href=\"#\" tabindex=\"104\">Uncheck all</a>");
    out.println("</div>");
    out.println("");
    out.println("");
    out.println("");
    out.println("          <!-- Tree content -->");
    out.println("");
    out.println("          <div id=\"treecontainer\" class=\"ygtv-checkbox\"></div>");
    out.println("");
    out.println("          <form id=\"pg_form\" enctype=\"application/x-www-form-urlencoded;charset=UTF-8\">");
    out.println("");
    out.println(
            "            <input type=\"hidden\" id=\"ontology_node_id\" name=\"ontology_node_id\" value=\"null\" />");
    out.println(
            "            <input type=\"hidden\" id=\"ontology_display_name\" name=\"ontology_display_name\" value=\""
                    + dictionary + "\" />");
    out.println(
            "            <input type=\"hidden\" id=\"schema\" name=\"schema\" value=\"" + dictionary + "\" />");
    out.println("            <input type=\"hidden\" id=\"ontology_version\" name=\"ontology_version\" value=\""
            + version + "\" />");
    out.println("            <input type=\"hidden\" id=\"view\" name=\"view\" value=\"source\" />");
    out.println("          </form>");
    out.println("");

    out.println("");
    out.println("        </div> <!-- popupContentArea -->");

    out.println("");
    out.println("");
    out.println("<div class=\"textbody\">");
    out.println("<!-- footer -->");
    out.println("<div class=\"footer\" style=\"width:920px\">");
    out.println("  <ul>");
    out.println(
            "    <li><a href=\"http://www.cancer.gov\" target=\"_blank\" alt=\"National Cancer Institute\">NCI Home</a> |</li>");
    out.println("    <li><a href=\"/ncitbrowser/pages/contact_us.jsf\">Contact Us</a> |</li>");
    out.println(
            "    <li><a href=\"http://www.cancer.gov/policies\" target=\"_blank\" alt=\"National Cancer Institute Policies\">Policies</a> |</li>");
    out.println(
            "    <li><a href=\"http://www.cancer.gov/policies/page3\" target=\"_blank\" alt=\"National Cancer Institute Accessibility\">Accessibility</a> |</li>");
    out.println(
            "    <li><a href=\"http://www.cancer.gov/policies/page6\" target=\"_blank\" alt=\"National Cancer Institute FOIA\">FOIA</a></li>");
    out.println("  </ul>");
    out.println("  <p>");
    out.println("    A Service of the National Cancer Institute<br />");
    out.println("    <img src=\"/ncitbrowser/images/external-footer-logos.gif\"");
    out.println("      alt=\"External Footer Logos\" width=\"238\" height=\"34\" border=\"0\"");
    out.println("      usemap=\"#external-footer\" />");
    out.println("  </p>");
    out.println("  <map id=\"external-footer\" name=\"external-footer\">");
    out.println("    <area shape=\"rect\" coords=\"0,0,46,34\"");
    out.println("      href=\"http://www.cancer.gov\" target=\"_blank\"");
    out.println("      alt=\"National Cancer Institute\" />");
    out.println("    <area shape=\"rect\" coords=\"55,1,99,32\"");
    out.println("      href=\"http://www.hhs.gov/\" target=\"_blank\"");
    out.println("      alt=\"U.S. Health &amp; Human Services\" />");
    out.println("    <area shape=\"rect\" coords=\"103,1,147,31\"");
    out.println("      href=\"http://www.nih.gov/\" target=\"_blank\"");
    out.println("      alt=\"National Institutes of Health\" />");
    out.println("    <area shape=\"rect\" coords=\"148,1,235,33\"");
    out.println("      href=\"http://www.usa.gov/\" target=\"_blank\"");
    out.println("      alt=\"USA.gov\" />");
    out.println("  </map>");
    out.println("</div>");
    out.println("<!-- end footer -->");
    out.println("</div>");
    out.println("");
    out.println("");
    out.println("      </div> <!-- pagecontent -->");
    out.println("    </div> <!--  main-area -->");
    out.println(
            "    <div class=\"mainbox-bottom\"><img src=\"/ncitbrowser/images/mainbox-bottom.gif\" width=\"945\" height=\"5\" alt=\"Mainbox Bottom\" /></div>");
    out.println("");
    out.println("  </div> <!-- center-page -->");
    out.println("");

    addHiddenForm(out, checked_vocabularies, partial_checked_vocabularies);

    out.println("</body>");
    out.println("</html>");
    out.println("");
}

From source file:gov.nih.nci.evs.browser.utils.SearchUtils.java

public ResolvedConceptReferencesIterator findConceptWithSourceCodeMatching(String scheme, String version,
        String sourceAbbr, String code, int maxToReturn, boolean searchInactive) {
    if (sourceAbbr == null || code == null)
        return null;
    ResolvedConceptReferencesIterator matchIterator = null;

    LexBIGService lbSvc = new RemoteServerUtil().createLexBIGService();
    CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
    versionOrTag.setVersion(version);/*  w ww  .j  av  a  2s. c  om*/

    if (lbSvc == null) {
        _logger.warn("lbSvc = null");
        return null;
    }

    LocalNameList contextList = null;
    NameAndValueList qualifierList = null;

    Vector<String> v = null;

    //if (code != null && code.compareTo("") != 0) {
    if (code.compareTo("") != 0) {
        qualifierList = new NameAndValueList();
        NameAndValue nv = new NameAndValue();
        nv.setName("source-code");
        nv.setContent(code);
        qualifierList.addNameAndValue(nv);
    }

    LocalNameList propertyLnL = null;
    // sourceLnL
    Vector<String> w2 = new Vector<String>();
    w2.add(sourceAbbr);
    LocalNameList sourceLnL = vector2LocalNameList(w2);
    if (sourceAbbr.compareTo("*") == 0 || sourceAbbr.compareToIgnoreCase("ALL") == 0) {
        sourceLnL = null;
    }

    SortOptionList sortCriteria = null;// Constructors.createSortOptionList(new
                                       // String[]{"matchToQuery", "code"});
    try {
        CodedNodeSet cns = lbSvc.getCodingSchemeConcepts(scheme, null);
        if (cns == null) {
            _logger.warn("lbSvc.getCodingSchemeConceptsd returns null");
            return null;
        }
        CodedNodeSet.PropertyType[] types = new PropertyType[] { PropertyType.PRESENTATION };
        cns = cns.restrictToProperties(propertyLnL, types, sourceLnL, contextList, qualifierList);

        if (cns != null) {
            boolean activeOnly = !searchInactive;
            cns = restrictToActiveStatus(cns, activeOnly);

            try {
                matchIterator = cns.resolve(sortCriteria, null, null);// ConvenienceMethods.createLocalNameList(getPropertyForCodingScheme(cs)),null);
            } catch (Exception ex) {

            }
        }

    } catch (Exception e) {
        return null;
    }
    return matchIterator;
}

From source file:gov.nih.nci.evs.browser.utils.DataUtils.java

public HashMap getRelationshipHashMap(String scheme, String version, String code, String sab) {
    // EVSApplicationService lbSvc = new
    // RemoteServerUtil().createLexBIGService();
    LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();

    CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
    if (version != null)
        csvt.setVersion(version);//from   w w  w  . j  a  va  2s . com

    // Perform the query ...
    ResolvedConceptReferenceList matches = null;

    //List list = new ArrayList();// getSupportedRoleNames(lbSvc, scheme,
    // version);

    ArrayList roleList = new ArrayList();
    ArrayList associationList = new ArrayList();
    ArrayList superconceptList = new ArrayList();
    ArrayList siblingList = new ArrayList();
    ArrayList subconceptList = new ArrayList();
    ArrayList btList = new ArrayList();
    ArrayList ntList = new ArrayList();

    Vector parent_asso_vec = new Vector(Arrays.asList(_hierAssocToParentNodes));
    Vector child_asso_vec = new Vector(Arrays.asList(_hierAssocToChildNodes));
    Vector sibling_asso_vec = new Vector(Arrays.asList(_assocToSiblingNodes));
    Vector bt_vec = new Vector(Arrays.asList(_assocToBTNodes));
    Vector nt_vec = new Vector(Arrays.asList(_assocToNTNodes));

    HashMap map = new HashMap();
    try {
        // LexBIGServiceConvenienceMethods lbscm =
        // createLexBIGServiceConvenienceMethods(lbSvc);
        /*
         * LexBIGServiceConvenienceMethods lbscm =
         * (LexBIGServiceConvenienceMethods) lbSvc
         * .getGenericExtension("LexBIGServiceConvenienceMethods");
         * lbscm.setLexBIGService(lbSvc);
         */
        CodedNodeGraph cng = lbSvc.getNodeGraph(scheme, csvt, null);

        if (sab != null) {
            cng = cng.restrictToAssociations(null, Constructors.createNameAndValueList(sab, SOURCE));
        }

        int maxToReturn = NCImBrowserProperties.get_maxToReturn();
        matches = cng.resolveAsList(ConvenienceMethods.createConceptReference(code, scheme), true, false, 1, 1,
                _noopList, null, null, null, maxToReturn, false);

        if (matches.getResolvedConceptReferenceCount() > 0) {
            Enumeration<ResolvedConceptReference> refEnum = (Enumeration<ResolvedConceptReference>) matches
                    .enumerateResolvedConceptReference();

            while (refEnum.hasMoreElements()) {
                ResolvedConceptReference ref = refEnum.nextElement();
                AssociationList sourceof = ref.getSourceOf();
                Association[] associations = sourceof.getAssociation();

                for (int i = 0; i < associations.length; i++) {
                    Association assoc = associations[i];
                    String associationName = assoc.getAssociationName();
                    // String associationName =
                    // lbscm.getAssociationNameFromAssociationCode(scheme,
                    // csvt, assoc.getAssociationName());
                    AssociatedConcept[] acl = assoc.getAssociatedConcepts().getAssociatedConcept();
                    for (int j = 0; j < acl.length; j++) {
                        AssociatedConcept ac = acl[j];
                        EntityDescription ed = ac.getEntityDescription();

                        String name = "No Description";
                        if (ed != null)
                            name = ed.getContent();
                        String pt = name;
                        if (associationName.compareToIgnoreCase("equivalentClass") != 0) {
                            String s = associationName + "|" + pt + "|" + ac.getConceptCode();
                            if (!parent_asso_vec.contains(associationName)
                                    && !child_asso_vec.contains(associationName)) {
                                if (sibling_asso_vec.contains(associationName)) {
                                    siblingList.add(s);
                                } else if (bt_vec.contains(associationName)) {
                                    btList.add(s);
                                } else if (nt_vec.contains(associationName)) {
                                    ntList.add(s);
                                } else {
                                    associationList.add(s);
                                }
                            }
                        }
                    }
                }
            }
        }

        if (roleList.size() > 0) {
            SortUtils.quickSort(roleList);
        }

        if (associationList.size() > 0) {
            // KLO, 052909
            associationList = removeRedundantRelationships(associationList, "RO");
            SortUtils.quickSort(associationList);
        }

        if (siblingList.size() > 0) {
            SortUtils.quickSort(siblingList);
        }
        if (btList.size() > 0) {
            SortUtils.quickSort(btList);
        }

        if (ntList.size() > 0) {
            SortUtils.quickSort(ntList);
        }

        map.put(TYPE_ROLE, roleList);
        map.put(TYPE_ASSOCIATION, associationList);
        map.put(TYPE_SIBLINGCONCEPT, siblingList);
        map.put(TYPE_BROADERCONCEPT, btList);
        map.put(TYPE_NARROWERCONCEPT, ntList);

        Vector superconcept_vec = getSuperconcepts(scheme, version, code);
        for (int i = 0; i < superconcept_vec.size(); i++) {
            Entity c = (Entity) superconcept_vec.elementAt(i);
            // String pt = getPreferredName(c);
            String pt = c.getEntityDescription().getContent();
            superconceptList.add(pt + "|" + c.getEntityCode());
        }

        SortUtils.quickSort(superconceptList);
        map.put(TYPE_SUPERCONCEPT, superconceptList);

        Vector subconcept_vec = getSubconcepts(scheme, version, code);
        for (int i = 0; i < subconcept_vec.size(); i++) {
            Entity c = (Entity) subconcept_vec.elementAt(i);
            // String pt = getPreferredName(c);
            String pt = c.getEntityDescription().getContent();
            subconceptList.add(pt + "|" + c.getEntityCode());
        }
        SortUtils.quickSort(subconceptList);
        map.put(TYPE_SUBCONCEPT, subconceptList);

    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return map;
}

From source file:org.regenstrief.util.Util.java

/**
 * Retrieves a comparison of two Strings
 * /*from  ww w  .  j a v  a  2s.c o m*/
 * @param c1 the first String
 * @param c2 the second String
 * @return -1 if c1 comes before c2, +1 if c2 comes first, otherwise 0
 **/
public final static int compareToIgnoreCase(final String c1, final String c2) {
    if (c1 == null) {
        return c2 == null ? 0 : 1;
    }
    return c2 == null ? -1 : c1.compareToIgnoreCase(c2);
}

From source file:com.ah.ui.actions.monitor.ClientMonitorAction.java

public List<String> getFilterList() {
    // Map<String, List> filterMap = (Map<String, List>) MgrUtil
    // .getSessionAttribute(MANAGED_ACTIVECLIENT_FILTERS);
    // if (null != filterMap) {
    // return new ArrayList<String>(filterMap.keySet());
    // }//from   ww w.j  ava2s. c om
    // return new ArrayList<String>();
    List<String> filterMap = (List<String>) QueryUtil.executeQuery(
            "select filterName from " + ActiveClientFilter.class.getSimpleName(), null,
            new FilterParams("userName", getUserContext().getUserName()), domainId);

    // order by name
    Collections.sort(filterMap, new Comparator<String>() {
        @Override
        public int compare(String o1, String o2) {
            return o1.compareToIgnoreCase(o2);
        }
    });
    return filterMap;
}

From source file:com.sentaroh.android.SMBExplorer.SMBExplorerMain.java

private void showFileListCache(final ArrayList<FileListCacheItem> fcl, final FileListAdapter fla,
        final ListView flv, final Spinner spinner) {
    // ??/*from   w  w  w . j  av  a2  s  . co m*/
    final Dialog dialog = new Dialog(this);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setContentView(R.layout.select_file_cache_dlg);
    //      final Button btnOk = 
    //            (Button) dialog.findViewById(R.id.select_file_cache_dlg_ok);
    final Button btnCancel = (Button) dialog.findViewById(R.id.select_file_cache_dlg_cancel);

    CommonDialog.setDlgBoxSizeCompact(dialog);

    ((TextView) dialog.findViewById(R.id.select_file_cache_dlg_title)).setText("Select file cache");

    ListView lv = (ListView) dialog.findViewById(R.id.select_file_cache_dlg_listview);

    final ArrayList<String> list = new ArrayList<String>();
    for (int i = 0; i < fcl.size(); i++) {
        list.add(fcl.get(i).directory);
    }
    Collections.sort(list, new Comparator<String>() {
        @Override
        public int compare(String lhs, String rhs) {
            return lhs.compareToIgnoreCase(rhs);
        }
    });
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(mContext, R.layout.simple_list_item_1o, list);
    lv.setAdapter(adapter);

    lv.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            String t_dir = list.get(position);
            FileListCacheItem dhi = getFileListCache(t_dir, fcl);
            if (dhi != null) {
                mIgnoreSpinnerSelection = true;
                int s_no = -1;
                for (int i = 0; i < spinner.getCount(); i++) {
                    if (spinner.getItemAtPosition(i).toString().equals(dhi.profile_name)) {
                        s_no = i;
                        break;
                    }
                }
                fla.setDataList(dhi.file_list);
                fla.notifyDataSetChanged();
                if (currentTabName.equals(SMBEXPLORER_TAB_LOCAL)) {
                    localBase = dhi.base;
                    if (dhi.base.equals(dhi.directory))
                        localDir = "";
                    else
                        localDir = dhi.directory.replace(localBase + "/", "");
                    replaceDirHist(localDirHist, dhi.directory_history);
                    setFilelistCurrDir(localFileListDirSpinner, localBase, localDir);
                    setFileListPathName(localFileListPathBtn, localFileListCache, localBase, localDir);
                    setEmptyFolderView();
                    localCurrFLI = dhi;
                    flv.setSelection(0);
                    for (int j = 0; j < localFileListView.getChildCount(); j++)
                        localFileListView.getChildAt(j).setBackgroundColor(Color.TRANSPARENT);
                    localFileListReloadBtn.performClick();
                } else if (currentTabName.equals(SMBEXPLORER_TAB_REMOTE)) {
                    remoteBase = dhi.base;
                    if (dhi.base.equals(dhi.directory))
                        remoteDir = "";
                    else
                        remoteDir = dhi.directory.replace(remoteBase + "/", "");
                    replaceDirHist(remoteDirHist, dhi.directory_history);
                    setFilelistCurrDir(remoteFileListDirSpinner, remoteBase, remoteDir);
                    setFileListPathName(remoteFileListPathBtn, remoteFileListCache, remoteBase, remoteDir);
                    setEmptyFolderView();
                    remoteCurrFLI = dhi;
                    flv.setSelection(0);

                    //                  Log.v("","base="+remoteBase+", dir="+remoteDir+", histsz="+remoteDirHist.size());
                    for (int j = 0; j < remoteFileListView.getChildCount(); j++)
                        remoteFileListView.getChildAt(j).setBackgroundColor(Color.TRANSPARENT);
                    if (remoteDir.equals("")) {
                        remoteFileListTopBtn.setEnabled(false);
                        remoteFileListUpBtn.setEnabled(false);
                    } else {
                        remoteFileListTopBtn.setEnabled(true);
                        remoteFileListUpBtn.setEnabled(true);
                    }
                }

                if (s_no != -1)
                    spinner.setSelection(s_no);
                Handler hndl = new Handler();
                hndl.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        mIgnoreSpinnerSelection = false;
                    }
                }, 100);
                dialog.dismiss();
            }
        }
    });

    btnCancel.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            dialog.dismiss();
        }
    });

    dialog.show();

}

From source file:org.sintef.thingml.ThingMLPanel.java

public ThingMLPanel(Boolean ArduinoPlugin, final ObservableString transferBuf) {
    try {//from www .j  a v a2  s. com
        this.setLayout(new BorderLayout());
        jsyntaxpane.DefaultSyntaxKit.initKit();
        jsyntaxpane.DefaultSyntaxKit.registerContentType("text/thingml",
                Class.forName("org.sintef.thingml.ThingMLJSyntaxKit").getName());
        JScrollPane scrPane = new JScrollPane(codeEditor);
        codeEditor.setContentType("text/thingml; charset=UTF-8");

        Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
        reg.getExtensionToFactoryMap().put("thingml", new ThingmlResourceFactory());

        //codeEditor.setBackground(Color.LIGHT_GRAY)

        JMenuBar menubar = new JMenuBar();
        JInternalFrame menuframe = new JInternalFrame();

        menuframe.setSize(getWidth(), getHeight());
        menuframe.setJMenuBar(menubar);

        menuframe.setLayout(new BorderLayout());
        menuframe.add(scrPane, BorderLayout.CENTER);

        if (!ArduinoPlugin) {
            try {
                this.transferBuf = transferBuf;
                EditorKit editorKit = codeEditor.getEditorKit();
                JToolBar toolPane = new JToolBar();
                ((ThingMLJSyntaxKit) editorKit).addToolBarActions(codeEditor, toolPane);
                menuframe.add(toolPane, BorderLayout.NORTH);
            } catch (Exception e) {
                if (ThingMLApp.debug)
                    e.printStackTrace();
            }
        }

        menuframe.setVisible(true);
        ((BasicInternalFrameUI) menuframe.getUI()).setNorthPane(null);
        menuframe.setBorder(BorderFactory.createEmptyBorder());
        add(menuframe, BorderLayout.CENTER);

        if (!ArduinoPlugin) {//FIXME: Nicolas, avoid code duplication
            final ThingMLCompilerRegistry registry = ThingMLCompilerRegistry.getInstance();

            JMenu newCompilersMenu = new JMenu("Compile to");
            for (final String id : registry.getCompilerIds()) {
                JMenuItem item = new JMenuItem(id);
                ThingMLCompiler c = registry.createCompilerInstanceByName(id);
                if (c.getConnectorCompilers().size() > 0) {
                    JMenu compilerMenu = new JMenu(c.getID());
                    newCompilersMenu.add(compilerMenu);
                    compilerMenu.add(item);
                    for (final Map.Entry<String, CfgExternalConnectorCompiler> connectorCompiler : c
                            .getConnectorCompilers().entrySet()) {
                        JMenuItem connectorMenu = new JMenuItem(connectorCompiler.getKey());
                        compilerMenu.add(connectorMenu);
                        connectorMenu.addActionListener(new ActionListener() {
                            @Override
                            public void actionPerformed(ActionEvent e) {
                                ThingMLModel thingmlModel = ThingMLCompiler.loadModel(targetFile);
                                for (Configuration cfg : ThingMLHelpers.allConfigurations(thingmlModel)) {
                                    final ThingMLCompiler compiler = registry.createCompilerInstanceByName(id);
                                    for (NetworkPlugin np : loadedPlugins) {
                                        if (np.getTargetedLanguages().contains(compiler.getID())) {
                                            compiler.addNetworkPlugin(np);
                                        }
                                    }
                                    for (SerializationPlugin sp : loadedSerPlugins) {
                                        if (sp.getTargetedLanguages().contains(compiler.getID())) {
                                            compiler.addSerializationPlugin(sp);
                                        }
                                    }
                                    compiler.setOutputDirectory(new File(System.getProperty("java.io.tmpdir")
                                            + "/ThingML_temp/" + cfg.getName()));
                                    compiler.compileConnector(connectorCompiler.getKey(), cfg);
                                }
                            }
                        });
                    }
                } else {
                    newCompilersMenu.add(item);
                }

                item.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        System.out.println("Input file : " + targetFile);
                        if (targetFile == null)
                            return;
                        try {
                            ThingMLModel thingmlModel = ThingMLCompiler.loadModel(targetFile);
                            if (thingmlModel != null) {
                                for (Configuration cfg : ThingMLHelpers.allConfigurations(thingmlModel)) {
                                    final ThingMLCompiler compiler = registry.createCompilerInstanceByName(id);
                                    for (NetworkPlugin np : loadedPlugins) {
                                        if (np.getTargetedLanguages().contains(compiler.getID())) {
                                            compiler.addNetworkPlugin(np);
                                        }
                                    }
                                    for (SerializationPlugin sp : loadedSerPlugins) {
                                        if (sp.getTargetedLanguages().contains(compiler.getID())) {
                                            compiler.addSerializationPlugin(sp);
                                        }
                                    }
                                    compiler.setOutputDirectory(new File(System.getProperty("java.io.tmpdir")
                                            + "/ThingML_temp/" + cfg.getName()));
                                    compiler.compile(cfg);
                                }
                            }
                        } catch (Exception ex) {
                            if (ThingMLApp.debug)
                                ex.printStackTrace();
                        }
                    }
                });
                c = null;
            }

            menubar.add(newCompilersMenu);
        } else {

            final ThingMLCompilerRegistry registry = ThingMLCompilerRegistry.getInstance();

            JMenu newCompilersMenu = new JMenu("Compile to");
            for (final String id : registry.getCompilerIds()) {
                if (id.compareToIgnoreCase("arduino") == 0) {
                    JMenuItem item = new JMenuItem(id);
                    ThingMLCompiler c = registry.createCompilerInstanceByName(id);
                    if (c.getConnectorCompilers().size() > 0) {
                        JMenu compilerMenu = new JMenu(c.getID());
                        newCompilersMenu.add(compilerMenu);
                        compilerMenu.add(item);
                        for (final Map.Entry<String, CfgExternalConnectorCompiler> connectorCompiler : c
                                .getConnectorCompilers().entrySet()) {
                            JMenuItem connectorMenu = new JMenuItem(connectorCompiler.getKey());
                            compilerMenu.add(connectorMenu);
                            connectorMenu.addActionListener(new ActionListener() {
                                @Override
                                public void actionPerformed(ActionEvent e) {
                                    ThingMLModel thingmlModel = ThingMLCompiler.loadModel(targetFile);
                                    for (Configuration cfg : ThingMLHelpers.allConfigurations(thingmlModel)) {
                                        final ThingMLCompiler compiler = registry
                                                .createCompilerInstanceByName(id);
                                        for (NetworkPlugin np : loadedPlugins) {
                                            if (np.getTargetedLanguages().contains(compiler.getID())) {
                                                compiler.addNetworkPlugin(np);
                                            }
                                        }
                                        for (SerializationPlugin sp : loadedSerPlugins) {
                                            if (sp.getTargetedLanguages().contains(compiler.getID())) {
                                                compiler.addSerializationPlugin(sp);
                                            }
                                        }
                                        compiler.setOutputDirectory(
                                                new File(System.getProperty("java.io.tmpdir") + "/ThingML_temp/"
                                                        + cfg.getName()));
                                        compiler.compileConnector(connectorCompiler.getKey(), cfg);
                                    }
                                }
                            });
                        }
                    } else {
                        newCompilersMenu.add(item);
                    }

                    item.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            System.out.println("Input file : " + targetFile);
                            if (targetFile == null)
                                return;
                            try {
                                ThingMLModel thingmlModel = ThingMLCompiler.loadModel(targetFile);
                                for (Configuration cfg : ThingMLHelpers.allConfigurations(thingmlModel)) {
                                    final ThingMLCompiler compiler = registry.createCompilerInstanceByName(id);
                                    for (NetworkPlugin np : loadedPlugins) {
                                        if (np.getTargetedLanguages().contains(compiler.getID())) {
                                            compiler.addNetworkPlugin(np);
                                        }
                                    }
                                    for (SerializationPlugin sp : loadedSerPlugins) {
                                        if (sp.getTargetedLanguages().contains(compiler.getID())) {
                                            compiler.addSerializationPlugin(sp);
                                        }
                                    }

                                    File myFileBuf = new File(System.getProperty("java.io.tmpdir")
                                            + "/ThingML_temp/" + cfg.getName());
                                    compiler.setOutputDirectory(myFileBuf);
                                    compiler.compile(cfg);

                                    final InputStream input = new FileInputStream(myFileBuf.getAbsolutePath()
                                            + "/" + cfg.getName() + "/" + cfg.getName() + ".pde");

                                    //System.out.println("tmp file: " + myFileBuf.getAbsolutePath() + "/" + cfg.getName() + "/" + cfg.getName() + ".pde");

                                    //final InputStream input = new FileInputStream(myFileBuf);
                                    String result = null;
                                    try {
                                        if (input != null) {
                                            result = org.apache.commons.io.IOUtils.toString(input);
                                            input.close();
                                            transferBuf.setString(result);
                                            transferBuf.hasChanged();
                                            transferBuf.notifyObservers();
                                        } else {
                                            //System.out.println("WHY");
                                        }
                                    } catch (Exception exce) {
                                        if (ThingMLApp.debug)
                                            System.out.println("OH REALLY?");
                                    }

                                }
                            } catch (Exception ex) {
                                if (ThingMLApp.debug)
                                    ex.printStackTrace();
                            }
                        }
                    });
                    c = null;
                }
            }

            menubar.add(newCompilersMenu);
        }

        codeEditor.getDocument().addDocumentListener(new DocumentListener() {
            public void removeUpdate(DocumentEvent e) {
                lastUpdate.set(System.currentTimeMillis());
                checkNeeded.set(true);
            }

            public void insertUpdate(DocumentEvent e) {
                lastUpdate.set(System.currentTimeMillis());
                checkNeeded.set(true);
            }

            public void changedUpdate(DocumentEvent e) {
                lastUpdate.set(System.currentTimeMillis());
                checkNeeded.set(true);
            }
        });

        java.util.Timer timer = new Timer();
        timer.scheduleAtFixedRate(new SeamlessNotification(), 250, 250);

    } catch (Exception e) {
        if (ThingMLApp.debug)
            e.printStackTrace();
    }
}

From source file:gov.nih.nci.evs.browser.utils.SearchUtils.java

public ResolvedConceptReferencesIteratorWrapper searchByProperties(String scheme, String version,
        String matchText, String[] property_types, String[] property_names, String source,
        String matchAlgorithm, boolean excludeDesignation, boolean ranking, int maxToReturn) {

    if (matchText == null)
        return null;

    boolean restrictToProperties = false;
    CodedNodeSet.PropertyType[] propertyTypes = null;
    LocalNameList propertyNames = null;// w w w  . j  a v a 2 s. c o m
    LocalNameList sourceList = null;
    if (property_types != null || property_names != null) {
        _logger.debug("Case #1 -- property_types != null || property_names != null");

        restrictToProperties = true;
        if (property_types != null)
            propertyTypes = createPropertyTypes(property_types);
        if (property_names != null)
            propertyNames = ConvenienceMethods.createLocalNameList(property_names);
    } else {
        _logger.debug("Case #2 ");
        propertyNames = new LocalNameList();
        propertyTypes = getAllPropertyTypes();
        if (excludeDesignation) {
            _logger.debug("Case #3 ");
            propertyTypes = getAllNonPresentationPropertyTypes();
        }
    }
    _logger.debug("searchByProperties scheme: " + scheme);
    _logger.debug("searchByProperties matchAlgorithm: " + matchAlgorithm);
    _logger.debug("searchByProperties source: " + source);
    _logger.debug("searchByProperties excludeDesignation: " + excludeDesignation);
    /*
            if (source != null)
    sourceList =
        ConvenienceMethods.createLocalNameList(new String[] { source });
     */
    NameAndValueList qualifierList = null;

    String matchText0 = matchText;
    String matchAlgorithm0 = matchAlgorithm;
    matchText0 = matchText0.trim();
    //if (matchText == null || matchText.length() == 0) {
    if (matchText.length() == 0) {
        return null;
    }
    matchText = matchText.trim();
    if (matchAlgorithm.compareToIgnoreCase("contains") == 0) {
        matchAlgorithm = findBestContainsAlgorithm(matchText);
    }

    CodedNodeSet cns = null;
    ResolvedConceptReferencesIterator iterator = null;
    try {
        LexBIGService lbSvc = new RemoteServerUtil().createLexBIGService();

        if (lbSvc == null) {
            _logger.warn("lbSvc = null");
            return null;
        }

        cns = null;
        iterator = null;
        CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
        if (version != null)
            versionOrTag.setVersion(version);

        try {
            cns = lbSvc.getNodeSet(scheme, versionOrTag, null);

            if (cns != null) {
                try {
                    String language = null;
                    try {
                        _logger.debug("*** restrictToMatchingProperties ...matchText " + matchText
                                + " matchAlgorithm " + matchAlgorithm);
                        cns = cns.restrictToMatchingProperties(propertyNames, propertyTypes, matchText,
                                matchAlgorithm, language);

                    } catch (Exception e) {
                        _logger.debug("\t(*) restrictToMatchingProperties throws exceptions???: " + matchText
                                + " matchAlgorithm: " + matchAlgorithm);
                        // e.printStackTrace();
                    }
                    try {
                        _logger.debug("restrictToSource ...source " + source);
                        cns = restrictToSource(cns, source);
                    } catch (Exception e) {
                        _logger.error("\t(*) restrictToSource throws exceptions???: " + matchText
                                + " matchAlgorithm: " + matchAlgorithm);
                        // e.printStackTrace();
                    }

                } catch (Exception ex) {
                    // ex.printStackTrace();
                    _logger.error("\t(*) searchByProperties2 throws exceptions.");
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            // return null;
        }
        iterator = null;
        if (cns == null) {
            return null;
        }

        // LocalNameList restrictToProperties = null;//new LocalNameList();
        boolean resolveConcepts = false;
        SortOptionList sortCriteria = null;
        if (ranking) {
            sortCriteria = Constructors.createSortOptionList(new String[] { "matchToQuery" });

        } else {
            sortCriteria = Constructors.createSortOptionList(new String[] { "entityDescription" }); // code
            _logger.debug("*** Sort alphabetically...");
            resolveConcepts = false;
        }
        try {
            try {
                long ms = System.currentTimeMillis(), delay = 0;
                cns = restrictToSource(cns, source);
                _logger.debug("cns.resolve ...");
                iterator = cns.resolve(sortCriteria, null, null, null, resolveConcepts);

            } catch (Exception e) {
                _logger.error("Method: SearchUtil.searchByProperties");
                _logger.error("* ERROR: cns.resolve throws exceptions.");
                _logger.error("* " + e.getClass().getSimpleName() + ": " + e.getMessage());
                e.printStackTrace();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
        }

    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }

    if (!excludeDesignation) {
        int lcv = 0;
        int iterator_size = 0;
        if (iterator != null) {
            try {
                iterator_size = iterator.numberRemaining();

                _logger.debug("Number of matches: " + iterator_size);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }

        if (iterator_size == 0) {
            iterator = matchConceptCode(scheme, version, matchText0, source, CODE_SEARCH_ALGORITHM);
            if (iterator != null) {
                try {
                    iterator_size = iterator.numberRemaining();
                } catch (Exception ex) {

                }
            }
        }
    }
    return new ResolvedConceptReferencesIteratorWrapper(iterator);
}

From source file:gov.nih.nci.evs.browser.servlet.AjaxServlet.java

public static void create_vs_tree(HttpServletRequest request, HttpServletResponse response, int view,
        String vsd_uri) {/* w  w w  .  j a  v a2s.com*/

    String nav_type = HTTPUtils.cleanXSS((String) request.getParameter("nav_type"));
    request.getSession().setAttribute("vs_nav_type", "valuesets");

    request.getSession().removeAttribute("dictionary");
    request.getSession().removeAttribute("version");

    String root_vsd_uri = vsd_uri;
    String vsd_name = null;
    boolean isValueSet = false;
    ValueSetDefinition vsd = null;

    String vsd_description = "DESCRIPTION NOT AVAILABLE";
    if (vsd_uri != null) {
        vsd = DataUtils.findValueSetDefinitionByURI(vsd_uri);
        if (vsd != null) {
            vsd_name = vsd.getValueSetDefinitionName();
            isValueSet = true;
            vsd_description = ValueSetHierarchy.getValueSetDecription(vsd_uri);
        } else {
            Entity entity = DataUtils.getConceptByCode(Constants.TERMINOLOGY_VALUE_SET_NAME, null, vsd_uri);
            if (entity != null) {
                vsd_name = entity.getEntityDescription().getContent();
            }
            vsd_description = DataUtils.getTerminologyValueSetDescription(vsd_uri);
        }
    }

    request.getSession().removeAttribute("b");
    request.getSession().removeAttribute("m");

    response.setContentType("text/html");
    PrintWriter out = null;

    String checked_vocabularies = HTTPUtils.cleanXSS((String) request.getParameter("checked_vocabularies"));
    String partial_checked_vocabularies = HTTPUtils
            .cleanXSS((String) request.getParameter("partial_checked_vocabularies"));
    try {
        out = response.getWriter();
    } catch (Exception ex) {
        ex.printStackTrace();
        return;
    }
    String message = (String) request.getSession().getAttribute("message");
    out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
    out.println("<html xmlns:c=\"http://java.sun.com/jsp/jstl/core\">");
    out.println("<head>");

    if (DataUtils.isNull(vsd_uri)) {
        if (view == Constants.STANDARD_VIEW) {
            out.println("  <title>NCI Term Browser - Value Set Source View</title>");
        } else {
            out.println("  <title>NCI Term Browser - Value Set Terminology View</title>");
        }
    } else {
        out.println("  <title>NCI Term Browser - Value Set " + vsd_uri + " </title>");
    }

    out.println("  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
    out.println("");
    out.println("<style type=\"text/css\">");
    out.println("/*margin and padding on body element");
    out.println("  can introduce errors in determining");
    out.println("  element position and are not recommended;");
    out.println("  we turn them off as a foundation for YUI");
    out.println("  CSS treatments. */");
    out.println("body {");
    out.println("   margin:0;");
    out.println("   padding:0;");
    out.println("}");
    out.println("</style>");
    out.println("");
    out.println(
            "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://yui.yahooapis.com/2.9.0/build/fonts/fonts-min.css\" />");
    out.println(
            "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://yui.yahooapis.com/2.9.0/build/treeview/assets/skins/sam/treeview.css\" />");
    out.println("");
    out.println(
            "<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.9.0/build/yahoo-dom-event/yahoo-dom-event.js\"></script>");
    //Before(GF31982): out.println("<script type=\"text/javascript\" src=\"http://yui.yahooapis.com/2.9.0/build/treeview/treeview-min.js\"></script>");
    out.println("<script type=\"text/javascript\" src=\"/ncitbrowser/js/yui/treeview-min.js\" ></script>"); //GF31982
    out.println("");
    out.println("");
    out.println("<!-- Dependency -->");
    out.println("<script src=\"http://yui.yahooapis.com/2.9.0/build/yahoo/yahoo-min.js\"></script>");
    out.println("");
    out.println("<!-- Source file -->");
    out.println("<!--");
    out.println("   If you require only basic HTTP transaction support, use the");
    out.println("   connection_core.js file.");
    out.println("-->");
    out.println(
            "<script src=\"http://yui.yahooapis.com/2.9.0/build/connection/connection_core-min.js\"></script>");
    out.println("");
    out.println("<!--");
    out.println("   Use the full connection.js if you require the following features:");
    out.println("   - Form serialization.");
    out.println("   - File Upload using the iframe transport.");
    out.println("   - Cross-domain(XDR) transactions.");
    out.println("-->");
    out.println("<script src=\"http://yui.yahooapis.com/2.9.0/build/connection/connection-min.js\"></script>");
    out.println("");
    out.println("");
    out.println("");
    out.println("<!--begin custom header content for this example-->");
    out.println("<!--Additional custom style rules for this example:-->");
    out.println("<style type=\"text/css\">");
    out.println("");
    out.println("");
    out.println(
            ".ygtvcheck0 { background: url(/ncitbrowser/images/yui/treeview/check0.gif) 0 0 no-repeat; width:16px; height:20px; float:left; cursor:pointer; }");
    out.println(
            ".ygtvcheck1 { background: url(/ncitbrowser/images/yui/treeview/check1.gif) 0 0 no-repeat; width:16px; height:20px; float:left; cursor:pointer; }");
    out.println(
            ".ygtvcheck2 { background: url(/ncitbrowser/images/yui/treeview/check2.gif) 0 0 no-repeat; width:16px; height:20px; float:left; cursor:pointer; }");
    out.println("");
    out.println("");
    out.println(".ygtv-edit-TaskNode  {   width: 190px;}");
    out.println(".ygtv-edit-TaskNode .ygtvcancel, .ygtv-edit-TextNode .ygtvok  {   border:none;}");
    out.println(".ygtv-edit-TaskNode .ygtv-button-container { float: right;}");
    out.println(".ygtv-edit-TaskNode .ygtv-input  input{   width: 140px;}");
    out.println(".whitebg {");
    out.println("   background-color:white;");
    out.println("}");
    out.println("</style>");
    out.println("");
    out.println("  <link rel=\"stylesheet\" type=\"text/css\" href=\"/ncitbrowser/css/styleSheet.css\" />");
    out.println("  <link rel=\"shortcut icon\" href=\"/ncitbrowser/favicon.ico\" type=\"image/x-icon\" />");
    out.println("");
    out.println("  <script type=\"text/javascript\" src=\"/ncitbrowser/js/script.js\"></script>");
    out.println("  <script type=\"text/javascript\" src=\"/ncitbrowser/js/tasknode.js\"></script>");

    println(out, "  <script type=\"text/javascript\" src=\"/ncitbrowser/js/search.js\"></script>");
    println(out, "  <script type=\"text/javascript\" src=\"/ncitbrowser/js/dropdown.js\"></script>");

    out.println("");
    out.println("  <script type=\"text/javascript\">");
    out.println("");
    out.println("    function refresh() {");
    out.println("");
    out.println(
            "      var selectValueSetSearchOptionObj = document.forms[\"valueSetSearchForm\"].selectValueSetSearchOption;");
    out.println("");
    out.println("      for (var i=0; i<selectValueSetSearchOptionObj.length; i++) {");
    out.println("        if (selectValueSetSearchOptionObj[i].checked) {");
    out.println("            selectValueSetSearchOption = selectValueSetSearchOptionObj[i].value;");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("");
    out.println("      window.location.href=\"/ncitbrowser/pages/value_set_source_view.jsf?refresh=1\""); //Before(GF31982)
    //GF31982(Not Sure): out.println("      window.location.href=\"/ncitbrowser/ajax?action=create_src_vs_tree?refresh=1\"");
    out.println("          + \"&nav_type=valuesets\" + \"&opt=\"+ selectValueSetSearchOption;");
    out.println("");
    out.println("    }");
    out.println("  </script>");
    out.println("");
    out.println("  <script language=\"JavaScript\">");
    out.println("");
    out.println("    var tree;");
    out.println("    var nodeIndex;");
    out.println("    var nodes = [];");
    out.println("");
    out.println("    function load(url,target) {");
    out.println("      if (target != '')");
    out.println("        target.window.location.href = url;");
    out.println("      else");
    out.println("        window.location.href = url;");
    out.println("    }");
    out.println("");
    out.println("    function init() {");
    out.println("       //initTree();");
    out.println("    }");
    out.println("");
    out.println("   //handler for expanding all nodes");
    out.println("   YAHOO.util.Event.on(\"expand_all\", \"click\", function(e) {");
    out.println("        //expandEntireTree();");
    out.println("");
    out.println("        tree.expandAll();");
    out.println("      //YAHOO.util.Event.preventDefault(e);");
    out.println("   });");
    out.println("");
    out.println("   //handler for collapsing all nodes");
    out.println("   YAHOO.util.Event.on(\"collapse_all\", \"click\", function(e) {");
    out.println("      tree.collapseAll();");
    out.println("      //YAHOO.util.Event.preventDefault(e);");
    out.println("   });");
    out.println("");
    out.println("   //handler for checking all nodes");
    out.println("   YAHOO.util.Event.on(\"check_all\", \"click\", function(e) {");
    out.println("      check_all();");
    out.println("      //YAHOO.util.Event.preventDefault(e);");
    out.println("   });");
    out.println("");
    out.println("   //handler for unchecking all nodes");
    out.println("   YAHOO.util.Event.on(\"uncheck_all\", \"click\", function(e) {");
    out.println("      uncheck_all();");
    out.println("      //YAHOO.util.Event.preventDefault(e);");
    out.println("   });");
    out.println("");
    out.println("");
    out.println("");
    out.println("   YAHOO.util.Event.on(\"getchecked\", \"click\", function(e) {");
    out.println(
            "               //alert(\"Checked nodes: \" + YAHOO.lang.dump(getCheckedNodes()), \"info\", \"example\");");
    out.println("      //YAHOO.util.Event.preventDefault(e);");
    out.println("");
    out.println("   });");
    out.println("");
    out.println("");
    out.println("    function addTreeNode(rootNode, nodeInfo) {");
    out.println(
            "      var newNodeDetails = \"javascript:onClickTreeNode('\" + nodeInfo.ontology_node_id + \"');\";");
    out.println("");
    out.println("      if (nodeInfo.ontology_node_id.indexOf(\"TVS_\") >= 0) {");
    out.println("          newNodeData = { label:nodeInfo.ontology_node_name, id:nodeInfo.ontology_node_id };");
    out.println("      } else {");
    out.println(
            "          newNodeData = { label:nodeInfo.ontology_node_name, id:nodeInfo.ontology_node_id, href:newNodeDetails };");
    out.println("      }");
    out.println("");
    out.println("      var newNode = new YAHOO.widget.TaskNode(newNodeData, rootNode, false);");
    out.println("      if (nodeInfo.ontology_node_child_count > 0) {");
    out.println("        newNode.setDynamicLoad(loadNodeData);");
    out.println("      }");
    out.println("    }");
    out.println("");
    out.println("    function buildTree(ontology_node_id, ontology_display_name) {");
    out.println("      var handleBuildTreeSuccess = function(o) {");
    out.println("        var respTxt = o.responseText;");
    out.println("        var respObj = eval('(' + respTxt + ')');");
    out.println("        if ( typeof(respObj) != \"undefined\") {");
    out.println("          if ( typeof(respObj.root_nodes) != \"undefined\") {");
    out.println("            var root = tree.getRoot();");
    out.println("            if (respObj.root_nodes.length == 0) {");
    out.println("              //showEmptyRoot();");
    out.println("            }");
    out.println("            else {");
    out.println("              for (var i=0; i < respObj.root_nodes.length; i++) {");
    out.println("                var nodeInfo = respObj.root_nodes[i];");
    out.println("                var expand = false;");
    out.println("                //addTreeNode(root, nodeInfo, expand);");
    out.println("");
    out.println("                addTreeNode(root, nodeInfo);");
    out.println("              }");
    out.println("            }");
    out.println("");
    out.println("            tree.draw();");
    out.println("          }");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("      var handleBuildTreeFailure = function(o) {");
    out.println("        alert('responseFailure: ' + o.statusText);");
    out.println("      }");
    out.println("");
    out.println("      var buildTreeCallback =");
    out.println("      {");
    out.println("        success:handleBuildTreeSuccess,");
    out.println("        failure:handleBuildTreeFailure");
    out.println("      };");
    out.println("");
    out.println("      if (ontology_display_name!='') {");
    out.println("        var ontology_source = null;");
    out.println("        var ontology_version = document.forms[\"pg_form\"].ontology_version.value;");
    out.println(
            "        var request = YAHOO.util.Connect.asyncRequest('GET','/ncitbrowser/ajax?action=build_src_vs_tree&ontology_node_id=' +ontology_node_id+'&ontology_display_name='+ontology_display_name+'&version='+ontology_version+'&ontology_source='+ontology_source,buildTreeCallback);");
    out.println("      }");
    out.println("    }");
    out.println("");
    out.println("    function resetTree(ontology_node_id, ontology_display_name) {");
    out.println("");
    out.println("      var handleResetTreeSuccess = function(o) {");
    out.println("        var respTxt = o.responseText;");
    out.println("        var respObj = eval('(' + respTxt + ')');");
    out.println("        if ( typeof(respObj) != \"undefined\") {");
    out.println("          if ( typeof(respObj.root_node) != \"undefined\") {");
    out.println("            var root = tree.getRoot();");
    out.println(
            "            var nodeDetails = \"javascript:onClickTreeNode('\" + respObj.root_node.ontology_node_id + \"');\";");
    out.println(
            "            var rootNodeData = { label:respObj.root_node.ontology_node_name, id:respObj.root_node.ontology_node_id, href:nodeDetails };");
    out.println("            var expand = false;");
    out.println("            if (respObj.root_node.ontology_node_child_count > 0) {");
    out.println("              expand = true;");
    out.println("            }");
    out.println("            var ontRoot = new YAHOO.widget.TaskNode(rootNodeData, root, expand);");
    out.println("");
    out.println("            if ( typeof(respObj.child_nodes) != \"undefined\") {");
    out.println("              for (var i=0; i < respObj.child_nodes.length; i++) {");
    out.println("                var nodeInfo = respObj.child_nodes[i];");
    out.println("                addTreeNode(ontRoot, nodeInfo);");
    out.println("              }");
    out.println("            }");
    out.println("            tree.draw();");
    out.println("          }");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("      var handleResetTreeFailure = function(o) {");
    out.println("        alert('responseFailure: ' + o.statusText);");
    out.println("      }");
    out.println("");
    out.println("      var resetTreeCallback =");
    out.println("      {");
    out.println("        success:handleResetTreeSuccess,");
    out.println("        failure:handleResetTreeFailure");
    out.println("      };");
    out.println("      if (ontology_node_id!= '') {");
    out.println("        var ontology_source = null;");
    out.println("        var ontology_version = document.forms[\"pg_form\"].ontology_version.value;");
    out.println(
            "        var request = YAHOO.util.Connect.asyncRequest('GET','/ncitbrowser/ajax?action=reset_vs_tree&ontology_node_id=' +ontology_node_id+'&ontology_display_name='+ontology_display_name + '&version='+ ontology_version +'&ontology_source='+ontology_source,resetTreeCallback);");
    out.println("      }");
    out.println("    }");
    out.println("");
    out.println("    function onClickTreeNode(ontology_node_id) {");
    out.println("        //alert(\"onClickTreeNode \" + ontology_node_id);");
    out.println(
            "        window.location = '/ncitbrowser/pages/value_set_treenode_redirect.jsf?ontology_node_id=' + ontology_node_id;");
    out.println("    }");
    out.println("");
    out.println("");
    out.println("    function onClickViewEntireOntology(ontology_display_name) {");
    out.println("      var ontology_display_name = document.pg_form.ontology_display_name.value;");
    out.println("      tree = new YAHOO.widget.TreeView(\"treecontainer\");");

    out.println("      tree.draw();");

    out.println("    }");
    out.println("");
    out.println("    function initTree() {");
    out.println("");
    out.println("        tree = new YAHOO.widget.TreeView(\"treecontainer\");");
    out.println("   tree.setNodesProperty('propagateHighlightUp',true);");
    out.println("   tree.setNodesProperty('propagateHighlightDown',true);");
    out.println("   tree.subscribe('keydown',tree._onKeyDownEvent);");
    out.println("");
    out.println("");
    out.println("");
    out.println("");
    out.println("          tree.subscribe(\"expand\", function(node) {");
    out.println("");
    out.println("         YAHOO.util.UserAction.keydown(document.body, { keyCode: 39 });");
    out.println("");
    out.println("          });");
    out.println("");
    out.println("");
    out.println("");
    out.println("          tree.subscribe(\"collapse\", function(node) {");
    out.println("         //alert(\"Collapsing \" + node.label );");
    out.println("");
    out.println("         YAHOO.util.UserAction.keydown(document.body, { keyCode: 109 });");
    out.println("          });");
    out.println("");
    out.println(
            "          // By default, trees with TextNodes will fire an event for when the label is clicked:");
    out.println("          tree.subscribe(\"checkClick\", function(node) {");
    out.println("         //alert(node.data.myNodeId + \" label was checked\");");
    out.println("          });");
    out.println("");
    out.println("");

    println(out, "            var root = tree.getRoot();");

    HashMap value_set_tree_hmap = null;
    Boolean value_set_tab = Boolean.TRUE;

    TreeItem root = null;

    if (DataUtils.isNull(vsd_uri)) {
        /*
        if (view == Constants.STANDARD_VIEW) {
           value_set_tree_hmap = DataUtils.getSourceValueSetTree();
        } else if (view == Constants.TERMINOLOGY_VIEW){
           value_set_tree_hmap = DataUtils.getCodingSchemeValueSetTree();
        }
         if (value_set_tree_hmap != null) {
            root = (TreeItem) value_set_tree_hmap.get("<Root>");
            new ValueSetUtils().printTree(out, root, view, value_set_tab);
         }
         */

        if (view == Constants.STANDARD_VIEW) {
            out.println(DataUtils.getSourceValueSetTreeStringBuffer().toString());
        } else if (view == Constants.TERMINOLOGY_VIEW) {
            out.println(DataUtils.getCodingSchemeValueSetTreeStringBuffer().toString());
        }

    } else {
        value_set_tab = Boolean.FALSE;
        if (view == Constants.STANDARD_VIEW) {
            value_set_tree_hmap = DataUtils.getSourceValueSetTree(vsd_uri);
        } else {
            value_set_tree_hmap = DataUtils.getCodingSchemeValueSetTree(vsd_uri);
        }

        if (value_set_tree_hmap != null) {
            root = (TreeItem) value_set_tree_hmap.get("<Root>");
            new ValueSetUtils().printTree(out, root, view, value_set_tab);
        }

    }

    String contextPath = request.getContextPath();
    String view_str = Integer.valueOf(view).toString();

    //[#31914] Search option and algorithm in value set search box are not preserved in session.
    //String option = (String) request.getSession().getAttribute("selectValueSetSearchOption");
    //String algorithm = (String) request.getSession().getAttribute("valueset_search_algorithm");

    String option = HTTPUtils.cleanXSS((String) request.getParameter("selectValueSetSearchOption"));
    if (DataUtils.isNull(option)) {
        option = (String) request.getSession().getAttribute("selectValueSetSearchOption");
    }

    if (DataUtils.isNull(option)) {
        option = "Name";
    }
    request.getSession().setAttribute("selectValueSetSearchOption", option);

    String algorithm = HTTPUtils.cleanXSS((String) request.getParameter("valueset_search_algorithm"));
    if (DataUtils.isNull(algorithm)) {
        algorithm = (String) request.getSession().getAttribute("valueset_search_algorithm");
    }

    if (DataUtils.isNull(algorithm)) {
        algorithm = Constants.DEFAULT_SEARCH_ALGORITHM;//"contains";
    }
    request.getSession().setAttribute("valueset_search_algorithm", algorithm);

    String matchText = HTTPUtils.cleanXSS((String) request.getParameter("matchText"));
    if (DataUtils.isNull(matchText)) {
        matchText = (String) request.getSession().getAttribute("matchText");
    }

    if (DataUtils.isNull(matchText)) {
        matchText = "";
    } else {
        matchText = matchText.trim();
    }
    request.getSession().setAttribute("matchText", matchText);

    String option_code = "";
    String option_name = "";
    if (DataUtils.isNull(option)) {
        option_name = "checked";

    } else {
        if (option.compareToIgnoreCase("Code") == 0) {
            option_code = "checked";
        }
        if (option.compareToIgnoreCase("Name") == 0) {
            option_name = "checked";
        }
    }

    String algorithm_exactMatch = "";
    String algorithm_startsWith = "";
    String algorithm_contains = "";

    if (DataUtils.isNull(algorithm)) {
        algorithm = "contains";
    }

    if (algorithm.compareToIgnoreCase("exactMatch") == 0) {
        algorithm_exactMatch = "checked";
    }

    if (algorithm.compareToIgnoreCase("startsWith") == 0) {
        algorithm_startsWith = "checked";
        option_name = "checked";
        option_code = "";
    }

    if (algorithm.compareToIgnoreCase("contains") == 0) {
        algorithm_contains = "checked";
        option_name = "checked";
        option_code = "";
    }

    out.println("");
    //if (message == null) {
    if (message == null && DataUtils.isNull(vsd_uri)) {
        out.println("       tree.collapseAll();");
    }

    if (DataUtils.isNull(vsd_uri)) {
        out.println("      initializeNodeCheckState();");
    } else if (DataUtils.isNull(message)) {
        out.println("      initializeNodeCheckState();");
    } else if (!message.startsWith("No value set definition")) {
        out.println("      initializeNodeCheckState();");
    }

    out.println("      tree.draw();");

    out.println("    }");
    out.println("");
    out.println("");
    out.println("    function onCheckClick(node) {");
    out.println(
            "        YAHOO.log(node.label + \" check was clicked, new state: \" + node.checkState, \"info\", \"example\");");
    out.println("    }");
    out.println("");
    out.println("    function check_all() {");
    out.println("        var topNodes = tree.getRoot().children;");
    out.println("        for(var i=0; i<topNodes.length; ++i) {");
    out.println("            topNodes[i].check();");
    out.println("        }");
    out.println("    }");
    out.println("");
    out.println("    function uncheck_all() {");
    out.println("        var topNodes = tree.getRoot().children;");
    out.println("        for(var i=0; i<topNodes.length; ++i) {");
    out.println("            topNodes[i].uncheck();");
    out.println("        }");
    out.println("    }");
    out.println("");
    out.println("");
    out.println("");
    out.println("    function expand_all() {");
    out.println("        //alert(\"expand_all\");");
    out.println("        var ontology_display_name = document.forms[\"pg_form\"].ontology_display_name.value;");
    out.println("        onClickViewEntireOntology(ontology_display_name);");
    out.println("    }");
    out.println("");
    out.println("");

    // 0=unchecked, 1=some children checked, 2=all children checked

    out.println("    function getCheckedVocabularies(nodes) {");
    out.println("       getCheckedNodes(nodes);");
    out.println("       getPartialCheckedNodes(nodes);");
    out.println("    }");

    writeInitialize(out);
    initializeNodeCheckState(out, value_set_tab);

    out.println("   // Gets the labels of all of the fully checked nodes");
    out.println("   // Could be updated to only return checked leaf nodes by evaluating");
    out.println("   // the children collection first.");

    out.println("    function getCheckedNodes(nodes) {");
    out.println("        nodes = nodes || tree.getRoot().children;");
    out.println("        var checkedNodes = [];");
    out.println("        for(var i=0, l=nodes.length; i<l; i=i+1) {");
    out.println("            var n = nodes[i];");
    out.println("            if (n.checkState == 2) {");
    out.println("                checkedNodes.push(n.label); // just using label for simplicity");
    out.println("            }");
    out.println("             if (n.hasChildren()) {");
    out.println("               checkedNodes = checkedNodes.concat(getCheckedNodes(n.children));");
    out.println("             }");
    out.println("        }");
    //out.println("         checkedNodes = checkedNodes.concat(\",\");");
    out.println(
            "        var checked_vocabularies = document.forms[\"valueSetSearchForm\"].checked_vocabularies;");
    out.println("        checked_vocabularies.value = checkedNodes;");
    out.println("        return checkedNodes;");
    out.println("    }");

    out.println("    function getPartialCheckedNodes(nodes) {");
    out.println("        nodes = nodes || tree.getRoot().children;");
    out.println("        var checkedNodes = [];");
    out.println("        for(var i=0, l=nodes.length; i<l; i=i+1) {");
    out.println("            var n = nodes[i];");
    out.println("            if (n.checkState == 1) {");
    out.println("                checkedNodes.push(n.label); // just using label for simplicity");
    out.println("            }");
    out.println("             if (n.hasChildren()) {");
    out.println("               checkedNodes = checkedNodes.concat(getPartialCheckedNodes(n.children));");
    out.println("             }");
    out.println("        }");
    //out.println("         checkedNodes = checkedNodes.concat(\",\");");
    out.println(
            "        var partial_checked_vocabularies = document.forms[\"valueSetSearchForm\"].partial_checked_vocabularies;");
    out.println("        partial_checked_vocabularies.value = checkedNodes;");
    out.println("        return checkedNodes;");
    out.println("    }");

    out.println("    function loadNodeData(node, fnLoadComplete) {");
    out.println("      var id = node.data.id;");
    out.println("");
    out.println("      var responseSuccess = function(o)");
    out.println("      {");
    out.println("        var path;");
    out.println("        var dirs;");
    out.println("        var files;");
    out.println("        var respTxt = o.responseText;");
    out.println("        var respObj = eval('(' + respTxt + ')');");
    out.println("        var fileNum = 0;");
    out.println("        var categoryNum = 0;");
    out.println("        if ( typeof(respObj.nodes) != \"undefined\") {");
    out.println("          for (var i=0; i < respObj.nodes.length; i++) {");
    out.println("            var name = respObj.nodes[i].ontology_node_name;");
    out.println(
            "            var nodeDetails = \"javascript:onClickTreeNode('\" + respObj.nodes[i].ontology_node_id + \"');\";");
    out.println(
            "            var newNodeData = { label:name, id:respObj.nodes[i].ontology_node_id, href:nodeDetails };");
    out.println("            var newNode = new YAHOO.widget.TaskNode(newNodeData, node, false);");
    out.println("            if (respObj.nodes[i].ontology_node_child_count > 0) {");
    out.println("              newNode.setDynamicLoad(loadNodeData);");
    out.println("            }");
    out.println("          }");
    out.println("        }");
    out.println("        tree.draw();");
    out.println("        fnLoadComplete();");
    out.println("      }");
    out.println("");
    out.println("      var responseFailure = function(o){");
    out.println("        alert('responseFailure: ' + o.statusText);");
    out.println("      }");
    out.println("");
    out.println("      var callback =");
    out.println("      {");
    out.println("        success:responseSuccess,");
    out.println("        failure:responseFailure");
    out.println("      };");
    out.println("");
    out.println("      var ontology_display_name = document.forms[\"pg_form\"].ontology_display_name.value;");
    out.println("      var ontology_version = document.forms[\"pg_form\"].ontology_version.value;");
    out.println(
            "      var cObj = YAHOO.util.Connect.asyncRequest('GET','/ncitbrowser/ajax?action=expand_src_vs_tree&ontology_node_id=' +id+'&ontology_display_name='+ontology_display_name+'&version='+ontology_version,callback);");
    out.println("    }");
    out.println("");
    out.println("");
    out.println("    function searchTree(ontology_node_id, ontology_display_name) {");
    out.println("");
    out.println("        var handleBuildTreeSuccess = function(o) {");
    out.println("");
    out.println("        var respTxt = o.responseText;");
    out.println("        var respObj = eval('(' + respTxt + ')');");
    out.println("        if ( typeof(respObj) != \"undefined\") {");
    out.println("");
    out.println("          if ( typeof(respObj.dummy_root_nodes) != \"undefined\") {");
    out.println("              showNodeNotFound(ontology_node_id);");
    out.println("          }");
    out.println("");
    out.println("          else if ( typeof(respObj.root_nodes) != \"undefined\") {");
    out.println("            var root = tree.getRoot();");
    out.println("            if (respObj.root_nodes.length == 0) {");
    out.println("              //showEmptyRoot();");
    out.println("            }");
    out.println("            else {");
    out.println("              showPartialHierarchy();");
    out.println("              showConstructingTreeStatus();");
    out.println("");
    out.println("              for (var i=0; i < respObj.root_nodes.length; i++) {");
    out.println("                var nodeInfo = respObj.root_nodes[i];");
    out.println("                //var expand = false;");
    out.println("                addTreeBranch(ontology_node_id, root, nodeInfo);");
    out.println("              }");
    out.println("            }");
    out.println("          }");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("      var handleBuildTreeFailure = function(o) {");
    out.println("        alert('responseFailure: ' + o.statusText);");
    out.println("      }");
    out.println("");
    out.println("      var buildTreeCallback =");
    out.println("      {");
    out.println("        success:handleBuildTreeSuccess,");
    out.println("        failure:handleBuildTreeFailure");
    out.println("      };");
    out.println("");
    out.println("      if (ontology_display_name!='') {");
    out.println("        var ontology_source = null;//document.pg_form.ontology_source.value;");
    out.println("        var ontology_version = document.forms[\"pg_form\"].ontology_version.value;");
    out.println(
            "        var request = YAHOO.util.Connect.asyncRequest('GET','/ncitbrowser/ajax?action=search_vs_tree&ontology_node_id=' +ontology_node_id+'&ontology_display_name='+ontology_display_name+'&version='+ontology_version+'&ontology_source='+ontology_source,buildTreeCallback);");
    out.println("");
    out.println("      }");
    out.println("    }");
    out.println("");
    out.println("");

    out.println("");
    out.println("    function expandEntireTree() {");
    out.println("        tree = new YAHOO.widget.TreeView(\"treecontainer\");");
    out.println("        //tree.draw();");
    out.println("");
    out.println("        var ontology_display_name = document.forms[\"pg_form\"].ontology_display_name.value;");
    out.println("        var ontology_node_id = document.forms[\"pg_form\"].ontology_node_id.value;");
    out.println("");
    out.println("        var handleBuildTreeSuccess = function(o) {");
    out.println("");
    out.println("        var respTxt = o.responseText;");
    out.println("        var respObj = eval('(' + respTxt + ')');");
    out.println("        if ( typeof(respObj) != \"undefined\") {");
    out.println("");
    out.println("             if ( typeof(respObj.root_nodes) != \"undefined\") {");
    out.println("");
    out.println("                    //alert(respObj.root_nodes.length);");
    out.println("");
    out.println("                    var root = tree.getRoot();");
    out.println("          if (respObj.root_nodes.length == 0) {");
    out.println("            //showEmptyRoot();");
    out.println("          } else {");
    out.println("            for (var i=0; i < respObj.root_nodes.length; i++) {");
    out.println("          var nodeInfo = respObj.root_nodes[i];");
    out.println("                    //alert(\"calling addTreeBranch \");");
    out.println("");
    out.println("          addTreeBranch(ontology_node_id, root, nodeInfo);");
    out.println("            }");
    out.println("          }");
    out.println("              }");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("      var handleBuildTreeFailure = function(o) {");
    out.println("        alert('responseFailure: ' + o.statusText);");
    out.println("      }");
    out.println("");
    out.println("      var buildTreeCallback =");
    out.println("      {");
    out.println("        success:handleBuildTreeSuccess,");
    out.println("        failure:handleBuildTreeFailure");
    out.println("      };");
    out.println("");
    out.println("      if (ontology_display_name!='') {");
    out.println("        var ontology_source = null;");
    out.println("        var ontology_version = document.forms[\"pg_form\"].ontology_version.value;");
    out.println(
            "        var request = YAHOO.util.Connect.asyncRequest('GET','/ncitbrowser/ajax?action=expand_entire_vs_tree&ontology_node_id=' +ontology_node_id+'&ontology_display_name='+ontology_display_name+'&version='+ontology_version+'&ontology_source='+ontology_source,buildTreeCallback);");
    out.println("");
    out.println("      }");
    out.println("    }");
    out.println("");
    out.println("");
    out.println("");
    out.println("");
    out.println("    function addTreeBranch(ontology_node_id, rootNode, nodeInfo) {");
    out.println(
            "      var newNodeDetails = \"javascript:onClickTreeNode('\" + nodeInfo.ontology_node_id + \"');\";");
    out.println("");
    out.println("      var newNodeData;");
    out.println("      if (ontology_node_id.indexOf(\"TVS_\") >= 0) {");
    out.println("          newNodeData = { label:nodeInfo.ontology_node_name, id:nodeInfo.ontology_node_id };");
    out.println("      } else {");
    out.println(
            "          newNodeData = { label:nodeInfo.ontology_node_name, id:nodeInfo.ontology_node_id, href:newNodeDetails };");
    out.println("      }");
    out.println("");
    out.println("      var expand = false;");
    out.println("      var childNodes = nodeInfo.children_nodes;");
    out.println("");
    out.println("      if (childNodes.length > 0) {");
    out.println("          expand = true;");
    out.println("      }");
    out.println("      var newNode = new YAHOO.widget.TaskNode(newNodeData, rootNode, expand);");
    out.println("      if (nodeInfo.ontology_node_id == ontology_node_id) {");
    out.println("          newNode.labelStyle = \"ygtvlabel_highlight\";");
    out.println("      }");
    out.println("");
    out.println("      if (nodeInfo.ontology_node_id == ontology_node_id) {");
    out.println("         newNode.isLeaf = true;");
    out.println("         if (nodeInfo.ontology_node_child_count > 0) {");
    out.println("             newNode.isLeaf = false;");
    out.println("             newNode.setDynamicLoad(loadNodeData);");
    out.println("         } else {");
    out.println("             tree.draw();");
    out.println("         }");
    out.println("");
    out.println("      } else {");
    out.println("          if (nodeInfo.ontology_node_id != ontology_node_id) {");
    out.println(
            "          if (nodeInfo.ontology_node_child_count == 0 && nodeInfo.ontology_node_id != ontology_node_id) {");
    out.println("        newNode.isLeaf = true;");
    out.println("          } else if (childNodes.length == 0) {");
    out.println("        newNode.setDynamicLoad(loadNodeData);");
    out.println("          }");
    out.println("        }");
    out.println("      }");
    out.println("");
    out.println("      tree.draw();");
    out.println("      for (var i=0; i < childNodes.length; i++) {");
    out.println("         var childnodeInfo = childNodes[i];");
    out.println("         addTreeBranch(ontology_node_id, newNode, childnodeInfo);");
    out.println("      }");
    out.println("    }");
    out.println("    YAHOO.util.Event.addListener(window, \"load\", init);");
    out.println("");
    out.println("    YAHOO.util.Event.onDOMReady(initTree);");

    out.println("");
    out.println("");
    out.println("  </script>");
    out.println("");
    out.println("</head>");
    out.println("");

    out.println("<body onLoad=\"document.forms.valueSetSearchForm.matchText.focus();\">");

    out.println("  <script type=\"text/javascript\" src=\"/ncitbrowser/js/wz_tooltip.js\"></script>");
    out.println("  <script type=\"text/javascript\" src=\"/ncitbrowser/js/tip_centerwindow.js\"></script>");
    out.println("  <script type=\"text/javascript\" src=\"/ncitbrowser/js/tip_followscroll.js\"></script>");

    out.println("  <!-- Begin Skip Top Navigation -->");
    out.println(
            "  <a href=\"#evs-content\" class=\"hideLink\" accesskey=\"1\" title=\"Skip repetitive navigation links\">skip navigation links</A>");
    out.println("  <!-- End Skip Top Navigation -->");
    out.println("");
    out.println("<!-- nci banner -->");
    out.println("<div class=\"ncibanner\">");
    out.println("  <a href=\"http://www.cancer.gov\" target=\"_blank\">");
    out.println("    <img src=\"/ncitbrowser/images/logotype.gif\"");
    out.println("      width=\"556\" height=\"39\" border=\"0\"");
    out.println("      alt=\"National Cancer Institute\"/>");
    out.println("  </a>");
    out.println("  <a href=\"http://www.cancer.gov\" target=\"_blank\">");
    out.println("    <img src=\"/ncitbrowser/images/spacer.gif\"");
    out.println("      width=\"60\" height=\"39\" border=\"0\"");
    out.println("      alt=\"National Cancer Institute\" class=\"print-header\"/>");
    out.println("  </a>");
    out.println("  <a href=\"http://www.nih.gov\" target=\"_blank\" >");
    out.println("    <img src=\"/ncitbrowser/images/tagline_nologo.gif\"");
    out.println("      width=\"219\" height=\"39\" border=\"0\"");
    out.println("      alt=\"U.S. National Institutes of Health\"/>");
    out.println("  </a>");
    out.println("  <a href=\"http://www.cancer.gov\" target=\"_blank\">");
    out.println("    <img src=\"/ncitbrowser/images/cancer-gov.gif\"");
    out.println("      width=\"125\" height=\"39\" border=\"0\"");
    out.println("      alt=\"www.cancer.gov\"/>");
    out.println("  </a>");
    out.println("</div>");
    out.println("<!-- end nci banner -->");
    out.println("");
    out.println("  <div class=\"center-page_960\">");
    out.println("    <!-- EVS Logo -->");
    out.println("<div>");
    out.println("  <img src=\"/ncitbrowser/images/evs-logo-swapped.gif\" alt=\"EVS Logo\"");
    out.println("       width=\"941\" height=\"26\" border=\"0\"");
    out.println("       usemap=\"#external-evs\" />");
    out.println("  <map id=\"external-evs\" name=\"external-evs\">");
    out.println("    <area shape=\"rect\" coords=\"0,0,140,26\"");
    out.println("      href=\"/ncitbrowser/start.jsf\" target=\"_self\"");
    out.println("      alt=\"NCI Term Browser\" />");
    out.println("    <area shape=\"rect\" coords=\"520,0,745,26\"");
    out.println("      href=\"http://evs.nci.nih.gov/\" target=\"_blank\"");
    out.println("      alt=\"Enterprise Vocabulary Services\" />");
    out.println("  </map>");
    out.println("</div>");
    out.println("");
    out.println("");
    out.println("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">");
    out.println("  <tr>");
    out.println("    <td width=\"5\"></td>");
    out.println("    <td><a href=\"/ncitbrowser/pages/multiple_search.jsf?nav_type=terminologies\">");
    out.println("      <img name=\"tab_terms\" src=\"/ncitbrowser/images/tab_terms.gif\"");
    out.println("        border=\"0\" alt=\"Terminologies\" title=\"Terminologies\" /></a></td>");
    out.println("    <td><a href=\"/ncitbrowser/ajax?action=create_src_vs_tree\">"); //GF31982
    out.println("      <img name=\"tab_valuesets\" src=\"/ncitbrowser/images/tab_valuesets_clicked.gif\"");
    out.println("        border=\"0\" alt=\"Value Sets\" title=\"ValueSets\" /></a></td>");
    out.println("    <td><a href=\"/ncitbrowser/pages/mapping_search.jsf?nav_type=mappings\">");
    out.println("      <img name=\"tab_map\" src=\"/ncitbrowser/images/tab_map.gif\"");
    out.println("        border=\"0\" alt=\"Mappings\" title=\"Mappings\" /></a></td>");
    out.println("  </tr>");
    out.println("</table>");
    out.println("");
    out.println(
            "<div class=\"mainbox-top\"><img src=\"/ncitbrowser/images/mainbox-top.gif\" width=\"945\" height=\"5\" alt=\"\"/></div>");
    out.println("<!-- end EVS Logo -->");
    out.println("    <!-- Main box -->");
    out.println("    <div id=\"main-area_960\">");
    out.println("");
    out.println("      <!-- Thesaurus, banner search area -->");
    out.println("      <div class=\"bannerarea_960\">");

    if (DataUtils.isNull(vsd_uri)) {
        out.println("        <a href=\"/ncitbrowser/start.jsf\" style=\"text-decoration: none;\">");
        out.println("            <div class=\"vocabularynamebanner_tb\">");
        out.println("               <span class=\"vocabularynamelong_tb\">"
                + JSPUtils.getApplicationVersionDisplay() + "</span>");
        out.println("            </div>");
        out.println("        </a>");
    } else {
        out.println(
                "        <a class=\"vocabularynamebanner\" href=\"/ncitbrowser/ajax?action=create_src_vs_tree&vsd_uri="
                        + vsd_uri + "\">");
        out.println("                <div class=\"vocabularynamebanner\">");
        out.println(
                "                <div class=\"vocabularynameshort\" STYLE=\"font-size: 22px; font-family : Arial\">");
        out.println(vsd_name);
        out.println("                </div>");
        out.println("              </div>");
        out.println("          </a>");
    }

    out.println("        <div class=\"search-globalnav_960\">");
    out.println("          <!-- Search box -->");
    out.println(
            "          <div class=\"searchbox-top\"><img src=\"/ncitbrowser/images/searchbox-top.gif\" width=\"352\" height=\"2\" alt=\"SearchBox Top\" /></div>");
    out.println("          <div class=\"searchbox\">");
    out.println("");
    out.println("");

    ///////////////
    // searchbox
    ///////////////

    out.println("<form id=\"valueSetSearchForm\" name=\"valueSetSearchForm\" method=\"post\" action=\""
            + contextPath
            + "/ajax?action=search_value_set\" class=\"search-form-main-area\" enctype=\"application/x-www-form-urlencoded;charset=UTF-8\">");

    out.println("<input type=\"hidden\" name=\"valueSetSearchForm\" value=\"valueSetSearchForm\" />");
    out.println("<input type=\"hidden\" name=\"view\" value=\"" + view_str + "\" />");

    out.println(
            "            <input type=\"hidden\" id=\"checked_vocabularies\" name=\"checked_vocabularies\" value=\"\" />");
    out.println(
            "            <input type=\"hidden\" id=\"partial_checked_vocabularies\" name=\"partial_checked_vocabularies\" value=\"\" />");
    out.println(
            "            <input type=\"hidden\" id=\"value_set_home\" name=\"value_set_home\" value=\"true\" />");
    out.println("            <input type=\"hidden\" name=\"vsd_uri\" value=\"" + vsd_uri + "\" />");

    out.println("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin: 2px\" >");
    out.println("  <tr valign=\"top\" align=\"left\">");
    out.println("    <td align=\"left\" class=\"textbody\">");
    out.println("");
    out.println("                  <input CLASS=\"searchbox-input-2\"");
    out.println("                    name=\"matchText\"");
    out.println("                    value=\"" + matchText + "\"");
    out.println("                    onFocus=\"active = true\"");
    out.println("                    onBlur=\"active = false\"");
    out.println(
            "                    onkeypress=\"return submitEnter('valueSetSearchForm:valueset_search',event)\"");
    out.println("                    tabindex=\"1\"/>");
    out.println("");
    out.println("");
    out.println(
            "                <input id=\"valueSetSearchForm:valueset_search\" type=\"image\" src=\"/ncitbrowser/images/search.gif\" name=\"valueSetSearchForm:valueset_search\" alt=\"Search value sets containing matched concepts\" onclick=\"javascript:getCheckedVocabularies();\" tabindex=\"2\" class=\"searchbox-btn\" /><a href=\"/ncitbrowser/pages/help.jsf#searchhelp\" tabindex=\"3\"><img src=\"/ncitbrowser/images/search-help.gif\" alt=\"Search Help\" style=\"border-width:0;\" class=\"searchbox-btn\" /></a>");
    out.println("");
    out.println("");
    out.println("    </td>");
    out.println("  </tr>");
    out.println("");
    out.println("  <tr valign=\"top\" align=\"left\">");
    out.println("    <td>");
    out.println("      <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin: 0px\">");
    out.println("");
    out.println("        <tr valign=\"top\" align=\"left\">");
    out.println("        <td align=\"left\" class=\"textbody\">");
    out.println(
            "                     <input type=\"radio\" name=\"valueset_search_algorithm\" value=\"contains\" alt=\"Contains\" "
                    + algorithm_contains + " tabindex=\"3\"  onclick=\"onVSAlgorithmChanged();\">Contains");
    out.println(
            "                     <input type=\"radio\" name=\"valueset_search_algorithm\" value=\"exactMatch\" alt=\"Exact Match\" "
                    + algorithm_exactMatch + " tabindex=\"3\">Exact Match&nbsp;");
    out.println(
            "                     <input type=\"radio\" name=\"valueset_search_algorithm\" value=\"startsWith\" alt=\"Begins With\" "
                    + algorithm_startsWith
                    + " tabindex=\"3\"  onclick=\"onVSAlgorithmChanged();\">Begins With&nbsp;");
    out.println("        </td>");
    out.println("        </tr>");
    out.println("");
    out.println("        <tr align=\"left\">");
    out.println("            <td height=\"1px\" bgcolor=\"#2F2F5F\" align=\"left\"></td>");
    out.println("        </tr>");
    out.println("        <tr valign=\"top\" align=\"left\">");
    out.println("          <td align=\"left\" class=\"textbody\">");
    out.println(
            "                <input type=\"radio\" id=\"selectValueSetSearchOption\" name=\"selectValueSetSearchOption\" value=\"Name\" "
                    + option_name + " alt=\"Name\" checked tabindex=\"4\"  >Name&nbsp;");
    out.println(
            "                <input type=\"radio\" id=\"selectValueSetSearchOption\" name=\"selectValueSetSearchOption\" value=\"Code\" "
                    + option_code
                    + " alt=\"Code\" tabindex=\"4\" onclick=\"onVSCodeButtonPressed();\">Code&nbsp;");
    out.println("          </td>");
    out.println("        </tr>");

    out.println("      </table>");
    out.println("    </td>");
    out.println("  </tr>");
    out.println("</table>");

    //out.println("                <input type=\"hidden\" name=\"referer\" id=\"referer\" value=\"http%3A%2F%2Flocalhost%3A8080%2Fncitbrowser%2Fpages%2Fresolved_value_set_search_results.jsf\">");
    out.println(
            "                <input type=\"hidden\" id=\"nav_type\" name=\"nav_type\" value=\"valuesets\" />");
    out.println("                <input type=\"hidden\" id=\"view\" name=\"view\" value=\"source\" />");
    //out.println("");

    //out.println("<input type=\"hidden\" name=\"javax.faces.ViewState\" id=\"javax.faces.ViewState\" value=\"j_id22:j_id23\" />");
    out.println("</form>");

    //addHiddenForm(out, checked_vocabularies, partial_checked_vocabularies);

    out.println("          </div> <!-- searchbox -->");

    out.println("");
    out.println(
            "          <div class=\"searchbox-bottom\"><img src=\"/ncitbrowser/images/searchbox-bottom.gif\" width=\"352\" height=\"2\" alt=\"SearchBox Bottom\" /></div>");
    out.println("          <!-- end Search box -->");
    out.println("          <!-- Global Navigation -->");
    out.println("");
    out.println(
            "<table class=\"global-nav\" border=\"0\" width=\"100%\" height=\"37px\" cellpadding=\"0\" cellspacing=\"0\">");
    out.println("  <tr>");
    out.println("    <td align=\"left\" valign=\"bottom\">");
    out.println(
            "      <a href=\"#\" onclick=\"javascript:window.open('/ncitbrowser/pages/source_help_info-termbrowser.jsf',");
    out.println(
            "        '_blank','top=100, left=100, height=740, width=780, status=no, menubar=no, resizable=yes, scrollbars=yes, toolbar=no, location=no, directories=no');\" tabindex=\"13\">");
    out.println("        Sources</a>");
    out.println("");

    String cart_size = (String) request.getSession().getAttribute("cart_size");
    if (!DataUtils.isNull(cart_size)) {
        out.write("|");
        out.write("                        <a href=\"");
        out.print(request.getContextPath());
        out.write("/pages/cart.jsf\" tabindex=\"16\">Cart</a>\r\n");
    }

    //KLO, 022612
    out.println(" \r\n");
    out.println("      ");
    out.print(VisitedConceptUtils.getDisplayLink(request, true));
    out.println(" \r\n");

    // Visited concepts -- to be implemented.
    //      out.println("      | <A href=\"#\" onmouseover=\"Tip('<ul><li><a href=\'/ncitbrowser/ConceptReport.jsp?dictionary=NCI Thesaurus&version=11.09d&code=C44256\'>Ratio &#40;NCI Thesaurus 11.09d&#41;</a><br></li></ul>',WIDTH, 300, TITLE, 'Visited Concepts', SHADOW, true, FADEIN, 300, FADEOUT, 300, STICKY, 1, CLOSEBTN, true, CLICKCLOSE, true)\" onmouseout=UnTip() >Visited Concepts</A>");

    out.println("    </td>");
    out.println("    <td align=\"right\" valign=\"bottom\">");

    out.println("      <a href=\"");
    out.print(request.getContextPath());
    out.println("/pages/help.jsf\" tabindex=\"16\">Help</a>\r\n");
    out.println("    </td>\r\n");
    out.println("    <td width=\"7\"></td>\r\n");
    out.println("  </tr>\r\n");
    out.println("</table>");

    out.println("          <!-- end Global Navigation -->");
    out.println("");
    out.println("        </div> <!-- search-globalnav -->");
    out.println("      </div> <!-- bannerarea -->");
    out.println("");
    out.println("      <!-- end Thesaurus, banner search area -->");

    //addHiddenForm(out, checked_vocabularies, partial_checked_vocabularies);

    out.println("      <!-- Quick links bar -->");
    out.println("");
    out.println("<div class=\"bluebar\">");
    out.println("  <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
    out.println("  <tr>");
    out.println("    <td><div class=\"quicklink-status\">&nbsp;</div></td>");
    out.println("    <td>");
    out.println("");

    addQuickLink(request, out);

    out.println("");
    out.println("      </td>");
    out.println("    </tr>");
    out.println("  </table>");
    out.println("");
    out.println("</div>");

    if (!ServerMonitorThread.getInstance().isLexEVSRunning()) {
        out.println("    <div class=\"redbar\">");
        out.println("      <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
        out.println("        <tr>");
        out.println("          <td class=\"lexevs-status\">");
        out.println("            " + ServerMonitorThread.getInstance().getMessage());
        out.println("          </td>");
        out.println("        </tr>");
        out.println("      </table>");
        out.println("    </div>");
    }

    out.println("      <!-- end Quick links bar -->");
    out.println("");
    out.println("      <!-- Page content -->");
    out.println("      <div class=\"pagecontent\">");
    out.println("");
    /*
          if (!DataUtils.isNull(message)) {
              out.println("<p class=\"textbodyred\">");
              out.print(message);
              out.println("</p>");
              //request.getSession().removeAttribute("message");
          }
    */
    if (!DataUtils.isNullOrBlank(message)) {
        out.println("\r\n");
        out.println("      <p class=\"textbodyred\">");
        out.print(message);
        out.println("</p>\r\n");
        out.println("    ");
        request.getSession().removeAttribute("message");
    }

    if (DataUtils.isNull(vsd_uri)) {
        out.println("<p class=\"textbody\">");
        out.println("View value sets organized by standards category or source terminology.");
        out.println(
                "Standards categories group the value sets supporting them; all other labels lead to the home pages of actual value sets or source terminologies.");
        out.println(
                "Search or browse a value set from its home page, or search all value sets at once from this page (very slow) to find which ones contain a particular code or term.");
        //out.println("Many of these value sets are subsets of NCI Thesaurus that are developed jointly with EVS partners as federal and international coding standards (see the <a href=http://ncit.nci.nih.gov/ncitbrowser/pages/subset.jsf>NCI Thesaurus Subsets</a> page).");
        out.println(
                "Many of these value sets are subsets of NCI Thesaurus that are developed jointly with EVS partners as federal and international coding standards (see the ");
        out.println(" <a href=\"");
        out.print(request.getContextPath());
        out.print("/pages/subset.jsf\">NCI Thesaurus Subsets</a> page).");

        out.println("</p>");
    }

    out.println("      <a href=\"");
    out.print(request.getContextPath());

    out.println("");
    out.println("        <div id=\"popupContentArea\">");
    out.println("          <a name=\"evs-content\" id=\"evs-content\"></a>");
    out.println("");

    //out.println("          <table width=\"580px\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\">");

    out.println(
            "      <table class=\"datatableValueSet_960\" summary=\"\" cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">");

    //out.println("                    <tr><td colspan=\"2\">");
    //out.println("&nbsp;");
    //out.println("                    </td></tr>");

    //(***)
    if (!DataUtils.isNull(vsd_uri)) {

        if (isValueSet) {
            out.println("            <tr class=\"textbody\">");
            out.println("                      <td>");
            out.println("                         <div class=\"texttitle-blue\">Welcome</div>");
            out.println("                      </td>");

            out.println("                      <td class=\"dataCellText\" align=\"right\">");

            out.println("<a href=\"/ncitbrowser/ajax?action=values&vsd_uri=" + vsd_uri
                    + "\"><img src=\"/ncitbrowser/images/values.gif\" alt=\"Values\" border=\"0\" tabindex=\"2\"></a>");
            out.println("&nbsp;");
            out.println("<a href=\"/ncitbrowser/ajax?action=versions&vsd_uri=" + vsd_uri
                    + "\"><img src=\"/ncitbrowser/images/versions.gif\" alt=\"Versions\" border=\"0\" tabindex=\"2\"></a>");
            out.println("&nbsp;");
            out.println("<a href=\"/ncitbrowser/ajax?action=xmldefinitions&vsd_uri=" + vsd_uri
                    + "\"><img src=\"/ncitbrowser/images/xmldefinitions.gif\" alt=\"XML Definition\" border=\"0\" tabindex=\"2\"></a>");

            out.println("                      </td>");
            out.println("            </tr>");
        } else {
            out.println("            <tr class=\"textbody\">");
            out.println("                      <td>");
            out.println("                         <div class=\"texttitle-blue\">Welcome</div>");
            out.println("                      </td>");

            out.println("                      <td class=\"dataCellText\" align=\"right\">");
            out.println("&nbsp;");
            out.println("                       </td>");
            out.println("            </tr>");
        }

        out.println("                    <tr><td colspan=\"2\" align=\"left\"><b>");
        out.println(vsd_name);
        out.println("                    </b></td></tr>");

        out.println("                    <tr><td colspan=\"2\" align=\"left\">");
        out.println(vsd_description);
        out.println("                    </td></tr>");

    }

    //out.println("                    <tr><td colspan=\"2\">");
    //out.println("                      <hr/>");
    //out.println("                    </td></tr>");

    if (DataUtils.isNull(vsd_uri)) {

        out.println("            <tr class=\"textbody\">");
        out.println("              <td class=\"textbody\" align=\"left\">");
        out.println("");

        if (view == Constants.STANDARD_VIEW) {
            out.println("                Standards View");
            out.println("                &nbsp;|");
            out.println("                <a href=\"" + contextPath
                    + "/ajax?action=create_cs_vs_tree\" tabindex=\"99\" >Terminology View</a>");
        } else {
            out.println("                <a href=\"" + contextPath
                    + "/ajax?action=create_src_vs_tree\" tabindex=\"100\">Standards View</a>");
            out.println("                &nbsp;|");
            out.println("                Terminology View");
        }
        out.println("              </td>");
        out.println("");
        out.println("              <td align=\"right\">");
        out.println("               <font size=\"1\" color=\"red\" align=\"right\">");
        out.println(
                "                 <a href=\"javascript:printPage()\"><img src=\"/ncitbrowser/images/printer.bmp\" border=\"0\" alt=\"Send to Printer\"><i>Send to Printer</i></a>");
        out.println("               </font>");

        out.println("              </td>");
        out.println("            </tr>");
    }

    out.println("          </table>");
    out.println("");
    out.println("          <hr/>");
    out.println("");
    out.println("");
    out.println("");
    out.println("<style>");
    out.println(
            "#expandcontractdiv {border:1px solid #336600; background-color:#FFFFCC; margin:0 0 .5em 0; padding:0.2em;}");
    out.println("#treecontainer { background: #fff }");
    out.println("</style>");
    out.println("");
    out.println("");
    out.println("<div id=\"expandcontractdiv\">");
    out.println("   <a id=\"expand_all\" href=\"#\" tabindex=\"101\" >Expand all</a>");
    out.println("   <a id=\"collapse_all\" href=\"#\" tabindex=\"102\">Collapse all</a>");
    out.println("   <a id=\"check_all\" href=\"#\" tabindex=\"103\">Check all</a>");
    out.println("   <a id=\"uncheck_all\" href=\"#\" tabindex=\"104\">Uncheck all</a>");
    out.println("</div>");
    out.println("");
    out.println("");
    out.println("");
    out.println("          <!-- Tree content -->");
    out.println("");
    out.println("          <div id=\"treecontainer\" class=\"ygtv-checkbox\"></div>");
    out.println("");
    out.println("          <form id=\"pg_form\"  enctype=\"application/x-www-form-urlencoded;charset=UTF-8\">");
    out.println(
            "            <input type=\"hidden\" id=\"ontology_node_id\" name=\"ontology_node_id\" value=\"null\" />");
    out.println("            <input type=\"hidden\" id=\"schema\" name=\"schema\" value=\"null\" />");
    out.println("            <input type=\"hidden\" id=\"view\" name=\"view\" value=\"source\" />");
    out.println("          </form>");
    out.println("");
    out.println("");
    out.println("        </div> <!-- popupContentArea -->");
    out.println("");
    out.println("");
    out.println("<div class=\"textbody\">");
    out.println("<!-- footer -->");
    out.println("<div class=\"footer\" style=\"width:920px\">");
    out.println("  <ul>");
    out.println(
            "    <li><a href=\"http://www.cancer.gov\" target=\"_blank\" alt=\"National Cancer Institute\">NCI Home</a> |</li>");
    out.println("    <li><a href=\"/ncitbrowser/pages/contact_us.jsf\">Contact Us</a> |</li>");
    out.println(
            "    <li><a href=\"http://www.cancer.gov/policies\" target=\"_blank\" alt=\"National Cancer Institute Policies\">Policies</a> |</li>");
    out.println(
            "    <li><a href=\"http://www.cancer.gov/policies/page3\" target=\"_blank\" alt=\"National Cancer Institute Accessibility\">Accessibility</a> |</li>");
    out.println(
            "    <li><a href=\"http://www.cancer.gov/policies/page6\" target=\"_blank\" alt=\"National Cancer Institute FOIA\">FOIA</a></li>");
    out.println("  </ul>");
    out.println("  <p>");
    out.println("    A Service of the National Cancer Institute<br />");
    out.println("    <img src=\"/ncitbrowser/images/external-footer-logos.gif\"");
    out.println("      alt=\"External Footer Logos\" width=\"238\" height=\"34\" border=\"0\"");
    out.println("      usemap=\"#external-footer\" />");
    out.println("  </p>");
    out.println("  <map id=\"external-footer\" name=\"external-footer\">");
    out.println("    <area shape=\"rect\" coords=\"0,0,46,34\"");
    out.println("      href=\"http://www.cancer.gov\" target=\"_blank\"");
    out.println("      alt=\"National Cancer Institute\" />");
    out.println("    <area shape=\"rect\" coords=\"55,1,99,32\"");
    out.println("      href=\"http://www.hhs.gov/\" target=\"_blank\"");
    out.println("      alt=\"U.S. Health &amp; Human Services\" />");
    out.println("    <area shape=\"rect\" coords=\"103,1,147,31\"");
    out.println("      href=\"http://www.nih.gov/\" target=\"_blank\"");
    out.println("      alt=\"National Institutes of Health\" />");
    out.println("    <area shape=\"rect\" coords=\"148,1,235,33\"");
    out.println("      href=\"http://www.usa.gov/\" target=\"_blank\"");
    out.println("      alt=\"USA.gov\" />");
    out.println("  </map>");
    out.println("</div>");
    out.println("<!-- end footer -->");
    out.println("</div>");
    out.println("");
    out.println("");
    out.println("      </div> <!-- pagecontent -->");
    out.println("    </div> <!--  main-area -->");
    out.println(
            "    <div class=\"mainbox-bottom\"><img src=\"/ncitbrowser/images/mainbox-bottom.gif\" width=\"945\" height=\"5\" alt=\"Mainbox Bottom\" /></div>");
    out.println("");
    out.println("  </div> <!-- center-page -->");
    out.println("");

    addHiddenForm(out, checked_vocabularies, partial_checked_vocabularies);

    out.println("</body>");
    out.println("</html>");
    out.println("");
}