Changeset 16123


Ignore:
Timestamp:
2008-06-24T15:51:47+12:00 (16 years ago)
Author:
mdewsnip
Message:

Improved to nested hlists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/src/recpt/dynamicclassifieraction.cpp

    r16122 r16123  
    348348  }
    349349
    350   // If no classifier node has been specified automatically go to the first hlist node
    351   if (args["dcn"] == parent_classifier_node_OID)
    352   {
    353     args["dcn"] = (*hlist_classifier_nodes.begin()).first;
    354   }
    355 
    356350  // Add the necessary metadata to the hlist classifier nodes
    357351  text_t selected_hlist_node_OID = "";
     
    361355  {
    362356    text_t hlist_classifier_node_OID = (*hlist_classifier_nodes_iterator).first;
     357    if (parent_classifier_node_OID != "")
     358    {
     359      hlist_classifier_node_OID = parent_classifier_node_OID + "|" + hlist_classifier_node_OID;
     360    }
    363361
    364362    // Is this the hlist node that is currently selected?
     
    374372    hlist_classifier_node.metadata["haschildren"].values.push_back ("1");
    375373    hlist_classifier_node.metadata["numleafdocs"].values.push_back ("?");  // We can't determine this without more database requests
    376     hlist_classifier_node.metadata["Title"].values.push_back (hlist_classifier_node_OID);
     374    hlist_classifier_node.metadata["Title"].values.push_back ((*hlist_classifier_nodes_iterator).first);
    377375    hlist_classifier_nodes_response.docInfo.push_back (hlist_classifier_node);
    378376
    379377    hlist_classifier_nodes_iterator++;
     378  }
     379
     380  // Automatically select the first hlist node if necessary
     381  if (selected_hlist_node_OID == "")
     382  {
     383    selected_hlist_node_OID = (*hlist_classifier_nodes_response.docInfo.begin()).OID;
     384
     385    if (args["dcn"] == parent_classifier_node_OID)
     386    {
     387      args["dcn"] = selected_hlist_node_OID;
     388    }
    380389  }
    381390
Note: See TracChangeset for help on using the changeset viewer.