Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ else if (serverVal instanceof Date)
Date d = dateFormat.parse(expectations[idx]);
assertEquals("Incorrect value for: " + col + " on row " + i, d, serverVal);
}
else if ((serverVal instanceof Integer || serverVal instanceof Double))
else if ((serverVal instanceof Integer || serverVal instanceof Long || serverVal instanceof Double))
{
double d = Double.parseDouble(expectations[idx]);
assertEquals("Incorrect value for: " + col + " on row " + i, d, Double.parseDouble(serverVal.toString()), DELTA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static public void setInstance(LaboratoryService instance)

abstract public Set<AssayDataProvider> getRegisteredAssayProviders();

abstract public AssayDataProvider getDataProviderForAssay(int protocolId);
abstract public AssayDataProvider getDataProviderForAssay(long protocolId);

abstract public AssayDataProvider getDataProviderForAssay(AssayProvider ap);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public AssayImportMethod getImportMethodByName(String methodName)
}

@Override
public String getDefaultImportMethodName(Container c, User u, int protocolId)
public String getDefaultImportMethodName(Container c, User u, long protocolId)
{
Container targetContainer = c.isWorkbook() ? c.getParent() : c;
Map<String, String> props = PropertyManager.getProperties(targetContainer, PROPERTY_CATEGORY);
Expand All @@ -176,7 +176,7 @@ public String getDefaultImportMethodName(Container c, User u, int protocolId)
return _importMethods.isEmpty() ? null : _importMethods.iterator().next().getName();
}

private String getDefaultMethodPropertyKey(int protocolId)
private String getDefaultMethodPropertyKey(long protocolId)
{
return getKey() + "||" + protocolId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface AssayDataProvider extends DataProvider

AssayImportMethod getImportMethodByName(String methodName);

String getDefaultImportMethodName(Container c, User u, int protocolId);
String getDefaultImportMethodName(Container c, User u, long protocolId);

boolean isModuleEnabled(Container c);
}
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ protected void validateRows(List<Map<String, Object>> rows, ImportContext contex
errors.confirmNoErrors();
}

protected void saveTemplate(ViewContext ctx, int templateId, int runId) throws BatchValidationException
protected void saveTemplate(ViewContext ctx, int templateId, long runId) throws BatchValidationException
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import au.com.bytecode.opencsv.CSVWriter;
import org.apache.commons.lang3.StringUtils;
import org.labkey.api.collections.CaseInsensitiveHashMap;
import org.labkey.api.collections.IntHashMap;
import org.labkey.api.data.Container;
import org.labkey.api.exp.property.DomainProperty;
import org.labkey.api.query.BatchValidationException;
Expand All @@ -27,7 +28,6 @@
import java.io.IOException;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -122,7 +122,7 @@ protected String readRawFile(ImportContext context) throws BatchValidationExcept
*/
private Map<Integer, String> inspectHeader(List<String> header, ImportContext context) throws BatchValidationException
{
Map<Integer, String> resultMap = new HashMap<>();
Map<Integer, String> resultMap = new IntHashMap<>();
Map<String, String> allowable = new CaseInsensitiveHashMap<>();
BatchValidationException errors = new BatchValidationException();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import java.util.Set;
import java.util.concurrent.Callable;

import static org.labkey.api.exp.api.ExperimentService.asInteger;

/**
* User: bimber
* Date: 3/12/13
Expand Down Expand Up @@ -153,6 +155,8 @@ private Integer getInteger(Object value) throws ValidationException
return null;
else if (value instanceof Integer)
return (Integer)value;
else if (value instanceof Long)
return asInteger(value);
else if (value instanceof Double)
return ((Double)value).intValue();
try
Expand Down Expand Up @@ -326,9 +330,9 @@ public Object call() throws Exception
Object selfAssignedId = it.getInputColumnValue(inputColMap.get(_incrementingCol));
if (selfAssignedId != null)
{
if (selfAssignedId instanceof Integer)
if (selfAssignedId instanceof Integer || selfAssignedId instanceof Long)
{
rowId = (Integer)selfAssignedId;
rowId = asInteger(selfAssignedId);

if (idGen.hasRowWithId(c, rowId))
_context.getErrors().addRowError(new ValidationException("A record is already present with ID: " + rowId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public Set<AssayDataProvider> getRegisteredAssayProviders()
}

@Override
public AssayDataProvider getDataProviderForAssay(int protocolId)
public AssayDataProvider getDataProviderForAssay(long protocolId)
{
ExpProtocol protocol = ExperimentService.get().getExpProtocol(protocolId);
if (protocol == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void setTransformResult(TransformResult result)
* The RowId for the run that is being deleted and reuploaded, or null if this is a new run
*/
@Override
public Integer getReRunId()
public Long getReRunId()
{
return null;
}
Expand Down