You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:12:12 UTC
[sling-org-apache-sling-scripting-sightly-repl] 03/08: trivial
Sightly refactoring:
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.repl-1.0.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-repl.git
commit 6d261a774d3eeb3c87662bed4899639c583d1b3b
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Thu Jun 16 17:21:14 2016 +0000
trivial Sightly refactoring:
* removed redundant code from the SightlyJavaCompilerService which is now handled by the SourceIdentifier
* removed redundant SightlyEngineConfiguration options
* adapted the REPL java source code servlet to the new pattern of generating java classes
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/repl@1748764 13f79535-47bb-0310-9956-ffa450edef68
---
.../scripting/sightly/repl/REPLJavaSourceCodeServlet.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/sling/scripting/sightly/repl/REPLJavaSourceCodeServlet.java b/src/main/java/org/apache/sling/scripting/sightly/repl/REPLJavaSourceCodeServlet.java
index e8a1939..90f0cc2 100644
--- a/src/main/java/org/apache/sling/scripting/sightly/repl/REPLJavaSourceCodeServlet.java
+++ b/src/main/java/org/apache/sling/scripting/sightly/repl/REPLJavaSourceCodeServlet.java
@@ -70,8 +70,10 @@ public class REPLJavaSourceCodeServlet extends SlingSafeMethodsServlet {
if (request.getServerPort() != 80) {
configurationLink.append(":").append(request.getServerPort());
}
- configurationLink.append(request.getContextPath()).append("/system/console/configMgr/org.apache.sling.scripting.sightly.impl.engine.SightlyEngineConfiguration");
- response.getWriter().write("/**\n * Please enable development mode at\n * " + configurationLink.toString() + "\n */");
+ configurationLink.append(request.getContextPath())
+ .append("/system/console/configMgr/org.apache.sling.scripting.sightly.impl.engine.SightlyEngineConfiguration");
+ response.getWriter().write("/**\n * Please enable the \"Keep Generated Java Source Code\" option at\n * " + configurationLink
+ .toString() + "\n */");
} else {
response.getWriter().write(getClassSourceCode());
}
@@ -79,7 +81,7 @@ public class REPLJavaSourceCodeServlet extends SlingSafeMethodsServlet {
private String getClassSourceCode() {
if (classesFolder != null && classesFolder.isDirectory()) {
- File classFile = new File(classesFolder, "/apps/repl/components/repl/SightlyJava_template.java");
+ File classFile = new File(classesFolder, "org/apache/sling/scripting/sightly/apps/repl/components/repl/template_html.java");
if (classFile.isFile()) {
try {
return IOUtils.toString(new FileInputStream(classFile), "UTF-8");
@@ -87,9 +89,10 @@ public class REPLJavaSourceCodeServlet extends SlingSafeMethodsServlet {
LOGGER.error("Unable to read file " + classFile.getAbsolutePath(), e);
}
}
+ LOGGER.warn("Source code for " + (classesFolder.isDirectory() ? classesFolder.getAbsolutePath() : "") +
+ "/org/apache/sling/scripting/sightly/apps/repl/components/repl/template_html.java was not found. Maybe you need to " +
+ "configure the Sightly Scripting Engine to keep the generated source files?");
}
- LOGGER.warn("Source code for " + (classesFolder.isDirectory() ? classesFolder.getAbsolutePath() : "") +
- "/apps/repl/components/repl/SightlyJava_template.java was not found. Maybe you need to enable dev mode for Sightly?");
return "";
}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.