import org.simantics.db.exception.DatabaseException;
import org.simantics.db.procedure.Listener;
import org.simantics.db.request.Read;
+import org.simantics.layer0.Layer0;
import org.simantics.scl.compiler.environment.specification.EnvironmentSpecification;
import org.simantics.scl.compiler.module.repository.ImportFailureException;
import org.simantics.scl.compiler.module.repository.UpdateListener;
if(mainModule != null) {
mainModuleUri = graph.getURI(mainModule);
environmentSpecification.importModule(mainModuleUri, "");
+ Layer0 L0 = Layer0.getInstance(graph);
+ for(Resource l : graph.getObjects(parameter, L0.IsLinkedTo)) {
+ mainModule = CommonDBUtils.getPossibleChild(graph, l, "SCLMain");
+ if(mainModule != null)
+ environmentSpecification.importModule(graph.getURI(mainModule), "");
+ }
}
else
mainModuleUri = graph.getURI(parameter) + "/#"; // Add something dummy to the model uri that cannot be in a real URI
import org.simantics.db.Resource;
import org.simantics.db.common.request.ParametrizedPrimitiveRead;
import org.simantics.db.common.request.UnaryRead;
+import org.simantics.db.common.utils.CommonDBUtils;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.internal.SimanticsInternal;
import org.simantics.db.procedure.Listener;
import org.simantics.db.request.Read;
+import org.simantics.layer0.Layer0;
import org.simantics.scl.compiler.environment.Environment;
import org.simantics.scl.compiler.environment.specification.EnvironmentSpecification;
import org.simantics.scl.compiler.module.repository.ImportFailureException;
"Builtin", "",
"StandardLibrary", "");
fillEnvironmentSpecification(environmentSpecification);
- Resource mainModule = Layer0Utils.getPossibleChild(graph, parameter, getRootModuleName());
+ Resource mainModule = CommonDBUtils.getPossibleChild(graph, parameter, getRootModuleName());
String mainModuleUri;
if(mainModule != null) {
mainModuleUri = graph.getURI(mainModule);
environmentSpecification.importModule(mainModuleUri, "");
+ Layer0 L0 = Layer0.getInstance(graph);
+ for(Resource l : graph.getObjects(parameter, L0.IsLinkedTo)) {
+ mainModule = CommonDBUtils.getPossibleChild(graph, l, "SCLMain");
+ if(mainModule != null)
+ environmentSpecification.importModule(graph.getURI(mainModule), "");
+ }
}
else
mainModuleUri = graph.getURI(parameter) + "/#"; // Add something dummy to the model uri that cannot be in a real URI
import org.simantics.db.common.request.BinaryRead;
import org.simantics.db.common.request.ObjectsWithType;
import org.simantics.db.common.request.ParametrizedPrimitiveRead;
+import org.simantics.db.common.utils.CommonDBUtils;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.internal.SimanticsInternal;
import org.simantics.db.procedure.Listener;
// `parameter` is optional and can be null for e.g. procedural user components
}
- Resource mainModule = Layer0Utils.getPossibleChild(graph, parameter2, "SCLMain");
- if(mainModule != null)
+ Resource mainModule = CommonDBUtils.getPossibleChild(graph, parameter2, "SCLMain");
+ if(mainModule != null) {
environmentSpecification.importModule(graph.getURI(mainModule), "");
+ for(Resource l : graph.getObjects(parameter2, L0.IsLinkedTo)) {
+ mainModule = CommonDBUtils.getPossibleChild(graph, l, "SCLMain");
+ if(mainModule != null)
+ environmentSpecification.importModule(graph.getURI(mainModule), "");
+ }
+ }
return graph.syncRequest(new ParametrizedPrimitiveRead<EnvironmentSpecification, RuntimeEnvironment>(environmentSpecification) {