Skip to content

Commit

Permalink
Fix template import
Browse files Browse the repository at this point in the history
  • Loading branch information
skodapetr committed Sep 7, 2023
1 parent 52e9042 commit 033c1fc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ private void importNewTemplates(Map<Resource, Resource> knownMap) {
while (runNextRound) {
runNextRound = false;
for (Container container : containers) {
if (getLocalResource(knownMap, container) != null) {
// This is a known template.
Resource localFromKnown = getLocalResource(knownMap, container);
if (localFromKnown != null) {
// This is a known template, we add a mapping.
knownMap.put(container.rawTemplate.resource, localFromKnown);
continue;
}
Resource local;
Expand Down Expand Up @@ -235,6 +237,7 @@ private Resource importNewTemplate(
if (pluginFacade.isPluginTemplate(remote.template())) {
localResource = remote.template();
} else {
// This is not recognized.
localResource = knownMap.get(remote.template());
}
if (localResource == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.linkedpipes.etl.storage.distribution;

public class ImportTemplateTest {

public void importWithKnowParent() {
// Test situation where a template has a parent.
// The parent has already been imported.
// Yet as the parent has knowAs, its original resource must be saved
// to know map.
}

}

0 comments on commit 033c1fc

Please sign in to comment.