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

knowledgepixels / nanodash / 17591069788

09 Sep 2025 05:45PM UTC coverage: 13.679% (-0.1%) from 13.812%
17591069788

push

github

tkuhn
Use ItemListPanel for journal list

414 of 3902 branches covered (10.61%)

Branch coverage included in aggregate %.

1090 of 7093 relevant lines covered (15.37%)

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

3
import java.util.Arrays;
4

5
import org.apache.wicket.request.mapper.parameter.PageParameters;
6

7
import com.knowledgepixels.nanodash.Project;
8
import com.knowledgepixels.nanodash.QueryRef;
9
import com.knowledgepixels.nanodash.component.ItemListElement;
10
import com.knowledgepixels.nanodash.component.ItemListPanel;
11
import com.knowledgepixels.nanodash.component.TitleBar;
12
import com.knowledgepixels.nanodash.connector.ConnectorConfig;
13
import com.knowledgepixels.nanodash.connector.GenOverviewPage;
14

15
/**
16
 * A page that lists all available connectors.
17
 */
18
public class ConnectorListPage extends NanodashPage {
19

20
    private static final long serialVersionUID = 1L;
21

22
    /**
23
     * The mount path for this page.
24
     */
25
    public static final String MOUNT_PATH = "/connectorlist";
26

27
    /**
28
     * {@inheritDoc}
29
     */
30
    @Override
31
    public String getMountPath() {
32
        return MOUNT_PATH;
×
33
    }
34

35
    private static final String[] journals = new String[]{"ios/ds", "pensoft/bdj", "pensoft/rio"};
×
36

37
    /**
38
     * Returns the number of available connectors.
39
     *
40
     * @return the number of connectors
41
     */
42
    public static int getConnectorCount() {
43
        return journals.length;
×
44
    }
45

46
    /**
47
     * Constructor for the ConnectorListPage.
48
     *
49
     * @param parameters the page parameters
50
     */
51
    public ConnectorListPage(final PageParameters parameters) {
52
        super(parameters);
×
53

54
        add(new TitleBar("titlebar", this, "connectors"));
×
55

56
        add(new ItemListPanel<String>(
×
57
                "journals",
58
                "Journals",
59
                Arrays.asList(journals),
×
60
                (journalId) -> {
61
                    String journalName = ConnectorConfig.get(journalId).getJournalName();
×
62
                    return new ItemListElement("item", GenOverviewPage.class, new PageParameters().add("journal", journalId), journalName);
×
63
                }
64
            ));
65

66
        add(new ItemListPanel<Project>(
×
67
                "projects",
68
                "Projects  Project pages are still experimental:",
69
                new QueryRef("get-projects"),
70
                (apiResponse) -> { Project.refresh(apiResponse); return Project.getProjectList(); },
×
71
                (project) -> {
72
                    return new ItemListElement("item", ProjectPage.class, new PageParameters().add("id", project.getId()), project.getLabel());
×
73
                }
74
            ));
75
    }
×
76

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