diff --git a/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/AutoTranslateListModel.java b/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/AutoTranslateListModel.java index 132ba527a..f23faeee6 100644 --- a/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/AutoTranslateListModel.java +++ b/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/AutoTranslateListModel.java @@ -130,7 +130,8 @@ protected void copyOriginalPage(SlingHttpServletRequest request, String path) th } Page copy = pageManager.copy(originalPage, newPath, null, true, true, false); if (copy != null) { - liveRelationshipManager.endRelationship(copy.getContentResource(), false); + liveRelationshipManager.endRelationship(copy.getContentResource(), true); + liveRelationshipManager.detach(copy.getContentResource(), true); // end doesn't seem to work LOG.info("Created copy of {} at {}", originalPage.getPath(), newPath); resolver.commit(); } else { diff --git a/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/AutoTranslateServiceImpl.java b/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/AutoTranslateServiceImpl.java index e0b94b52a..7e8bd8dc0 100644 --- a/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/AutoTranslateServiceImpl.java +++ b/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/AutoTranslateServiceImpl.java @@ -150,7 +150,7 @@ public TranslationRun startTranslation( } protected List collectPages(Resource root, int maxDepth) { - if (maxDepth < 0) { + if (maxDepth < 0 || root.getName().endsWith(AutoTranslateListModel.SUFFIX_TRANSLATECOPY)) { return Collections.emptyList(); } if (root.getPath().contains("/jcr:content")) { diff --git a/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/workflow/AutoTranslateWorkflowProcess.java b/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/workflow/AutoTranslateWorkflowProcess.java index a51a3133b..075e87b0a 100644 --- a/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/workflow/AutoTranslateWorkflowProcess.java +++ b/aem/core/src/main/java/com/composum/ai/aem/core/impl/autotranslate/workflow/AutoTranslateWorkflowProcess.java @@ -23,6 +23,7 @@ import com.adobe.granite.workflow.metadata.MetaDataMap; import com.composum.ai.aem.core.impl.autotranslate.AutoPageTranslateService; import com.composum.ai.aem.core.impl.autotranslate.AutoTranslateConfigService; +import com.composum.ai.aem.core.impl.autotranslate.AutoTranslateListModel; import com.composum.ai.aem.core.impl.autotranslate.AutoTranslateService.TranslationParameters; import com.day.cq.wcm.api.WCMException; import com.google.gson.Gson; @@ -146,7 +147,8 @@ protected void translate(@Nonnull Resource resource, TranslationParameters parms while (childIterator.hasNext()) { Resource child = childIterator.next(); // skip jcr:content node since that has been translated already - if (!child.getPath().contains("/jcr:content")) { + if (!child.getPath().contains("/jcr:content") && + !child.getName().endsWith(AutoTranslateListModel.SUFFIX_TRANSLATECOPY)) { translate(child, parms, depth + 1); } } diff --git a/aem/ui.apps/src/main/content/jcr_root/apps/composum-ai/components/autotranslate/list/list.html b/aem/ui.apps/src/main/content/jcr_root/apps/composum-ai/components/autotranslate/list/list.html index adb6c5392..d9384559e 100644 --- a/aem/ui.apps/src/main/content/jcr_root/apps/composum-ai/components/autotranslate/list/list.html +++ b/aem/ui.apps/src/main/content/jcr_root/apps/composum-ai/components/autotranslate/list/list.html @@ -113,7 +113,7 @@
- Drag this bookmarklet to your bookmark bar to easily open this UI from any page: + Drag this bookmarklet to your bookmark bar to easily open this UI with the path from any page or editor: Translation Tester
diff --git a/aem/ui.apps/src/main/content/jcr_root/apps/composum-ai/components/tool/comparetool/comparetool.html b/aem/ui.apps/src/main/content/jcr_root/apps/composum-ai/components/tool/comparetool/comparetool.html index b61f530c3..cf901ae05 100644 --- a/aem/ui.apps/src/main/content/jcr_root/apps/composum-ai/components/tool/comparetool/comparetool.html +++ b/aem/ui.apps/src/main/content/jcr_root/apps/composum-ai/components/tool/comparetool/comparetool.html @@ -77,8 +77,14 @@ // Load the initial URLs if available in the parameters const initialUrl1 = getParameterByName('url1'); const initialUrl2 = getParameterByName('url2'); - if (initialUrl1) leftIframe.src = initialUrl1; - if (initialUrl2) rightIframe.src = initialUrl2; + if (initialUrl1) { + leftIframe.src = initialUrl1; + leftField.value = initialUrl1; + } + if (initialUrl2) { + rightIframe.src = initialUrl2; + rightField.value = initialUrl2; + } // Load event listeners for iframes leftIframe.addEventListener('load', function () {