Skip to content

Commit

Permalink
Use WritablePropertyMap (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-adam authored Oct 2, 2024
1 parent a40b4c7 commit 9168510
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/org/labkey/response/ResponseController.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.labkey.api.data.DataRegionSelection;
import org.labkey.api.data.NormalContainerType;
import org.labkey.api.data.PropertyManager;
import org.labkey.api.data.PropertyManager.WritablePropertyMap;
import org.labkey.api.module.FolderTypeManager;
import org.labkey.api.query.InvalidKeyException;
import org.labkey.api.query.QueryForm;
Expand Down Expand Up @@ -1273,7 +1274,7 @@ else if (form.getMetadataLoadLocation() != null && form.getMetadataLoadLocation(
return false;
else
{
PropertyManager.PropertyMap props = PropertyManager.getEncryptedStore().getWritableProperties(getContainer(), RESPONSE_SERVER_CONFIGURATION, true);
WritablePropertyMap props = PropertyManager.getEncryptedStore().getWritableProperties(getContainer(), RESPONSE_SERVER_CONFIGURATION, true);
Map<String, String> valuesToPersist = form.getOptions();

if (!valuesToPersist.isEmpty())
Expand Down
5 changes: 3 additions & 2 deletions src/org/labkey/response/forwarder/ForwarderProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.apache.logging.log4j.Logger;
import org.labkey.api.data.Container;
import org.labkey.api.data.PropertyManager;
import org.labkey.api.data.PropertyManager.WritablePropertyMap;
import org.labkey.api.security.Encryption;
import org.labkey.api.util.logging.LogHelper;

Expand Down Expand Up @@ -60,7 +61,7 @@ public class ForwarderProperties
*/
public void setForwarderProperties(Container container, Map<String, String> newConfig)
{
PropertyManager.PropertyMap propertyMap = PropertyManager.getEncryptedStore().getWritableProperties(container, FORWARDER_CATEGORY ,true);
WritablePropertyMap propertyMap = PropertyManager.getEncryptedStore().getWritableProperties(container, FORWARDER_CATEGORY ,true);
newConfig.keySet().forEach((key) -> {
if (PROPERTIES.contains(key))
{
Expand All @@ -79,7 +80,7 @@ public void setForwarderProperties(Container container, Map<String, String> newC

public void setForwarderDisabled(Container container, ForwardingType authType)
{
PropertyManager.PropertyMap propertyMap = PropertyManager.getEncryptedStore().getWritableProperties(container, FORWARDER_CATEGORY ,true);
WritablePropertyMap propertyMap = PropertyManager.getEncryptedStore().getWritableProperties(container, FORWARDER_CATEGORY ,true);
propertyMap.put(FORWARDING_TYPE, authType.name());
propertyMap.save();
}
Expand Down
2 changes: 1 addition & 1 deletion src/org/labkey/response/forwarder/ForwardingScheduler.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public synchronized void schedule()
try
{
StdSchedulerFactory.getDefaultScheduler().scheduleJob(job, trigger);
logger.info(String.format("SurveyResponseForwarder scheduled to run every %1$S minutes. Next runtime %2$s", getIntervalMinutes(), DateUtil.formatDateTimeISO8601(trigger.getNextFireTime())));
logger.info(String.format("SurveyResponseForwarder scheduled to run every %1$S minutes. Next runtime %2$s", getIntervalMinutes(), DateUtil.formatIsoDateShortTime(trigger.getNextFireTime())));
}
catch (SchedulerException e)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.labkey.api.data.Container;
import org.labkey.api.data.JdbcType;
import org.labkey.api.data.PropertyManager;
import org.labkey.api.data.PropertyManager.WritablePropertyMap;
import org.labkey.api.data.PropertyStorageSpec;
import org.labkey.api.data.SimpleFilter;
import org.labkey.api.data.Table;
Expand Down Expand Up @@ -246,7 +247,7 @@ private void updatePropertyMetadata(Integer rowId, ParticipantProperty.Participa

private void updateParticipantPropertiesVersion(Container container, User user, String newVersion)
{
PropertyManager.PropertyMap versionProperties = PropertyManager.getWritableProperties(user, container, PARTICIPANT_PROPERTIES_PROPERTY_CATEGORY, true);
WritablePropertyMap versionProperties = PropertyManager.getWritableProperties(user, container, PARTICIPANT_PROPERTIES_PROPERTY_CATEGORY, true);
versionProperties.put(PARTICIPANT_PROPERTIES_VERSION_KEY, newVersion);
versionProperties.save();
}
Expand Down

0 comments on commit 9168510

Please sign in to comment.