public final Resource Composite;
public final Resource Connection;
public final Resource Diagram;
+ public final Resource Diagram_MappedDiagram;
public final Resource EPSG_4326;
public final Resource Edge;
public final Resource EdgeDefaultMapping;
public final Resource Images_ConfigurationFolder;
public final Resource InLayer;
public final Resource Layer;
+ public final Resource MappedComponent;
public final Resource Mapping;
public final Resource MappingParameterType;
public final Resource Mapping_Base;
public static final String Composite = "http://www.simantics.org/DistrictNetwork-1.0/Composite";
public static final String Connection = "http://www.simantics.org/DistrictNetwork-1.0/Connection";
public static final String Diagram = "http://www.simantics.org/DistrictNetwork-1.0/Diagram";
+ public static final String Diagram_MappedDiagram = "http://www.simantics.org/DistrictNetwork-1.0/Diagram/MappedDiagram";
public static final String EPSG_4326 = "http://www.simantics.org/DistrictNetwork-1.0/EPSG_4326";
public static final String Edge = "http://www.simantics.org/DistrictNetwork-1.0/Edge";
public static final String EdgeDefaultMapping = "http://www.simantics.org/DistrictNetwork-1.0/EdgeDefaultMapping";
public static final String Images_ConfigurationFolder = "http://www.simantics.org/DistrictNetwork-1.0/Images/ConfigurationFolder";
public static final String InLayer = "http://www.simantics.org/DistrictNetwork-1.0/InLayer";
public static final String Layer = "http://www.simantics.org/DistrictNetwork-1.0/Layer";
+ public static final String MappedComponent = "http://www.simantics.org/DistrictNetwork-1.0/MappedComponent";
public static final String Mapping = "http://www.simantics.org/DistrictNetwork-1.0/Mapping";
public static final String MappingParameterType = "http://www.simantics.org/DistrictNetwork-1.0/MappingParameterType";
public static final String Mapping_Base = "http://www.simantics.org/DistrictNetwork-1.0/Mapping/Base";
Composite = getResourceOrNull(graph, URIs.Composite);
Connection = getResourceOrNull(graph, URIs.Connection);
Diagram = getResourceOrNull(graph, URIs.Diagram);
+ Diagram_MappedDiagram = getResourceOrNull(graph, URIs.Diagram_MappedDiagram);
EPSG_4326 = getResourceOrNull(graph, URIs.EPSG_4326);
Edge = getResourceOrNull(graph, URIs.Edge);
EdgeDefaultMapping = getResourceOrNull(graph, URIs.EdgeDefaultMapping);
Images_ConfigurationFolder = getResourceOrNull(graph, URIs.Images_ConfigurationFolder);
InLayer = getResourceOrNull(graph, URIs.InLayer);
Layer = getResourceOrNull(graph, URIs.Layer);
+ MappedComponent = getResourceOrNull(graph, URIs.MappedComponent);
Mapping = getResourceOrNull(graph, URIs.Mapping);
MappingParameterType = getResourceOrNull(graph, URIs.MappingParameterType);
Mapping_Base = getResourceOrNull(graph, URIs.Mapping_Base);
import org.simantics.db.Session;
import org.simantics.db.WriteGraph;
import org.simantics.db.common.request.IndexRoot;
+import org.simantics.db.common.request.ObjectsWithType;
import org.simantics.db.common.request.ReadRequest;
import org.simantics.db.common.request.WriteRequest;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.variable.Variable;
import org.simantics.db.layer0.variable.Variables.Role;
import org.simantics.db.procedure.Procedure;
+import org.simantics.diagram.stubs.DiagramResource;
import org.simantics.district.network.ontology.DistrictNetworkResource;
import org.simantics.layer0.Layer0;
import org.simantics.modeling.ModelingResources;
}
protected Map<String, Resource> getComposites(ReadGraph graph, Resource element) throws DatabaseException {
+
Resource indexRoot = graph.sync(new IndexRoot(element));
- List<Resource> composites = ModelingUtils.searchByType(graph, indexRoot, StructuralResource2.getInstance(graph).Composite);
- List<Resource> nonDistrictComposites = composites.stream().filter(comp -> {
+ List<Resource> diagrams = ModelingUtils.searchByType(graph, indexRoot, DiagramResource.getInstance(graph).Diagram);
+
+ List<Resource> nonDistrictComposites = composites.values().stream().filter(comp -> {
try {
return !graph.isInstanceOf(comp, DistrictNetworkResource.getInstance(graph).Composite);
} catch (ServiceException e1) {
String name = graph.getRelatedValue2(mapping, L0.HasName);
result.put(name, mapping);
} catch (DatabaseException e) {
- e.printStackTrace();
+ LOGGER.error("Could not read name of " + mapping, e);
}
});
return result;