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
2 changes: 1 addition & 1 deletion laboratory/resources/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</propertyDescriptor>
</properties>
<requiredModuleContext>
<requiredModule name="LDK"/>
<module name="LDK"/>
</requiredModuleContext>
<clientDependencies>
<dependency path="Ext4"/>
Expand Down
16 changes: 0 additions & 16 deletions laboratory/src/org/labkey/laboratory/LaboratoryModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Supplier;

/**
* User: bimber
Expand Down Expand Up @@ -212,19 +209,6 @@ public Set<String> getSchemaNames()
return PageFlowUtil.set(SCHEMA_NAME);
}

@NotNull
@Override
public List<Supplier<ClientDependency>> getClientDependencies(Container c)
{
// allow other modules to register with EHR service, and include their dependencies automatically
// whenever laboratory context is requested
List<Supplier<ClientDependency>> ret = new LinkedList<>();
ret.addAll(super.getClientDependencies(c));
ret.addAll(LaboratoryService.get().getRegisteredClientDependencies(c));

return ret;
}

@Override
public JSONObject getPageContextJson(ContainerUser context)
{
Expand Down
38 changes: 4 additions & 34 deletions laboratory/src/org/labkey/laboratory/LaboratoryServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

import org.apache.log4j.Logger;
import org.json.JSONObject;
import org.labkey.api.assay.AssayFileWriter;
import org.labkey.api.assay.AssayProvider;
import org.labkey.api.assay.AssayService;
import org.labkey.api.collections.CaseInsensitiveHashMap;
import org.labkey.api.data.ColumnInfo;
import org.labkey.api.data.Container;
Expand All @@ -32,10 +35,10 @@
import org.labkey.api.exp.api.ExperimentService;
import org.labkey.api.laboratory.DataProvider;
import org.labkey.api.laboratory.LaboratoryService;
import org.labkey.api.laboratory.NavItem;
import org.labkey.api.laboratory.TabbedReportItem;
import org.labkey.api.laboratory.assay.AssayDataProvider;
import org.labkey.api.laboratory.assay.SimpleAssayDataProvider;
import org.labkey.api.laboratory.NavItem;
import org.labkey.api.ldk.table.ButtonConfigFactory;
import org.labkey.api.module.Module;
import org.labkey.api.module.ModuleLoader;
Expand All @@ -44,12 +47,8 @@
import org.labkey.api.query.ValidationException;
import org.labkey.api.security.User;
import org.labkey.api.security.permissions.ReadPermission;
import org.labkey.api.assay.AssayFileWriter;
import org.labkey.api.assay.AssayProvider;
import org.labkey.api.assay.AssayService;
import org.labkey.api.util.Pair;
import org.labkey.api.view.ViewContext;
import org.labkey.api.view.template.ClientDependency;
import org.labkey.laboratory.assay.AssayHelper;
import org.labkey.laboratory.query.DefaultAssayCustomizer;
import org.labkey.laboratory.query.LaboratoryTableCustomizer;
Expand All @@ -65,7 +64,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Supplier;

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

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

@Override
public void registerClientDependency(Supplier<ClientDependency> cd, Module owner)
{
List<Supplier<ClientDependency>> list = _clientDependencies.get(owner);
if (list == null)
list = new ArrayList<>();

list.add(cd);

_clientDependencies.put(owner, list);
}

@Override
public List<Supplier<ClientDependency>> getRegisteredClientDependencies(Container c)
{
List<Supplier<ClientDependency>> list = new ArrayList<>();
for (Module m : _clientDependencies.keySet())
{
if (c.getActiveModules().contains(m))
{
list.addAll(_clientDependencies.get(m));
}
}

return Collections.unmodifiableList(list);
}

@Override
public String getDefaultWorkbookFolderType(Container c)
{
Expand Down