Skip to content

Commit 035cd6c

Browse files
Adjust updateRow and importData interfaces to account for auditUserComments (#190)
1 parent 382431d commit 035cd6c

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

LDK/api-src/org/labkey/api/ldk/table/AbstractDataDefinedTable.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import org.apache.commons.lang3.StringUtils;
1919
import org.jetbrains.annotations.NotNull;
20+
import org.jetbrains.annotations.Nullable;
2021
import org.labkey.api.data.AbstractTableInfo;
2122
import org.labkey.api.data.ColumnInfo;
2223
import org.labkey.api.data.CompareType;
@@ -174,7 +175,7 @@ protected Map<String, Object> insertRow(User user, Container container, Map<Stri
174175
}
175176

176177
@Override
177-
protected Map<String, Object> updateRow(User user, Container container, Map<String, Object> row, @NotNull Map<String, Object> oldRow) throws InvalidKeyException, ValidationException, QueryUpdateServiceException, SQLException
178+
protected Map<String, Object> updateRow(User user, Container container, Map<String, Object> row, @NotNull Map<String, Object> oldRow, @Nullable Map<Enum, Object> configParameters) throws InvalidKeyException, ValidationException, QueryUpdateServiceException, SQLException
178179
{
179180
String oldValue = (String)oldRow.get(_valueColumn);
180181
String newValue = (String)row.get(_valueColumn);
@@ -186,7 +187,7 @@ protected Map<String, Object> updateRow(User user, Container container, Map<Stri
186187
_vm.uncacheValue(oldValue);
187188

188189
row.put(_filterColumn, _filterValue);
189-
return super.updateRow(user, container, row, oldRow);
190+
return super.updateRow(user, container, row, oldRow, configParameters);
190191
}
191192

192193
@Override

LDK/api-src/org/labkey/api/ldk/table/ContainerScopedTable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,15 @@ public List<Map<String,Object>> insertRows(User user, Container container, List<
199199
}
200200

201201
@Override
202-
protected Map<String, Object> updateRow(User user, Container container, Map<String, Object> row, @NotNull Map<String, Object> oldRow) throws InvalidKeyException, ValidationException, QueryUpdateServiceException, SQLException
202+
protected Map<String, Object> updateRow(User user, Container container, Map<String, Object> row, @NotNull Map<String, Object> oldRow, @Nullable Map<Enum, Object> configParameters) throws InvalidKeyException, ValidationException, QueryUpdateServiceException, SQLException
203203
{
204204
Object oldValue = oldRow.get(_pseudoPk);
205205
Object newValue = row.get(_pseudoPk);
206206

207207
if (oldRow != null && newValue != null && !oldValue.equals(newValue) && _keyManager.rowExists(container, newValue))
208208
throw new ValidationException("There is already a record where " + _pseudoPk + " equals " + newValue);
209209

210-
return super.updateRow(user, container, row, oldRow);
210+
return super.updateRow(user, container, row, oldRow, configParameters);
211211
}
212212
}
213213

laboratory/api-src/org/labkey/api/laboratory/query/ContainerIncrementingTable.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.apache.commons.lang3.StringUtils;
44
import org.jetbrains.annotations.NotNull;
5+
import org.jetbrains.annotations.Nullable;
56
import org.labkey.api.data.Aggregate;
67
import org.labkey.api.data.ColumnInfo;
78
import org.labkey.api.data.CompareType;
@@ -133,15 +134,15 @@ else if (rowId != null)
133134
}
134135

135136
@Override
136-
protected Map<String, Object> updateRow(User user, Container container, Map<String, Object> row, @NotNull Map<String, Object> oldRow) throws InvalidKeyException, ValidationException, QueryUpdateServiceException, SQLException
137+
protected Map<String, Object> updateRow(User user, Container container, Map<String, Object> row, @NotNull Map<String, Object> oldRow, @Nullable Map<Enum, Object> configParameters) throws InvalidKeyException, ValidationException, QueryUpdateServiceException, SQLException
137138
{
138139
Integer oldValue = getInteger(oldRow.get(_incrementingCol));
139140
Integer newValue = getInteger(row.get(_incrementingCol));
140141

141142
if (oldValue != null && newValue != null && !oldValue.equals(newValue))
142143
throw new ValidationException("Cannot change the value of the column: " + _incrementingCol);
143144

144-
return super.updateRow(user, container, row, oldRow);
145+
return super.updateRow(user, container, row, oldRow, configParameters);
145146
}
146147
}
147148

laboratory/src/org/labkey/laboratory/query/LaboratoryWorkbooksTable.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.apache.logging.log4j.Logger;
55
import org.apache.logging.log4j.LogManager;
66
import org.jetbrains.annotations.NotNull;
7+
import org.jetbrains.annotations.Nullable;
78
import org.labkey.api.data.ColumnInfo;
89
import org.labkey.api.data.Container;
910
import org.labkey.api.data.ContainerFilter;
@@ -137,15 +138,15 @@ protected Map<String, Object> insertRow(User user, Container container, Map<Stri
137138
}
138139

139140
@Override
140-
protected Map<String, Object> updateRow(User user, Container container, Map<String, Object> row, @NotNull Map<String, Object> oldRow) throws InvalidKeyException, ValidationException, QueryUpdateServiceException, SQLException
141+
protected Map<String, Object> updateRow(User user, Container container, Map<String, Object> row, @NotNull Map<String, Object> oldRow, @Nullable Map<Enum, Object> configParameters) throws InvalidKeyException, ValidationException, QueryUpdateServiceException, SQLException
141142
{
142143
Object oldValue = oldRow.get(WORKBOOK_ID_COl);
143144
Object newValue = row.get(WORKBOOK_ID_COl);
144145

145146
if (oldValue != null && newValue != null && !oldValue.equals(newValue))
146147
throw new ValidationException("Cannot change the workbook Id");
147148

148-
return super.updateRow(user, container, row, oldRow);
149+
return super.updateRow(user, container, row, oldRow, configParameters);
149150
}
150151

151152
/**

0 commit comments

Comments
 (0)