X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fstubs%2FInteropResource.java;h=4ad00569d5a74cf72a7b69232369133fef07c7ea;hb=624443b2a7c97a1808a42470dddf1437ed59cd21;hp=6115e7a2ffcd65fddb4c79b21a163074b521ffb4;hpb=e669f77a8bbc1d5ddac72f2d45ea3b8b45eddb10;p=simantics%2Finterop.git diff --git a/org.simantics.interop/src/org/simantics/interop/stubs/InteropResource.java b/org.simantics.interop/src/org/simantics/interop/stubs/InteropResource.java index 6115e7a..4ad0056 100644 --- a/org.simantics.interop/src/org/simantics/interop/stubs/InteropResource.java +++ b/org.simantics.interop/src/org/simantics/interop/stubs/InteropResource.java @@ -5,6 +5,7 @@ import org.simantics.db.ReadGraph; import org.simantics.db.request.Read; import org.simantics.db.Session; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.service.QueryControl; public class InteropResource { @@ -12,6 +13,7 @@ public class InteropResource { public final Resource HasGeneratorID; public final Resource HasGeneratorID_Inverse; public final Resource HasImportData; + public final Resource HasInputResource; public final Resource HasSource; public final Resource INodeType; public final Resource ImportDataOf; @@ -25,6 +27,7 @@ public class InteropResource { public static final String HasGeneratorID = "http://www.simantics.org/Interop-1.0/HasGeneratorID"; public static final String HasGeneratorID_Inverse = "http://www.simantics.org/Interop-1.0/HasGeneratorID/Inverse"; public static final String HasImportData = "http://www.simantics.org/Interop-1.0/HasImportData"; + public static final String HasInputResource = "http://www.simantics.org/Interop-1.0/HasInputResource"; public static final String HasSource = "http://www.simantics.org/Interop-1.0/HasSource"; public static final String INodeType = "http://www.simantics.org/Interop-1.0/INodeType"; public static final String ImportDataOf = "http://www.simantics.org/Interop-1.0/ImportDataOf"; @@ -48,6 +51,7 @@ public class InteropResource { HasGeneratorID = getResourceOrNull(graph, URIs.HasGeneratorID); HasGeneratorID_Inverse = getResourceOrNull(graph, URIs.HasGeneratorID_Inverse); HasImportData = getResourceOrNull(graph, URIs.HasImportData); + HasInputResource = getResourceOrNull(graph, URIs.HasInputResource); HasSource = getResourceOrNull(graph, URIs.HasSource); INodeType = getResourceOrNull(graph, URIs.INodeType); ImportDataOf = getResourceOrNull(graph, URIs.ImportDataOf); @@ -61,7 +65,8 @@ public class InteropResource { Session session = graph.getSession(); InteropResource ret = session.peekService(InteropResource.class); if(ret == null) { - ret = new InteropResource(graph); + QueryControl qc = graph.getService(QueryControl.class); + ret = new InteropResource(qc.getIndependentGraph(graph)); session.registerService(InteropResource.class, ret); } return ret; @@ -72,7 +77,8 @@ public class InteropResource { if(ret == null) { ret = session.syncRequest(new Read() { public InteropResource perform(ReadGraph graph) throws DatabaseException { - return new InteropResource(graph); + QueryControl qc = graph.getService(QueryControl.class); + return new InteropResource(qc.getIndependentGraph(graph)); } }); session.registerService(InteropResource.class, ret);