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

knowledgepixels / nanodash / 17319343703

29 Aug 2025 08:53AM UTC coverage: 12.007% (-0.3%) from 12.355%
17319343703

push

github

tkuhn
Fix forcedGet(...) also catching RuntimeExceptions

330 of 3844 branches covered (8.58%)

Branch coverage included in aggregate %.

949 of 6808 relevant lines covered (13.94%)

0.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

7.63
src/main/java/com/knowledgepixels/nanodash/component/NanopubItem.java
1
package com.knowledgepixels.nanodash.component;
2

3
import com.knowledgepixels.nanodash.*;
4
import com.knowledgepixels.nanodash.action.NanopubAction;
5
import com.knowledgepixels.nanodash.page.TypePage;
6
import com.knowledgepixels.nanodash.page.UserPage;
7
import com.knowledgepixels.nanodash.template.*;
8
import org.apache.wicket.markup.html.WebMarkupContainer;
9
import org.apache.wicket.markup.html.basic.Label;
10
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
11
import org.apache.wicket.markup.html.panel.Panel;
12
import org.apache.wicket.markup.repeater.Item;
13
import org.apache.wicket.markup.repeater.data.DataView;
14
import org.apache.wicket.markup.repeater.data.ListDataProvider;
15
import org.apache.wicket.model.Model;
16
import org.apache.wicket.request.mapper.parameter.PageParameters;
17
import org.eclipse.rdf4j.model.IRI;
18
import org.eclipse.rdf4j.model.Statement;
19
import org.nanopub.SimpleCreatorPattern;
20
import org.nanopub.extra.security.MalformedCryptoElementException;
21
import org.nanopub.extra.security.SignatureUtils;
22
import org.nanopub.vocabulary.NTEMPLATE;
23

24
import java.text.SimpleDateFormat;
25
import java.util.*;
26

27
/**
28
 * A panel that displays a nanopublication with its header, footer, assertion, provenance, and pubinfo.
29
 */
30
public class NanopubItem extends Panel {
31

32
    private static final long serialVersionUID = -5109507637942030910L;
33

34
    /**
35
     * Date format for displaying the creation date and time of the nanopub.
36
     */
37
    public static SimpleDateFormat simpleDateTimeFormat = new SimpleDateFormat("d MMM yyyy, HH:mm:ss zzz");
5✔
38
    /**
39
     * Date format for displaying the creation time of the nanopub without time.
40
     */
41
    public static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("d MMM yyyy");
6✔
42

43
    private boolean isInitialized = false;
3✔
44
    private NanopubElement n;
45
    private boolean hideAssertion = false;
3✔
46
    private boolean hideProvenance = false;
3✔
47
    private boolean hidePubinfo = false;
3✔
48
    private boolean hideHeader = false;
3✔
49
    private boolean hideFooter = false;
3✔
50
    private boolean hideActionMenu = false;
3✔
51
    private List<NanopubAction> actions;
52
    private IRI signerId;
53
    private String tempalteId;
54

55
    /**
56
     * Creates a NanopubItem panel.
57
     *
58
     * @param id         the Wicket component ID
59
     * @param n          the NanopubElement to display
60
     * @param tempalteId the ID of the template to use for rendering the assertion.
61
     */
62
    public NanopubItem(String id, NanopubElement n, String tempalteId) {
63
        super(id);
3✔
64
        this.n = n;
3✔
65
        this.tempalteId = tempalteId;
3✔
66
    }
1✔
67

68
    /**
69
     * Creates a NanopubItem panel with a default template ID.
70
     *
71
     * @param id the Wicket component ID
72
     * @param n  the NanopubElement to display
73
     */
74
    public NanopubItem(String id, NanopubElement n) {
75
        this(id, n, null);
×
76
    }
×
77

78
    private void initialize() {
79
        if (isInitialized) return;
×
80

81
        String pubkey = n.getPubkey();
×
82
        String pubkeyhash = n.getPubkeyhash();
×
83
        signerId = n.getSignerId();
×
84

85
        if (hideHeader) {
×
86
            add(new Label("header", "").setVisible(false));
×
87
        } else {
88
            WebMarkupContainer header = new WebMarkupContainer("header");
×
89
            String labelString = n.getLabel();
×
90
            if (labelString == null || labelString.isBlank()) labelString = Utils.getShortNanopubId(n.getUri());
×
91
            header.add(NanodashLink.createLink("nanopub-id-link", n.getUri(), labelString));
×
92
            if (!hideActionMenu && (actions == null || !actions.isEmpty())) {
×
93
                NanodashSession session = NanodashSession.get();
×
94
                final boolean isOwnNanopub = (session.getUserIri() != null && session.getUserIri().equals(User.getUserData().getUserIriForPubkeyhash(pubkeyhash, false))) ||
×
95
                                             ((pubkey != null) && pubkey.equals(session.getPubkeyString()));
×
96
                final boolean hasLocalPubkey = session.getUserIri() != null && session.getPubkeyString() != null && session.getPubkeyString().equals(pubkey);
×
97
                final List<NanopubAction> actionList = new ArrayList<>();
×
98
                final Map<String, NanopubAction> actionMap = new HashMap<>();
×
99
                List<NanopubAction> allActions = new ArrayList<>();
×
100
                if (actions == null) {
×
101
                    allActions.addAll(Arrays.asList(NanopubAction.defaultActions));
×
102
                    allActions.addAll(NanopubAction.getActionsFromPreferences(NanodashPreferences.get()));
×
103
                } else {
104
                    allActions.addAll(actions);
×
105
                }
106
                for (NanopubAction action : allActions) {
×
107
                    if (isOwnNanopub && !action.isApplicableToOwnNanopubs()) continue;
×
108
                    if (isOwnNanopub && !hasLocalPubkey && !action.isApplicableToOthersNanopubs() && !Utils.hasNanodashLocation(pubkeyhash))
×
109
                        continue;
×
110
                    if (!isOwnNanopub && !action.isApplicableToOthersNanopubs()) continue;
×
111
                    if (!action.isApplicableTo(n.getNanopub())) continue;
×
112
                    actionList.add(action);
×
113
                    actionMap.put(action.getLinkLabel(n.getNanopub()), action);
×
114
                }
×
115
                header.add(new ActionMenu("action-menu", actionList, n));
×
116
            } else {
×
117
                header.add(new Label("action-menu", "").setVisible(false));
×
118
            }
119
            header.add(new DataView<IRI>("typespan", new ListDataProvider<IRI>(Utils.getTypes(n.getNanopub()))) {
×
120

121
                private static final long serialVersionUID = 1L;
122

123
                @Override
124
                protected void populateItem(Item<IRI> item) {
125
                    IRI typeIri = item.getModelObject();
×
126
                    String label = Utils.getTypeLabel(typeIri);
×
127
                    item.add(new BookmarkablePageLink<Void>("type", TypePage.class, new PageParameters().add("id", typeIri)).setBody(Model.of(label)));
×
128
                }
×
129

130
            });
131
            add(header);
×
132
        }
133

134
        if (hideFooter) {
×
135
            add(new Label("footer", "").setVisible(false));
×
136
        } else {
137
            WebMarkupContainer footer = new WebMarkupContainer("footer");
×
138
            if (n.getCreationTime() != null) {
×
139
                footer.add(new Label("datetime", simpleDateTimeFormat.format(n.getCreationTime().getTime())));
×
140
            } else {
141
                footer.add(new Label("datetime", "(undated)"));
×
142
            }
143

144
            List<IRI> authors = SimpleCreatorPattern.getAuthorList(n.getNanopub());
×
145
            WebMarkupContainer authorsSpan = new WebMarkupContainer("authors-span");
×
146
            if (authors.isEmpty()) {
×
147
                authorsSpan.setVisible(false);
×
148
                footer.add(new Label("creator-post", "").setVisible(false));
×
149
            } else {
150
                IRI mainAuthor = authors.get(0);
×
151
                BookmarkablePageLink<Void> mainAuthorLink = new BookmarkablePageLink<Void>("main-author-link", UserPage.class, new PageParameters().add("id", mainAuthor));
×
152
                String authorName = n.getFoafNameMap().get(mainAuthor.stringValue());
×
153
                if (authorName == null) {
×
154
                    authorName = User.getShortDisplayName(mainAuthor);
×
155
                }
156
                mainAuthorLink.add(new Label("main-author-text", authorName));
×
157
                authorsSpan.add(mainAuthorLink);
×
158
                if (authors.size() > 1) {
×
159
                    authorsSpan.add(new Label("authors-post", " et al. (authors)"));
×
160
                } else {
161
                    authorsSpan.add(new Label("authors-post", " (author)"));
×
162
                }
163
                footer.add(new Label("creator-post", " (creator)"));
×
164
            }
165
            footer.add(authorsSpan);
×
166

167
            PageParameters params = new PageParameters();
×
168

169
            // ----------
170
            // TODO Clean this up and move to helper method:
171
            IRI uIri = User.findSingleIdForPubkeyhash(pubkeyhash);
×
172
            if (uIri == null) {
×
173
                try {
174
                    Set<IRI> signers = SignatureUtils.getSignatureElement(n.getNanopub()).getSigners();
×
175
                    if (signers.size() == 1) {
×
176
                        uIri = signers.iterator().next();
×
177
                    } else {
178
                        Set<IRI> creators = SimpleCreatorPattern.getCreators(n.getNanopub());
×
179
                        if (creators.size() == 1) uIri = creators.iterator().next();
×
180
                    }
181
                } catch (MalformedCryptoElementException ex) {
×
182
                }
×
183
            }
184
            // ----------
185

186
            if (uIri != null) params.add("id", uIri);
×
187
            BookmarkablePageLink<Void> userLink = new BookmarkablePageLink<Void>("creator-link", UserPage.class, params);
×
188
            String userString;
189
            if (signerId != null) {
×
190
                userString = User.getShortDisplayNameForPubkeyhash(signerId, pubkeyhash);
×
191
            } else {
192
                userString = User.getShortDisplayNameForPubkeyhash(uIri, pubkeyhash);
×
193
            }
194
            userLink.add(new Label("creator-text", userString));
×
195
            footer.add(userLink);
×
196

197
            String positiveNotes = "";
×
198
            String negativeNotes = "";
×
199
            if (n.seemsToHaveSignature()) {
×
200
                try {
201
                    if (!n.hasValidSignature()) {
×
202
                        negativeNotes = "- invalid signature";
×
203
                    }
204
                } catch (Exception ex) {
×
205
                    ex.printStackTrace();
×
206
                    negativeNotes = "- malformed or legacy signature";
×
207
                }
×
208
            }
209
            footer.add(new Label("positive-notes", positiveNotes));
×
210
            footer.add(new Label("negative-notes", negativeNotes));
×
211
            add(footer);
×
212
        }
213

214
        final TemplateData td = TemplateData.get();
×
215

216
        WebMarkupContainer assertion = new WebMarkupContainer("assertion");
×
217

218
        if (hideAssertion) {
×
219
            assertion.setVisible(false);
×
220
        } else {
221
            Template assertionTemplate = td.getTemplate(n.getNanopub());
×
222
            if (tempalteId != null) assertionTemplate = td.getTemplate(tempalteId);
×
223
            if (assertionTemplate == null)
×
224
                assertionTemplate = td.getTemplate("http://purl.org/np/RAFu2BNmgHrjOTJ8SKRnKaRp-VP8AOOb7xX88ob0DZRsU");
×
225
            List<StatementItem> assertionStatements = new ArrayList<>();
×
226
            ValueFiller assertionFiller = new ValueFiller(n.getNanopub(), ContextType.ASSERTION, false);
×
227
            TemplateContext context = new TemplateContext(ContextType.ASSERTION, assertionTemplate.getId(), "assertion-statement", n.getNanopub());
×
228
            populateStatementItemList(context, assertionFiller, assertionStatements);
×
229

230
            assertion.add(createStatementView("assertion-statements", assertionStatements));
×
231
            assertion.add(new DataView<Statement>("unused-assertion-statements", new ListDataProvider<Statement>(assertionFiller.getUnusedStatements())) {
×
232

233
                private static final long serialVersionUID = 1L;
234

235
                @Override
236
                protected void populateItem(Item<Statement> item) {
237
                    item.add(new TripleItem("unused-assertion-statement", item.getModelObject(), n.getNanopub(), null));
×
238
                }
×
239

240
            });
241
        }
242
        add(assertion);
×
243

244
        WebMarkupContainer provenance = new WebMarkupContainer("provenance");
×
245
        if (hideProvenance) {
×
246
            provenance.setVisible(false);
×
247
        } else {
248
            Template provenanceTemplate = td.getProvenanceTemplate(n.getNanopub());
×
249
            if (provenanceTemplate == null)
×
250
                provenanceTemplate = td.getTemplate("http://purl.org/np/RA3Jxq5JJjluUNEpiMtxbiIHa7Yt-w8f9FiyexEstD5R4");
×
251
            List<StatementItem> provenanceStatements = new ArrayList<>();
×
252
            ValueFiller provenanceFiller = new ValueFiller(n.getNanopub(), ContextType.PROVENANCE, false);
×
253
            TemplateContext prContext = new TemplateContext(ContextType.PROVENANCE, provenanceTemplate.getId(), "provenance-statement", n.getNanopub());
×
254
            populateStatementItemList(prContext, provenanceFiller, provenanceStatements);
×
255
            provenance.add(createStatementView("provenance-statements", provenanceStatements));
×
256
            provenance.add(new DataView<Statement>("unused-provenance-statements", new ListDataProvider<Statement>(provenanceFiller.getUnusedStatements())) {
×
257

258
                private static final long serialVersionUID = 1L;
259

260
                @Override
261
                protected void populateItem(Item<Statement> item) {
262
                    item.add(new TripleItem("unused-provenance-statement", item.getModelObject(), n.getNanopub(), null));
×
263
                }
×
264

265
            });
266
        }
267
        add(provenance);
×
268

269
        WebMarkupContainer pubInfo = new WebMarkupContainer("pubinfo");
×
270
        if (hidePubinfo) {
×
271
            pubInfo.setVisible(false);
×
272
        } else {
273
            ValueFiller pubinfoFiller = new ValueFiller(n.getNanopub(), ContextType.PUBINFO, false);
×
274

275
            // TODO We should do this better:
276
            List<String> pubinfoAuthorTemplateIds = new ArrayList<>();
×
277
            List<String> pubinfoTemplateIds = new ArrayList<>();
×
278
            for (IRI iri : td.getPubinfoTemplateIds(n.getNanopub())) {
×
279
                if (iri.stringValue().equals("https://w3id.org/np/RA16U9Wo30ObhrK1NzH7EsmVRiRtvEuEA_Dfc-u8WkUCA")) { // author list
×
280
                    pubinfoAuthorTemplateIds.add(iri.stringValue());
×
281
                } else if (iri.stringValue().equals("http://purl.org/np/RA4vTctL3Luaj8oI_sPiN7I_8xEnR_hkdz5gN7bCvZpNY")) { // authors
×
282
                    pubinfoAuthorTemplateIds.add(iri.stringValue());
×
283
                } else if (iri.stringValue().equals("http://purl.org/np/RAA2MfqdBCzmz9yVWjKLXNbyfBNcwsMmOqcNUxkk1maIM")) { // creator
×
284
                    pubinfoTemplateIds.add(0, iri.stringValue());
×
285
                } else {
286
                    pubinfoTemplateIds.add(iri.stringValue());
×
287
                }
288
            }
×
289
            pubinfoTemplateIds.addAll(0, pubinfoAuthorTemplateIds);
×
290
            pubinfoTemplateIds.add("https://w3id.org/np/RAXVsr624oEAJvCt1WZXoUJ90lFYC5LUMoYHgEUOwmrLw"); // user name
×
291
            pubinfoTemplateIds.add("https://w3id.org/np/RARJj78P72NR5edKOnu_f4ePE9NYYuW2m2pM-fEoobMBk"); // nanopub label
×
292
            pubinfoTemplateIds.add("https://w3id.org/np/RA8iXbwvOC7BwVHuvAhFV235j2582SyAYJ2sfov19ZOlg"); // nanopub type
×
293
            pubinfoTemplateIds.add("https://w3id.org/np/RALmzqHlrRfeTD8ESZdKFyDNYY6eFuyQ8GAe_4N5eVytc"); // timestamp
×
294
            pubinfoTemplateIds.add("https://w3id.org/np/RADVnztsdSc36ffAXTxiIdXpYEMLiJrRENqaJ2Qn2LX3Y"); // templates
×
295
            pubinfoTemplateIds.add("https://w3id.org/np/RAvqXPNKPf56b2226oqhKzARyvIhnpnTrRpLGC1cYweMw"); // introductions
×
296
            pubinfoTemplateIds.add("https://w3id.org/np/RAgIlomuR39mN-Z39bbv59-h2DgQBnLyNdL22YmOJ_VHM"); // labels from APIs
×
297
            pubinfoTemplateIds.add("https://w3id.org/np/RAoWx0AJvNw-WqkGgZO4k8udNCg6kMcGZARN3DgO_5TII"); // contributor names
×
298
            pubinfoTemplateIds.add("https://w3id.org/np/RAY_M7GUmyOTjXQbJArzhVVzQ5XvgHt0JR7h2LZo6TXvY"); // signature
×
299
            pubinfoTemplateIds.add("https://w3id.org/np/RA_TZ9tvF6sBewmbIGbTFguLOPUUS70huklacisZrYtYw"); // creation site
×
300
            pubinfoTemplateIds.add("https://w3id.org/np/RAE-zsHxw2VoE6emhSY_Fkr5p_li5Qb8FrREqUwdWdzyM"); // generic
×
301

302
            List<TemplateContext> contexts = new ArrayList<>();
×
303
            List<TemplateContext> genericContexts = new ArrayList<>();
×
304
            for (String s : pubinfoTemplateIds) {
×
305
                TemplateContext piContext = new TemplateContext(ContextType.PUBINFO, s, "pubinfo-statement", n.getNanopub());
×
306
                if (piContext.willMatchAnyTriple()) {
×
307
                    genericContexts.add(piContext);
×
308
                } else if (piContext.getTemplateId().equals("https://w3id.org/np/RAE-zsHxw2VoE6emhSY_Fkr5p_li5Qb8FrREqUwdWdzyM")) {
×
309
                    // TODO: This is a work-around; check why this template doesn't give true to willMatchAnyTriple()
310
                    genericContexts.add(piContext);
×
311
                } else {
312
                    contexts.add(piContext);
×
313
                }
314
            }
×
315
            contexts.addAll(genericContexts);  // make sure the generic one are at the end
×
316
            List<WebMarkupContainer> elements = new ArrayList<>();
×
317
            for (TemplateContext piContext : contexts) {
×
318
                WebMarkupContainer pubInfoElement = new WebMarkupContainer("pubinfo-element");
×
319
                List<StatementItem> pubinfoStatements = new ArrayList<>();
×
320
                populateStatementItemList(piContext, pubinfoFiller, pubinfoStatements);
×
321
                if (!pubinfoStatements.isEmpty()) {
×
322
                    pubInfoElement.add(createStatementView("pubinfo-statements", pubinfoStatements));
×
323
                    elements.add(pubInfoElement);
×
324
                }
325
            }
×
326
            pubInfo.add(new DataView<WebMarkupContainer>("pubinfo-elements", new ListDataProvider<WebMarkupContainer>(elements)) {
×
327

328
                private static final long serialVersionUID = 1L;
329

330
                @Override
331
                protected void populateItem(Item<WebMarkupContainer> item) {
332
                    item.add(item.getModelObject());
×
333
                }
×
334

335
            });
336
        }
337
        add(pubInfo);
×
338

339
        isInitialized = true;
×
340
    }
×
341

342
    /**
343
     * Hides the provenance part of the nanopub item.
344
     *
345
     * @return this NanopubItem instance for method chaining
346
     */
347
    public NanopubItem hideProvenance() {
348
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
×
349
        hideProvenance = true;
×
350
        return this;
×
351
    }
352

353
    /**
354
     * Sets whether the provenance part of the nanopub item should be hidden.
355
     *
356
     * @param hideProvenance true to hide provenance, false to show it
357
     * @return this NanopubItem instance for method chaining
358
     */
359
    public NanopubItem setProvenanceHidden(boolean hideProvenance) {
360
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
3!
361
        this.hideProvenance = hideProvenance;
3✔
362
        return this;
2✔
363
    }
364

365
    /**
366
     * Hides the pubinfo part of the nanopub item.
367
     *
368
     * @return this NanopubItem instance for method chaining
369
     */
370
    public NanopubItem hidePubinfo() {
371
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
×
372
        hidePubinfo = true;
×
373
        return this;
×
374
    }
375

376
    /**
377
     * Sets whether the pubinfo part of the nanopub item should be hidden.
378
     *
379
     * @param hidePubinfo true to hide pubinfo, false to show it
380
     * @return this NanopubItem instance for method chaining
381
     */
382
    public NanopubItem setPubinfoHidden(boolean hidePubinfo) {
383
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
3!
384
        this.hidePubinfo = hidePubinfo;
3✔
385
        return this;
2✔
386
    }
387

388
    /**
389
     * Hides the header part of the nanopub item.
390
     *
391
     * @return this NanopubItem instance for method chaining
392
     */
393
    public NanopubItem hideHeader() {
394
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
×
395
        hideHeader = true;
×
396
        return this;
×
397
    }
398

399
    /**
400
     * Sets whether the header part of the nanopub item should be hidden.
401
     *
402
     * @param hideHeader true to hide header, false to show it
403
     * @return this NanopubItem instance for method chaining
404
     */
405
    public NanopubItem setHeaderHidden(boolean hideHeader) {
406
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
3!
407
        this.hideHeader = hideHeader;
3✔
408
        return this;
2✔
409
    }
410

411
    /**
412
     * Hides the footer part of the nanopub item.
413
     *
414
     * @return this NanopubItem instance for method chaining
415
     */
416
    public NanopubItem hideFooter() {
417
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
×
418
        hideFooter = true;
×
419
        return this;
×
420
    }
421

422
    /**
423
     * Sets whether the footer part of the nanopub item should be hidden.
424
     *
425
     * @param hideFooter true to hide footer, false to show it
426
     * @return this NanopubItem instance for method chaining
427
     */
428
    public NanopubItem setFooterHidden(boolean hideFooter) {
429
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
3!
430
        this.hideFooter = hideFooter;
3✔
431
        return this;
2✔
432
    }
433

434
    /**
435
     * Sets the nanopub item to a minimal state, hiding assertion, action menu, provenance, and pubinfo.
436
     *
437
     * @return this NanopubItem instance for method chaining
438
     */
439
    public NanopubItem setMinimal() {
440
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
×
441
        this.hideAssertion = true;
×
442
        this.hideActionMenu = true;
×
443
        setProvenanceHidden(true).setPubinfoHidden(true);
×
444
        return this;
×
445
    }
446

447
    /**
448
     * Adds the given actions to the nanopub item.
449
     *
450
     * @param a a {@link com.knowledgepixels.nanodash.action.NanopubAction} object
451
     * @return this NanopubItem instance for method chaining
452
     */
453
    public NanopubItem addActions(NanopubAction... a) {
454
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
×
455
        if (actions == null) actions = new ArrayList<>();
×
456
        for (NanopubAction na : a) {
×
457
            actions.add(na);
×
458
        }
459
        return this;
×
460
    }
461

462
    /**
463
     * Sets the nanopub item to have no actions.
464
     *
465
     * @return this NanopubItem instance for method chaining
466
     */
467
    public NanopubItem noActions() {
468
        if (isInitialized) throw new RuntimeException("Nanopub item is already initialized");
×
469
        actions = new ArrayList<>();
×
470
        return this;
×
471
    }
472

473
    /**
474
     * {@inheritDoc}
475
     */
476
    @Override
477
    protected void onBeforeRender() {
478
        initialize();
×
479
        super.onBeforeRender();
×
480
    }
×
481

482
    private void populateStatementItemList(TemplateContext context, ValueFiller filler, List<StatementItem> list) {
483
        context.initStatements();
×
484
        if (signerId != null) {
×
485
            context.getComponentModels().put(NTEMPLATE.CREATOR_PLACEHOLDER, Model.of(signerId.stringValue()));
×
486
        }
487
        filler.fill(context);
×
488
        for (StatementItem si : context.getStatementItems()) {
×
489
            if (si.isMatched()) {
×
490
                list.add(si);
×
491
            }
492
        }
×
493
    }
×
494

495
    private DataView<StatementItem> createStatementView(String elementId, List<StatementItem> list) {
496
        return new DataView<StatementItem>(elementId, new ListDataProvider<StatementItem>(list)) {
×
497

498
            private static final long serialVersionUID = 1L;
499

500
            @Override
501
            protected void populateItem(Item<StatementItem> item) {
502
                item.add(item.getModelObject());
×
503
            }
×
504

505
        };
506
    }
507

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