\r
} else {\r
fixHasTailAndHasHead(graph, ModelRoot);\r
+ addDependencies(graph, ModelRoot);\r
}\r
}\r
+\r
});\r
} catch (DatabaseException e) {\r
e.printStackTrace();\r
return null;\r
\r
}\r
+ \r
+ protected void addDependencies(WriteGraph graph, Resource modelRoot) throws DatabaseException {\r
+ Layer0 L0 = Layer0.getInstance(graph);\r
+\r
+ ArrayList<String> links = new ArrayList<String>();\r
+ for(Resource link : graph.getObjects(modelRoot, L0.IsLinkedTo))\r
+ links.add(graph.getURI(link));\r
+ \r
+ \r
+ if(!links.contains("http://www.simantics.org/Documentation-1.0")) {\r
+ Resource documentation = graph.getPossibleResource("http://www.simantics.org/Documentation-1.0");\r
+ if(documentation != null)\r
+ graph.claim(modelRoot, L0.IsLinkedTo, documentation);\r
+ }\r
+ \r
+ if(!links.contains("http://www.simantics.org/SelectionView-1.1")) {\r
+ Resource selectionView = graph.getPossibleResource("http://www.simantics.org/SelectionView-1.1");\r
+ if(selectionView != null)\r
+ graph.claim(modelRoot, L0.IsLinkedTo, selectionView);\r
+ }\r
+ }\r
\r
protected void fixHasTailAndHasHead(WriteGraph graph, Resource modelRoot) throws DatabaseException {\r
Layer0 L0 = Layer0.getInstance(graph);\r
private String name;\r
\r
@RelatedElement(StructuralResource2.URIs.IsDefinedBy)\r
- private Configuration configuration;\r
+ private Object configuration;\r
\r
@RelatedElement(Layer0.URIs.PartOf)\r
protected Object parent;\r
}\r
\r
public Configuration getConfiguration() {\r
- return this.configuration;\r
+ return configuration instanceof Configuration ? (Configuration)configuration : null;\r
}\r
\r
@Override\r