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 @@ -228,7 +228,7 @@ public Map<FieldKey, String> getKeywordAndSampleFieldMap(boolean includeStatisti
}

FieldKey sampleProperty = FieldKey.fromParts("FCSFile", "Sample");
ExpSampleType sampleType = getProtocol().getSampleType(getUser());
ExpSampleType sampleType = getProtocol().getSampleType();
if (sampleType != null)
{
if (sampleType.hasNameAsIdCol())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Map<String, String> getAvailableSampleKeyFields()
{
LinkedHashMap<String,String> ret = new LinkedHashMap<>();
ret.put("", "");
ExpSampleType sampleType = getProtocol().getSampleType(getUser());
ExpSampleType sampleType = getProtocol().getSampleType();
if (sampleType != null)
{
if (sampleType.hasNameAsIdCol())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<%
JoinSampleTypeForm form = (JoinSampleTypeForm) __form;

if (form.getProtocol().getSampleType(getUser()) == null)
if (form.getProtocol().getSampleType() == null)
{
%>
<p>You must first upload a sample type before specifying how to match samples to FCS files.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<%
ProtocolForm form = (ProtocolForm) __form;
FlowProtocol protocol = form.getProtocol();
ExpSampleType sampleType = protocol.getSampleType(getUser());
ExpSampleType sampleType = protocol.getSampleType();
%>
<p>
The Flow Protocol describes sample information and metadata about the experiment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<%
ProtocolForm form = (ProtocolForm) __form;
FlowProtocol protocol = form.getProtocol();
ExpSampleType st = protocol.getSampleType(getUser());
ExpSampleType st = protocol.getSampleType();

ExperimentUrls expUrls = urlProvider(ExperimentUrls.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
<%= form.fileCount%> FCS files were linked to samples in this sample type.
</p>
<p><a href="<%=h(form.getProtocol().urlShowSamples())%>">Show linked samples</a><br>
<a href="<%=h(form.getProtocol().getSampleType(getUser()).detailsURL())%>">Show all samples</a><br>
<a href="<%=h(form.getProtocol().getSampleType().detailsURL())%>">Show all samples</a><br>
<a href="<%=h(form.getProtocol().urlFor(ProtocolController.JoinSampleTypeAction.class))%>">Edit join properties</a></p>
26 changes: 15 additions & 11 deletions flow/src/org/labkey/flow/data/FlowProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ public FlowProtocolStep getStep()
*/
public ExpSampleType getSampleType(User user)
{
return SampleTypeService.get().getSampleType(getContainer(), user, SAMPLETYPE_NAME);
return SampleTypeService.get().getSampleType(getContainer(), SAMPLETYPE_NAME, true);
}
public ExpSampleType getSampleType()
{
return SampleTypeService.get().getSampleType(getContainer(), SAMPLETYPE_NAME, true);
}

/**
Expand Down Expand Up @@ -305,14 +309,14 @@ public Map<String, FieldKey> getSampleTypeJoinFields()
return ret;
}

public String getSampleTypeLSID(User user)
public String getSampleTypeLSID()
{
String propValue = (String) getProperty(ExperimentProperty.SampleTypeLSID.getPropertyDescriptor());
if (propValue != null)
return propValue;

// get lsid for sample type with name "Samples"
ExpSampleType sampleType = getSampleType(user);
ExpSampleType sampleType = getSampleType();
if (sampleType != null)
return sampleType.getLSID();

Expand All @@ -328,7 +332,7 @@ public void setSampleTypeJoinFields(User user, Map<String, FieldKey> values) thr
}
String value = StringUtils.join(strings.iterator(), "&");
setProperty(user, FlowProperty.SampleTypeJoin.getPropertyDescriptor(), value);
setProperty(user, ExperimentProperty.SampleTypeLSID.getPropertyDescriptor(), getSampleTypeLSID(user));
setProperty(user, ExperimentProperty.SampleTypeLSID.getPropertyDescriptor(), getSampleTypeLSID());
FlowManager.get().flowObjectModified();
}

Expand All @@ -352,7 +356,7 @@ public ActionURL urlShowSamples()

public Map<SampleKey, ExpMaterial> getSampleMap(User user)
{
ExpSampleType st = getSampleType(user);
ExpSampleType st = getSampleType();
if (st == null)
return Collections.emptyMap();
Set<String> propertyNames = getSampleTypeJoinFields().keySet();
Expand Down Expand Up @@ -433,7 +437,7 @@ public int updateSampleIds(User user)
Map<SampleKey, ExpMaterial> sampleMap = getSampleMap(user);
_log.debug("sampleMap=" + sampleMap.size());

ExpSampleType st = getSampleType(user);
ExpSampleType st = getSampleType();
_log.debug("sampleType=" + (st == null ? "<none>" : st.getName()) + ", lsid=" + (st == null ? "<none>" : st.getLSID()));

FlowSchema schema = new FlowSchema(user, getContainer());
Expand Down Expand Up @@ -604,7 +608,7 @@ public FCSFilesGroupedBySample getFCSFilesGroupedBySample(User user, Container c
"__FCSFiles.Sample = M.RowId\n" +
"ORDER BY M.Name, __FCSFiles.RowId";

ExpSampleType sampleType = getSampleType(user);
ExpSampleType sampleType = getSampleType();
ContainerFilter cf = getContainerFilter(sampleType, user);
UserSchema userSchema = QueryService.get().getUserSchema(user, getContainer(), SamplesSchema.SCHEMA_NAME);
TableInfo sampleTable = userSchema.getTable(SAMPLETYPE_NAME, cf);
Expand Down Expand Up @@ -1017,8 +1021,8 @@ public void testSampleJoin() throws Exception
assertEquals(0, fcsFiles[1].getSamples().size());

// create sample type
assertNull(protocol.getSampleType(user));
String sampleTypeLSID = protocol.getSampleTypeLSID(user);
assertNull(protocol.getSampleType());
String sampleTypeLSID = protocol.getSampleTypeLSID();
assertNull(sampleTypeLSID);

List<GWTPropertyDescriptor> props = List.of(
Expand All @@ -1029,9 +1033,9 @@ public void testSampleJoin() throws Exception
);
ExpSampleType st = SampleTypeService.get().createSampleType(c, user, SAMPLETYPE_NAME, null,
props, List.of(), -1,-1,-1,-1,null);
assertNotNull(protocol.getSampleType(user));
assertNotNull(protocol.getSampleType());

sampleTypeLSID = protocol.getSampleTypeLSID(user);
sampleTypeLSID = protocol.getSampleTypeLSID();
assertNotNull(sampleTypeLSID);

// add join fields
Expand Down
10 changes: 0 additions & 10 deletions flow/src/org/labkey/flow/persist/FlowKeywordAuditProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,6 @@ public String getDescription()
return "Displays information about keyword changes.";
}

@Override
public Map<FieldKey, String> legacyNameMap()
{
Map<FieldKey, String> legacyNames = super.legacyNameMap();
legacyNames.put(FieldKey.fromParts("key1"), COLUMN_NAME_DIRECTORY);
legacyNames.put(FieldKey.fromParts("key2"), COLUMN_NAME_FILE);
legacyNames.put(FieldKey.fromParts("key3"), COLUMN_NAME_KEYWORD_NAME);
return legacyNames;
}

@Override
public <K extends AuditTypeEvent> Class<K> getEventClass()
{
Expand Down
2 changes: 1 addition & 1 deletion flow/src/org/labkey/flow/persist/FlowManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ public Map<String, Object> getUsageMetrics(User user, Container c, boolean inclu
FlowProtocol protocol = FlowProtocol.getForContainer(c);
if (protocol != null)
{
ExpSampleType st = protocol.getSampleType(user);
ExpSampleType st = protocol.getSampleType();
if (st != null)
{
// put sample count at top-level since it isn't really specific to the protocol
Expand Down
2 changes: 1 addition & 1 deletion flow/src/org/labkey/flow/query/FlowSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ public FlowDataTable createFCSFileTable(String name, ContainerFilter cf, boolean
ExpSampleType st = null;
if (_protocol != null)
{
st = _protocol.getSampleType(getUser());
st = _protocol.getSampleType();
}
var colMaterialInput = ret.addMaterialInputColumn("Sample", new SamplesSchema(getUser(), getContainer()), ExpMaterialRunInput.DEFAULT_ROLE, st);
if (st == null)
Expand Down
2 changes: 1 addition & 1 deletion flow/src/org/labkey/flow/reports/statPicker.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

Collection<String> sampleTypeProperties = new ArrayList<>();
FlowProtocol protocol = FlowProtocol.ensureForContainer(getUser(), getContainer());
ExpSampleType sampleType = protocol.getSampleType(getUser());
ExpSampleType sampleType = protocol.getSampleType();
if (sampleType != null)
{
for (DomainProperty dp : sampleType.getDomain().getProperties())
Expand Down
2 changes: 1 addition & 1 deletion flow/src/org/labkey/flow/webparts/FlowOverview.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private Step getSamplesStep()
Step ret = new Step("Assign additional meanings to keywords", status);
if (protocol != null)
{
ExpSampleType st = protocol.getSampleType(getUser());
ExpSampleType st = protocol.getSampleType();
if (st != null)
{
HtmlStringBuilder sb = HtmlStringBuilder.of();
Expand Down
2 changes: 1 addition & 1 deletion flow/src/org/labkey/flow/webparts/FlowSummary.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
//int _flaggedCount = FlowManager.get().getFlaggedCount(c);

FlowProtocol _protocol = FlowProtocol.getForContainer(c);
ExpSampleType _sampleType = _protocol != null ? _protocol.getSampleType(getUser()) : null;
ExpSampleType _sampleType = _protocol != null ? _protocol.getSampleType() : null;
List<? extends ExpMaterial> _sampleTypeSamples = _sampleType == null ? null : _protocol.getSamples(_sampleType, user);
ActionURL _sampleTypeDetailsUrl = _sampleType != null ? _protocol.getSampleTypeDetailsURL(_sampleType, getContainer()) : null;

Expand Down