Ignore:
Timestamp:
2000-09-07T09:49:07+12:00 (24 years ago)
Author:
davidb
Message:

Improvements to corba implementation so images within a collection
are handled better and images in the remote site but not in the local
site are cached locally.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/corba/gsdl/src/recpt/pageaction.cpp

    r1033 r1509  
    2828/*
    2929   $Log$
     30   Revision 1.29.2.1  2000/09/06 21:49:02  davidb
     31
     32   Improvements to corba implementation so images within a collection
     33   are handled better and images in the remote site but not in the local
     34   site are cached locally.
     35
    3036   Revision 1.29  2000/03/19 21:16:46  nzdl
    3137   added german language interface
     
    204210    while (collist_here != collist_end) {
    205211     
     212      text_t protocol_name = (*rprotolist_here).p->get_protocol_name ();
     213
    206214      ColInfoResponse_t cinfo;
    207215      (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout);
    208      
     216
    209217      if (err == noError) {
    210218        if (cinfo.isPublic && (cinfo.buildDate > 0)) {
     
    217225          text_t collectionname = *collist_here;
    218226          text_t alt = collectionname;
     227
    219228          if (get_info ("collection", *collist_here, metadata, false,
    220229                (*rprotolist_here).p, response, logout)) {
    221230        if (!response.docInfo[0].metadata["collectionname"].values[0].empty())
    222231          alt = response.docInfo[0].metadata["collectionname"].values[0];
    223        
     232
     233        text_t iconurl;
     234        iconurl.clear();
     235
    224236        if (!response.docInfo[0].metadata["iconcollectionsmall"].values[0].empty())
    225             collectionname = "<img width=150 border=1 src=\""
    226               + response.docInfo[0].metadata["iconcollectionsmall"].values[0]
    227               + "\" alt=\"" + alt + "\">";
     237          {
     238            iconurl = response.docInfo[0].metadata["iconcollectionsmall"].values[0];
     239
     240          }
    228241        else if (!response.docInfo[0].metadata["iconcollection"].values[0].empty())
    229           collectionname = "<img width=150 border=1 src=\""
    230             + response.docInfo[0].metadata["iconcollection"].values[0]
    231             + "\" alt=\"" + alt + "\">";
    232         else collectionname = alt;
     242          {
     243            iconurl = response.docInfo[0].metadata["iconcollection"].values[0];
     244          }
     245
     246        if (!iconurl.empty())
     247          {
     248            // check to see URL is local to colserver
     249            text_t::iterator iconurl_head = iconurl.begin();
     250            text_t iconhead = substr(iconurl_head,iconurl_head+16);
     251            if (iconhead=="_httpcollection_")
     252              {
     253            // local and using _httpcollection_
     254            text_t icontail = substr(iconurl_head+16,iconurl.end());
     255            iconurl = "http://" + cinfo.httpdomain
     256              + cinfo.httpprefix + "/collect/"
     257              + *collist_here + "/" + icontail;
     258              }
     259            else if (iconurl[0]=='/')
     260              {
     261            // local but with full path
     262            iconurl = "http://" + cinfo.httpdomain + iconurl;
     263              }
     264
     265            collectionname
     266              = "<img width=150 border=1 src=\"" + iconurl + "\" alt=\"" + alt + "\">";
     267          }
     268        else
     269          {
     270            collectionname = alt;
     271          }
     272
    233273          }
    234274       
     
    246286          }
    247287         
    248           text_t link = "<a href=\"_gwcgi_?a=p&p=about&c=" + *collist_here + "\">";
     288          text_t optsite = "";
     289          text_t site_name = (*rprotolist_here).p->get_site_name ();
     290          if (!site_name.empty()) { optsite = "site="+site_name+"&"; }
     291
     292          text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + "\">";
    249293          if (*collist_here == "chinese")
    250         link = "<a href=\"_gwcgi_?a=p&p=about&l=zh&nw=u&c=" + *collist_here + "\">";
     294        link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&l=zh&nw=u&c=" + *collist_here + "\">";
    251295          if (*collist_here == "arabic")
    252         link = "<a href=\"_gwcgi_?a=p&p=about&w=a&c=" + *collist_here + "\">";
     296        link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&w=a&c=" + *collist_here + "\">";
    253297
    254298          if (!cinfo.receptionist.empty())
     
    266310      collist_here ++;
    267311    }
    268     homeextra += "</tr></table></center>\n";
    269     disp.setmacro ("homeextra", "home", homeextra);
    270       }
    271     }
     312      }
     313    }
     314    homeextra += "</td>";
    272315    rprotolist_here ++;
    273316  }
     317  homeextra += "</tr></table></center>\n";
     318  disp.setmacro ("homeextra", "home", homeextra);
     319
    274320}
    275321
Note: See TracChangeset for help on using the changeset viewer.