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
10 changes: 6 additions & 4 deletions DBUtils/api-src/org/labkey/dbutils/api/SimpleQuery.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.labkey.dbutils.api;

import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
import org.labkey.api.data.ColumnInfo;
Expand Down Expand Up @@ -267,15 +268,16 @@ protected Map<String,Object> getColModel(DisplayColumn dc, TableInfo tableInfo)
extGridColumn.put("tooltip", dc.getDescription());
if (dc.getWidth() != null)
{
extGridColumn.put("width", dc.getWidth());
try
{
//try to parse as integer (which is what Ext wants)
extGridColumn.put("width", Integer.parseInt(dc.getWidth()));
if (StringUtils.isNotBlank(dc.getWidth()))
extGridColumn.put("width", Integer.parseInt(dc.getWidth()));
}
catch(NumberFormatException e)
catch (NumberFormatException e)
{
//include it as a string
extGridColumn.put("width", dc.getWidth());
// pass
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.apache.logging.log4j.Logger;
import org.labkey.api.collections.CaseInsensitiveHashMap;
import org.labkey.api.collections.IntHashMap;
import org.labkey.api.data.ColumnInfo;
import org.labkey.api.data.CompareType;
import org.labkey.api.data.Container;
Expand Down Expand Up @@ -149,7 +150,7 @@ protected void findAnimalsWithEnoughWater(final Container c, final User u, final
{
//Organizing report by project
Map<String,Object>[] totalWaterForDay = ts.getMapArray();
Map<Integer, List<Map<String,Object>>> projectMap = new HashMap<>();
Map<Integer, List<Map<String,Object>>> projectMap = new IntHashMap<>();
int animalsWaterMeaning = 0;
for(Map<String,Object> mapItem : totalWaterForDay){
int projectNum = ConvertHelper.convert(mapItem.get("project"),Integer.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.labkey.api.action.SimpleViewAction;
import org.labkey.api.action.SpringActionController;
import org.labkey.api.admin.notification.NotificationService;
import org.labkey.api.collections.IntHashMap;
import org.labkey.api.data.ColumnInfo;
import org.labkey.api.data.ContainerManager;
import org.labkey.api.data.Filter;
Expand Down Expand Up @@ -398,7 +399,7 @@ private void sendRequestChangeEmailNotification(String oldStatus, EmailTemplateF

private Map<Integer, String> getPurchasingDirectorUserIds()
{
Map<Integer, String> purchasingDirUserIds = new HashMap<>();
Map<Integer, String> purchasingDirUserIds = new IntHashMap<>();
for (RoleAssignment roleAssignment : getContainer().getPolicy().getAssignments())
{
if (roleAssignment.getRole().getName().equals(WNPRC_PurchasingDirectorRole.PURCHASING_DIRECTOR_ROLE_NAME))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
import java.util.List;
import java.util.Map;

import static org.labkey.api.exp.api.ExperimentService.asInteger;

public class WNPRC_PurchasingManager
{
private static final WNPRC_PurchasingManager _instance = new WNPRC_PurchasingManager();
Expand Down Expand Up @@ -240,7 +242,7 @@ else if (null != requestForm.getVendor() && newVendorData.size() == 0)
insertedPurchasingReq = qus.updateRows(user, container, purchasingRequestsData, null, errors, null, null);

if (null != insertedPurchasingReq)
requestForm.setRowId((Integer) insertedPurchasingReq.get(0).get("rowId"));
requestForm.setRowId(asInteger(insertedPurchasingReq.get(0).get("rowId")));
else
{
requestOrderErrors.addError(new SimpleValidationError("Unable to submit purchasing request"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import jakarta.mail.Message;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Logger;
import org.labkey.api.collections.IntHashMap;
import org.labkey.api.data.Container;
import org.labkey.api.data.ContainerManager;
import org.labkey.api.data.Results;
Expand Down Expand Up @@ -65,7 +66,7 @@ public class ViralLoadQueueNotification extends AbstractEHRNotification


public Map<String, Object> _emailSummaryTable;
public Map<Integer, String> _accounts = new HashMap<>();
public Map<Integer, String> _accounts = new IntHashMap<>();
private static final Logger _log = LogHelper.getLogger(ViralLoadQueueNotification.class, "Server-side logger for WNPRC_Virology notifications");

public ViralLoadQueueNotification(Module owner)
Expand Down Expand Up @@ -210,7 +211,7 @@ public void setUp()
}
// old notes:
//emails.put(createdByUserId, getEmailArray(notifyEmails)); - old way, user id is unique.
//used to use public Map<Integer, List<String>> emails = new HashMap<Integer,List<String>>();
//used to use public Map<Integer, List<String>> emails = new IntHashMap<Integer,List<String>>();
//but ideally instead of Integer as the key it would be a a string of:
//submitter email + notify email string(normalized = sorted in such a way there arent repeats).
countEmailsAndPut(notifyEmails);
Expand Down Expand Up @@ -247,7 +248,7 @@ public void getRowsAndSendMessage()
}*/
//pull out accounts
Set<Integer> accounts = new HashSet<>();
Map<Integer, Integer> accountsAndCount = new HashMap<>();
Map<Integer, Integer> accountsAndCount = new IntHashMap<>();
Integer arr[] = new Integer[VLSampleListResults.size()];
for (int i = 0; i < VLSampleListResults.size(); i++)
{
Expand Down
2 changes: 1 addition & 1 deletion WNPRC_r24/resources/transform/src/MicrobiomeTransform.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class MicrobiomeTransform extends AbstractAssayValidator
{
private File _errorFile;
private Map<String, String> _runProperties = new HashMap<>();
private Map<Integer, String> _colMap = new HashMap<>();
private Map<Integer, String> _colMap = new IntHashMap<>();
private Map<String, String> _dictionary = new HashMap<>();
private final int numHeaderCols = 4;

Expand Down