Skip to content

Commit 7ac4acb

Browse files
authored
Rename module.xml "requiredModule" element to "module" (#27) (#29)
1 parent 919ec11 commit 7ac4acb

File tree

3 files changed

+5
-51
lines changed

3 files changed

+5
-51
lines changed

laboratory/resources/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</propertyDescriptor>
1818
</properties>
1919
<requiredModuleContext>
20-
<requiredModule name="LDK"/>
20+
<module name="LDK"/>
2121
</requiredModuleContext>
2222
<clientDependencies>
2323
<dependency path="Ext4"/>

laboratory/src/org/labkey/laboratory/LaboratoryModule.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,8 @@
5353
import java.util.Arrays;
5454
import java.util.Collection;
5555
import java.util.HashMap;
56-
import java.util.LinkedList;
57-
import java.util.List;
5856
import java.util.Map;
5957
import java.util.Set;
60-
import java.util.function.Supplier;
6158

6259
/**
6360
* User: bimber
@@ -212,19 +209,6 @@ public Set<String> getSchemaNames()
212209
return PageFlowUtil.set(SCHEMA_NAME);
213210
}
214211

215-
@NotNull
216-
@Override
217-
public List<Supplier<ClientDependency>> getClientDependencies(Container c)
218-
{
219-
// allow other modules to register with EHR service, and include their dependencies automatically
220-
// whenever laboratory context is requested
221-
List<Supplier<ClientDependency>> ret = new LinkedList<>();
222-
ret.addAll(super.getClientDependencies(c));
223-
ret.addAll(LaboratoryService.get().getRegisteredClientDependencies(c));
224-
225-
return ret;
226-
}
227-
228212
@Override
229213
public JSONObject getPageContextJson(ContainerUser context)
230214
{

laboratory/src/org/labkey/laboratory/LaboratoryServiceImpl.java

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
import org.apache.log4j.Logger;
1919
import org.json.JSONObject;
20+
import org.labkey.api.assay.AssayFileWriter;
21+
import org.labkey.api.assay.AssayProvider;
22+
import org.labkey.api.assay.AssayService;
2023
import org.labkey.api.collections.CaseInsensitiveHashMap;
2124
import org.labkey.api.data.ColumnInfo;
2225
import org.labkey.api.data.Container;
@@ -32,10 +35,10 @@
3235
import org.labkey.api.exp.api.ExperimentService;
3336
import org.labkey.api.laboratory.DataProvider;
3437
import org.labkey.api.laboratory.LaboratoryService;
38+
import org.labkey.api.laboratory.NavItem;
3539
import org.labkey.api.laboratory.TabbedReportItem;
3640
import org.labkey.api.laboratory.assay.AssayDataProvider;
3741
import org.labkey.api.laboratory.assay.SimpleAssayDataProvider;
38-
import org.labkey.api.laboratory.NavItem;
3942
import org.labkey.api.ldk.table.ButtonConfigFactory;
4043
import org.labkey.api.module.Module;
4144
import org.labkey.api.module.ModuleLoader;
@@ -44,12 +47,8 @@
4447
import org.labkey.api.query.ValidationException;
4548
import org.labkey.api.security.User;
4649
import org.labkey.api.security.permissions.ReadPermission;
47-
import org.labkey.api.assay.AssayFileWriter;
48-
import org.labkey.api.assay.AssayProvider;
49-
import org.labkey.api.assay.AssayService;
5050
import org.labkey.api.util.Pair;
5151
import org.labkey.api.view.ViewContext;
52-
import org.labkey.api.view.template.ClientDependency;
5352
import org.labkey.laboratory.assay.AssayHelper;
5453
import org.labkey.laboratory.query.DefaultAssayCustomizer;
5554
import org.labkey.laboratory.query.LaboratoryTableCustomizer;
@@ -65,7 +64,6 @@
6564
import java.util.List;
6665
import java.util.Map;
6766
import java.util.Set;
68-
import java.util.function.Supplier;
6967

7068
/**
7169
* User: bimber
@@ -78,7 +76,6 @@ public class LaboratoryServiceImpl extends LaboratoryService
7876
private static final Logger _log = Logger.getLogger(LaboratoryServiceImpl.class);
7977

8078
private Set<Module> _registeredModules = new HashSet<>();
81-
private Map<Module, List<Supplier<ClientDependency>>> _clientDependencies = new HashMap<>();
8279
private Map<String, Map<String, List<ButtonConfigFactory>>> _assayButtons = new CaseInsensitiveHashMap<>();
8380
private Map<String, DataProvider> _dataProviders = new HashMap<>();
8481
private Map<String, Map<String, List<Pair<Module, Class<? extends TableCustomizer>>>>> _tableCustomizers = new CaseInsensitiveHashMap<>();
@@ -314,33 +311,6 @@ public void sortNavItems(List<? extends NavItem> navItems)
314311
});
315312
}
316313

317-
@Override
318-
public void registerClientDependency(Supplier<ClientDependency> cd, Module owner)
319-
{
320-
List<Supplier<ClientDependency>> list = _clientDependencies.get(owner);
321-
if (list == null)
322-
list = new ArrayList<>();
323-
324-
list.add(cd);
325-
326-
_clientDependencies.put(owner, list);
327-
}
328-
329-
@Override
330-
public List<Supplier<ClientDependency>> getRegisteredClientDependencies(Container c)
331-
{
332-
List<Supplier<ClientDependency>> list = new ArrayList<>();
333-
for (Module m : _clientDependencies.keySet())
334-
{
335-
if (c.getActiveModules().contains(m))
336-
{
337-
list.addAll(_clientDependencies.get(m));
338-
}
339-
}
340-
341-
return Collections.unmodifiableList(list);
342-
}
343-
344314
@Override
345315
public String getDefaultWorkbookFolderType(Container c)
346316
{

0 commit comments

Comments
 (0)