-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To make experiments with translation rules easier, we turn /apps/composum-ai/components/autotranslate/list.html into a retranslation UI usable for content authors. That is, the experimenting UI that was there is now moved to /apps/composum-ai/components/autotranslate-experiments/list.html and this UI is now reduced to operations that would be acceptable on production as well and is unrestricted. Also, there is a new checkbox that prints the additional instructions collected into that page for checking everything works as expected.
- Loading branch information
Showing
33 changed files
with
809 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
247 changes: 132 additions & 115 deletions
247
...c/main/java/com/composum/ai/aem/core/impl/autotranslate/AutoPageTranslateServiceImpl.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
.../main/content/jcr_root/apps/composum-ai/components/autotranslate-experiments/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
xmlns:sling="http://sling.apache.org/jcr/sling/1.0" | ||
jcr:primaryType="sling:Folder"> | ||
</jcr:root> |
5 changes: 5 additions & 0 deletions
5
.../content/jcr_root/apps/composum-ai/components/autotranslate-experiments/list/.content.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" | ||
xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
jcr:primaryType="sling:Folder" | ||
sling:resourceType="composum-ai/components/autotranslate/list"/> |
43 changes: 43 additions & 0 deletions
43
...in/content/jcr_root/apps/composum-ai/components/autotranslate-experiments/list/create.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<%@ page import="com.composum.ai.aem.core.impl.autotranslate.AutoTranslateListModel" %> | ||
<%@ page import="org.apache.sling.api.SlingHttpServletRequest" %> | ||
<%@page session="false" pageEncoding="UTF-8" %> | ||
<%-- Redirects to page displaying the run --%> | ||
<% | ||
try { | ||
SlingHttpServletRequest slingRequest = (SlingHttpServletRequest) request; | ||
AutoTranslateListModel model = slingRequest.adaptTo(AutoTranslateListModel.class); | ||
String id = model.createRun().id; | ||
response.sendRedirect("run.html/" + id); | ||
} catch (Exception e) { | ||
%> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Error during translation</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
<body class="coral--light foundation-layout-util-maximized-alt"> | ||
<div class="foundation-layout-panel"> | ||
<div class="foundation-layout-panel-bodywrapper spectrum-ready"> | ||
<div class="foundation-layout-panel-body"> | ||
<div class="foundation-layout-panel-content foundation-layout-form foundation-layout-form-mode-edit"> | ||
<div class="cq-dialog-content-page"> | ||
<p>Error: <%= e.toString() %> | ||
</p> | ||
<pre> | ||
<% | ||
out.flush(); | ||
e.printStackTrace(response.getWriter()); | ||
%> | ||
</pre> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
<% | ||
} | ||
%> |
File renamed without changes.
Oops, something went wrong.