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

knowledgepixels / nanodash / 23361100507

20 Mar 2026 08:21PM UTC coverage: 16.371% (-0.008%) from 16.379%
23361100507

push

github

tkuhn
feat: add upcoming events table view to home page and make nanopub set items-per-page configurable

Add the upcoming-events-view as a table alongside the most recent nanopubs
(reduced to 5 items) on the home page. Remove unnecessary DataView wrappers
for single-item views and strip col-* classes to avoid extra spacing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

731 of 5533 branches covered (13.21%)

Branch coverage included in aggregate %.

1877 of 10398 relevant lines covered (18.05%)

2.47 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/QueryResultNanopubSetBuilder.java
1
package com.knowledgepixels.nanodash.component;
2

3
import com.knowledgepixels.nanodash.ApiCache;
4
import com.knowledgepixels.nanodash.ViewDisplay;
5
import com.knowledgepixels.nanodash.domain.AbstractResourceWithProfile;
6
import org.apache.wicket.Component;
7
import org.nanopub.extra.services.ApiResponse;
8
import org.nanopub.extra.services.QueryRef;
9

10
import java.io.Serializable;
11

12
/**
13
 * Builder class for creating QueryResultNanopubSet components.
14
 */
15
public class QueryResultNanopubSetBuilder implements Serializable {
16

17
    private final String markupId;
18
    private final ViewDisplay viewDisplay;
19
    private String contextId = null;
×
20
    private final QueryRef queryRef;
21
    private boolean hasTitle = true;
×
22
    private AbstractResourceWithProfile pageResource = null;
×
23
    private long itemsPerPage = 10;
×
24

25
    private QueryResultNanopubSetBuilder(String markupId, QueryRef queryRef, ViewDisplay viewDisplay) {
×
26
        this.markupId = markupId;
×
27
        this.queryRef = queryRef;
×
28
        this.viewDisplay = viewDisplay;
×
29
    }
×
30

31
    /**
32
     * Creates a new QueryResultNanopubSetBuilder instance.
33
     *
34
     * @param markupId    the markup ID for the component
35
     * @param queryRef    the query reference
36
     * @param viewDisplay the view display
37
     * @return a new QueryResultNanopubSetBuilder instance
38
     */
39
    public static QueryResultNanopubSetBuilder create(String markupId, QueryRef queryRef, ViewDisplay viewDisplay) {
40
        return new QueryResultNanopubSetBuilder(markupId, queryRef, viewDisplay);
×
41
    }
42

43
    /**
44
     * Sets the context ID for the QueryResultNanopubSet.
45
     *
46
     * @param contextId the context ID
47
     * @return the current QueryResultNanopubSetBuilder instance
48
     */
49
    public QueryResultNanopubSetBuilder contextId(String contextId) {
50
        this.contextId = contextId;
×
51
        return this;
×
52
    }
53

54
    public QueryResultNanopubSetBuilder pageResource(AbstractResourceWithProfile pageResource) {
55
        this.pageResource = pageResource;
×
56
        return this;
×
57
    }
58

59
    public QueryResultNanopubSetBuilder setItemsPerPage(long itemsPerPage) {
60
        this.itemsPerPage = itemsPerPage;
×
61
        return this;
×
62
    }
63

64
    /**
65
     * Removes the title from the QueryResultNanopubSet.
66
     *
67
     * @return the current QueryResultNanopubSetBuilder instance
68
     */
69
    public QueryResultNanopubSetBuilder noTitle() {
70
        this.hasTitle = false;
×
71
        return this;
×
72
    }
73

74
    /**
75
     * Builds the QueryResultNanopubSet component.
76
     *
77
     * @return the QueryResultNanopubSet component
78
     */
79
    public Component build() {
80
        ApiResponse response = ApiCache.retrieveResponseAsync(queryRef);
×
81
        if (response != null) {
×
82
            QueryResultNanopubSet queryResultNanopubSet = new QueryResultNanopubSet(markupId, queryRef, response, viewDisplay, itemsPerPage);
×
83
            queryResultNanopubSet.setContextId(contextId);
×
84
            queryResultNanopubSet.setPageResource(pageResource);
×
85
            queryResultNanopubSet.populateComponent();
×
86
            queryResultNanopubSet.setTitleVisible(hasTitle);
×
87
            return queryResultNanopubSet;
×
88
        } else {
89
            return new ApiResultComponent(markupId, queryRef) {
×
90
                @Override
91
                public Component getApiResultComponent(String markupId, ApiResponse response) {
92
                    QueryResultNanopubSet queryResultNanopubSet = new QueryResultNanopubSet(markupId, queryRef, response, viewDisplay, itemsPerPage);
×
93
                    queryResultNanopubSet.setContextId(contextId);
×
94
                    queryResultNanopubSet.setPageResource(pageResource);
×
95
                    queryResultNanopubSet.populateComponent();
×
96
                    queryResultNanopubSet.setTitleVisible(hasTitle);
×
97
                    return queryResultNanopubSet;
×
98
                }
99
            };
100
        }
101
    }
102

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