Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #120

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# AEM Groovy Console

_This project has moved to https://github.com/CID15/aem-groovy-console and will no longer be maintained in this repository._

## Overview

The AEM Groovy Console provides an interface for running [Groovy](http://www.groovy-lang.org/) scripts in Adobe Experience Manager. Scripts can be created to manipulate content in the JCR, call OSGi services, or execute arbitrary code using the AEM, Sling, or JCR APIs. After ainstalling the package in AEM (instructions below), see the [console page](http://localhost:4502/apps/groovyconsole.html) for documentation on the available bindings and methods. Sample scripts are included in the package for reference.
Expand Down Expand Up @@ -108,4 +110,4 @@ Sample scripts can be found in the `src/main/scripts` directory.

## Versioning

Follows [Semantic Versioning](http://semver.org/) guidelines.
Follows [Semantic Versioning](http://semver.org/) guidelines.
18 changes: 15 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.icfolson.aem.groovy.console</groupId>
<artifactId>aem-groovy-console</artifactId>
<packaging>jar</packaging>
<version>16.0.0</version>
<version>16.1.0-SNAPSHOT</version>
<name>AEM Groovy Console</name>
<description>
The AEM Groovy Console provides an interface for running Groovy scripts in the AEM container. Scripts can be
Expand All @@ -22,6 +22,13 @@
<url>http://www.icfnext.com</url>
</organization>

<repositories>
<repository>
<id>local-server</id>
<url>https://cmsnew/maven-repository</url>
</repository>
</repositories>

<developers>
<developer>
<name>Mark Daugherty</name>
Expand Down Expand Up @@ -49,10 +56,15 @@
</issueManagement>

<distributionManagement>
<!-- <repository>-->
<!-- <id>sonatype-nexus-staging</id>-->
<!-- <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>-->
<!-- </repository>-->
<repository>
<id>sonatype-nexus-staging</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>local-server</id>
<url>https://cmsnew/maven-repository</url>
</repository>

</distributionManagement>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import org.osgi.service.event.propertytypes.EventTopics
@EventTopics(NotificationConstants.TOPIC_JOB_FINISHED)
@EventFilter("(event.job.topic=groovyconsole/job*)")
@Slf4j("LOG")
class DefaultGroovyConsoleEmailNotificationEventHandler extends AbstractGroovyConsoleScheduledJobEventHandler {
class DefaultGroovyConsoleEmailNotificationEventHandler {

@Reference
private EmailNotificationService emailNotificationService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import javax.servlet.Servlet

import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST

class GroovyScriptLet extends Object {

}

@Component(service = Servlet, immediate = true, property = [
"sling.servlet.paths=/bin/groovyconsole/download"
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.icfolson.aem.groovy.console.GroovyConsoleService
import com.icfolson.aem.groovy.console.api.context.ScriptContext
import com.icfolson.aem.groovy.console.api.impl.RequestScriptContext
import com.icfolson.aem.groovy.console.configuration.ConfigurationService
import com.icfolson.aem.groovy.console.utils.GroovyScriptException
import groovy.util.logging.Slf4j
import org.apache.sling.api.SlingHttpServletRequest
import org.apache.sling.api.SlingHttpServletResponse
Expand All @@ -14,7 +15,8 @@ import org.osgi.service.component.annotations.Reference

import javax.jcr.Session
import javax.servlet.Servlet
import javax.servlet.ServletException

//import javax.servlet.ServletException

import static com.google.common.base.Preconditions.checkNotNull
import static com.icfolson.aem.groovy.console.constants.GroovyConsoleConstants.SCRIPT
Expand All @@ -36,7 +38,7 @@ class ScriptPostServlet extends AbstractJsonResponseServlet {

@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws
ServletException, IOException {
GroovyScriptException, IOException {
if (configurationService.hasPermission(request)) {
def scriptPaths = request.getParameterValues(SCRIPT_PATHS)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.icfolson.aem.groovy.console.utils

class GroovyScriptException extends Throwable {

}
15 changes: 15 additions & 0 deletions ui.content/web/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<servlet-name>Groovy</servlet-name>
<servlet-class>groovy.servlet.GroovyServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Groovy</servlet-name>
<url-pattern>*.groovy</url-pattern>
</servlet-mapping>
</web-app>
16 changes: 16 additions & 0 deletions ui.content/web/index.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<%--
Created by IntelliJ IDEA.
User: jordankanter
Date: 10/22/22
Time: 4:42 PM
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>$Title$</title>
</head>
<body>
$END$
</body>
</html>
38 changes: 38 additions & 0 deletions ui.standalone/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store