rose-website/src/main/java/rose/gwt/client/App.java
// If search arguments are null, just displays search dialog
If search arguments are null, just displays search dialog
If search arguments are null just displays search dialog
private void viewSearch(final Searcher.UserField[] userfields,
            final String[] userqueries, final String[] restrictedbookids,
            final int offset, final String searchtokenprefix) {
        book = null;
        if (userfields == null || userqueries == null) {
            initDisplay(Labels.INSTANCE.search(), true);
            content.add(createAdvancedSearchWidget(userfields, userqueries,
                    restrictedbookids));
            return;
        }
        loadingdialog.display();
        if (charnames_variants == null) {
            try {
                Resources.INSTANCE.characterNamesTable().getText(
                        new ResourceCallback<TextResource>() {
                            public void onSuccess(TextResource resource) {
                                loadingdialog.hide();
                                charnames = new CharacterNamesTable(resource
                                        .getText());
                                charnames_variants = charnames
                                        .asSearchVariants();
                                viewSearch(userfields, userqueries,
                                        restrictedbookids, offset,
                                        searchtokenprefix);
                            }
                            public void onError(ResourceException e) {
                                loadingdialog.hide();
                                reportInternalError(
                                        "Failed to load external resource", e);
                            }
                        });
            } catch (ResourceException e) {
                loadingdialog.hide();
                reportInternalError("Failed to load external resource", e);
            }
        } else {
            AsyncCallback<SearchResult> cb = new AsyncCallback<SearchResult>() {
                public void onFailure(Throwable caught) {
                    loadingdialog.error(caught.getMessage());
                }
                public void onSuccess(SearchResult result) {
                    loadingdialog.hide();
                    initDisplay(result.total + " " + Labels.INSTANCE.hits(),
                            true);
                    content.add(createAdvancedSearchWidget(userfields,
                            userqueries, restrictedbookids));
                    displaySearchResults(content, searchtokenprefix, result);
                }
            };
            searcher.searchCollection(userfields, userqueries,
                    restrictedbookids, offset, MAX_SEARCH_RESULTS,
                    charnames_variants, cb);
        }
    }
private void viewSearch ( final Searcher . UserField [ ] userfields , final String [ ] userqueries , final String [ ] restrictedbookids , final int offset , final String searchtokenprefix ) { book = null ; if ( userfields == null || userqueries == null ) { initDisplay ( Labels . INSTANCE . search ( ) , true ) ; content . add ( createAdvancedSearchWidget ( userfields , userqueries , restrictedbookids ) ) ; return ; } loadingdialog . display ( ) ; if ( charnames_variants == null ) { try { Resources . INSTANCE . characterNamesTable ( ) . getText ( new ResourceCallback < TextResource > ( ) { public void onSuccess ( TextResource resource ) { loadingdialog . hide ( ) ; charnames = new CharacterNamesTable ( resource . getText ( ) ) ; charnames_variants = charnames . asSearchVariants ( ) ; viewSearch ( userfields , userqueries , restrictedbookids , offset , searchtokenprefix ) ; } public void onError ( ResourceException e ) { loadingdialog . hide ( ) ; reportInternalError ( "Failed to load external resource" , e ) ; } } ) ; } catch ( ResourceException e ) { loadingdialog . hide ( ) ; reportInternalError ( "Failed to load external resource" , e ) ; } } else { AsyncCallback < SearchResult > cb = new AsyncCallback < SearchResult > ( ) { public void onFailure ( Throwable caught ) { loadingdialog . error ( caught . getMessage ( ) ) ; } public void onSuccess ( SearchResult result ) { loadingdialog . hide ( ) ; initDisplay ( result . total + " " + Labels . INSTANCE . hits ( ) , true ) ; content . add ( createAdvancedSearchWidget ( userfields , userqueries , restrictedbookids ) ) ; displaySearchResults ( content , searchtokenprefix , result ) ; } } ; searcher . searchCollection ( userfields , userqueries , restrictedbookids , offset , MAX_SEARCH_RESULTS , charnames_variants , cb ) ; } }
If search arguments are null, just displays search dialog
If search arguments are null just displays search dialog
// Load character names as needed