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

knowledgepixels / nanodash / 22661136759

04 Mar 2026 08:25AM UTC coverage: 15.94% (-0.09%) from 16.03%
22661136759

Pull #369

github

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

699 of 5319 branches covered (13.14%)

Branch coverage included in aggregate %.

1721 of 9863 relevant lines covered (17.45%)

2.39 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

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

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

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

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

58
    /**
59
     * Removes the title from the QueryResultNanopubSet.
60
     *
61
     * @return the current QueryResultNanopubSetBuilder instance
62
     */
63
    public QueryResultNanopubSetBuilder noTitle() {
64
        this.hasTitle = false;
×
65
        return this;
×
66
    }
67

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

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