Changeset 7034 for SRUAggregator


Ignore:
Timestamp:
07/06/16 15:00:37 (8 years ago)
Author:
Leif-Jöran
Message:

Added fully visible but unstyled ADV view. Very similar to the spreadsheet export. Updated some of the paragraphs on the help page. Preparing for new version number.

Location:
SRUAggregator/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • SRUAggregator/trunk/pom.xml

    r7016 r7034  
    88        <groupId>eu.clarin.sru.fcs</groupId>
    99        <artifactId>aggregator</artifactId>
    10         <version>2.0.0-beta-54</version>
     10        <version>2.9.90-alpha-56</version>
    1111        <name>FCS Aggregator</name>
    1212
     
    109109                    <artifactId>language-detector</artifactId>
    110110                        <version>0.4</version>
     111                        <!-- version 0.5 is using java 8 features? -->
    111112                        <exclusions>
    112113                                <exclusion>
     
    120121                        <groupId>org.apache.poi</groupId>
    121122                        <artifactId>poi-ooxml</artifactId>
    122                         <version>3.11-beta2</version>
     123                        <version>3.15-beta2</version>
    123124                </dependency>
    124125                <dependency>
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/rest/RestService.java

    r7028 r7034  
    5353public class RestService {
    5454
    55         private static final String EXPORT_FILENAME_PREFIX = "ClarinDFederatedContentSearch-";
     55        private static final String EXPORT_FILENAME_PREFIX = "ClarinFederatedContentSearch-";
    5656        private static final String TCF_MEDIA_TYPE = "text/tcf+xml";
    5757        private static final String EXCEL_MEDIA_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
  • SRUAggregator/trunk/src/main/resources/assets/js/main.jsx

    r7016 r7034  
    33"use strict";
    44
    5 var VERSION = window.MyAggregator.VERSION = "v.2.0.0-beta-54";
     5var VERSION = window.MyAggregator.VERSION = "v.2.9.90-alpha-56";
    66
    77var URLROOT = window.MyAggregator.URLROOT =
     
    411411                                <div className="top-gap">
    412412                                        <h1>Help</h1>
    413                                         <h3>Performing search in FCS corpora</h3>
    414                                         <p>To perform simple keyword search in all CLARIN-D Federated Content Search centres
     413                                        <h3>Performing search in Federated Content Search corpora</h3>
     414                                        <p>To perform a simple keyword search in all CLARIN Federated Content Search centres
    415415                                        and their corpora, go to the search field at the top of the page,
    416                                         enter your query, and click 'search' button or press the 'Enter' key.</p>
     416                                        enter your query, and click the 'search' button or press the 'Enter' key.</p>
     417                                        <p>To perform an advanced search on multiple annotation layers in CLARIN Federated Content Search centres that support this, switch to Multi-layer Federated Content Search (FCS) in the dropdown list, enter a FCS query in the search field at the top of the page, and click the 'search' button or press the 'Enter' key.</p>
    417418
    418419                                        <p>When the search starts, the page will start filling in with the corpora responses.
     
    433434                                        right below the search fiels on the main page. The current options are
    434435                                        to filter resources based on their language, to select specific resources, and
    435                                         to set the maximum number of hits.</p>
     436                                        to set the maximum number of hits. In the multi-layer FCS search the supported layers filter on the supported features like, e. g. part of speech or lemma in addition to the other filter options.</p>
    436437
    437438
  • SRUAggregator/trunk/src/main/resources/assets/js/search.jsx

    r7026 r7034  
    467467                        hits: this.nohits,
    468468                        searchId: null,
     469                        displayADV: layerId == "fcs" ? true : false,
    469470                        corpora: this.state.corpora, // === this.state.corpora.update();
    470471                });
     
    501502                                                               langCode === null;
    502503                                                }),
     504                                        advancedLayers: noLangFiltering ? corpusHit.advancedLayers :
     505                                                corpusHit.advancedLayers.filter(function(layer) {
     506                                                        return layer.language === langCode ||
     507                                                               langCode === multipleLanguageCode ||
     508                                                               langCode === null;
     509                                                }),
    503510                                };
    504511                        });
     
    784791                return {
    785792                        displayKwic: false,
     793                        displayADV: false,
    786794                };
    787795        },
     
    789797        toggleKwic: function() {
    790798                this.setState({displayKwic:!this.state.displayKwic});
     799        },
     800
     801        toggleADV: function() {
     802                this.setState({displayADV:!this.state.displayADV});
    791803        },
    792804
     
    824836        },
    825837
    826         renderRowsAsAdv: function(hit,i) {
    827                 var sleft={textAlign:"left", verticalAlign:"top", width:"50%"};
    828                 var scenter={textAlign:"center", verticalAlign:"top", maxWidth:"50%"};
    829                 var sright={textAlign:"right", verticalAlign:"top", maxWidth:"50%"};
    830                 return  <tr key={i} className="hitrow">
    831                                         <td>{this.renderRowLanguage(hit)}</td>
    832                                         <td style={sright}>{hit.left}</td>
    833                                         <td style={scenter} className="keyword">{hit.keyword}</td>
    834                                         <td style={sleft}>{hit.right}</td>
    835                                 </tr>;
     838        renderRowsAsADV: function(hit,i) {
     839            var sleft={textAlign:"left", verticalAlign:"top", width:"50%"};
     840            var scenter={textAlign:"center", verticalAlign:"top", maxWidth:"50%"};
     841            var sright={textAlign:"right", verticalAlign:"top", maxWidth:"50%"};
     842           
     843            function renderSpans(span, idx) {
     844                return <td key={idx} className={span.hit?"keyword":""}>{span.text}</td>;
     845            }
     846            return <tr key={i} className="hitrow">
     847                      {this.renderRowLanguage(hit)}
     848                      <td style={sleft}>{hit.pid}</td>
     849                      <td style={sleft}>{hit.reference}</td>
     850                      {hit.spans.map(renderSpans)}
     851                   </tr>;
    836852        },
    837853
     
    866882
    867883        renderPanelBody: function(corpusHit) {
    868                 var fulllength = {width:"100%"};
    869                 if (this.state.displayKwic) {
    870                         return  <div>
    871                                                 {this.renderErrors(corpusHit)}
    872                                                 {this.renderDiagnostics(corpusHit)}
    873                                                 <table className="table table-condensed table-hover" style={fulllength}>
    874                                                         <tbody>{corpusHit.kwics.map(this.renderRowsAsKwic)}</tbody>
    875                                                 </table>
    876                                         </div>;
    877                 } else {
    878                         return  <div>
    879                                                 {this.renderErrors(corpusHit)}
    880                                                 {this.renderDiagnostics(corpusHit)}
    881                                                 {corpusHit.kwics.map(this.renderRowsAsHits)}
    882                                         </div>;
    883                 }
     884            var fulllength = {width:"100%"};
     885
     886            if (this.state.displayADV) {
     887                return  <div>
     888                            {this.renderErrors(corpusHit)}
     889                            {this.renderDiagnostics(corpusHit)}
     890                            <table className="table table-condensed table-hover" style={fulllength}>
     891                                <tbody>{corpusHit.advancedLayers.map(this.renderRowsAsADV)}</tbody>
     892                            </table>
     893                </div>;
     894            } else if (this.state.displayKwic) {
     895                return  <div>
     896                    {this.renderErrors(corpusHit)}
     897                    {this.renderDiagnostics(corpusHit)}
     898                    <table className="table table-condensed table-hover" style={fulllength}>
     899                        <tbody>{corpusHit.kwics.map(this.renderRowsAsKwic)}</tbody>
     900                    </table>
     901                </div>;
     902            } else  {
     903                return  <div>
     904                    {this.renderErrors(corpusHit)}
     905                    {this.renderDiagnostics(corpusHit)}
     906                    {corpusHit.kwics.map(this.renderRowsAsHits)}
     907                </div>;
     908            }
    884909        },
    885910
     
    898923
    899924        renderDisplayADV: function() {
    900                 return  <div className="inline btn-group" style={{display:"inline-block"}}>
    901                                         <label forHtml="inputKwic" className="btn btn-flat">
    902                                                 { this.state.displayKwic ?
    903                                                         <input id="inputKwic" type="checkbox" value="kwic" checked onChange={this.toggleKwic} /> :
    904                                                         <input id="inputKwic" type="checkbox" value="kwic" onChange={this.toggleKwic} />
    905                                                 }
    906                                                 &nbsp;
    907                                                 Display as AdvancedDataView
    908                                         </label>
    909                                 </div>;
     925                return  <div className="inline btn-group" style={{display:"inline-block"}}>
     926                                        <label forHtml="inputADV" className="btn btn-flat">
     927                                                { this.state.displayADV ?
     928                                                        <input id="inputADV" type="checkbox" value="adv" checked onChange={this.toggleADV} /> :
     929                                                        <input id="inputADV" type="checkbox" value="adv" onChange={this.toggleADV} />
     930                                                }
     931                                                &nbsp;
     932                                                Display as AdvancedDataView (ADV)
     933                                        </label>
     934                                </div>;
    910935        },
    911936
     
    10411066                                                        <div className="float-right">
    10421067                                                                <div>
    1043                                                                         { this.renderDisplayKWIC() }
     1068                                                                        {this.renderDisplayKWIC()}
     1069                                                                        {this.renderDisplayADV()}
    10441070                                                                        <div className="inline"> {this.renderDownloadLinks(corpusHit.corpus.id)} </div>
    10451071                                                                        <div className="inline"> {this.renderToWeblichtLinks(corpus.id, forceLanguage, wlerror)} </div>
     
    11361162                                                                <div className="float-right">
    11371163                                                                        <div>
    1138                                                                                 { this.renderDisplayKWIC() }
     1164                                                                                {this.renderDisplayKWIC()}
     1165                                                                                {this.renderDisplayADV()}
    11391166                                                                                { collhits.inProgress === 0 ?
    11401167                                                                                        <div className="inline"> {this.renderDownloadLinks()} </div>
Note: See TracChangeset for help on using the changeset viewer.