Skip to content

Commit

Permalink
Merge pull request #44 from bjagg/overrides-context
Browse files Browse the repository at this point in the history
fix: add overrides context support
  • Loading branch information
bjagg authored Sep 10, 2019
2 parents e8069e2 + 82c2956 commit dae6b6a
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 38 deletions.
36 changes: 27 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
<portlet-api.version>2.0</portlet-api.version>
<resource-server.version>1.0.44</resource-server.version>
<servlet-api.version>2.5</servlet-api.version>
<spring.version>4.1.4.RELEASE</spring.version>
<spring.version>4.3.25.RELEASE</spring.version>
<logbackVersion>1.0.13</logbackVersion>
<slf4jVersion>1.7.5</slf4jVersion>
<mockito.version>1.9.5</mockito.version>
<portlet.mvc.util.version>1.1.2</portlet.mvc.util.version>
<uportal-libs.version>5.8.0</uportal-libs.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -100,6 +101,24 @@
<artifactId>cas-client-core</artifactId>
<version>${cas.version}</version>
</dependency>
<dependency>
<groupId>org.jasig.portal</groupId>
<artifactId>uPortal-api-search</artifactId>
<version>${uportal-libs.version}</version>
</dependency>
<dependency>
<groupId>org.jasig.portal</groupId>
<artifactId>uPortal-spring</artifactId>
<version>${uportal-libs.version}</version>
<!--
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
-->
</dependency>
<dependency>
<groupId>org.jasig.resourceserver</groupId>
<artifactId>resource-server-content</artifactId>
Expand Down Expand Up @@ -156,11 +175,6 @@
<artifactId>standard</artifactId>
<version>${jstl.version}</version>
</dependency>
<dependency>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-search-api</artifactId>
<version>4.0.10</version>
</dependency>

<!-- For sl4j/logback logging, see https://wiki.jasig.org/display/PLT/Logging+Best+Practices -->
<dependency>
Expand Down Expand Up @@ -299,7 +313,11 @@

<dependency>
<groupId>org.jasig.portal</groupId>
<artifactId>uportal-search-api</artifactId>
<artifactId>uPortal-api-search</artifactId>
</dependency>
<dependency>
<groupId>org.jasig.portal</groupId>
<artifactId>uPortal-spring</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -407,11 +425,11 @@
<configuration>
<rules>
<requireJavaVersion>
<version>1.6</version>
<version>1.8</version>
</requireJavaVersion>
<bannedDependencies>
<excludes>
<exclude>commons-collections:commons-collections:[3.0,3.2.1],[4.0]</exclude>
<exclude>commons-collections:commons-collections:[3.2.1,4.0]</exclude>
</excludes>
</bannedDependencies>
</rules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.jasig.portal.search.SearchConstants;
import org.jasig.portal.search.SearchResults;
import org.apereo.portal.search.SearchConstants;
import org.apereo.portal.search.SearchResults;
import org.jasig.portlet.proxy.search.ISearchService;
import org.jasig.portlet.proxy.service.IContentRequest;
import org.jasig.portlet.proxy.service.IContentResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
import javax.portlet.PortletMode;
import javax.portlet.WindowState;

import org.jasig.portal.search.PortletUrl;
import org.jasig.portal.search.PortletUrlParameter;
import org.jasig.portal.search.PortletUrlType;
import org.jasig.portal.search.SearchRequest;
import org.jasig.portal.search.SearchResult;
import org.apereo.portal.search.PortletUrl;
import org.apereo.portal.search.PortletUrlParameter;
import org.apereo.portal.search.PortletUrlType;
import org.apereo.portal.search.SearchRequest;
import org.apereo.portal.search.SearchResult;
import org.jasig.portlet.proxy.search.util.SearchUtil;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import javax.portlet.Event;
import javax.portlet.EventRequest;
import javax.portlet.PortletPreferences;
import org.jasig.portal.search.SearchRequest;
import org.jasig.portal.search.SearchResult;
import org.jasig.portal.search.SearchResults;
import org.apereo.portal.search.SearchRequest;
import org.apereo.portal.search.SearchResult;
import org.apereo.portal.search.SearchResults;
import org.jsoup.nodes.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.jasig.portal.search.PortletUrl;
import org.jasig.portal.search.PortletUrlParameter;
import org.jasig.portal.search.PortletUrlType;
import org.jasig.portal.search.SearchRequest;
import org.jasig.portal.search.SearchResult;
import org.apereo.portal.search.PortletUrl;
import org.apereo.portal.search.PortletUrlParameter;
import org.apereo.portal.search.PortletUrlType;
import org.apereo.portal.search.SearchRequest;
import org.apereo.portal.search.SearchResult;
import org.jasig.portlet.proxy.search.util.SearchUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import javax.portlet.EventRequest;

import org.jasig.portal.search.SearchResults;
import org.apereo.portal.search.SearchResults;
import org.jsoup.nodes.Document;

public interface ISearchService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

import javax.portlet.EventRequest;

import org.jasig.portal.search.SearchRequest;
import org.jasig.portal.search.SearchResult;
import org.apereo.portal.search.SearchRequest;
import org.apereo.portal.search.SearchResult;
import org.jsoup.nodes.Document;

public interface ISearchStrategy {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to Apereo under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Apereo licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at the following location:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">

</beans>
53 changes: 43 additions & 10 deletions src/main/webapp/WEB-INF/context/applicationContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,53 @@
<context:component-scan base-package="org.jasig.portlet.proxy.service"/>
<context:annotation-config/>

<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:configuration.properties" />
</bean>

<util:properties id="props" location="classpath:configuration.properties"/>
<!--
| Supports encrypted properties within the location(s) listed in this
| bean. The password is the environment variable "UP_JASYPT_KEY"
| (see http://www.jasypt.org/).
+-->
<bean id="propertyConfigurer" class="org.springframework.context.support.PortalPropertySourcesPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:datasource.properties</value>
<value>classpath:configuration.properties</value>
<!--
| The following optional files allow deployers to set or override most
| configuration settings in a manner that is outside the footprint of the
| build/deploy cycle and SCM.
|
| Reasons for choosing that may include:
| - Desire to keep sensitive information out of your Git repository
| - Ability to change some common settings without a full build and deploy cycle
| - Building a WAR/EAR that is environment-independent
|
| Any property defined in the above files that is referenced in the Spring context
| may be overridden in one (or both) of these files. Later files override earlier
| files.
|
| The conventional location of ${portal.home} is ${catalina.base}/portal; but you
| can (typically) override that location using a PORTAL_HOME environment variable.
| (Ultimately it depends on your setenv.sh or setenv.bat file.)
|
| The first file (global.properties) may contain properties that are shared with
| other modules (e.g. portlets) in Tomcat. Several Apereo portlets source
| global.properties automatically. The second file (web-proxy.properties) is
| (should be) sourced by this module exclusively.
+-->
<value>file:${portal.home}/global.properties</value>
<value>file:${portal.home}/web-proxy.properties</value>
</list>
</property>
</bean>

<bean class="org.apache.http.impl.conn.PoolingClientConnectionManager"
p:maxTotal="50" p:defaultMaxPerRoute="10"/>

<util:list id="replayedRequestHeaders">
<value>user-agent</value>
</util:list>

<util:list id="knownHtmlContentTypes">
<value>.*text/html.*</value>
</util:list>
Expand Down Expand Up @@ -137,14 +170,14 @@
<!--
| CAS PROXY AUTHENTICATION CONFIGURATION
+-->

<!-- Ticket validation filter -->
<bean id="ticketValidationFilter"
class="org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter"
p:serverName="${portal.server.base.url}" p:redirectAfterValidation="false"
p:proxyReceptorUrl="/proxy/receptor" p:ticketValidator-ref="ticketValidator"
p:proxyGrantingTicketStorage-ref="proxyGrantingTicketStorage"/>

<!-- CAS proxy ticket validator -->
<bean id="ticketValidator"
class="org.jasig.cas.client.validation.Cas20ProxyTicketValidator"
Expand All @@ -153,7 +186,7 @@
p:acceptAnyProxy="true">
<constructor-arg index="0" value="${cas.server.base.url}" />
</bean>

<bean id="proxyGrantingTicketStorage"
class="org.jasig.cas.client.proxy.ProxyGrantingTicketStorageImpl"/>

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/context/applicationContext.xml</param-value>
<param-value>/WEB-INF/context/applicationContext.xml,classpath:/properties/contextOverrides/*.xml</param-value>
</context-param>

<listener>
Expand Down

0 comments on commit dae6b6a

Please sign in to comment.