while (iter.hasNext()) {
Object obj = iter.next();
if (obj instanceof Viewable) {
Viewable v = (Viewable) obj;
if (IliUtils.isPureRefAssoc(v)) {
continue;
}
String className = v.getScopedName(null);
logger.debug(className);
String tableName = (className
.substring(className.indexOf(".") + 1))
.replace(".", "_").toLowerCase();
ArrayList<String> geometryColumns = new ArrayList();
Iterator attri = v.getAttributesAndRoles2();
while (attri.hasNext()) {
ch.interlis.ili2c.metamodel.ViewableTransferElement attrObj = (ch.interlis.ili2c.metamodel.ViewableTransferElement) attri
.next();
if (attrObj.obj instanceof AttributeDef) {
AttributeDef attrdefObj = (AttributeDef) attrObj.obj;
Type type = attrdefObj
.getDomainResolvingAliases();
String attrName = attrdefObj.getName()
.toLowerCase();
if (type instanceof PolylineType
|| type instanceof SurfaceType
|| type instanceof AreaType
|| type instanceof CoordType) {
geometryColumns.add(attrName);
}
}
}
if (geometryColumns.size() > 0) {
for (String g : geometryColumns) {
JSONObject jobjTable = new JSONObject();
jobjTable.put("group", topicName);
JSONObject langTableObj = new JSONObject();
langTableObj.put("de", v.getName()
+ " (" + g + ")");
langTableObj.put("fr", v.getName()
+ " (" + g + ")" + "_fr");
jobjTable.put("title", langTableObj);
jobjTable.put("featuretype", tableName);
jobjTable.put("key", "ogc_fid");
jobjTable.put("geom", g);
jobjTable.put("readonly", 1);
jobjTable.put("style", "");
jTablesList.add(jobjTable);
}
} else {
JSONObject jobjTable = new JSONObject();
jobjTable.put("group", topicName);
JSONObject langTableObj = new JSONObject();
langTableObj.put("de", v.getName());
langTableObj.put("fr", v.getName() + "_fr");
jobjTable.put("title", langTableObj);
jobjTable.put("featuretype", tableName);
jobjTable.put("key", "ogc_fid");
jobjTable.put("readonly", 1);