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
5 changes: 3 additions & 2 deletions elispotassay/src/org/labkey/elispot/ElispotModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;

public class ElispotModule extends DefaultModule
Expand Down Expand Up @@ -70,9 +71,9 @@ public boolean hasScripts()

@NotNull
@Override
public Set<String> getSchemaNames()
public Collection<String> getSchemaNames()
{
return Set.of(
return List.of(
ElispotProtocolSchema.ELISPOT_DBSCHEMA_NAME,
ElispotProtocolSchema.ELISPOT_ANTIGEN_SCHEMA_NAME
);
Expand Down
5 changes: 3 additions & 2 deletions flow/src/org/labkey/flow/FlowSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.labkey.api.data.Container;
import org.labkey.api.data.ContainerManager;
import org.labkey.api.data.PropertyManager;
import org.labkey.api.data.PropertyManager.WritablePropertyMap;
import org.labkey.api.util.FileUtil;

import java.io.File;
Expand Down Expand Up @@ -74,7 +75,7 @@ static public String getWorkingDirectoryPath()
static public void setWorkingDirectoryPath(String path)
{
Container container = ContainerManager.getRoot();
PropertyManager.PropertyMap map = PropertyManager.getWritableProperties(container, PROPCAT_FLOW, path != null);
WritablePropertyMap map = PropertyManager.getWritableProperties(container, PROPCAT_FLOW, path != null);
if (map == null)
{
assert path == null;
Expand All @@ -87,7 +88,7 @@ static public void setWorkingDirectoryPath(String path)
public static void setDeleteFiles(boolean deleteFiles)
{
Container container = ContainerManager.getRoot();
PropertyManager.PropertyMap map = PropertyManager.getWritableProperties(container, PROPCAT_FLOW, !deleteFiles);
WritablePropertyMap map = PropertyManager.getWritableProperties(container, PROPCAT_FLOW, !deleteFiles);
if (map == null)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.apache.commons.lang3.StringUtils;
import org.labkey.api.data.Container;
import org.labkey.api.data.PropertyManager;
import org.labkey.api.data.PropertyManager.WritablePropertyMap;
import org.labkey.api.exp.api.ExpProtocol;
import org.labkey.api.exp.property.DomainProperty;
import org.labkey.api.security.User;
Expand Down Expand Up @@ -174,7 +175,7 @@ public static Map<String, String> getContainerDefaultValues(Container container,
return PropertyManager.getProperties(container, getAnalyteColumnCategory(protocol));
}

public static PropertyManager.PropertyMap getWritableContainerDefaultValues(Container container, ExpProtocol protocol)
public static WritablePropertyMap getWritableContainerDefaultValues(Container container, ExpProtocol protocol)
{
return PropertyManager.getWritableProperties(container, AnalyteDefaultValueService.getAnalyteColumnCategory(protocol), true);
}
Expand All @@ -184,7 +185,7 @@ public static Map<String, String> getUserDefaultValues(User user, Container cont
return PropertyManager.getProperties(user, container, getAnalyteColumnCategory(protocol));
}

public static PropertyManager.PropertyMap getWritableUserDefaultValues(User user, Container container, ExpProtocol protocol)
public static WritablePropertyMap getWritableUserDefaultValues(User user, Container container, ExpProtocol protocol)
{
return PropertyManager.getWritableProperties(user, container, AnalyteDefaultValueService.getAnalyteColumnCategory(protocol), true);
}
Expand Down Expand Up @@ -253,7 +254,7 @@ public static List<String> getAnalyteProperty(List<String> analytes, Container c

public static void setAnalyteDefaultValues(Map<String, Map<String, String>> analyteProperties, Container container, ExpProtocol protocol)
{
PropertyManager.PropertyMap defaultAnalyteColumnValues = getWritableContainerDefaultValues(container, protocol);
WritablePropertyMap defaultAnalyteColumnValues = getWritableContainerDefaultValues(container, protocol);
defaultAnalyteColumnValues.clear(); // NOTE: an empty property map would work too.
for(Map.Entry<String, Map<String, String>> entry : analyteProperties.entrySet())
{
Expand All @@ -280,7 +281,7 @@ public static void setAnalyteDefaultValues(Map<String, Map<String, String>> anal
// TODO: merge with the method above
public static void setAnalyteDefaultValues(List<String> analytes, List<String> positivityThresholds, List<String> negativeBeads, Container container, ExpProtocol protocol)
{
PropertyManager.PropertyMap defaultAnalyteColumnValues = getWritableContainerDefaultValues(container, protocol);
WritablePropertyMap defaultAnalyteColumnValues = getWritableContainerDefaultValues(container, protocol);
defaultAnalyteColumnValues.clear(); // NOTE: an empty property map would work too.
if (analytes != null)
{
Expand Down
9 changes: 5 additions & 4 deletions luminex/src/org/labkey/luminex/LuminexUploadWizardAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.labkey.luminex;

import jakarta.servlet.ServletException;
import org.apache.commons.collections4.keyvalue.MultiKey;
import org.jetbrains.annotations.Nullable;
import org.labkey.api.action.LabKeyError;
Expand All @@ -36,6 +37,7 @@
import org.labkey.api.data.DisplayColumnFactory;
import org.labkey.api.data.DisplayColumnGroup;
import org.labkey.api.data.PropertyManager;
import org.labkey.api.data.PropertyManager.WritablePropertyMap;
import org.labkey.api.data.RenderContext;
import org.labkey.api.data.SQLFragment;
import org.labkey.api.data.SqlSelector;
Expand Down Expand Up @@ -68,7 +70,6 @@
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;

import jakarta.servlet.ServletException;
import java.io.File;
import java.io.IOException;
import java.io.Writer;
Expand Down Expand Up @@ -759,7 +760,7 @@ public boolean executeStep(LuminexRunUploadForm form, BindException errors) thro
saveExperimentRun(form);

// Save user last entered default values for analytes
PropertyManager.PropertyMap defaultAnalyteColumnValues = AnalyteDefaultValueService.getWritableUserDefaultValues(getUser(), getContainer(), form.getProtocol());
WritablePropertyMap defaultAnalyteColumnValues = AnalyteDefaultValueService.getWritableUserDefaultValues(getUser(), getContainer(), form.getProtocol());
for (String analyteName : form.getAnalyteNames())
{
// for analyte domain properties use the standard assay default value persistance
Expand All @@ -782,7 +783,7 @@ public boolean executeStep(LuminexRunUploadForm form, BindException errors) thro
defaultAnalyteColumnValues.save();

// save the default values for the analyte standards/titrations information in 2 categories: well roles and titrations
PropertyManager.PropertyMap defaultWellRoleValues = PropertyManager.getWritableProperties(
WritablePropertyMap defaultWellRoleValues = PropertyManager.getWritableProperties(
getUser(), getContainer(), form.getProtocol().getName() + ": Well Role", true);

for (final Map.Entry<String, Titration> titrationEntry : form.getParser().getTitrationsWithTypes().entrySet())
Expand Down Expand Up @@ -816,7 +817,7 @@ public boolean executeStep(LuminexRunUploadForm form, BindException errors) thro
propertyName = getShowStandardCheckboxColumnName(titrationEntry.getValue());
if (!titrationEntry.getValue().isUnknown() && getViewContext().getRequest().getParameter(propertyName).equals("true"))
{
PropertyManager.PropertyMap defaultTitrationValues = PropertyManager.getWritableProperties(
WritablePropertyMap defaultTitrationValues = PropertyManager.getWritableProperties(
getUser(), getContainer(),
form.getProtocol().getName() + ": " + titrationEntry.getValue().getName(), true);
for (String analyteName : form.getAnalyteNames())
Expand Down
13 changes: 7 additions & 6 deletions ms2/src/org/labkey/ms2/MS2Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.labkey.api.data.MenuButton;
import org.labkey.api.data.NestableQueryView;
import org.labkey.api.data.PropertyManager;
import org.labkey.api.data.PropertyManager.WritablePropertyMap;
import org.labkey.api.data.RenderContext;
import org.labkey.api.data.ResultsImpl;
import org.labkey.api.data.RuntimeSQLException;
Expand Down Expand Up @@ -1105,7 +1106,7 @@ public boolean handlePost(ManageViewsForm form, BindException errors)

if (null != viewNames)
{
PropertyManager.PropertyMap m = PropertyManager.getWritableProperties(getUser(), ContainerManager.getRoot(), MS2_VIEWS_CATEGORY, true);
WritablePropertyMap m = PropertyManager.getWritableProperties(getUser(), ContainerManager.getRoot(), MS2_VIEWS_CATEGORY, true);

for (String viewName : viewNames)
m.remove(viewName);
Expand Down Expand Up @@ -1142,7 +1143,7 @@ else if (viewType == DefaultViewType.Manual)
viewName = form.getDefaultViewName();
}

PropertyManager.PropertyMap m = PropertyManager.getWritableProperties(getUser(), ContainerManager.getRoot(), MS2_DEFAULT_VIEW_CATEGORY, true);
WritablePropertyMap m = PropertyManager.getWritableProperties(getUser(), ContainerManager.getRoot(), MS2_DEFAULT_VIEW_CATEGORY, true);
m.put(DEFAULT_VIEW_NAME, viewName);
m.save();

Expand Down Expand Up @@ -2106,12 +2107,12 @@ public ModelAndView getView(FormType form, boolean reshow, BindException errors)

private void savePreferences(Map<String, String> prefs)
{
if (prefs instanceof PropertyManager.PropertyMap)
if (prefs instanceof WritablePropertyMap writable)
{
// Non-guests are stored in the database, guests get it stored in their session
try (var ignored = SpringActionController.ignoreSqlUpdates())
{
((PropertyManager.PropertyMap) prefs).save();
writable.save();
}
}
}
Expand Down Expand Up @@ -3069,7 +3070,7 @@ public boolean handlePost(MS2ViewForm form, BindException errors)
String viewParams = (null == form.getViewParams() ? "" : form.getViewParams());

String name = form.name;
PropertyManager.PropertyMap m;
WritablePropertyMap m;
if (form.isShared() && getContainer().hasPermission(getUser(), InsertPermission.class))
m = PropertyManager.getWritableProperties(getContainer(), MS2_VIEWS_CATEGORY, true);
else
Expand Down Expand Up @@ -4279,7 +4280,7 @@ public static class MS2SearchOptionsAction extends MutatingApiAction<MS2SearchOp
@Override
public Object execute(MS2SearchOptions form, BindException errors)
{
PropertyManager.PropertyMap properties = PropertyManager.getWritableProperties(getUser(), getContainer(), CATEGORY, true);
WritablePropertyMap properties = PropertyManager.getWritableProperties(getUser(), getContainer(), CATEGORY, true);

Map<String, String> valuesToPersist = form.getOptions();
if (!valuesToPersist.isEmpty())
Expand Down
10 changes: 4 additions & 6 deletions ms2/src/org/labkey/ms2/pipeline/mascot/MascotConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@

import org.labkey.api.data.Container;
import org.labkey.api.data.PropertyManager;
import org.labkey.api.data.PropertyManager.WritablePropertyMap;
import org.labkey.api.settings.AbstractWriteableSettingsGroup;

/**
* Created by: jeckels
* Date: 2/7/16
*/
public class MascotConfig extends AbstractWriteableSettingsGroup
{
protected static final String MASCOT_SERVER_PROP = "MascotServer";
Expand Down Expand Up @@ -116,8 +113,9 @@ protected boolean isPasswordProperty(String propName)

public static void reset(Container container)
{
PropertyManager.PropertyMap props = PropertyManager.getProperties(SITE_CONFIG_USER, container, GROUP_NAME);
props.delete();
WritablePropertyMap props = PropertyManager.getWritableProperties(SITE_CONFIG_USER, container, GROUP_NAME, false);
if (props != null)
props.delete();
}

public static MascotConfig getWriteableMascotConfig(Container container)
Expand Down