Skip to content

Commit 818d1fa

Browse files
committed
Trigger interface changes
1 parent 79a5deb commit 818d1fa

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

SivStudies/src/org/labkey/sivstudies/query/DefaultDatasetTrigger.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.labkey.api.data.TableInfo;
88
import org.labkey.api.data.triggers.Trigger;
99
import org.labkey.api.data.triggers.TriggerFactory;
10+
import org.labkey.api.query.QueryUpdateService;
1011
import org.labkey.api.query.ValidationException;
1112
import org.labkey.api.security.User;
1213
import org.labkey.api.util.logging.LogHelper;
@@ -35,9 +36,9 @@ public Factory()
3536
}
3637

3738
@Override
38-
public void beforeInsert(TableInfo table, Container c, User user, @Nullable Map<String, Object> newRow, ValidationException errors, Map<String, Object> extraContext) throws ValidationException
39+
public void beforeInsert(TableInfo table, Container c, User user, @Nullable QueryUpdateService.InsertOption insertOption, @Nullable Map<String, Object> newRow, ValidationException errors, Map<String, Object> extraContext) throws ValidationException
3940
{
40-
beforeInsert(table, c, user, newRow, errors, extraContext, null);
41+
beforeInsert(table, c, user, insertOption, newRow, errors, extraContext, null);
4142
}
4243

4344
@Override
@@ -64,13 +65,13 @@ protected void afterUpsert(TableInfo table, Container c, User user, @Nullable Ma
6465
}
6566

6667
@Override
67-
public void beforeInsert(TableInfo table, Container c, User user, @Nullable Map<String, Object> newRow, ValidationException errors, Map<String, Object> extraContext, @Nullable Map<String, Object> existingRecord) throws ValidationException
68+
public void beforeInsert(TableInfo table, Container c, User user, @Nullable QueryUpdateService.InsertOption insertOption, @Nullable Map<String, Object> newRow, ValidationException errors, Map<String, Object> extraContext, @Nullable Map<String, Object> existingRecord) throws ValidationException
6869
{
6970
beforeUpsert(table, c, user, newRow, existingRecord, errors, extraContext);
7071
}
7172

7273
@Override
73-
public void beforeUpdate(TableInfo table, Container c, User user, @Nullable Map<String, Object> newRow, @Nullable Map<String, Object> oldRow, ValidationException errors, Map<String, Object> extraContext) throws ValidationException
74+
public void beforeUpdate(TableInfo table, Container c, User user, @Nullable QueryUpdateService.InsertOption insertOption, @Nullable Map<String, Object> newRow, @Nullable Map<String, Object> oldRow, ValidationException errors, Map<String, Object> extraContext) throws ValidationException
7475
{
7576
beforeUpsert(table, c, user, newRow, oldRow, errors, extraContext);
7677
}

SivStudies/src/org/labkey/sivstudies/query/ViralLoadsTriggerFactory.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
import org.labkey.api.data.TableInfo;
99
import org.labkey.api.data.triggers.Trigger;
1010
import org.labkey.api.data.triggers.TriggerFactory;
11+
import org.labkey.api.query.QueryUpdateService;
1112
import org.labkey.api.query.SimpleValidationError;
1213
import org.labkey.api.query.ValidationException;
1314
import org.labkey.api.security.User;
1415

1516
import java.util.Collection;
1617
import java.util.List;
1718
import java.util.Map;
18-
import java.util.regex.Pattern;
1919

2020
public class ViralLoadsTriggerFactory implements TriggerFactory
2121
{
@@ -33,19 +33,19 @@ public ViralLoadsTriggerFactory()
3333
public static class ViralLoadTrigger implements Trigger
3434
{
3535
@Override
36-
public void beforeInsert(TableInfo table, Container c, User user, @Nullable Map<String, Object> newRow, ValidationException errors, Map<String, Object> extraContext) throws ValidationException
36+
public void beforeInsert(TableInfo table, Container c, User user, @Nullable QueryUpdateService.InsertOption insertOption, @Nullable Map<String, Object> newRow, ValidationException errors, Map<String, Object> extraContext) throws ValidationException
3737
{
38-
beforeInsert(table, c, user, newRow, errors, extraContext, null);
38+
beforeInsert(table, c, user, insertOption, newRow, errors, extraContext, null);
3939
}
4040

4141
@Override
42-
public void beforeInsert(TableInfo table, Container c, User user, @Nullable Map<String, Object> newRow, ValidationException errors, Map<String, Object> extraContext, @Nullable Map<String, Object> existingRecord) throws ValidationException
42+
public void beforeInsert(TableInfo table, Container c, User user, @Nullable QueryUpdateService.InsertOption insertOption, @Nullable Map<String, Object> newRow, ValidationException errors, Map<String, Object> extraContext, @Nullable Map<String, Object> existingRecord) throws ValidationException
4343
{
4444
handlePVL(newRow, c, errors);
4545
}
4646

4747
@Override
48-
public void beforeUpdate(TableInfo table, Container c, User user, @Nullable Map<String, Object> newRow, @Nullable Map<String, Object> oldRow, ValidationException errors, Map<String, Object> extraContext) throws ValidationException
48+
public void beforeUpdate(TableInfo table, Container c, User user, @Nullable QueryUpdateService.InsertOption insertOption, @Nullable Map<String, Object> newRow, @Nullable Map<String, Object> oldRow, ValidationException errors, Map<String, Object> extraContext) throws ValidationException
4949
{
5050
handlePVL(newRow, c, errors);
5151
}

0 commit comments

Comments
 (0)