This page last changed on Apr 23, 2008 by alejandro.giacometti@gmail.com.

Search

Monk.component.SearchComponent

This is the Search box that appears on the top right of the Workbench. It can take a simple, or an advanced query. On submit it sends out a search event that can be interpreted by any component that  wants to make use of a general search. By convention, only the focused component will react to to the search event.

It does not perform any search by itself.

Monk.event.workbench.SearchQuery

MonkEvent sent out by the SearchComponent. All components are aware of it. Only focused component should react to it.

Properties  
label Event label
searchType simple (default) or advanced
Data  
corpusCriterion the ID of the collection to search
pubDateStart / pubDateEnd publication dates (year)
posCriterion a part of speech criterion
lemmaPatternCriterion a pattern to search

Component Event Handling

This is how the Collections Tree Browser reacts to the event.

if (monkEvent.instanceOf(Monk.event.workbench.SearchQuery)) {
            if (this.hasFocus) {
            	if (monkEvent.searchType == 'advanced') {
            		var query = data;
            		
            		Monk.data.chunk.getChunksContainingFeature(query);
            	} else {
	                var query = data.query;
	                Monk.data.chunk.getChunksContainingFeature({
	                    lemmaPatternCriterion: query
	                });
            	}
            }
}
Document generated by Confluence on Apr 19, 2009 15:04