Changeset 668 for trunk/gsdl/src/recpt/vlistbrowserclass.cpp
- Timestamp:
- 1999-10-15T11:59:35+13:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/vlistbrowserclass.cpp
r649 r668 28 28 /* 29 29 $Log$ 30 Revision 1.2 1999/10/14 22:59:34 sjboddie 31 finished off browser classes 32 30 33 Revision 1.1 1999/10/10 08:14:11 sjboddie 31 34 - metadata now returns mp rather than array … … 46 49 } 47 50 48 49 50 // configure should be called once for each configuration line51 // the default version does nothing52 void vlistbrowserclass::configure (const text_t &/*key*/, const text_tarray &/*cfgline*/) {53 }54 55 // init should be called after all the configuration is done but56 // before any other methods are called57 bool vlistbrowserclass::init (ostream &/*logout*/) {58 return true;59 }60 61 51 // returns the name that specifies the browserclass type 62 52 text_t vlistbrowserclass::get_browser_name () { … … 64 54 } 65 55 66 void vlistbrowserclass::processOID (cgiargsclass &/*args*/) {67 }68 69 56 void vlistbrowserclass::load_metadata_defaults (text_tset &metadata) { 70 57 metadata.insert ("haschildren"); 71 58 metadata.insert ("doctype"); 72 metadata.insert ("classifytype"); 59 } 60 61 text_t vlistbrowserclass::get_default_formatstring () { 62 return "<td>[link][icon][/link]</td><td>[highlight]{Or}{[Title],Untitled}[/highlight]</td>"; 73 63 } 74 64 75 65 int vlistbrowserclass::output_section_group (ResultDocInfo_t §ion, cgiargsclass &args, 76 const int &colnumber, format_t *formatlistptr,77 const bool &use_table, displayclass &disp,78 outconvertclass &outconvert, ostream &textout,79 o stream &logout) {66 int colnumber, format_t *formatlistptr, 67 bool use_table, text_tset &/*metadata*/, bool &/*getParents*/, 68 recptproto */*collectproto*/, displayclass &disp, 69 outconvertclass &outconvert, ostream &textout, ostream &/*logout*/) { 80 70 81 71 text_t link, icon; 82 72 get_link_icon (section, args, link, icon); 83 84 output_section (section, colnumber, formatlistptr, use_table, 85 link, icon, disp, outconvert, textout, logout); 86 87 return 1; 88 } 89 90 void vlistbrowserclass::output_section (ResultDocInfo_t §ion, const int &colnumber, 91 format_t *formatlistptr, const bool &use_table, 92 const text_t &link, const text_t &icon, 93 displayclass &disp, outconvertclass &outconvert, 94 ostream &textout, ostream &logout) { 95 73 bool highlight = false; 74 if (!args["d"].empty()) { 75 if (args["d"] == section.OID) highlight = true; 76 } else 77 if (args["cl"] == section.OID) highlight = true; 78 79 96 80 if (use_table || colnumber > 0) { 97 textout << "<table><tr> <td>";81 textout << "<table><tr>"; 98 82 // get tab size 99 83 text_t tab; int itab; … … 101 85 itab = tab.getint(); 102 86 if (colnumber > 0) textout << outconvert << disp 103 << "< img src=\"_httpimg_/space.gif\" width="104 << (itab*colnumber) << "> ";105 textout << "</td>";106 } 107 108 textout << outconvert << disp << get_formatted_string (section, formatlistptr, link, icon);109 87 << "<td><img src=\"_httpimg_/space.gif\" width=" 88 << (itab*colnumber) << "></td>"; 89 } 90 91 textout << outconvert << disp << get_formatted_string (section, formatlistptr, 92 link, icon, highlight); 93 110 94 if (use_table || colnumber > 0) textout << "</tr></table>\n"; 95 96 return 1; 97 } 98 99 int vlistbrowserclass::output_section_group (FilterResponse_t §ions, cgiargsclass &args, 100 int colnumber, format_t *formatlistptr, 101 bool use_table, text_tset &/*metadata*/, bool &/*getParents*/, 102 recptproto */*collectproto*/, displayclass &disp, 103 outconvertclass &outconvert, ostream &textout, ostream &/*logout*/) { 104 105 text_t link, icon; 106 text_t &arg_d = args["d"]; 107 text_t &arg_cl = args["cl"]; 108 109 if (colnumber > 0) { 110 textout << "<table><tr>"; 111 // get tab size 112 text_t tab; int itab; 113 disp.expandstring ("Global", "_tabwidth_", tab); 114 itab = tab.getint(); 115 if (colnumber > 0) textout << outconvert << disp 116 << "<td><img src=\"_httpimg_/space.gif\" width=" 117 << (itab*colnumber) << "></td>"; 118 textout << "<td>"; 119 } 120 if (use_table) textout << "<table>\n"; 121 122 ResultDocInfo_tarray::iterator thissection = sections.docInfo.begin(); 123 ResultDocInfo_tarray::iterator endsection = sections.docInfo.end(); 124 125 while (thissection != endsection) { 126 127 get_link_icon (*thissection, args, link, icon); 128 bool highlight = false; 129 if (!arg_d.empty()) { 130 if (arg_d == (*thissection).OID) highlight = true; 131 } else 132 if (arg_cl == (*thissection).OID) highlight = true; 133 134 if (use_table || colnumber > 0) textout << "<tr>"; 135 textout << outconvert << disp << get_formatted_string (*thissection, formatlistptr, 136 link, icon, highlight); 137 if (use_table || colnumber > 0) textout << "</tr>"; 138 textout << "\n"; 139 thissection ++; 140 } 141 142 if (use_table) textout << "</table>\n"; 143 if (colnumber > 0) textout << "</table></td></tr></table>\n"; 144 145 return 1; 111 146 } 112 147 … … 119 154 link = "<a href=\"_httpdocument_"; 120 155 icon = "_document:icontext_"; 121 int haschildren = section.metadata["haschildren"].values.back().getint(); 122 const text_t doctype = section.metadata["doctype"].values.back(); 156 int haschildren = section.metadata["haschildren"].values[0].getint(); 157 const text_t doctype = section.metadata["doctype"].values[0]; 158 159 text_t &arg_d = args["d"]; 160 text_t &arg_cl = args["cl"]; 123 161 124 162 if (args["a"] == "q") { … … 128 166 link += "&cl=search&d=" + section.OID + "\">"; 129 167 130 } else if (!arg s["d"].empty()) {168 } else if (!arg_d.empty()) { 131 169 // document level 132 170 if (is_top(section.OID)) { 133 171 icon = "_document:iconopenbook_"; 134 if (arg s["cl"]== "search") link = "<a href=\"_httpquery_\">";135 else link += "&cl=" + arg s["cl"] + "&d=" + section.OID + ".pr\">";172 if (arg_cl == "search") link = "<a href=\"_httpquery_\">"; 173 else link += "&cl=" + arg_cl + "\">"; 136 174 137 175 } else if (haschildren == 1) { 138 if ((args["gc"] == "1") || (is_child_of (section.OID, args["d"]))) { 176 if ((args["gc"] == "1") || 177 (is_child_of (section.OID, arg_d)) || 178 (section.OID == arg_d)) { 139 179 icon = "_document:iconopenfolder_"; 140 link += "&cl=" + arg s["cl"]+ "&d=" + section.OID + ".pr\">";180 link += "&cl=" + arg_cl + "&d=" + section.OID + ".pr\">"; 141 181 } else { 142 182 icon = "_document:iconclosedfolder_"; 143 link += "&cl=" + arg s["cl"]+ "&d=" + section.OID + "\">";183 link += "&cl=" + arg_cl + "&d=" + section.OID + "\">"; 144 184 } 145 } else link += "&cl=" + arg s["cl"]+ "&d=" + section.OID + "\">";185 } else link += "&cl=" + arg_cl + "&d=" + section.OID + "\">"; 146 186 147 187 } else { … … 149 189 if (haschildren == 1) { 150 190 if (doctype == "classify") { 151 if ((args["gc"] == "1") || (is_child_of (section.OID, args["cl"]))) { 191 if ((args["gc"] == "1") || 192 (is_child_of (section.OID, arg_cl)) || 193 (section.OID == arg_cl)) { 152 194 icon = "_document:iconopenbookshelf_"; 153 195 link += "&cl=" + section.OID + ".pr\">"; … … 158 200 } else { 159 201 icon = "_document:iconclosedbook_"; 160 link += "&cl=" + arg s["cl"]+ "&d=" + section.OID + "\">";202 link += "&cl=" + arg_cl + "&d=" + section.OID + "\">"; 161 203 } 162 204 } else { 163 205 if (doctype == "classify") link = ""; 164 else link += "&cl=" + arg s["cl"]+ "&d=" + section.OID + "\">";206 else link += "&cl=" + arg_cl + "&d=" + section.OID + "\">"; 165 207 } 166 208 }
Note:
See TracChangeset
for help on using the changeset viewer.