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

knowledgepixels / nanodash / 22630596072

03 Mar 2026 03:41PM UTC coverage: 15.949% (-0.08%) from 16.03%
22630596072

Pull #369

github

web-flow
Merge 6951bc4cf into 85e0af2dc
Pull Request #369: Replace "^" for view displays with dropdown menu

699 of 5317 branches covered (13.15%)

Branch coverage included in aggregate %.

1721 of 9856 relevant lines covered (17.46%)

2.4 hits per line

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

0.0
src/main/java/com/knowledgepixels/nanodash/component/QueryResultPlainParagraph.java
1
package com.knowledgepixels.nanodash.component;
2

3
import com.knowledgepixels.nanodash.QueryResult;
4
import com.knowledgepixels.nanodash.ViewDisplay;
5
import com.knowledgepixels.nanodash.page.ExplorePage;
6
import org.apache.wicket.markup.html.basic.Label;
7
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
8
import org.apache.wicket.markup.html.list.ListItem;
9
import org.apache.wicket.markup.html.list.ListView;
10
import org.apache.wicket.request.mapper.parameter.PageParameters;
11
import org.nanopub.extra.services.ApiResponse;
12
import org.nanopub.extra.services.ApiResponseEntry;
13
import org.nanopub.extra.services.QueryRef;
14

15
/**
16
 * Component for displaying query results in a list format.
17
 */
18
public class QueryResultPlainParagraph extends QueryResult {
19

20
    /**
21
     * Constructor for QueryResultList.
22
     *
23
     * @param markupId    the markup ID
24
     * @param queryRef    the query reference
25
     * @param response    the API response
26
     * @param viewDisplay the view display
27
     */
28
    QueryResultPlainParagraph(String markupId, QueryRef queryRef, ApiResponse response, ViewDisplay viewDisplay) {
29
        super(markupId, queryRef, response, viewDisplay);
×
30

31
        String label = grlcQuery.getLabel();
×
32
        if (viewDisplay.getView() != null && viewDisplay.getView().getTitle() != null) {
×
33
            label = viewDisplay.getView().getTitle();
×
34
        }
35
        add(new Label("label", label));
×
36
        setOutputMarkupId(true);
×
37
        populateComponent();
×
38
    }
×
39

40
    @Override
41
    protected void populateComponent() {
42
        add(new ListView<>("paragraphs", response.getData()) {
×
43
            @Override
44
            protected void populateItem(ListItem<ApiResponseEntry> item) {
45
                item.add(new Label("title", item.getModelObject().get("title")));
×
46
                String npId = item.getModelObject().get("np");
×
47
                if (npId != null && !npId.isBlank()) {
×
48
                    item.add(new BookmarkablePageLink<Void>("pnp", ExplorePage.class, new PageParameters().set("id", npId)));
×
49
                } else {
50
                    item.add(new Label("pnp").setVisible(false));
×
51
                }
52
                item.add(new Label("content", item.getModelObject().get("content")).setEscapeModelStrings(false));
×
53
            }
×
54
        });
55
    }
×
56

57
}
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