From e5531e7e8d96d2d3656dd9535121aa8fa893628c Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Fri, 11 Oct 2024 15:05:52 -0700 Subject: [PATCH] Remove dependency on sitemesh --- LICENSE | 52 ------------------- gradle/libs.versions.toml | 3 -- grails-plugin-async/build.gradle | 2 - .../web/async/GrailsAsyncContext.groovy | 24 --------- 4 files changed, 81 deletions(-) diff --git a/LICENSE b/LICENSE index 5e829a5e..607eabdf 100644 --- a/LICENSE +++ b/LICENSE @@ -224,7 +224,6 @@ SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES >>> dom4j-1.6.1 >>> hsqldb-1.8.0.10 >>> jline-2.11 - >>> sitemesh-2.4 >>> slf4j-1.7.5 @@ -394,57 +393,6 @@ This software is distributable under the BSD license. See the terms of the BSD license in the documentation provided with this software. ->>> sitemesh-2.4 - -The OpenSymphony Software License, Version 1.1 - -(this license is derived and fully compatible with the Apache Software -License - see http://www.apache.org/LICENSE.txt) - -Copyright (c) 2001 The OpenSymphony Group. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in -the documentation and/or other materials provided with the -distribution. - -3. The end-user documentation included with the redistribution, -if any, must include the following acknowledgment: -"This product includes software developed by the -OpenSymphony Group (http://www.opensymphony.com/)." -Alternately, this acknowledgment may appear in the software itself, -if and wherever such third-party acknowledgments normally appear. - -4. The names "OpenSymphony" and "The OpenSymphony Group" -must not be used to endorse or promote products derived from this -software without prior written permission. For written -permission, please contact license@opensymphony.com . - -5. Products derived from this software may not be called "OpenSymphony" -or "SiteMesh", nor may "OpenSymphony" or "SiteMesh" appear in their -name, without prior written permission of the OpenSymphony Group. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - - >>> slf4j-1.7.5 Copyright (c) 2004-2007 QOS.ch diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 97674681..c2f484b5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,7 +12,6 @@ micronaut-serde-jackson = '2.10.2' objenesis = '3.3' rxjava = '1.3.8' rxjava2 = '2.2.21' -sitemesh = '2.4.4' slf4j = '1.7.36' spock = '2.3-groovy-4.0' spring = '6.1.13' @@ -27,14 +26,12 @@ grails-datastore-gorm = { module = 'org.grails:grails-datastore-gorm', version.r grails-datastore-gorm-test = { module = 'org.grails:grails-datastore-gorm-test', version.ref = 'gorm' } grails-web-common = { module = 'org.grails:grails-web-common', version.ref = 'grails' } grails-web-mvc = { module = 'org.grails:grails-web-mvc', version.ref = 'grails' } -grails-web-sitemesh = { module = 'org.grails:grails-web-sitemesh', version.ref = 'grails-gsp' } gpars = { module = 'org.codehaus.gpars:gpars', version.ref = 'gpars' } groovy-core = { module = 'org.apache.groovy:groovy', version.ref = 'groovy' } jakarta-annotation-api = { module = 'jakarta.annotation:jakarta.annotation-api', version.ref = 'jakarta-annotation-api' } objenesis = { module = 'org.objenesis:objenesis', version.ref = 'objenesis' } rxjava = { module = 'io.reactivex:rxjava', version.ref = 'rxjava' } rxjava2 = { module = 'io.reactivex.rxjava2:rxjava', version.ref = 'rxjava2' } -sitemesh = { module = 'opensymphony:sitemesh', version.ref = 'sitemesh' } slf4j-api = { module = 'org.slf4j:slf4j-api', version.ref = 'slf4j' } slf4j-nop = { module = 'org.slf4j:slf4j-nop', version.ref = 'slf4j' } servlet-api = { module = 'javax.servlet:javax.servlet-api', version = '4.0.1' } diff --git a/grails-plugin-async/build.gradle b/grails-plugin-async/build.gradle index 3a5f99e4..8f9fc74b 100644 --- a/grails-plugin-async/build.gradle +++ b/grails-plugin-async/build.gradle @@ -14,7 +14,6 @@ dependencies { api project(':grails-events-core') api libs.grails.core api libs.grails.web.common - api libs.grails.web.sitemesh api libs.groovy.core api libs.spring.beans api libs.spring.context @@ -22,7 +21,6 @@ dependencies { implementation libs.grails.controllers implementation libs.grails.web.mvc - implementation libs.sitemesh implementation libs.spring.core implementation libs.spring.web diff --git a/grails-plugin-async/src/main/groovy/org/grails/plugins/web/async/GrailsAsyncContext.groovy b/grails-plugin-async/src/main/groovy/org/grails/plugins/web/async/GrailsAsyncContext.groovy index 132a832b..58b8acfc 100644 --- a/grails-plugin-async/src/main/groovy/org/grails/plugins/web/async/GrailsAsyncContext.groovy +++ b/grails-plugin-async/src/main/groovy/org/grails/plugins/web/async/GrailsAsyncContext.groovy @@ -22,12 +22,8 @@ import jakarta.servlet.AsyncListener import grails.persistence.support.PersistenceContextInterceptor import org.grails.web.servlet.mvc.GrailsWebRequest -import org.grails.web.sitemesh.GrailsContentBufferingResponse -import org.grails.web.sitemesh.GroovyPageLayoutFinder import org.grails.web.util.WebUtils -import com.opensymphony.sitemesh.webapp.SiteMeshWebAppContext - import jakarta.servlet.http.HttpServletRequest import jakarta.servlet.http.HttpServletResponse @@ -43,16 +39,11 @@ class GrailsAsyncContext implements AsyncContext { final @Delegate AsyncContext delegate final GrailsWebRequest originalWebRequest - final GroovyPageLayoutFinder groovyPageLayoutFinder final AsyncGrailsWebRequest asyncGrailsWebRequest GrailsAsyncContext(AsyncContext delegate, GrailsWebRequest webRequest, AsyncGrailsWebRequest asyncGrailsWebRequest = null) { this.delegate = delegate originalWebRequest = webRequest - def applicationContext = webRequest.getApplicationContext() - if (applicationContext && applicationContext.containsBean("groovyPageLayoutFinder")) { - groovyPageLayoutFinder = applicationContext.getBean("groovyPageLayoutFinder", GroovyPageLayoutFinder) - } this.asyncGrailsWebRequest = asyncGrailsWebRequest } @@ -82,21 +73,6 @@ class GrailsAsyncContext implements AsyncContext { } void complete() { - if (response instanceof GrailsContentBufferingResponse) { - GrailsContentBufferingResponse bufferingResponse = (GrailsContentBufferingResponse) response - def targetResponse = bufferingResponse.getTargetResponse() - def content = bufferingResponse.getContent() - final httpRequest = (HttpServletRequest) request - if (content != null && groovyPageLayoutFinder != null) { - com.opensymphony.sitemesh.Decorator decorator = (com.opensymphony.sitemesh.Decorator)groovyPageLayoutFinder?.findLayout(httpRequest, content) - if (decorator) { - decorator.render content, - new SiteMeshWebAppContext(httpRequest, targetResponse, request.servletContext) - } else { - content.writeOriginal(targetResponse.getWriter()) - } - } - } delegate.complete() }