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

knowledgepixels / nanodash / 37889132508

09 Oct 2026 05:33AM UTC coverage: 51.346% (-0.07%) from 51.411%
37889132508

Pull #771

github

web-flow
Merge d7a54987b into 108b57d49
Pull Request #771: Group result-table rows under header rows via a "_group" column

5531 of 11571 branches covered (47.8%)

Branch coverage included in aggregate %.

9789 of 18266 relevant lines covered (53.59%)

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

3
import com.knowledgepixels.nanodash.*;
4
import com.knowledgepixels.nanodash.component.menu.EntryActionMenu;
5
import com.knowledgepixels.nanodash.page.ExplorePage;
6
import com.knowledgepixels.nanodash.page.NanodashPage;
7
import com.knowledgepixels.nanodash.page.PublishPage;
8
import org.apache.wicket.Component;
9
import org.apache.wicket.ajax.AjaxRequestTarget;
10
import org.apache.wicket.behavior.AttributeAppender;
11
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackHeadersToolbar;
12
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxNavigationToolbar;
13
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
14
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
15
import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
16
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
17
import org.apache.wicket.extensions.markup.html.repeater.data.table.IStyledColumn;
18
import org.apache.wicket.markup.html.WebMarkupContainer;
19
import org.apache.wicket.markup.html.basic.Label;
20
import org.apache.wicket.markup.html.form.TextField;
21
import org.apache.wicket.markup.html.link.AbstractLink;
22
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
23
import org.apache.wicket.markup.html.list.ListItem;
24
import org.apache.wicket.markup.html.list.ListView;
25
import org.apache.wicket.markup.repeater.Item;
26
import org.apache.wicket.model.IModel;
27
import org.apache.wicket.model.Model;
28
import org.apache.wicket.model.util.ListModel;
29
import org.apache.wicket.request.mapper.parameter.PageParameters;
30
import org.apache.wicket.util.string.Strings;
31
import org.nanopub.extra.services.ApiResponse;
32
import org.nanopub.extra.services.ApiResponseEntry;
33
import org.nanopub.extra.services.QueryRef;
34
import org.slf4j.Logger;
35
import org.slf4j.LoggerFactory;
36

37
import java.util.ArrayList;
38
import java.util.Collections;
39
import java.util.List;
40
import java.util.Set;
41

42
/**
43
 * Component for displaying query results in a table format.
44
 */
45
public class QueryResultTable extends QueryResult {
46

47
    private static final Logger logger = LoggerFactory.getLogger(QueryResultTable.class);
×
48

49
    private Model<String> errorMessages = Model.of("");
×
50
    private DataTable<ApiResponseEntry, String> table;
51
    private String groupColumnKey = null;
×
52
    private Label noRecordsLabel;
53
    private Label errorLabel;
54
    private FilteredQueryResultDataProvider filteredDataProvider;
55
    private Model<String> filterModel = Model.of("");
×
56
    // The source-nanopub column ("np"/"nps"), folded into the per-row actions dropdown.
57
    private String sourceColumnKey;
58

59
    QueryResultTable(String id, QueryRef queryRef, ApiResponse response, ViewDisplay viewDisplay, boolean plain) {
60
        super(id, queryRef, response, viewDisplay);
×
61

62
        if (plain) {
×
63
            add(new Label("label").setVisible(false));
×
64
            add(new Label("np").setVisible(false));
×
65
            showViewDisplayMenu = false;
×
66
            hideDescription();
×
67
        } else {
68
            String label = grlcQuery.getLabel();
×
69
            if (viewDisplay.getTitle() != null) {
×
70
                label = viewDisplay.getTitle();
×
71
            }
72
            add(new Label("label", label).setVisible(label != null && !label.isEmpty()));
×
73
        }
74

75
        errorLabel = new Label("error-messages", errorMessages);
×
76
        errorLabel.setVisible(false);
×
77
        add(errorLabel);
×
78

79
        TextField<String> filterField = new TextField<>("filter", filterModel);
×
80
        filterField.setOutputMarkupId(true);
×
81
        filterField.add(new FilterUpdatingBehavior() {
×
82
            @Override
83
            protected void onUpdate(AjaxRequestTarget target) {
84
                if (filteredDataProvider != null && table != null) {
×
85
                    filteredDataProvider.setFilterText(filterModel.getObject());
×
86
                    target.add(table);
×
87
                    if (noRecordsLabel != null) {
×
88
                        target.add(noRecordsLabel);
×
89
                    }
90
                }
91
            }
×
92
        });
93
        filterField.setVisible(!fitsOnFirstPage());
×
94
        add(filterField);
×
95

96
        populateComponent();
×
97
    }
×
98

99
    private void addErrorMessage(String errorMessage) {
100
        String s = errorMessages.getObject();
×
101
        if (s.isEmpty()) {
×
102
            s = "Error: " + errorMessage;
×
103
        } else {
104
            s += ", " + errorMessage;
×
105
        }
106
        errorMessages.setObject(s);
×
107
        errorLabel.setVisible(true);
×
108
        if (table != null) {
×
109
            table.setVisible(false);
×
110
        }
111
    }
×
112

113
    @Override
114
    protected void populateComponent() {
115
        List<IColumn<ApiResponseEntry, String>> columns = new ArrayList<>();
×
116
        QueryResultDataProvider dataProvider;
117
        try {
118
            // Columns that only feed action query mappings (conditional targets, the
119
            // local-key bundle) carry action data, not row content — don't render them.
120
            Set<String> hiddenColumns = viewDisplay.getView() != null
×
121
                    ? viewDisplay.getView().getActionMappingSourceColumns() : Collections.emptySet();
×
122
            // The source-nanopub column ("np"/"nps") is no longer rendered as its own
123
            // column; it becomes the "source" entry of this row's actions dropdown.
124
            sourceColumnKey = null;
×
125
            for (String h : response.getHeader()) {
×
126
                if (h.equals("np") || h.equals("nps")) {
×
127
                    sourceColumnKey = h;
×
128
                }
129
            }
130
            // Whether any rendered column carries a visible header label. If none do
131
            // (every column is "_noheader"), the entire header row is dropped — see the
132
            // gated addTopToolbar below.
133
            boolean anyHeaderShown = false;
×
134
            // A column whose name ends in "_group" is not rendered as a column: its value
135
            // labels a group of rows, shown as a full-width header row wherever the value
136
            // changes from one row to the next (in display order), see newRowItem below.
137
            // Sort the query by that column (or leave it unsorted) to get one header per
138
            // group; sorting the table by another column simply interleaves the headers.
139
            groupColumnKey = null;
×
140
            for (String h : response.getHeader()) {
×
141
                if (h.endsWith("_group")) {
×
142
                    groupColumnKey = h;
×
143
                }
144
            }
145
            for (String h : response.getHeader()) {
×
146
                if (h.endsWith("_label") || h.endsWith("_label_multi")
×
147
                    || hiddenColumns.contains(h) || h.equals(sourceColumnKey) || h.equals(groupColumnKey)) {
×
148
                    continue;
×
149
                }
150
                // A trailing "_noheader" hides this column's header label while still
151
                // rendering the column. It is stripped first to recover the logical
152
                // column key, so every other rule (type suffix, _label companion,
153
                // action mappings) operates unchanged on the unmarked name.
154
                boolean noHeader = h.endsWith("_noheader");
×
155
                String key = noHeader ? h.substring(0, h.length() - "_noheader".length()) : h;
×
156
                String displayLabel = key;
×
157
                if (displayLabel.endsWith("_multi_iri")) {
×
158
                    displayLabel = displayLabel.substring(0, displayLabel.length() - "_multi_iri".length());
×
159
                } else if (displayLabel.endsWith("_multi_val")) {
×
160
                    displayLabel = displayLabel.substring(0, displayLabel.length() - "_multi_val".length());
×
161
                } else if (displayLabel.endsWith("_multi")) {
×
162
                    displayLabel = displayLabel.substring(0, displayLabel.length() - "_multi".length());
×
163
                } else if (displayLabel.endsWith("_iri")) {
×
164
                    displayLabel = displayLabel.substring(0, displayLabel.length() - "_iri".length());
×
165
                }
166
                String columnHeader = displayLabel.replaceAll("_", " ");
×
167
                if (noHeader) {
×
168
                    columns.add(new Column("", h, key, null));
×
169
                } else {
170
                    anyHeaderShown = true;
×
171
                    columns.add(new Column(columnHeader, h, key, null));
×
172
                }
173
            }
174
            // A single trailing dropdown column bundling this row's entry-level actions
175
            // and its "source" link, shown whenever either is present.
176
            boolean hasEntryActions = viewDisplay.getView() != null
×
177
                                      && !viewDisplay.getView().getViewEntryActionList().isEmpty();
×
178
            if (hasEntryActions || sourceColumnKey != null) {
×
179
                columns.add(new Column("", Column.ACTIONS, "cell-right"));
×
180
            }
181
            dataProvider = new QueryResultDataProvider(response.getData());
×
182
            filteredDataProvider = new FilteredQueryResultDataProvider(dataProvider, response);
×
183
            // The whole table (header included) is hidden when there is nothing to show;
184
            // a "(nothing found)" note is shown instead. No NoRecordsToolbar, since that
185
            // would leave the header row visible.
186
            final int renderedColumnCount = columns.size();
×
187
            table = new DataTable<>("table", columns, filteredDataProvider, viewDisplay.getPageSize() < 1 ? Integer.MAX_VALUE : viewDisplay.getPageSize()) {
×
188
                @Override
189
                protected void onConfigure() {
190
                    super.onConfigure();
×
191
                    setVisible(errorMessages.getObject().isEmpty() && filteredDataProvider.size() > 0);
×
192
                }
×
193

194
                // The value of the "_group" column of the row rendered before the current
195
                // one on this page; rows are created in display order, so comparing against
196
                // it tells where a new group starts. Reset on the first row of each page.
197
                private String previousGroup = null;
×
198

199
                @Override
200
                protected Item<ApiResponseEntry> newRowItem(String id, int index, IModel<ApiResponseEntry> model) {
201
                    if (groupColumnKey == null) {
×
202
                        return super.newRowItem(id, index, model);
×
203
                    }
204
                    if (index == 0) previousGroup = null;
×
205
                    String group = model.getObject().get(groupColumnKey);
×
206
                    if (group == null) group = "";
×
207
                    final String header = group.equals(previousGroup) || group.isEmpty() ? null : group;
×
208
                    previousGroup = group;
×
209
                    return new Item<ApiResponseEntry>(id, index, model) {
×
210
                        @Override
211
                        protected void onRender() {
212
                            if (header != null) {
×
213
                                // A full-width header row written straight before this row's
214
                                // own <tr>, outside Wicket's component tree (there is no
215
                                // component for it to attach to).
216
                                getResponse().write("<tr class=\"group-header\"><td colspan=\"" + renderedColumnCount + "\">"
×
217
                                        + Strings.escapeMarkup(header) + "</td></tr>");
×
218
                            }
219
                            super.onRender();
×
220
                        }
×
221
                    };
222
                }
223
            };
224
            table.setOutputMarkupPlaceholderTag(true);
×
225
            // Marker class so nanodash.js can wrap emoji in body cells with the same
226
            // monochrome .emoji styling used for headings (e.g. the ✅/⚠️ key-approval
227
            // annotations in the "keys" column).
228
            table.add(new AttributeAppender("class", "result-table"));
×
229
            table.addBottomToolbar(new AjaxNavigationToolbar(table));
×
230
            // Drop the header row entirely when no column has a visible header label.
231
            if (anyHeaderShown) {
×
232
                table.addTopToolbar(new AjaxFallbackHeadersToolbar<String>(table, dataProvider));
×
233
            }
234
            add(table);
×
235
            // Hidden when the empty-actions line below shows instead, which carries
236
            // its own "Nothing here yet:" text; this note still covers the case of
237
            // the filter text matching no row.
238
            noRecordsLabel = new Label("no-records", "(nothing found)") {
×
239
                @Override
240
                protected void onConfigure() {
241
                    super.onConfigure();
×
242
                    setVisible(errorMessages.getObject().isEmpty() && filteredDataProvider.size() == 0 && !hasEmptyStateActions());
×
243
                }
×
244
            };
245
            noRecordsLabel.setOutputMarkupPlaceholderTag(true);
×
246
            add(noRecordsLabel);
×
247
            // When the result is genuinely empty (not merely filtered down to zero
248
            // rows), the view-level actions are promoted from the dropdown menu to
249
            // visible buttons in the empty state, pointing e.g. a space admin to
250
            // "add preset..." as the next step. menuActions only ever contains
251
            // actions the viewer is entitled to (see QueryResultTableBuilder), so
252
            // everyone else just gets the plain note. The same actions stay in the
253
            // dropdown menu, which remains their place once the table has content.
254
            WebMarkupContainer emptyActions = new WebMarkupContainer("empty-actions") {
×
255
                @Override
256
                protected void onConfigure() {
257
                    super.onConfigure();
×
258
                    setVisible(errorMessages.getObject().isEmpty() && hasEmptyStateActions());
×
259
                }
×
260
            };
261
            // menuActions is filled by the builder after construction, so the list
262
            // is wrapped as a live model rather than copied here.
263
            emptyActions.add(new ListView<MenuAction>("actions", new ListModel<>(menuActions)) {
×
264
                @Override
265
                protected void populateItem(ListItem<MenuAction> item) {
266
                    MenuAction action = item.getModelObject();
×
267
                    AbstractLink link = new BookmarkablePageLink<NanodashPage>("link", action.pageClass(), action.params());
×
268
                    link.setBody(Model.of(action.label()));
×
269
                    item.add(link);
×
270
                }
×
271
            });
272
            add(emptyActions);
×
273
        } catch (Exception ex) {
×
274
            logger.error("Error creating table for query {}", grlcQuery.getQueryId(), ex);
×
275
            add(new Label("table", "").setVisible(false));
×
276
            add(new Label("no-records", "").setVisible(false));
×
277
            add(new Label("empty-actions", "").setVisible(false));
×
278
            addErrorMessage(ex.getMessage());
×
279
        }
×
280
    }
×
281

282
    private class Column extends AbstractColumn<ApiResponseEntry, String> implements IStyledColumn<ApiResponseEntry, String> {
283

284
        private String key;
285
        // The actual response-column name to read row data from. Differs from the
286
        // logical key only for "_noheader" columns, whose marker is kept here but
287
        // stripped from key so all name-matching uses the unmarked name.
288
        private String dataKey;
289
        private String cssClass;
290
        public static final String ACTIONS = "*actions*";
291

292
        public Column(String title, String key) {
293
            this(title, key, key, null);
×
294
        }
×
295

296
        public Column(String title, String key, String cssClass) {
297
            this(title, key, key, cssClass);
×
298
        }
×
299

300
        public Column(String title, String dataKey, String key, String cssClass) {
×
301
            // Only a column with a header label is sortable: an empty header is nothing to
302
            // click, and the actions column would otherwise offer to order the table by a
303
            // property no row has, giving a round trip that changes nothing (issue #673).
304
            super(new Model<String>(title), Strings.isEmpty(title) ? null : dataKey);
×
305
            this.key = key;
×
306
            this.dataKey = dataKey;
×
307
            this.cssClass = cssClass;
×
308
        }
×
309

310
        @Override
311
        public String getCssClass() {
312
            return cssClass;
×
313
        }
314

315
        @Override
316
        public void populateItem(Item<ICellPopulator<ApiResponseEntry>> cellItem, String componentId, IModel<ApiResponseEntry> rowModel) {
317
            try {
318
                View view = viewDisplay.getView();
×
319
                if (key.equals(ACTIONS)) {
×
320
                    List<AbstractLink> links = ViewActionMappings.buildEntryActionLinks(view, rowModel.getObject(),
×
321
                            queryRef, resourceWithProfile, contextId, partId, refRoot, postPublishTab);
×
322
                    // The former "^" source link joins the same dropdown, as a "source" entry.
323
                    if (sourceColumnKey != null) {
×
324
                        String sourceUri = rowModel.getObject().get(sourceColumnKey);
×
325
                        if (sourceUri != null && !sourceUri.isBlank()) {
×
326
                            AbstractLink sourceLink = new BookmarkablePageLink<NanodashPage>("link", ExplorePage.class,
×
327
                                    new PageParameters().set("id", sourceUri));
×
328
                            sourceLink.add(NavigationContext.pageContextFallback());
×
329
                            sourceLink.setBody(Model.of("<span class=\"actionmenu-icon\">↗︎</span>source")).setEscapeModelStrings(false);
×
330
                            links.add(sourceLink);
×
331
                        }
332
                    }
333
                    if (links.isEmpty()) {
×
334
                        cellItem.add(new Label(componentId).setVisible(false));
×
335
                    } else {
336
                        cellItem.add(new EntryActionMenu(componentId, links));
×
337
                    }
338
                } else {
×
339
                    String value = rowModel.getObject().get(dataKey);
×
340
                    if (key.endsWith("_multi_iri")) {
×
341
                        String labelKey = key.substring(0, key.length() - "_multi_iri".length()) + "_label_multi";
×
342
                        String labelValue = rowModel.getObject().get(labelKey);
×
343
                        String[] uris = (value == null || value.isBlank()) ? new String[0] : value.split("\\s+");
×
344
                        String[] labels = labelValue != null ? labelValue.split("\n", -1) : null;
×
345
                        List<Component> links = new ArrayList<>();
×
346
                        for (int i = 0; i < uris.length; i++) {
×
347
                            String uri = uris[i];
×
348
                            if (uri.isBlank()) {
×
349
                                continue;
×
350
                            }
351
                            String rawLabel = (labels != null && i < labels.length && !labels[i].isBlank()) ? Utils.unescapeMultiValue(labels[i]) : null;
×
352
                            // SPARQL coalesce often falls back to the URI string itself; treat that as no label
353
                            // so NanodashLink can derive a short name from the URI.
354
                            if (rawLabel != null && rawLabel.equals(uri)) {
×
355
                                rawLabel = null;
×
356
                            }
357
                            links.add(new NanodashLink("component", uri, null, null, rawLabel, contextId));
×
358
                        }
359
                        cellItem.add(new ComponentSequence(componentId, ", ", links));
×
360
                    } else if (key.endsWith("_multi_val")) {
×
361
                        String labelKey = key.substring(0, key.length() - "_multi_val".length()) + "_label_multi";
×
362
                        String labelValue = rowModel.getObject().get(labelKey);
×
363
                        String[] parts = (value == null) ? new String[0] : value.split("\n", -1);
×
364
                        String[] labels = labelValue != null ? labelValue.split("\n", -1) : null;
×
365
                        List<Component> components = new ArrayList<>();
×
366
                        for (int i = 0; i < parts.length; i++) {
×
367
                            String part = parts[i];
×
368
                            String rawLabel = (labels != null && i < labels.length && !labels[i].isBlank()) ? Utils.unescapeMultiValue(labels[i]) : null;
×
369
                            if (isPublishLink(part)) {
×
370
                                components.add(new Label("component", publishButtonHtml(part, rawLabel)).setEscapeModelStrings(false));
×
371
                            } else if (Utils.isUriValue(part)) {
×
372
                                if (rawLabel != null && rawLabel.equals(part)) {
×
373
                                    rawLabel = null;
×
374
                                }
375
                                components.add(new NanodashLink("component", part, null, null, rawLabel, contextId));
×
376
                            } else {
377
                                String label = rawLabel;
×
378
                                String unescaped = Utils.unescapeMultiValue(part);
×
379
                                if (label == null && Utils.isDate(unescaped)) {
×
380
                                    // Friendly relative time, matching single-value cells.
381
                                    components.add(new Label("component", Utils.friendlyDateHtml(unescaped, unescaped)).setEscapeModelStrings(false));
×
382
                                } else {
383
                                    String display = label != null ? label : unescaped;
×
384
                                    if (Utils.looksLikeHtml(display)) {
×
385
                                        components.add(new Label("component", cellHtml(display))
×
386
                                                .setEscapeModelStrings(false)
×
387
                                                .add(new AttributeAppender("class", "cell-data-html")));
×
388
                                    } else {
389
                                        components.add(new Label("component", display));
×
390
                                    }
391
                                }
392
                            }
393
                        }
394
                        cellItem.add(new ComponentSequence(componentId, ", ", components));
×
395
                    } else if (key.endsWith("_multi")) {
×
396
                        String labelKey = key.substring(0, key.length() - "_multi".length()) + "_label_multi";
×
397
                        String labelValue = rowModel.getObject().get(labelKey);
×
398
                        String[] parts = (value == null) ? new String[0] : value.split("\n", -1);
×
399
                        String[] labels = labelValue != null ? labelValue.split("\n", -1) : null;
×
400
                        List<Component> components = new ArrayList<>();
×
401
                        for (int i = 0; i < parts.length; i++) {
×
402
                            boolean hasLabel = labels != null && i < labels.length && !labels[i].isBlank();
×
403
                            String display = hasLabel ? Utils.unescapeMultiValue(labels[i]) : Utils.unescapeMultiValue(parts[i]);
×
404
                            if (!hasLabel && Utils.isDate(display)) {
×
405
                                // Friendly relative time, matching single-value cells.
406
                                components.add(new Label("component", Utils.friendlyDateHtml(display, display)).setEscapeModelStrings(false));
×
407
                            } else if (Utils.looksLikeHtml(display)) {
×
408
                                components.add(new Label("component", cellHtml(display))
×
409
                                        .setEscapeModelStrings(false)
×
410
                                        .add(new AttributeAppender("class", "cell-data-html")));
×
411
                            } else {
412
                                components.add(new Label("component", display));
×
413
                            }
414
                        }
415
                        cellItem.add(new ComponentSequence(componentId, ", ", components));
×
416
                    } else if (key.endsWith("template_iri")) {
×
417
                        String label = rowModel.getObject().get(key + "_label");
×
418
                        if (label == null || label.isBlank()) {
×
419
                            label = truncateLabel(value);
×
420
                        }
421
                        String templateUrl = PublishPage.MOUNT_PATH + "?template=" + Utils.urlEncode(value) + "&template-version=latest";
×
422
                        templateUrl += linkNavParams(templateUrl);
×
423
                        String html = "<a href=\"" + Strings.escapeMarkup(templateUrl) + "\">" + Strings.escapeMarkup(label) + "</a>";
×
424
                        cellItem.add(new Label(componentId, html).setEscapeModelStrings(false));
×
425
                    } else if (isPublishLink(value)) {
×
426
                        // A ready-made link to the publish form: an action the view offers,
427
                        // shown as a button rather than as a link to content.
428
                        String label = rowModel.getObject().get(key + "_label");
×
429
                        cellItem.add(new Label(componentId, publishButtonHtml(value, label)).setEscapeModelStrings(false));
×
430
                    } else if (Utils.isUriValue(value)) {
×
431
                        String label = rowModel.getObject().get(key + "_label");
×
432
                        cellItem.add(new NanodashLink(componentId, value, null, null, label, contextId));
×
433
                    } else {
×
434
                        String litLabel = rowModel.getObject().get(key + "_label");
×
435
                        if (litLabel != null && !litLabel.isBlank() && !litLabel.equals(value)) {
×
436
                            // Separate display label for a (non-IRI) literal value; the full
437
                            // literal is shown on hover via the standard styled tooltip.
438
                            String labelHtml = Utils.looksLikeHtml(litLabel) ? cellHtml(litLabel) : Strings.escapeMarkup(litLabel).toString();
×
439
                            String html = "<span class=\"tooltip\"><span class=\"tooltiptext tooltiptext-auto\">" + Strings.escapeMarkup(value) + "</span>" + labelHtml + "</span>";
×
440
                            cellItem.add(new Label(componentId, html).setEscapeModelStrings(false));
×
441
                        } else if (key.startsWith("pubkey")) {
×
442
                            cellItem.add(new Label(componentId, value).add(new AttributeAppender("style", "overflow-wrap: anywhere;")));
×
443
                        } else if (Utils.isDate(value)) {
×
444
                            // Show a friendly relative time (client-side); raw ISO value stays as no-script fallback.
445
                            cellItem.add(new Label(componentId, Utils.friendlyDateHtml(value, value)).setEscapeModelStrings(false));
×
446
                        } else {
447
                            Label cellLabel;
448
                            if (Utils.looksLikeHtml(value)) {
×
449
                                cellLabel = (Label) new Label(componentId, cellHtml(value))
×
450
                                        .setEscapeModelStrings(false)
×
451
                                        .add(new AttributeAppender("class", "cell-data-html"));
×
452
                            } else {
453
                                cellLabel = new Label(componentId, value);
×
454
                            }
455
                            cellItem.add(cellLabel);
×
456
                        }
457
                    }
458
                }
459
            } catch (Exception ex) {
×
460
                logger.error("Failed to populate table column: ", ex);
×
461
                cellItem.add(new Label(componentId).setVisible(false));
×
462
                addErrorMessage(ex.getMessage());
×
463
            }
×
464
        }
×
465

466
    }
467

468
    private static String truncateLabel(String label) {
469
        return Utils.truncateLabel(label);
×
470
    }
471

472
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc