From ccfd196cb5087974268227fbdef829eff0b62f59 Mon Sep 17 00:00:00 2001 From: XingY Date: Mon, 27 Apr 2026 18:56:07 -0700 Subject: [PATCH 1/2] GitHub Issue 1099: Folder export fails with multi-value text choice columns --- api/src/org/labkey/api/exp/property/Type.java | 230 +++++++++--------- 1 file changed, 116 insertions(+), 114 deletions(-) diff --git a/api/src/org/labkey/api/exp/property/Type.java b/api/src/org/labkey/api/exp/property/Type.java index db9ad2b254f..7abcabf927e 100644 --- a/api/src/org/labkey/api/exp/property/Type.java +++ b/api/src/org/labkey/api/exp/property/Type.java @@ -1,114 +1,116 @@ -/* - * Copyright (c) 2009-2018 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.labkey.api.exp.property; - -import org.labkey.api.exp.PropertyType; -import org.labkey.api.util.SimpleTime; - -import java.io.File; -import java.math.BigDecimal; -import java.nio.ByteBuffer; -import java.sql.Time; -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.Date; -import java.util.HashSet; -import java.util.Set; - -/** -* User: adam -* Date: Apr 29, 2009 -* Time: 9:44:07 AM -*/ -// TODO: Consider getting rid of this, adding the xsd: to PropertyType instead -public enum Type -{ - StringType("Text (String)", "xsd:string", "varchar", String.class, ByteBuffer.class), - IntType("Integer", "xsd:int", "integer", Integer.class, Integer.TYPE, Short.class, Short.TYPE, Byte.class, Byte.TYPE), - LongType("Long", "xsd:long", "bigint", Long.class, long.class), - DoubleType("Number (Double)", "xsd:double", "double", Double.class, Double.TYPE, BigDecimal.class), // Double.TYPE is here because manually created datasets with required doubles return Double.TYPE as Class - FloatType("Number (Float)", "xsd:float", "float", Float.class, Float.TYPE), - TimeType("Time", PropertyType.TIME.getTypeUri(), "time", Time.class, SimpleTime.class), - DateTimeType("DateTime", "xsd:dateTime", "timestamp", Date.class, Timestamp.class, java.sql.Date.class), - BooleanType("Boolean", "xsd:boolean", "boolean", Boolean.class, Boolean.TYPE), - AttachmentType("Attachment", "xsd:attachment", "varchar", String.class, File.class); - - private final String label; - private final String xsd; - private final Class clazz; - private final Set allClasses = new HashSet<>(); - private final String sqlTypeName; - - Type(String label, String xsd, String sqlTypeName, Class clazz, Class... additionalClasses) - { - this.label = label; - this.xsd = xsd; - this.clazz = clazz; - this.allClasses.add(clazz); - this.allClasses.addAll(Arrays.asList(additionalClasses)); - this.sqlTypeName = sqlTypeName; - } - - public String getLabel() - { - return label; - } - - public String getXsdType() - { - return xsd; - } - - public Class getJavaClass() - { - return clazz; - } - - public boolean matches(Class clazz) - { - return allClasses.contains(clazz); - } - - public String getSqlTypeName() - { - return sqlTypeName; - } - - public boolean isNumeric() - { - return this == IntType || this == DoubleType; - } - - public static Type getTypeByXsdType(String xsd) - { - for (Type type : values()) - { - if (type.getXsdType().equals(xsd)) - return type; - } - return null; - } - - public static Type getTypeByClass(Class clazz) - { - for (Type type : values()) - { - if (type.matches(clazz)) - return type; - } - return null; - } -} +/* + * Copyright (c) 2009-2018 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.labkey.api.exp.property; + +import org.labkey.api.data.MultiChoice; +import org.labkey.api.exp.PropertyType; +import org.labkey.api.util.SimpleTime; + +import java.io.File; +import java.math.BigDecimal; +import java.nio.ByteBuffer; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +/** +* User: adam +* Date: Apr 29, 2009 +* Time: 9:44:07 AM +*/ +// TODO: Consider getting rid of this, adding the xsd: to PropertyType instead +public enum Type +{ + StringType("Text (String)", "xsd:string", "varchar", String.class, ByteBuffer.class), + IntType("Integer", "xsd:int", "integer", Integer.class, Integer.TYPE, Short.class, Short.TYPE, Byte.class, Byte.TYPE), + LongType("Long", "xsd:long", "bigint", Long.class, long.class), + DoubleType("Number (Double)", "xsd:double", "double", Double.class, Double.TYPE, BigDecimal.class), // Double.TYPE is here because manually created datasets with required doubles return Double.TYPE as Class + FloatType("Number (Float)", "xsd:float", "float", Float.class, Float.TYPE), + TimeType("Time", PropertyType.TIME.getTypeUri(), "time", Time.class, SimpleTime.class), + DateTimeType("DateTime", "xsd:dateTime", "timestamp", Date.class, Timestamp.class, java.sql.Date.class), + BooleanType("Boolean", "xsd:boolean", "boolean", Boolean.class, Boolean.TYPE), + AttachmentType("Attachment", "xsd:attachment", "varchar", String.class, File.class), + MultiChoiceArrayType("MultiChoiceArray", "xsd:multichoicearray", "varchar", MultiChoice.Array.class); + + private final String label; + private final String xsd; + private final Class clazz; + private final Set allClasses = new HashSet<>(); + private final String sqlTypeName; + + Type(String label, String xsd, String sqlTypeName, Class clazz, Class... additionalClasses) + { + this.label = label; + this.xsd = xsd; + this.clazz = clazz; + this.allClasses.add(clazz); + this.allClasses.addAll(Arrays.asList(additionalClasses)); + this.sqlTypeName = sqlTypeName; + } + + public String getLabel() + { + return label; + } + + public String getXsdType() + { + return xsd; + } + + public Class getJavaClass() + { + return clazz; + } + + public boolean matches(Class clazz) + { + return allClasses.contains(clazz); + } + + public String getSqlTypeName() + { + return sqlTypeName; + } + + public boolean isNumeric() + { + return this == IntType || this == DoubleType; + } + + public static Type getTypeByXsdType(String xsd) + { + for (Type type : values()) + { + if (type.getXsdType().equals(xsd)) + return type; + } + return null; + } + + public static Type getTypeByClass(Class clazz) + { + for (Type type : values()) + { + if (type.matches(clazz)) + return type; + } + return null; + } +} From d4a5ff071c765444db86a8b5e81bb47925e3aad5 Mon Sep 17 00:00:00 2001 From: XingY Date: Mon, 27 Apr 2026 21:47:05 -0700 Subject: [PATCH 2/2] crlf --- api/src/org/labkey/api/exp/property/Type.java | 232 +++++++++--------- 1 file changed, 116 insertions(+), 116 deletions(-) diff --git a/api/src/org/labkey/api/exp/property/Type.java b/api/src/org/labkey/api/exp/property/Type.java index 7abcabf927e..740ca76f2cf 100644 --- a/api/src/org/labkey/api/exp/property/Type.java +++ b/api/src/org/labkey/api/exp/property/Type.java @@ -1,116 +1,116 @@ -/* - * Copyright (c) 2009-2018 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.labkey.api.exp.property; - -import org.labkey.api.data.MultiChoice; -import org.labkey.api.exp.PropertyType; -import org.labkey.api.util.SimpleTime; - -import java.io.File; -import java.math.BigDecimal; -import java.nio.ByteBuffer; -import java.sql.Time; -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.Date; -import java.util.HashSet; -import java.util.Set; - -/** -* User: adam -* Date: Apr 29, 2009 -* Time: 9:44:07 AM -*/ -// TODO: Consider getting rid of this, adding the xsd: to PropertyType instead -public enum Type -{ - StringType("Text (String)", "xsd:string", "varchar", String.class, ByteBuffer.class), - IntType("Integer", "xsd:int", "integer", Integer.class, Integer.TYPE, Short.class, Short.TYPE, Byte.class, Byte.TYPE), - LongType("Long", "xsd:long", "bigint", Long.class, long.class), - DoubleType("Number (Double)", "xsd:double", "double", Double.class, Double.TYPE, BigDecimal.class), // Double.TYPE is here because manually created datasets with required doubles return Double.TYPE as Class - FloatType("Number (Float)", "xsd:float", "float", Float.class, Float.TYPE), - TimeType("Time", PropertyType.TIME.getTypeUri(), "time", Time.class, SimpleTime.class), - DateTimeType("DateTime", "xsd:dateTime", "timestamp", Date.class, Timestamp.class, java.sql.Date.class), - BooleanType("Boolean", "xsd:boolean", "boolean", Boolean.class, Boolean.TYPE), - AttachmentType("Attachment", "xsd:attachment", "varchar", String.class, File.class), - MultiChoiceArrayType("MultiChoiceArray", "xsd:multichoicearray", "varchar", MultiChoice.Array.class); - - private final String label; - private final String xsd; - private final Class clazz; - private final Set allClasses = new HashSet<>(); - private final String sqlTypeName; - - Type(String label, String xsd, String sqlTypeName, Class clazz, Class... additionalClasses) - { - this.label = label; - this.xsd = xsd; - this.clazz = clazz; - this.allClasses.add(clazz); - this.allClasses.addAll(Arrays.asList(additionalClasses)); - this.sqlTypeName = sqlTypeName; - } - - public String getLabel() - { - return label; - } - - public String getXsdType() - { - return xsd; - } - - public Class getJavaClass() - { - return clazz; - } - - public boolean matches(Class clazz) - { - return allClasses.contains(clazz); - } - - public String getSqlTypeName() - { - return sqlTypeName; - } - - public boolean isNumeric() - { - return this == IntType || this == DoubleType; - } - - public static Type getTypeByXsdType(String xsd) - { - for (Type type : values()) - { - if (type.getXsdType().equals(xsd)) - return type; - } - return null; - } - - public static Type getTypeByClass(Class clazz) - { - for (Type type : values()) - { - if (type.matches(clazz)) - return type; - } - return null; - } -} +/* + * Copyright (c) 2009-2018 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.labkey.api.exp.property; + +import org.labkey.api.data.MultiChoice; +import org.labkey.api.exp.PropertyType; +import org.labkey.api.util.SimpleTime; + +import java.io.File; +import java.math.BigDecimal; +import java.nio.ByteBuffer; +import java.sql.Time; +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +/** +* User: adam +* Date: Apr 29, 2009 +* Time: 9:44:07 AM +*/ +// TODO: Consider getting rid of this, adding the xsd: to PropertyType instead +public enum Type +{ + StringType("Text (String)", "xsd:string", "varchar", String.class, ByteBuffer.class), + IntType("Integer", "xsd:int", "integer", Integer.class, Integer.TYPE, Short.class, Short.TYPE, Byte.class, Byte.TYPE), + LongType("Long", "xsd:long", "bigint", Long.class, long.class), + DoubleType("Number (Double)", "xsd:double", "double", Double.class, Double.TYPE, BigDecimal.class), // Double.TYPE is here because manually created datasets with required doubles return Double.TYPE as Class + FloatType("Number (Float)", "xsd:float", "float", Float.class, Float.TYPE), + TimeType("Time", PropertyType.TIME.getTypeUri(), "time", Time.class, SimpleTime.class), + DateTimeType("DateTime", "xsd:dateTime", "timestamp", Date.class, Timestamp.class, java.sql.Date.class), + BooleanType("Boolean", "xsd:boolean", "boolean", Boolean.class, Boolean.TYPE), + AttachmentType("Attachment", "xsd:attachment", "varchar", String.class, File.class), + MultiChoiceArrayType("MultiChoiceArray", "xsd:multichoicearray", "varchar", MultiChoice.Array.class); + + private final String label; + private final String xsd; + private final Class clazz; + private final Set allClasses = new HashSet<>(); + private final String sqlTypeName; + + Type(String label, String xsd, String sqlTypeName, Class clazz, Class... additionalClasses) + { + this.label = label; + this.xsd = xsd; + this.clazz = clazz; + this.allClasses.add(clazz); + this.allClasses.addAll(Arrays.asList(additionalClasses)); + this.sqlTypeName = sqlTypeName; + } + + public String getLabel() + { + return label; + } + + public String getXsdType() + { + return xsd; + } + + public Class getJavaClass() + { + return clazz; + } + + public boolean matches(Class clazz) + { + return allClasses.contains(clazz); + } + + public String getSqlTypeName() + { + return sqlTypeName; + } + + public boolean isNumeric() + { + return this == IntType || this == DoubleType; + } + + public static Type getTypeByXsdType(String xsd) + { + for (Type type : values()) + { + if (type.getXsdType().equals(xsd)) + return type; + } + return null; + } + + public static Type getTypeByClass(Class clazz) + { + for (Type type : values()) + { + if (type.matches(clazz)) + return type; + } + return null; + } +}