You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by mm...@apache.org on 2020/03/23 09:53:09 UTC

[syncope] branch SYNCOPE-1545 updated: move thymeleaf resources to a thymeleaf folder to take advantage of the built-in template resolver for overrides.

This is an automated email from the ASF dual-hosted git repository.

mmoayyed pushed a commit to branch SYNCOPE-1545
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/SYNCOPE-1545 by this push:
     new c3469b9  move thymeleaf resources to a thymeleaf folder to take advantage of the built-in template resolver for overrides.
c3469b9 is described below

commit c3469b90fdeffa89373364caa6965f6f661da47f
Author: Misagh Moayyed <mm...@gmail.com>
AuthorDate: Mon Mar 23 14:21:59 2020 +0430

    move thymeleaf resources to a thymeleaf folder
    to take advantage of the built-in template resolver
    for overrides.
---
 .../syncope/wa/starter/SyncopeWAConfiguration.java |  24 ++++-----------------
 .../src/main/resources/application.properties      |   3 +--
 .../static/images/favicon.png                      | Bin
 .../{syncope => thymeleaf}/static/images/logo.png  | Bin
 .../templates/fragments/footer.html                |   0
 .../templates/fragments/header.html                |   0
 .../{syncope => thymeleaf}/templates/layout.html   |   0
 7 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/wa/starter/src/main/java/org/apache/syncope/wa/starter/SyncopeWAConfiguration.java b/wa/starter/src/main/java/org/apache/syncope/wa/starter/SyncopeWAConfiguration.java
index 4add4ff..b7c41b7 100644
--- a/wa/starter/src/main/java/org/apache/syncope/wa/starter/SyncopeWAConfiguration.java
+++ b/wa/starter/src/main/java/org/apache/syncope/wa/starter/SyncopeWAConfiguration.java
@@ -18,39 +18,23 @@
  */
 package org.apache.syncope.wa.starter;
 
-import java.io.Serializable;
-import java.nio.charset.StandardCharsets;
 import org.apereo.cas.services.DefaultRegisteredServiceEntityMapper;
+import org.apereo.cas.services.RegisteredService;
 import org.apereo.cas.services.RegisteredServiceEntityMapper;
+
 import org.apache.syncope.common.keymaster.client.api.model.NetworkService;
 import org.apache.syncope.common.keymaster.client.api.startstop.KeymasterStart;
 import org.apache.syncope.common.keymaster.client.api.startstop.KeymasterStop;
-import org.apereo.cas.services.RegisteredService;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.thymeleaf.templatemode.TemplateMode;
-import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver;
+
+import java.io.Serializable;
 
 @Configuration(proxyBeanMethods = false)
 public class SyncopeWAConfiguration {
 
     @Bean
-    @ConditionalOnMissingBean
-    public ClassLoaderTemplateResolver syncopeTemplateResolver() {
-        ClassLoaderTemplateResolver syncopeTemplateResolver = new ClassLoaderTemplateResolver();
-        syncopeTemplateResolver.setPrefix("syncope/templates/");
-        syncopeTemplateResolver.setSuffix(".html");
-        syncopeTemplateResolver.setTemplateMode(TemplateMode.HTML);
-        syncopeTemplateResolver.setCharacterEncoding(StandardCharsets.UTF_8.name());
-        syncopeTemplateResolver.setOrder(0);
-        syncopeTemplateResolver.setCheckExistence(true);
-
-        return syncopeTemplateResolver;
-    }
-
-    @Bean
     @ConditionalOnProperty(name = "cas.serviceRegistry.rest.url")
     public RegisteredServiceEntityMapper<RegisteredService, Serializable> registeredServiceEntityMapper() {
         return new DefaultRegisteredServiceEntityMapper();
diff --git a/wa/starter/src/main/resources/application.properties b/wa/starter/src/main/resources/application.properties
index 555d056..5ad1d51 100644
--- a/wa/starter/src/main/resources/application.properties
+++ b/wa/starter/src/main/resources/application.properties
@@ -26,8 +26,7 @@ spring.http.encoding.force=true
 
 server.servlet.contextPath=/syncope-wa
 
-spring.resources.static-locations=classpath:/syncope/static,classpath:/static
-spring.thymeleaf.templateResolverOrder=1 
+spring.resources.static-locations=classpath:/thymeleaf/static,classpath:/static
 
 management.endpoints.web.exposure.include=health,loggers
 management.endpoint.health.show-details=always
diff --git a/wa/starter/src/main/resources/syncope/static/images/favicon.png b/wa/starter/src/main/resources/thymeleaf/static/images/favicon.png
similarity index 100%
rename from wa/starter/src/main/resources/syncope/static/images/favicon.png
rename to wa/starter/src/main/resources/thymeleaf/static/images/favicon.png
diff --git a/wa/starter/src/main/resources/syncope/static/images/logo.png b/wa/starter/src/main/resources/thymeleaf/static/images/logo.png
similarity index 100%
rename from wa/starter/src/main/resources/syncope/static/images/logo.png
rename to wa/starter/src/main/resources/thymeleaf/static/images/logo.png
diff --git a/wa/starter/src/main/resources/syncope/templates/fragments/footer.html b/wa/starter/src/main/resources/thymeleaf/templates/fragments/footer.html
similarity index 100%
rename from wa/starter/src/main/resources/syncope/templates/fragments/footer.html
rename to wa/starter/src/main/resources/thymeleaf/templates/fragments/footer.html
diff --git a/wa/starter/src/main/resources/syncope/templates/fragments/header.html b/wa/starter/src/main/resources/thymeleaf/templates/fragments/header.html
similarity index 100%
rename from wa/starter/src/main/resources/syncope/templates/fragments/header.html
rename to wa/starter/src/main/resources/thymeleaf/templates/fragments/header.html
diff --git a/wa/starter/src/main/resources/syncope/templates/layout.html b/wa/starter/src/main/resources/thymeleaf/templates/layout.html
similarity index 100%
rename from wa/starter/src/main/resources/syncope/templates/layout.html
rename to wa/starter/src/main/resources/thymeleaf/templates/layout.html