Skip to content

Commit 4c94952

Browse files
Merge remote-tracking branch 'origin/develop' into fb_dialect_arrays
2 parents 98554f5 + c96e935 commit 4c94952

File tree

55 files changed

+1113
-581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1113
-581
lines changed

api/schemas/expTypes.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<xs:element name="Comments" type="string" minOccurs="0"/>
9797
<xs:element name="ExperimentLSID" type="string" minOccurs="0" maxOccurs="1" />
9898
<xs:element name="Properties" type="exp:PropertyCollectionType" minOccurs="0"/>
99-
<xs:element name="WorkflowTaskLSID" type="string" minOccurs="0" maxOccurs="1" />
99+
<xs:element name="WorkflowTaskId" type="string" minOccurs="0" maxOccurs="1" />
100100
<xs:element name="ReplacedByRunLSID" type="string" minOccurs="0">
101101
<xs:annotation>
102102
<xs:documentation>Reference to another run that defines an updated version of this data</xs:documentation>

api/schemas/folder.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
<xs:element name="moduleProperties" minOccurs="0" type="modulePropertiesType"/>
9494
<xs:element name="xar" minOccurs="0" type="exportDirType" />
9595
<xs:element name="inventory" minOccurs="0" type="exportDirType"/>
96+
<xs:element name="workflow" minOccurs="0" type="exportDirType"/>
9697
<xs:element name="fileBrowserConfig" minOccurs="0" maxOccurs="1">
9798
<xs:complexType>
9899
<xs:attribute name="file" type="xs:string">

api/src/org/labkey/api/admin/FolderArchiveDataTypes.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ private FolderArchiveDataTypes() {}
5151
public static final String DATA_CLASS_DATA = "Data Class Data";
5252
public static final String INVENTORY = "Inventory locations and items";
5353
public static final String VIEW_CATEGORIES = "Categories";
54+
public static final String WORKFLOW = "Workflow jobs, templates, tasks, actions and entities";
5455
}

api/src/org/labkey/api/admin/FolderImportContext.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class FolderImportContext extends AbstractFolderContext
5151
private String _xarJobId;
5252

5353
private final HashSet<String> _importedReports = new HashSet<>();
54+
private Map<Long, Long> _assayRunWorkflowTaskMap = new HashMap<>();
5455

5556
private static final String FOLDER_IMPORT_DB_SEQUENCE_PREFIX = "FolderImportJobCounter-";
5657

@@ -180,6 +181,16 @@ public void addImportedReport(ReportDescriptor d)
180181
_importedReports.add(ReportUtil.getSerializedName(d));
181182
}
182183

184+
public Map<Long, Long> getAssayRunWorkflowTaskMap()
185+
{
186+
return _assayRunWorkflowTaskMap;
187+
}
188+
189+
public void setAssayRunWorkflowTaskMap(Map<Long, Long> assayRunWorkflowTaskMap)
190+
{
191+
_assayRunWorkflowTaskMap = assayRunWorkflowTaskMap;
192+
}
193+
183194
@Override
184195
public AuditBehaviorType getAuditBehaviorType() throws Exception
185196
{
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2011 LabKey Corporation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.labkey.api.data;
17+
18+
import org.labkey.api.util.SkipMothershipLogging;
19+
20+
/**
21+
* Signals there was a problem with a SQL parameter, such as a conversion problem.
22+
*/
23+
public class SQLParameterException extends SQLGenerationException implements SkipMothershipLogging
24+
{
25+
public SQLParameterException(String message)
26+
{
27+
super(message);
28+
}
29+
}

api/src/org/labkey/api/data/SqlExecutingSelector.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,9 @@ public void handleSqlException(SQLException e, @Nullable Connection conn)
567567
if (null != _sql)
568568
ExceptionUtil.decorateException(e, ExceptionUtil.ExceptionInfo.DialectSQL, _sql.toDebugString(), false);
569569

570-
throw getExceptionFramework().translate(getScope(), "ExecutingSelector", e);
570+
RuntimeException translated = getExceptionFramework().translate(getScope(), "ExecutingSelector", e);
571+
ExceptionUtil.copyDecorations(e, translated);
572+
throw translated;
571573
}
572574
}
573575
}

api/src/org/labkey/api/data/Table.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.apache.commons.beanutils.BeanUtils;
2020
import org.apache.commons.beanutils.PropertyUtils;
2121
import org.apache.commons.lang3.StringUtils;
22+
import org.apache.commons.lang3.Strings;
2223
import org.apache.logging.log4j.Level;
2324
import org.apache.logging.log4j.Logger;
2425
import org.jetbrains.annotations.NotNull;
@@ -50,6 +51,7 @@
5051
import org.labkey.api.query.RuntimeValidationException;
5152
import org.labkey.api.security.User;
5253
import org.labkey.api.util.BaseScanner;
54+
import org.labkey.api.util.ExceptionUtil;
5355
import org.labkey.api.util.GUID;
5456
import org.labkey.api.util.JunitUtil;
5557
import org.labkey.api.util.MemTracker;
@@ -571,7 +573,7 @@ Object getObject(ResultSet rs) throws SQLException
571573
// Standard SQLException catch block: log exception, query SQL, and params
572574
static void logException(@Nullable SQLFragment sql, @Nullable Connection conn, SQLException e, Level logLevel)
573575
{
574-
if (SqlDialect.isCancelException(e))
576+
if (SqlDialect.isCancelException(e) || ExceptionUtil.isIgnorable(e))
575577
{
576578
return;
577579
}
@@ -585,7 +587,7 @@ static void logException(@Nullable SQLFragment sql, @Nullable Connection conn, S
585587
String trim = sql.getSQL().trim();
586588

587589
// Treat a ConstraintException during INSERT/UPDATE as a WARNING. Treat all other SQLExceptions as an ERROR.
588-
if (RuntimeSQLException.isConstraintException(e) && (StringUtils.startsWithIgnoreCase(trim, "INSERT") || StringUtils.startsWithIgnoreCase(trim, "UPDATE")))
590+
if (RuntimeSQLException.isConstraintException(e) && (Strings.CI.startsWith(trim, "INSERT") || Strings.CI.startsWith(trim, "UPDATE")))
589591
{
590592
// Log this ConstraintException if log Level is WARN (the default) or lower. Skip logging for callers that request just ERRORs.
591593
if (Level.WARN.isMoreSpecificThan(logLevel))
@@ -1409,7 +1411,7 @@ public void testSelect() throws SQLException
14091411
//noinspection EmptyTryBlock,UnusedDeclaration
14101412
try (ResultSet rs = new TableSelector(tinfo).getResultSet()){}
14111413

1412-
Map[] maps = new TableSelector(tinfo).getMapArray();
1414+
Map<?, ?>[] maps = new TableSelector(tinfo).getMapArray();
14131415
assertNotNull(maps);
14141416

14151417
Principal[] principals = new TableSelector(tinfo).getArray(Principal.class);
@@ -1739,7 +1741,7 @@ public static ParameterMapStatement deleteStatement(Connection conn, TableInfo t
17391741
//
17401742

17411743
Domain domain = tableDelete.getDomain();
1742-
DomainKind domainKind = tableDelete.getDomainKind();
1744+
DomainKind<?> domainKind = tableDelete.getDomainKind();
17431745
if (null != domain && null != domainKind && StringUtils.isEmpty(domainKind.getStorageSchemaName()))
17441746
{
17451747
if (!d.isPostgreSQL() && !d.isSqlServer())

api/src/org/labkey/api/data/TableSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public Results getResultsAsync(final boolean cache, final boolean scrollable, Ht
396396
}
397397

398398
/**
399-
* Setting this options asks the TableSelector to add additional display columns to the generated SQL, as well
399+
* Setting this option asks the TableSelector to add additional display columns to the generated SQL, as well
400400
401401
* as forcing the results to be sorted.
402402
* @return this

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

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,5 @@ default String getDocumentId()
165165
return String.join(":",getContainer().getId(), "assay", String.valueOf(getRowId()));
166166
}
167167

168-
static boolean isSampleWorkflowJobProtocol(String lsid)
169-
{
170-
return lsid.contains(ExperimentService.SAMPLE_MANAGEMENT_JOB_PROTOCOL_PREFIX);
171-
}
172-
173-
static boolean isSampleWorkflowTaskProtocol(String lsid)
174-
{
175-
return lsid.contains(ExperimentService.SAMPLE_MANAGEMENT_TASK_PROTOCOL_PREFIX);
176-
}
177-
178-
// TODO remove this and its relatives once the workflow folder import/export rewrite has happened.
179-
static boolean isSampleWorkflowProtocol(String lsid)
180-
{
181-
return isSampleWorkflowTaskProtocol(lsid) || isSampleWorkflowJobProtocol(lsid);
182-
}
183-
184168
Map<String, Object> getAuditRecordMap(AssayProvider provider);
185169
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ ValidationException updateDataClass(
393393
*/
394394
@NotNull List<? extends ExpMaterial> getExpMaterialsByName(String name, @Nullable Container container, User user);
395395

396+
@NotNull List<? extends ExpMaterial> getExpMaterialsByName(@NotNull Collection<String> names, @NotNull String sampleTypeName, @NotNull Container container, User user);
397+
396398
@Nullable ExpData findExpData(
397399
Container c,
398400
User user,

0 commit comments

Comments
 (0)