X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.graph%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Frefactoring%2FGraphRefactoringUtils.java;h=2f00156c3b36dfdd93db0010f38ec3d54af2b0d3;hp=90b134e33762b5f991baa5288a2974906f2bad7b;hb=da0a902de6b2b4c7b4b635d11b397f663db8ecd9;hpb=b913419ca9037bf9734c56a5f079024c3a1cd177 diff --git a/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/GraphRefactoringUtils.java b/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/GraphRefactoringUtils.java index 90b134e33..2f00156c3 100644 --- a/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/GraphRefactoringUtils.java +++ b/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/GraphRefactoringUtils.java @@ -96,7 +96,7 @@ public class GraphRefactoringUtils { String[] parts = URIStringUtils.splitURI(path); Identity parentId = recursePath(tg, parts[0]); tg.identities = Arrays.copyOf(tg.identities, tg.identities.length+1); - Identity childIdentity = new Identity(tg.resourceCount++, new External(parentId.resource, parts[1])); + Identity childIdentity = new Identity(tg.resourceCount++, new External(parentId.resource, URIStringUtils.unescape(parts[1]))); tg.identities[tg.identities.length-1] = childIdentity; return childIdentity; @@ -113,10 +113,10 @@ public class GraphRefactoringUtils { String[] parts = URIStringUtils.splitURI(ext.name); Identity path = recursePath(tg, parts[0]); - id.definition = new Internal(path.resource, parts[1]); + id.definition = new Internal(path.resource, URIStringUtils.unescape(parts[1])); GraphStore store = TransferableGraphConversion.convert(tg); - int rootId = store.identities.createPathToId(UriUtils.uriToPath(ext.name)); + int rootId = store.identities.createPathToId(UriUtils.uriToPathUnescaped(ext.name)); propagateNewMarks(store.identities, rootId); TransferableGraph1 tgNew = TransferableGraphConversion.convert(store); @@ -125,16 +125,16 @@ public class GraphRefactoringUtils { tg.identities = tgNew.identities; tg.values = tgNew.values; tg.statements = tgNew.statements; - + return; } else if (ext.type.startsWith("http://")) { - String first = "http://Projects/Development Project"; + String first = "http://Projects/Development%20Project"; Identity path = recursePath(tg, first); id.definition = new Internal(path.resource, ext.name); GraphStore store = TransferableGraphConversion.convert(tg); - int rootId = store.identities.createPathToId(UriUtils.uriToPath(first + "/" + ext.name)); + int rootId = store.identities.createPathToId(UriUtils.uriToPathUnescaped(first + "/" + ext.name)); propagateNewMarks(store.identities, rootId); TransferableGraph1 tgNew = TransferableGraphConversion.convert(store); @@ -143,7 +143,7 @@ public class GraphRefactoringUtils { tg.identities = tgNew.identities; tg.values = tgNew.values; tg.statements = tgNew.statements; - + } } }