ESRI_ItemInformation itemInfo = new ESRI_ItemInformation();
itemInfo.setType("Map Service");
itemInfo.setTags(Arrays.asList(new String[]{"ArcGIS","Server map","service"}));
Envelope extent = new Envelope();
for (Fieldable fld : flds) {
String fieldName = fld.name();
String[] vals = document.getValues(fieldName);
if (fieldName.contains("uuid")) {
itemInfo.setId(vals[0].replaceAll("^\\{|\\}$|\\-", ""));
} else if (fieldName.contains("title")) {
itemInfo.setTitle(vals[0]);
itemInfo.setName(vals[0]);
} else if (fieldName.contains("resource.url")) {
itemInfo.setUrl(vals[0]);
String type = Val.chkStr(guessServiceTypeFromUrl(vals[0]));
if (type.length() > 0) {
itemInfo.setType(type);
}
} else if (fieldName.contains("contentType")) {
} else if (fieldName.contains("keywords")) {
itemInfo.setTypeKeywords(Arrays.asList(vals));
itemInfo.setTags(Arrays.asList(vals));
} else if (fieldName.contains("dataTheme")) {
itemInfo.setTags(Arrays.asList(vals));
} else if (fieldName.contains("abstract")) {
itemInfo.setDescription(vals[0]);
// } else if (fieldName.contains("xml")) {
// itemInfo.setXml(vals[0]);
} else if (fieldName.contains("minx")) {
extent.setMinX(vals[0]);
} else if (fieldName.contains("miny")) {
extent.setMinY(vals[0]);
} else if (fieldName.contains("maxx")) {
extent.setMaxX(vals[0]);
} else if (fieldName.contains("maxy")) {
extent.setMaxY(vals[0]);
} else if (fieldName.contains("thumbnail.url")) {
itemInfo.setThumbnailUrl(vals[0]);
}
}
itemInfo.setExtent(extent);