Hi guys,
I'm playing with the Exhibit format printer in SemanticResultFormats.

Specifically, I do an ask query like this:


{{#ask: [[Category:E22 1.Art Object]]
[[HasDeparment::+]]
[[HasClassification::+]]
[[HasObjectType::+]]
[[HasObjectName::+]]
| ?HasDeparment
| ?HasClassification
| ?HasObjectType
| ?HasObjectName
| ?P102F has title
| ?HasThumbnailImage
| format=exhibit
| views=tabular,tiles
| facets=HasDeparment,HasClassification,HasObjectType,HasObjectName
| limit=21
}}

and HasThumbnailImage is a property that points to an Image URI.
eg:
http://ssemtestdb00:8765/services/MediaBinImageURI/Default.aspx?objAcc=02.6.129&getBest=true&imgSize=3&ext=.jpg


coming out of the wiki text parser, those uris get turned into full image tags. 
Which is what I want. And the table that gets generated from the ASK query 
looks 
like:
    <tr>
        <td><a href="/metwiki/index.php/02.6.129" 
title="02.6.129">02.6.129</a></td>
        <td>European Sculpture and Decorative Arts</td>
        <td>Ceramics-Porcelain</td>
        <td>normal object (accessioned)</td>
        <td>Stand</td>

        <td></td>
        
    </tr>


Here is where Exhibit's javascript takes over, pulling all the data from the 
table and indexing it. for faceting and sorting and whatnot, I guess.
However, as it does this, it explicitely replaces the img tag with just the 
text 
of the uri.

in 
extensions/SemanticResultFormats/Exhibit/exhibit/scripts/data/importers/html-table-importer.js,
 around line 150:
    var img, imgs = table.getElementsByTagName("img");
    while( img = imgs[0] ){ // replace any images with their respective URLs 
donundeen: I don't want to do that!!!
              img.parentNode.replaceChild( document.createTextNode( img.src ), 
img );
    }


However, I can't just remove this chunk of code, because the bit that comes 
after will extract the text anyways, and not get any from the image tag:
 var items = [], td, raw;
    for( row = 1; tr = trs[row]; row++ ) {
        var item = {};
        var tds = tr.getElementsByTagName("td");
        for( col = 0; td = tds[col]; col++ ) {
      var raw = textOf( td ); // this part removes anything that's not text. 
hence, no image tags get through. But I want to see images...
            data = columnData[col].valueParser( raw, td, row, col );
            if( data == null || raw === "" ) {
          continue;
            }
            if( typeof data == 'object' && !(data instanceof Array) ) {
                for( var property in data ) {
                    item[property] = data[property];
                }
            } else {
                item[fields[col]] = data;
            }
        }
        if( type )
            item.type = type;
        items.push( item );
        parsed.items = items;
    }


Is there a way to accomplish what I want? I just want to see the images in the 
tabular and Tiles output formats. I don't care about using the value of the 
image tag (whatever that would mean) for faceting or sorting.

Does exhibit have a setting to help with this? Or a newer version or something?
I'm using:

MediaWiki 1.15.1 
PHP 5.2.9 (apache2handler) 
MySQL 5.1.33-community
 Semantic MediaWiki (Version 1.5.0)
Semantic Forms (Version 1.9) Forms for adding and editing semantic data

Or if you guys can recommend a better forum for this issue (an exhibit-focused 
forum, maybe?) I'd appreciate it.

Thanks!
------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to