• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

knowledgepixels / nanodash / 17852532121

19 Sep 2025 08:10AM UTC coverage: 13.568% (-0.3%) from 13.87%
17852532121

push

github

tkuhn
feat: Switch to QueryRef provided by nanopub, using multimap

428 of 4008 branches covered (10.68%)

Branch coverage included in aggregate %.

1104 of 7283 relevant lines covered (15.16%)

0.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
src/main/java/com/knowledgepixels/nanodash/page/QueryListPage.java
1
package com.knowledgepixels.nanodash.page;
2

3
import org.apache.wicket.Component;
4
import org.apache.wicket.markup.html.form.Form;
5
import org.apache.wicket.markup.html.form.TextField;
6
import org.apache.wicket.model.Model;
7
import org.apache.wicket.request.mapper.parameter.PageParameters;
8
import org.nanopub.extra.services.ApiResponse;
9
import org.nanopub.extra.services.QueryRef;
10

11
import com.knowledgepixels.nanodash.ApiCache;
12
import com.knowledgepixels.nanodash.component.ApiResultComponent;
13
import com.knowledgepixels.nanodash.component.QueryList;
14
import com.knowledgepixels.nanodash.component.TitleBar;
15

16
/**
17
 * Page that lists queries and allows searching through them.
18
 */
19
public class QueryListPage extends NanodashPage {
20

21
    /**
22
     * The mount path for this page.
23
     */
24
    public static final String MOUNT_PATH = "/queries";
25

26
    /**
27
     * {@inheritDoc}
28
     */
29
    @Override
30
    public String getMountPath() {
31
        return MOUNT_PATH;
×
32
    }
33

34
    private TextField<String> searchField;
35

36
    /**
37
     * Constructor for the QueryListPage.
38
     *
39
     * @param parameters Page parameters containing the search query.
40
     */
41
    public QueryListPage(final PageParameters parameters) {
42
        super(parameters);
×
43

44
        add(new TitleBar("titlebar", this, "query"));
×
45

46
        final String searchText = parameters.get("query").toString();
×
47

48
        Form<?> form = new Form<Void>("form") {
×
49

50
            protected void onSubmit() {
51
                String searchText = searchField.getModelObject().trim();
×
52
                PageParameters params = new PageParameters();
×
53
                params.add("query", searchText);
×
54
                setResponsePage(SearchPage.class, params);
×
55
            }
×
56
        };
57
        add(form);
×
58

59
        form.add(searchField = new TextField<String>("search", Model.of(searchText)));
×
60

61
        final String queryName = "get-queries";
×
62
        final QueryRef queryRef = new QueryRef(queryName);
×
63
        ApiResponse qResponse = ApiCache.retrieveResponse(queryRef);
×
64
        if (qResponse != null) {
×
65
            add(new QueryList("queries", qResponse));
×
66
        } else {
67
            add(new ApiResultComponent("queries", queryRef) {
×
68

69
                @Override
70
                public Component getApiResultComponent(String markupId, ApiResponse response) {
71
                    return new QueryList(markupId, response);
×
72
                }
73
            });
74

75
        }
76
    }
×
77

78
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc