importJava "org.simantics.modeling.ModelingUtils" where
importSharedOntologyWithUI :: Variable -> <ReadGraph> ()
importSharedOntology :: String -> ()
+ importSharedOntology2 :: String -> <Proc> [Resource]
createSharedOntologyWithUI :: Resource -> <ReadGraph> ()
unlinkSharedOntologyWithUI :: Variable -> [Resource] -> <ReadGraph> ()
createNewVersionWithUI :: Resource -> <ReadGraph> ()
import org.simantics.db.layer0.genericrelation.DependenciesRelation.DependencyChangesRequest;
import org.simantics.db.layer0.genericrelation.DependencyChanges;
import org.simantics.db.layer0.genericrelation.IndexedRelations;
+import org.simantics.db.layer0.migration.MigratedImportResult;
import org.simantics.db.layer0.migration.MigrationUtils;
import org.simantics.db.layer0.request.ActivateModel;
import org.simantics.db.layer0.request.ActiveModels;
}
- public static void importSharedOntology(String fileName) throws Exception {
+ public static MigratedImportResult importSharedOntologyWithResult(String fileName) throws Exception {
try {
DataContainer dc = DataContainers.readFile(new File(fileName));
TransferableGraph1 tg = (TransferableGraph1)dc.content.getValue(TransferableGraph1.BINDING);
Variant draftStatus = dc.metadata.get(DraftStatusBean.EXTENSION_KEY);
- MigrationUtils.importSharedOntology(Simantics.getSession(), tg, draftStatus == null);
+ return MigrationUtils.importSharedOntology(Simantics.getSession(), tg, draftStatus == null);
} catch (Exception e) {
Logger.defaultLogError(e);
throw e;
}
}
+ public static void importSharedOntology(String fileName) throws Exception {
+ importSharedOntologyWithResult(fileName);
+ }
+
+ public static List<Resource> importSharedOntology2(String fileName) throws Exception {
+ MigratedImportResult result = importSharedOntologyWithResult(fileName);
+ return new ArrayList<Resource>(result.roots);
+ }
+
public static void importSharedOntologyWithUI(ReadGraph graph, final Variable variable) throws DatabaseException {
Display.getDefault().asyncExec(new Runnable() {