Skip to content

Commit b968623

Browse files
authored
Merge pull request oskariorg#1246 from DenverCoder544/default_attributes_clean
do not add default attributes on import
2 parents ef5e560 + ef74496 commit b968623

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

control-myfeatures/src/main/java/org/oskari/control/myfeatures/ImportMyFeaturesHandler.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import fi.nls.oskari.control.*;
2424

25-
import org.json.JSONArray;
2625
import org.oskari.log.AuditLog;
2726
import org.oskari.map.myfeatures.service.MyFeaturesService;
2827
import org.oskari.map.userlayer.input.FeatureCollectionParser;
@@ -100,10 +99,6 @@ public class ImportMyFeaturesHandler extends RestActionHandler {
10099
private static final String PARAM_SOURCE_EPSG_KEY = "sourceEpsg";
101100
private static final String KEY_STYLE = "style";
102101
private static final String KEY_LOCALE = "locale";
103-
// attributes json
104-
private static final String KEY_DEFAULT = "default";
105-
private static final String KEY_FILTER = "filter";
106-
private static final String KEY_DATA = "data";
107102

108103
private static final int KB = 1024;
109104
private static final int MB = 1024 * KB;
@@ -590,9 +585,6 @@ private MyFeaturesLayer createLayer(String ownerUuid, List<MyFeaturesFieldInfo>
590585
JSONObject locale = JSONHelper.createJSONObject(formParams.get(KEY_LOCALE));
591586
JSONObject style = JSONHelper.createJSONObject(formParams.get(KEY_STYLE));
592587

593-
// create default attributes which only allow showing the fields defined in dataset
594-
JSONObject attributes = getAttributesJSON(fields);
595-
596588
WFSLayerOptions options = new WFSLayerOptions();
597589
options.setDefaultFeatureStyle(style);
598590

@@ -607,25 +599,10 @@ private MyFeaturesLayer createLayer(String ownerUuid, List<MyFeaturesFieldInfo>
607599
layer.setLayerFields(layerFields);
608600
layer.setLocale(locale);
609601
layer.setLayerOptions(options);
610-
layer.setAttributes(attributes);
611602
myFeaturesService.createLayer(layer);
612603
return layer;
613604
}
614605

615-
private static JSONObject getAttributesJSON(List<MyFeaturesFieldInfo> fields ) {
616-
JSONObject attributes = new JSONObject();
617-
JSONObject data = new JSONObject();
618-
JSONObject filter = new JSONObject();
619-
List<String> fieldNames = fields.stream().map(MyFeaturesFieldInfo::getName).toList();
620-
JSONArray defaultFieldNames = new JSONArray(fieldNames);
621-
622-
filter.put(KEY_DEFAULT, defaultFieldNames);
623-
data.put(KEY_FILTER, filter);
624-
attributes.put(KEY_DATA, data);
625-
return attributes;
626-
627-
}
628-
629606
private static Optional<MyFeaturesFieldInfo> attribute(AttributeDescriptor attr) {
630607
String name = attr.getLocalName();
631608
Class<?> c = attr.getType().getBinding();

0 commit comments

Comments
 (0)