Skip to content

Commit 0f5d680

Browse files
authored
1026: Include rowId in serialized data rows (#7619)
1 parent 594ad17 commit 0f5d680

2 files changed

Lines changed: 125 additions & 126 deletions

File tree

api/src/org/labkey/api/exp/api/AssayJSONConverter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,18 @@ public static JSONObject serializeBatch(ExpExperiment batch, AssayProvider provi
7575
public static JSONArray serializeDataRows(ExpData data, AssayProvider provider, ExpProtocol protocol, User user, Long... objectIds)
7676
{
7777
Domain dataDomain = provider.getResultsDomain(protocol);
78+
TableInfo tableInfo = provider.createProtocolSchema(user, data.getContainer(), protocol, null).createDataTable(null);
79+
if (tableInfo == null)
80+
return new JSONArray();
81+
82+
// GitHub Issue #1026: Include rowId in serialized data rows
7883
List<FieldKey> fieldKeys = new ArrayList<>();
84+
fieldKeys.add(FieldKey.fromParts(AbstractTsvAssayProvider.ROW_ID_COLUMN_NAME));
7985
for (DomainProperty property : dataDomain.getProperties())
8086
{
8187
fieldKeys.add(FieldKey.fromParts(property.getName()));
8288
}
8389

84-
if (fieldKeys.isEmpty())
85-
{
86-
return new JSONArray();
87-
}
88-
89-
TableInfo tableInfo = provider.createProtocolSchema(user, data.getContainer(), protocol, null).createDataTable(null);
9090
Map<FieldKey, ColumnInfo> columns = QueryService.get().getColumns(tableInfo, fieldKeys);
9191
assert columns.size() == fieldKeys.size() : "Missing a column for at least one of the properties";
9292
SimpleFilter filter = new SimpleFilter(FieldKey.fromParts(AbstractTsvAssayProvider.DATA_ID_COLUMN_NAME), data.getRowId());

0 commit comments

Comments
 (0)