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

knowledgepixels / nanodash / 19366908152

14 Nov 2025 02:02PM UTC coverage: 14.317% (+0.4%) from 13.87%
19366908152

push

github

tkuhn
feat: "refresh-upon-publish" PublishPage param to force cache refreshing

546 of 4776 branches covered (11.43%)

Branch coverage included in aggregate %.

1401 of 8823 relevant lines covered (15.88%)

0.71 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/SpaceListPage.java
1
package com.knowledgepixels.nanodash.page;
2

3
import org.apache.wicket.request.mapper.parameter.PageParameters;
4
import org.nanopub.extra.services.QueryRef;
5

6
import com.knowledgepixels.nanodash.Project;
7
import com.knowledgepixels.nanodash.Space;
8
import com.knowledgepixels.nanodash.component.ItemListElement;
9
import com.knowledgepixels.nanodash.component.ItemListPanel;
10
import com.knowledgepixels.nanodash.component.TitleBar;
11

12
/**
13
 * A page that lists all available connectors.
14
 */
15
public class SpaceListPage extends NanodashPage {
16

17
    /**
18
     * The mount path for this page.
19
     */
20
    public static final String MOUNT_PATH = "/spaces";
21

22
    /**
23
     * {@inheritDoc}
24
     */
25
    @Override
26
    public String getMountPath() {
27
        return MOUNT_PATH;
×
28
    }
29

30
    /**
31
     * Constructor for the SpaceListPage.
32
     *
33
     * @param parameters the page parameters
34
     */
35
    public SpaceListPage(final PageParameters parameters) {
36
        super(parameters);
×
37

38
        add(new TitleBar("titlebar", this, "connectors"));
×
39

40
        addSpacePanel("Alliance", true);
×
41
        addSpacePanel("Consortium", false);
×
42
        addSpacePanel("Organization", true);
×
43
        addSpacePanel("Taskforce", false);
×
44
        addSpacePanel("Division", true);
×
45
        addSpacePanel("Taskunit", false);
×
46
        addSpacePanel("Group", true);
×
47
        addSpacePanel("Project", false);
×
48
        addSpacePanel("Program", true);
×
49
        addSpacePanel("Initiative", false);
×
50
        addSpacePanel("Outlet", true);
×
51
        addSpacePanel("Campaign", false);
×
52
        addSpacePanel("Community", true);
×
53
        addSpacePanel("Event", false);
×
54

55
        add(new ItemListPanel<Project>(
×
56
                "legacy-projects",
57
                "Legacy Projects",
58
                new QueryRef("get-projects"),
59
                (apiResponse) -> { Project.refresh(apiResponse); return Project.getProjectList(); },
×
60
                (project) -> {
61
                    return new ItemListElement("item", ProjectPage.class, new PageParameters().set("id", project.getId()), project.getLabel());
×
62
                }
63
            ).setDescription("These legacy project pages will be migrated into the Spaces above:"));
×
64
    }
×
65

66
    private void addSpacePanel(String type, boolean openEnded) {
67
        String typePl = type + "s";
×
68
        typePl = typePl.replaceFirst("ys$", "ies");
×
69

70
        PageParameters newLinkParams = new PageParameters()
×
71
                .set("param_type", "https://w3id.org/kpxl/gen/terms/" + type)
×
72
                .set("template-version", "latest")
×
73
                .set("refresh-upon-publish", "spaces")
×
74
                .set("postpub-redirect-url", MOUNT_PATH);
×
75
        if (openEnded) {
×
76
            newLinkParams.set("template", "https://w3id.org/np/RA7dQfmndqKmooQ4PlHyQsAql9i2tg_8GLHf_dqtxsGEQ");
×
77
        } else {
78
            newLinkParams.set("template", "https://w3id.org/np/RAaE7NP9RNIx03AHZxanFMdtUuaTfe50ns5tHhpEVloQ4");
×
79
        }
80

81
        add(new ItemListPanel<Space>(
×
82
            typePl.toLowerCase(),
×
83
            typePl,
84
            new QueryRef("get-spaces"),
85
            (apiResponse) -> { Space.refresh(apiResponse); return Space.getSpaceList("https://w3id.org/kpxl/gen/terms/" + type); },
×
86
            (space) -> {
87
                return new ItemListElement("item", SpacePage.class, new PageParameters().set("id", space.getId()), space.getLabel());
×
88
            }
89
        ).addButton("+", PublishPage.class, newLinkParams));
×
90
    }
×
91

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