Skip to content

Commit 5ed8a9b

Browse files
authored
Remove unused User parameters from service methods (#968)
1 parent 9e14e16 commit 5ed8a9b

File tree

13 files changed

+26
-32
lines changed

13 files changed

+26
-32
lines changed

flow/src/org/labkey/flow/controllers/protocol/EditICSMetadataForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public Map<FieldKey, String> getKeywordAndSampleFieldMap(boolean includeStatisti
228228
}
229229

230230
FieldKey sampleProperty = FieldKey.fromParts("FCSFile", "Sample");
231-
ExpSampleType sampleType = getProtocol().getSampleType(getUser());
231+
ExpSampleType sampleType = getProtocol().getSampleType();
232232
if (sampleType != null)
233233
{
234234
if (sampleType.hasNameAsIdCol())

flow/src/org/labkey/flow/controllers/protocol/JoinSampleTypeForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public Map<String, String> getAvailableSampleKeyFields()
6969
{
7070
LinkedHashMap<String,String> ret = new LinkedHashMap<>();
7171
ret.put("", "");
72-
ExpSampleType sampleType = getProtocol().getSampleType(getUser());
72+
ExpSampleType sampleType = getProtocol().getSampleType();
7373
if (sampleType != null)
7474
{
7575
if (sampleType.hasNameAsIdCol())

flow/src/org/labkey/flow/controllers/protocol/joinSampleType.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<%
2525
JoinSampleTypeForm form = (JoinSampleTypeForm) __form;
2626
27-
if (form.getProtocol().getSampleType(getUser()) == null)
27+
if (form.getProtocol().getSampleType() == null)
2828
{
2929
%>
3030
<p>You must first upload a sample type before specifying how to match samples to FCS files.</p>

flow/src/org/labkey/flow/controllers/protocol/showProtocol.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<%
2828
ProtocolForm form = (ProtocolForm) __form;
2929
FlowProtocol protocol = form.getProtocol();
30-
ExpSampleType sampleType = protocol.getSampleType(getUser());
30+
ExpSampleType sampleType = protocol.getSampleType();
3131
%>
3232
<p>
3333
The Flow Protocol describes sample information and metadata about the experiment.

flow/src/org/labkey/flow/controllers/protocol/showSamples2.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<%
3838
ProtocolForm form = (ProtocolForm) __form;
3939
FlowProtocol protocol = form.getProtocol();
40-
ExpSampleType st = protocol.getSampleType(getUser());
40+
ExpSampleType st = protocol.getSampleType();
4141
4242
ExperimentUrls expUrls = urlProvider(ExperimentUrls.class);
4343

flow/src/org/labkey/flow/controllers/protocol/updateSamples.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
<%= form.fileCount%> FCS files were linked to samples in this sample type.
2626
</p>
2727
<p><a href="<%=h(form.getProtocol().urlShowSamples())%>">Show linked samples</a><br>
28-
<a href="<%=h(form.getProtocol().getSampleType(getUser()).detailsURL())%>">Show all samples</a><br>
28+
<a href="<%=h(form.getProtocol().getSampleType().detailsURL())%>">Show all samples</a><br>
2929
<a href="<%=h(form.getProtocol().urlFor(ProtocolController.JoinSampleTypeAction.class))%>">Edit join properties</a></p>

flow/src/org/labkey/flow/data/FlowProtocol.java

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,11 @@ public FlowProtocolStep getStep()
257257
*/
258258
public ExpSampleType getSampleType(User user)
259259
{
260-
return SampleTypeService.get().getSampleType(getContainer(), user, SAMPLETYPE_NAME);
260+
return SampleTypeService.get().getSampleType(getContainer(), SAMPLETYPE_NAME, true);
261+
}
262+
public ExpSampleType getSampleType()
263+
{
264+
return SampleTypeService.get().getSampleType(getContainer(), SAMPLETYPE_NAME, true);
261265
}
262266

263267
/**
@@ -305,14 +309,14 @@ public Map<String, FieldKey> getSampleTypeJoinFields()
305309
return ret;
306310
}
307311

308-
public String getSampleTypeLSID(User user)
312+
public String getSampleTypeLSID()
309313
{
310314
String propValue = (String) getProperty(ExperimentProperty.SampleTypeLSID.getPropertyDescriptor());
311315
if (propValue != null)
312316
return propValue;
313317

314318
// get lsid for sample type with name "Samples"
315-
ExpSampleType sampleType = getSampleType(user);
319+
ExpSampleType sampleType = getSampleType();
316320
if (sampleType != null)
317321
return sampleType.getLSID();
318322

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

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

353357
public Map<SampleKey, ExpMaterial> getSampleMap(User user)
354358
{
355-
ExpSampleType st = getSampleType(user);
359+
ExpSampleType st = getSampleType();
356360
if (st == null)
357361
return Collections.emptyMap();
358362
Set<String> propertyNames = getSampleTypeJoinFields().keySet();
@@ -433,7 +437,7 @@ public int updateSampleIds(User user)
433437
Map<SampleKey, ExpMaterial> sampleMap = getSampleMap(user);
434438
_log.debug("sampleMap=" + sampleMap.size());
435439

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

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

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

10191023
// create sample type
1020-
assertNull(protocol.getSampleType(user));
1021-
String sampleTypeLSID = protocol.getSampleTypeLSID(user);
1024+
assertNull(protocol.getSampleType());
1025+
String sampleTypeLSID = protocol.getSampleTypeLSID();
10221026
assertNull(sampleTypeLSID);
10231027

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

1034-
sampleTypeLSID = protocol.getSampleTypeLSID(user);
1038+
sampleTypeLSID = protocol.getSampleTypeLSID();
10351039
assertNotNull(sampleTypeLSID);
10361040

10371041
// add join fields

flow/src/org/labkey/flow/persist/FlowKeywordAuditProvider.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,6 @@ public String getDescription()
9999
return "Displays information about keyword changes.";
100100
}
101101

102-
@Override
103-
public Map<FieldKey, String> legacyNameMap()
104-
{
105-
Map<FieldKey, String> legacyNames = super.legacyNameMap();
106-
legacyNames.put(FieldKey.fromParts("key1"), COLUMN_NAME_DIRECTORY);
107-
legacyNames.put(FieldKey.fromParts("key2"), COLUMN_NAME_FILE);
108-
legacyNames.put(FieldKey.fromParts("key3"), COLUMN_NAME_KEYWORD_NAME);
109-
return legacyNames;
110-
}
111-
112102
@Override
113103
public <K extends AuditTypeEvent> Class<K> getEventClass()
114104
{

flow/src/org/labkey/flow/persist/FlowManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ public Map<String, Object> getUsageMetrics(User user, Container c, boolean inclu
13591359
FlowProtocol protocol = FlowProtocol.getForContainer(c);
13601360
if (protocol != null)
13611361
{
1362-
ExpSampleType st = protocol.getSampleType(user);
1362+
ExpSampleType st = protocol.getSampleType();
13631363
if (st != null)
13641364
{
13651365
// put sample count at top-level since it isn't really specific to the protocol

flow/src/org/labkey/flow/query/FlowSchema.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ public FlowDataTable createFCSFileTable(String name, ContainerFilter cf, boolean
15181518
ExpSampleType st = null;
15191519
if (_protocol != null)
15201520
{
1521-
st = _protocol.getSampleType(getUser());
1521+
st = _protocol.getSampleType();
15221522
}
15231523
var colMaterialInput = ret.addMaterialInputColumn("Sample", new SamplesSchema(getUser(), getContainer()), ExpMaterialRunInput.DEFAULT_ROLE, st);
15241524
if (st == null)

0 commit comments

Comments
 (0)