public final Resource Functions_selectedProfile;
public final Resource Group;
public final Resource GroupStyleProfileEntry;
+ public final Resource Groups;
+ public final Resource Groups_DefinedElementGroup;
public final Resource HasActivationContext;
public final Resource HasActivationContext_Inverse;
public final Resource HasActiveProfile;
public final Resource PageDescription_Size_Inverse;
public final Resource Profile;
public final Resource ProfileEntry;
+ public final Resource ProfileEntryContribution;
+ public final Resource ProfileEntryContribution_HasEntry;
public final Resource ProfileEntry_HasGroup;
public final Resource ProfileEntry_HasGroup_Inverse;
public final Resource ProfileEntry_HasPriority;
public static final String Functions_selectedProfile = "http://www.simantics.org/Diagram-2.2/Functions/selectedProfile";
public static final String Group = "http://www.simantics.org/Diagram-2.2/Group";
public static final String GroupStyleProfileEntry = "http://www.simantics.org/Diagram-2.2/GroupStyleProfileEntry";
+ public static final String Groups = "http://www.simantics.org/Diagram-2.2/Groups";
+ public static final String Groups_DefinedElementGroup = "http://www.simantics.org/Diagram-2.2/Groups/DefinedElementGroup";
public static final String HasActivationContext = "http://www.simantics.org/Diagram-2.2/HasActivationContext";
public static final String HasActivationContext_Inverse = "http://www.simantics.org/Diagram-2.2/HasActivationContext/Inverse";
public static final String HasActiveProfile = "http://www.simantics.org/Diagram-2.2/HasActiveProfile";
public static final String PageDescription_Size_Inverse = "http://www.simantics.org/Diagram-2.2/PageDescription/Size/Inverse";
public static final String Profile = "http://www.simantics.org/Diagram-2.2/Profile";
public static final String ProfileEntry = "http://www.simantics.org/Diagram-2.2/ProfileEntry";
+ public static final String ProfileEntryContribution = "http://www.simantics.org/Diagram-2.2/ProfileEntryContribution";
+ public static final String ProfileEntryContribution_HasEntry = "http://www.simantics.org/Diagram-2.2/ProfileEntryContribution/HasEntry";
public static final String ProfileEntry_HasGroup = "http://www.simantics.org/Diagram-2.2/ProfileEntry/HasGroup";
public static final String ProfileEntry_HasGroup_Inverse = "http://www.simantics.org/Diagram-2.2/ProfileEntry/HasGroup/Inverse";
public static final String ProfileEntry_HasPriority = "http://www.simantics.org/Diagram-2.2/ProfileEntry/HasPriority";
Functions_selectedProfile = getResourceOrNull(graph, URIs.Functions_selectedProfile);
Group = getResourceOrNull(graph, URIs.Group);
GroupStyleProfileEntry = getResourceOrNull(graph, URIs.GroupStyleProfileEntry);
+ Groups = getResourceOrNull(graph, URIs.Groups);
+ Groups_DefinedElementGroup = getResourceOrNull(graph, URIs.Groups_DefinedElementGroup);
HasActivationContext = getResourceOrNull(graph, URIs.HasActivationContext);
HasActivationContext_Inverse = getResourceOrNull(graph, URIs.HasActivationContext_Inverse);
HasActiveProfile = getResourceOrNull(graph, URIs.HasActiveProfile);
PageDescription_Size_Inverse = getResourceOrNull(graph, URIs.PageDescription_Size_Inverse);
Profile = getResourceOrNull(graph, URIs.Profile);
ProfileEntry = getResourceOrNull(graph, URIs.ProfileEntry);
+ ProfileEntryContribution = getResourceOrNull(graph, URIs.ProfileEntryContribution);
+ ProfileEntryContribution_HasEntry = getResourceOrNull(graph, URIs.ProfileEntryContribution_HasEntry);
ProfileEntry_HasGroup = getResourceOrNull(graph, URIs.ProfileEntry_HasGroup);
ProfileEntry_HasGroup_Inverse = getResourceOrNull(graph, URIs.ProfileEntry_HasGroup_Inverse);
ProfileEntry_HasPriority = getResourceOrNull(graph, URIs.ProfileEntry_HasPriority);
--- /dev/null
+package org.simantics.scenegraph.profile.request;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.common.request.ResourceRead;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.adapter.Instances;
+import org.simantics.diagram.stubs.DiagramResource;
+
+public class ProfileEntryContributions extends ResourceRead<Collection<Resource>>{
+
+ protected ProfileEntryContributions(Resource runtimeDiagram) {
+ super(runtimeDiagram);
+ }
+
+ @Override
+ public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {
+
+ DiagramResource DIA = DiagramResource.getInstance(graph);
+
+ String indexURI = graph.getPossibleRelatedValue(resource, DIA.RuntimeDiagram_HasModelURI);
+ if (indexURI == null)
+ return Collections.emptyList();
+
+ Resource index = graph.getPossibleResource(indexURI);
+ if (index == null)
+ return Collections.emptyList();
+
+ Instances query = graph.adapt(DIA.ProfileEntryContribution, Instances.class);
+
+ ArrayList<Resource> result = new ArrayList<>();
+ for(Resource contribution : query.find(graph, index)) {
+ result.add(graph.getSingleObject(contribution, DIA.ProfileEntryContribution_HasEntry));
+ }
+
+ return result;
+
+ }
+
+}
\ No newline at end of file