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

knowledgepixels / nanodash / 27963160946

22 Jun 2026 03:13PM UTC coverage: 26.549% (-0.02%) from 26.57%
27963160946

Pull #494

github

web-flow
Merge a6c43f110 into 4c33b803f
Pull Request #494: feat: drive view-displays tables by the view's query, ref-scope maintained resources

1552 of 6885 branches covered (22.54%)

Branch coverage included in aggregate %.

3418 of 11835 relevant lines covered (28.88%)

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

3
import com.google.common.collect.ArrayListMultimap;
4
import com.google.common.collect.Multimap;
5
import com.knowledgepixels.nanodash.View;
6
import com.knowledgepixels.nanodash.ViewDisplay;
7
import com.knowledgepixels.nanodash.domain.MaintainedResource;
8
import org.apache.wicket.markup.html.panel.Panel;
9
import org.nanopub.extra.services.QueryRef;
10

11
/**
12
 * The "About" tab body for a maintained resource: its assigned presets and the
13
 * listing of its configured view displays (issue #302). Resource-level
14
 * members/roles are intentionally not shown (roles live on the parent space).
15
 */
16
public class AboutResourcePanel extends Panel {
17

18
    /**
19
     * The "ℹ️ Info" view for a maintained resource: key-value facts (type,
20
     * namespace, maintaining space). Also shown on the Content tab; surfaced here
21
     * at the top of the About tab.
22
     */
23
    public static final String MAINTAINED_RESOURCE_INFO_VIEW = "https://w3id.org/np/RAqKkqvOFWWCDJ4LOa6rrgQJMFbDnoaG56zkIBN5AMBZw/maintained-resource-info-view-kind";
24

25
    /**
26
     * View listing a maintained resource's configured view displays. Mirrors the space
27
     * view-displays view but its "add view display" action links the maintained-resource-
28
     * specific creation template.
29
     */
30
    public static final String MAINTAINED_RESOURCE_VIEW_DISPLAYS_VIEW = "https://w3id.org/np/RAZOxROZRaxSeoeO05iI0tKpDIy2mEN3jlUuVIo0uZN1I/view-displays-view";
31

32
    /**
33
     * View listing the presets assigned to a maintained resource. Mirrors the space
34
     * preset-assignments view but its "add preset" action links the maintained-resource-specific
35
     * template (offering only presets that apply to maintained resources).
36
     */
37
    public static final String MAINTAINED_RESOURCE_PRESET_ASSIGNMENTS_VIEW = "https://w3id.org/np/RA-CRSYJrYf-uaw1fip7hr_kdPqVb7_6dENwTPYQpikRY/preset-assignments-view";
38

39
    /**
40
     * @param id       the Wicket markup id
41
     * @param resource the maintained resource whose About listings to render
42
     */
43
    public AboutResourcePanel(String id, MaintainedResource resource) {
44
        super(id);
×
45

46
        // The info view leads the "Structure" section (to the left of the presets).
47
        View infoView = View.get(MAINTAINED_RESOURCE_INFO_VIEW);
×
48
        add(QueryResultTableBuilder.create("info", new QueryRef(infoView.getQuery().getQueryId(), "resource", resource.getId()), new ViewDisplay(infoView)).resourceWithProfile(resource).id(resource.getId()).contextId(resource.getId()).build());
×
49

50
        View presetsView = View.get(MAINTAINED_RESOURCE_PRESET_ASSIGNMENTS_VIEW);
×
51
        add(QueryResultTableBuilder.create("presets", new QueryRef(presetsView.getQuery().getQueryId(), "resource", resource.getId()), new ViewDisplay(presetsView)).resourceWithProfile(resource).id(resource.getId()).contextId(resource.getId()).build());
×
52

53
        // The view nanopub's hasViewQuery is the ref-scoped list-view-displays query; supply the
54
        // owning space's representative ref as root_np so authority (who may add/deactivate displays)
55
        // is read from that ref, consistent with space pages — the query resolves the maintained
56
        // resource to its space via npa:isMaintainedBy.
57
        View vdView = View.get(MAINTAINED_RESOURCE_VIEW_DISPLAYS_VIEW);
×
58
        String refRoot = resource.getSpace() != null ? resource.getSpace().getRefRootId() : null;
×
59
        Multimap<String, String> vdParams = ArrayListMultimap.create();
×
60
        vdParams.put("resource", resource.getId());
×
61
        if (refRoot != null && !refRoot.isEmpty()) vdParams.put("root_np", refRoot);
×
62
        add(QueryResultTableBuilder.create("viewdisplays", new QueryRef(vdView.getQuery().getQueryId(), vdParams), new ViewDisplay(vdView)).resourceWithProfile(resource).id(resource.getId()).contextId(resource.getId()).refRoot(refRoot).build());
×
63
    }
×
64

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