Hi there,

I have managed to make external customized views works in CAS 6.2.x, I 
don't have the time to test this out in CAS 6.3 yet but please try this out 
see if it works:

Instead of putting *nextor *in:
- /your/external/folder/templates/*nextor*
You should do it like this:
-  /your/external/folder/templates/*themes*/*nextor*

I didn't found this in the official doc, I found this my looking at CAS 
source code some time ago.

See if this still works in CAS 6.3... If it does not work I have no idea 
what's wrong as well. Or maybe CAS 6.3 have some new change.

Cheers,
Andy
On Saturday, 13 March 2021 at 00:34:06 UTC+8 [email protected] wrote:

>
> Accorging to :
> https://dacurry-tns.github.io/deploying-apereo-cas/ui_develop_update-the-layout-template.html
> "By default, Thymeleaf interprets all relative file paths as if they were 
> rooted at the templates directory. If we do not make this change, we will 
> be including the fragments from the default layout (rooted at templates), 
> not our custom layout (rooted at templates/newschool)."
>
>
> But not work.Probably Above mentioned tutorial is for older version form 
> 6.2.x.  Other possiblity  cas cant reach  templates/nextor when is outside 
> the webapp. I don know. 
>
> środa, 10 marca 2021 o 16:36:28 UTC+1 artur miś napisał(a):
>
>> *Gradle.properties*
>>
>> ss@zal:~/cas.6.3_10_10_2020_update/cas-overlay-template-master$ cat 
>> gradle.properties
>>
>> cas.version=6.3.2
>>
>> springBootVersion=2.3.4.RELEASE
>>
>> appServer=-tomcat
>>
>> executable=false
>>
>> tomcatVersion=9.0.38
>>
>> group=org.apereo.cas
>>
>> sourceCompatibility=11
>>
>> targetCompatibility=11
>>
>> jibVersion=2.8.0
>>
>> shellDir=build/libs
>>
>> ivyVersion=2.4.0
>>
>> gradleDownloadTaskVersion=4.1.1
>>
>> gradleMavenPluginVersion=5.2.1
>>
>> gradleLombokPluginVersion=5.2.1
>>
>> baseDockerImage=adoptopenjdk/openjdk11:alpine-jre
>>
>> allowInsecureRegistries=false
>>
>>
>>
>> *cas.propierties*
>>
>> spring.thymeleaf.prefix=classpath:/templates/
>>
>> cas.view.template-prefixes[0]=file:///etc/cas/templates ← store for  
>> views outside the cas.war
>>
>>
>>
>>
>> *services*:
>>
>> ss@zal:/cas/cas7/services$ cat  prg-3.json
>>
>> {
>>
>>   "@class" : "org.jasig.cas.services.RegexRegisteredService",
>>
>>   "serviceId" : "^(http|https|imaps)://newton.xx/.*",
>>
>>   "name" : "PRG_PABLO",
>>
>>   "id" : 3,
>>
>>   "evaluationOrder" : 0,
>>
>>   "theme" : "nextor",
>>
>>    "authenticationPolicy" : {
>>
>>     "@class" : 
>> "org.apereo.cas.services.DefaultRegisteredServiceAuthenticationPolicy",
>>
>>     "requiredAuthenticationHandlers" : ["java.util.TreeSet", ["xxx",  
>> "yyyy" ]]
>>
>>   },
>>
>> }
>>
>>
>> *Copy templates outside the webapp:*
>>
>> cp -rp  
>> :~/cas.6.3_10_10_2020_update/cas-overlay-template-master/src/main/resources 
>> /cas/cas7/templates
>>
>> /cas/cas7$ ls
>>
>> config  services  templates  thekeystore
>>
>>
>>
>> *Removing templates from cas overlay:*
>>
>> cd 
>> ~/cas.6.3_10_10_2020_update/cas-overlay-template-master/src/main/resources$ 
>> ls
>>
>> messages_pl.properties  nextor.properties  static  templates
>>
>> rm -rf templates
>>
>>
>>
>> *Theme files/tree:*
>>
>> ss@zal~/cas.6.3_10_10_2020_update/cas-overlay-template-master/src/main/resources$
>>  
>> cd static/
>>
>> ss@zal:~/cas.6.3_10_10_2020_update/cas-overlay-template-master/src/main/resources/static$
>>  
>> ls
>>
>> css  images  js  themes
>>
>> ss@zal:~/cas.6.3_10_10_2020_update/cas-overlay-template-master/src/main/resources/static$
>>  
>> cd themes/
>>
>> ss@zal:~/cas.6.3_10_10_2020_update/cas-overlay-template-master/src/main/resources/static/themes$
>>  
>> ls
>>
>> nextor
>>
>> ss@zal:~/cas.6.3_10_10_2020_update/cas-overlay-template-master/src/main/resources/static/themes$
>>  
>> cd nextor/
>>
>> ss@zal:~/cas.6.3_10_10_2020_update/cas-overlay-template-master/src/main/resources/static/themes/nextor$
>>  
>> ls
>>
>> css  images  js
>>
>>
>>
>> *Theme def:for service nextor*
>>
>> ss@zal~/cas.6.3_10_10_2020_update/cas-overlay-template-master/src/main/resources$
>>  
>> cat nextor.properties
>>
>> cas.theme.defaultThemeName=nextor
>>
>> cas.standard.css.file=/themes/nextor/css/cas.css
>>
>> cas.standard.js.file=/themes/nextor/js/cas.js
>>
>>
>> *Image creation:*
>>
>> ./gradlew --info build jibDockerBuild
>>
>>
>> *Creation container:*
>>
>> sudo docker run  --name cas2localTT    -v /cas/cas7:/etc/cas -p 
>> 127.0.0.1:4444:8443 -d org.apereo.cas/cas:latest
>>
>>
>>
>> *Result:* 
>>
>> reguest: https://sample.xx/casphp/login?service=https://newton.xx/
>>
>> It is using files from  /etc/cas/templates  but only for  default files 
>> (/etc/cas/templates/fragments/footer.html)  . It doesn’t uses nextor views 
>> at all. I thought that if i have theme  nextor.properties it will be use  
>> views defined in  folder templates/nextor .  Problably i have missed 
>> something  but i don’t know what. Could you help me please ?
>>
>> How i menssioned before:
>>
>> ss@zal/cas/cas7/templates$ ls
>>
>> casLoginView.html  fragments  nextor
>>
>> If i change footer.html i can see changes on website but if i change  
>> footer.htm in nextor  i can not  see result.
>>
>> Obviously if I  have all in  cas.war   I have customised  view nextor 
>> working.
>>
>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/9071dfb8-0d99-4dc2-a2b2-0f73566d2e78n%40apereo.org.

Reply via email to