The corpus you wanted to access unfortunally does not (yet) exist"
+ + " in ANNIS.
" + "
possible reasons are:
" + "
"
+ + "- that it has not been imported yet,
"
+ + "- you don't have the access rights to see this corpus,
"
+ + "- or the ANNIS service is not running.
" + "
"
+ + "
Please ask the responsible person of the site that contained "
+ + "the link to import the corpus.
",
+ Notification.Type.WARNING_MESSAGE, true).show(Page.getCurrent());
- }
-
- private void evaluateFragment(String fragment) {
- // do nothing if not changed
- if (fragment == null || fragment.isEmpty() || fragment.equals(lastEvaluatedFragment)) {
- return;
}
+ } // end if corpus list returned from service is empty
+ else {
+ if (args.containsKey("c") && args.size() == 1) {
+ // special case: we were called from outside and should only select,
+ // but not query, the selected corpora
+ Query q = new Query();
+ q.setCorpora(corpora);
+ q.setQuery("");
+ ui.getQueryController().setQuery(q);
+ } else if (args.get("cl") != null && args.get("cr") != null) {
+ // make sure the properties are not overwritten by the background process
+ getControlPanel().getSearchOptions().setUpdateStateFromConfig(false);
+
+ DisplayedResultQuery query =
+ QueryGenerator.displayed().left(Integer.parseInt(args.get("cl")))
+ .right(Integer.parseInt(args.get("cr"))).offset(Integer.parseInt(args.get("s")))
+ .limit(Integer.parseInt(args.get("l"))).segmentation(args.get("seg"))
+ .baseText(args.get("bt")).query(args.get("q")).corpora(corpora).build();
+
+ if (query.getBaseText() == null && query.getSegmentation() != null) {
+ // if no explicit visible segmentation was given use the same as the context
+ query.setBaseText(query.getSegmentation());
+ }
+ if (query.getBaseText() != null && query.getBaseText().isEmpty()) {
+ // empty string means "null"
+ query.setBaseText(null);
+ }
+
+ String matchSelectionRaw = args.get("m");
+ if (matchSelectionRaw != null) {
+ for (String selectedMatchNr : Splitter.on(',').omitEmptyStrings().trimResults()
+ .split(matchSelectionRaw)) {
+ try {
+ long nr = Long.parseLong(selectedMatchNr);
+ query.getSelectedMatches().add(nr);
+ } catch (NumberFormatException ex) {
+ log.warn("Invalid long provided as selected match", ex);
+ }
+ }
+ }
- Map