X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.graph.db%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fdb%2FTransferableGraphImportProcess.java;h=6a699d81bce51fa7a46ea1f7c2ff8fe0c00d727f;hp=586562fa34df83ef4bccdffaebe9e5a373bd90f6;hb=32a17a670cf4f9d459917495be5f4a504afac205;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07 diff --git a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/TransferableGraphImportProcess.java b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/TransferableGraphImportProcess.java index 586562fa3..6a699d81b 100644 --- a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/TransferableGraphImportProcess.java +++ b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/TransferableGraphImportProcess.java @@ -13,6 +13,7 @@ import org.simantics.databoard.Bindings; import org.simantics.databoard.accessor.error.AccessorException; import org.simantics.databoard.adapter.AdaptException; import org.simantics.databoard.binding.mutable.Variant; +import org.simantics.databoard.util.URIStringUtils; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.WriteOnlyGraph; @@ -173,7 +174,11 @@ public class TransferableGraphImportProcess implements TransferableGraphImporter missingExternals.add(external); } - void prepare(ReadGraph graph) throws DatabaseException { + public Resource[] getResources() { + return resources; + } + + public void prepare(ReadGraph graph) throws DatabaseException { findBuiltins(graph); Resource[] resources = new Resource[tg.resourceCount]; @@ -200,14 +205,14 @@ public class TransferableGraphImportProcess implements TransferableGraphImporter if(child == null) { String uri = graph.getPossibleURI(parent); if(uri == null) { - addMissing(NameUtils.getSafeName(graph, parent) + " /" + def.name); + addMissing(URIStringUtils.escape(NameUtils.getSafeName(graph, parent)) + " /" + URIStringUtils.escape(def.name)); } else { - addMissing(graph.getURI(parent) + "/" + def.name); + addMissing(graph.getURI(parent) + "/" + URIStringUtils.escape(def.name)); } } resources[identity.resource] = child; } else { - addMissing(TransferableGraphUtils.getURI(tg, def.parent) + "/" + def.name); + addMissing(TransferableGraphUtils.getURI(tg, def.parent) + "/" + URIStringUtils.escape(def.name)); } } } @@ -337,7 +342,7 @@ public class TransferableGraphImportProcess implements TransferableGraphImporter } - void write(WriteOnlyGraph graph) throws DatabaseException { + public void write(WriteOnlyGraph graph) throws DatabaseException { Resource[] resources = this.resources;