1 package org.simantics.scenegraph.profile.request;
3 import java.util.ArrayList;
4 import java.util.Collection;
5 import java.util.Collections;
7 import org.simantics.db.ReadGraph;
8 import org.simantics.db.Resource;
9 import org.simantics.db.common.request.ResourceRead;
10 import org.simantics.db.exception.DatabaseException;
11 import org.simantics.db.layer0.adapter.Instances;
12 import org.simantics.diagram.stubs.DiagramResource;
14 public class ProfileEntryContributions extends ResourceRead<Collection<Resource>>{
16 protected ProfileEntryContributions(Resource runtimeDiagram) {
17 super(runtimeDiagram);
21 public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {
23 DiagramResource DIA = DiagramResource.getInstance(graph);
25 String indexURI = graph.getPossibleRelatedValue(resource, DIA.RuntimeDiagram_HasModelURI);
27 return Collections.emptyList();
29 Resource index = graph.getPossibleResource(indexURI);
31 return Collections.emptyList();
33 Instances query = graph.adapt(DIA.ProfileEntryContribution, Instances.class);
35 ArrayList<Resource> result = new ArrayList<>();
36 for(Resource contribution : query.find(graph, index)) {
37 result.add(graph.getSingleObject(contribution, DIA.ProfileEntryContribution_HasEntry));