Using CasConfigurationProperties and add my own properties to cas.properties

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using CasConfigurationProperties and add my own properties to cas.properties

Julien Marchal-2
Hi all,

I try to develop my own extension to modify CAS webflow and I want use my own properties in cas.properties.
I've made a WebflowConfiguration class and I want use CasConfigurationProperties class to read my properties.
But CasConfigurationProperties have only methods to read predefine CAS properties.

What' the best way to add properties to cas.properties and read this in my extensions classes ?

Thank's

--
You received this message because you are subscribed to the Google Groups "CAS Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-dev/.
Reply | Threaded
Open this post in threaded view
|

Re: Using CasConfigurationProperties and add my own properties to cas.properties

Dmitriy Kopylenko-3
You simply create your own “POJO” encapsulating custom properties and inject that bean into your custom components. No need to mess around with CAS’ CasConfigurationProperties class.

Here’s an an example of a couple of custom properties namespaced to ‘cas.*’, which then are freely used in standard ‘cas.properties’ property source: https://github.com/dima767/cas-events-telegram-bot/blob/master/cas/src/main/java/org/apereo/cas/support/events/publish/telegram/CasTelegramBotConfigurationProperties.java

D.




On Fri, Feb 23, 2018 at 3:55 AM -0500, "Julien Marchal" <[hidden email]> wrote:

Hi all,

I try to develop my own extension to modify CAS webflow and I want use my own properties in cas.properties.
I've made a WebflowConfiguration class and I want use CasConfigurationProperties class to read my properties.
But CasConfigurationProperties have only methods to read predefine CAS properties.

What' the best way to add properties to cas.properties and read this in my extensions classes ?

Thank's

--
You received this message because you are subscribed to the Google Groups "CAS Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-dev/.

--
You received this message because you are subscribed to the Google Groups "CAS Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-dev/.
Reply | Threaded
Open this post in threaded view
|

Re: Using CasConfigurationProperties and add my own properties to cas.properties

Peter Lajko
Hi,

Since this line was added to CasConfigurationProperties:
@ConfigurationProperties(value = "cas", ignoreUnknownFields = false)

It is not possible now to define your extension properties with "cas." prefix, because loading CasConfigurationProperties will fail with unknown field.

Regards,
Peter


On Fri, Feb 23, 2018 at 10:30 AM, Dmitriy Kopylenko <[hidden email]> wrote:
You simply create your own “POJO” encapsulating custom properties and inject that bean into your custom components. No need to mess around with CAS’ CasConfigurationProperties class.

Here’s an an example of a couple of custom properties namespaced to ‘cas.*’, which then are freely used in standard ‘cas.properties’ property source: https://github.com/dima767/cas-events-telegram-bot/blob/master/cas/src/main/java/org/apereo/cas/support/events/publish/telegram/CasTelegramBotConfigurationProperties.java

D.




On Fri, Feb 23, 2018 at 3:55 AM -0500, "Julien Marchal" <[hidden email]> wrote:

Hi all,

I try to develop my own extension to modify CAS webflow and I want use my own properties in cas.properties.
I've made a WebflowConfiguration class and I want use CasConfigurationProperties class to read my properties.
But CasConfigurationProperties have only methods to read predefine CAS properties.

What' the best way to add properties to cas.properties and read this in my extensions classes ?

Thank's

--
You received this message because you are subscribed to the Google Groups "CAS Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-dev/.

--
You received this message because you are subscribed to the Google Groups "CAS Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-dev/.



--
Péter Lajkó
JChem Web Services, Synergy
ChemAxon Ltd.
Building Hx, GraphiSoft Park
Záhony utca 7., Budapest, 1037 Hungary
http://www.chemaxon.com
Tel: <a href="tel:+36%201%20453%202658" value="+3614532658" style="color:rgb(17,85,204)" target="_blank">+361 4532658
Fax: <a href="tel:+36%201%20453%202659" value="+3614532659" style="color:rgb(17,85,204)" target="_blank">+361 4532659

[hidden email]

--
You received this message because you are subscribed to the Google Groups "CAS Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-dev/.
Reply | Threaded
Open this post in threaded view
|

Re: Using CasConfigurationProperties and add my own properties to cas.properties

Julien Marchal-2
In reply to this post by Dmitriy Kopylenko-3
Thanks you, it's work fine.

Le vendredi 23 février 2018 10:30:47 UTC+1, Dmitriy Kopylenko a écrit :
You simply create your own “POJO” encapsulating custom properties and inject that bean into your custom components. No need to mess around with CAS’ CasConfigurationProperties class.

Here’s an an example of a couple of custom properties namespaced to ‘cas.*’, which then are freely used in standard ‘cas.properties’ property source: <a href="https://github.com/dima767/cas-events-telegram-bot/blob/master/cas/src/main/java/org/apereo/cas/support/events/publish/telegram/CasTelegramBotConfigurationProperties.java" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdima767%2Fcas-events-telegram-bot%2Fblob%2Fmaster%2Fcas%2Fsrc%2Fmain%2Fjava%2Forg%2Fapereo%2Fcas%2Fsupport%2Fevents%2Fpublish%2Ftelegram%2FCasTelegramBotConfigurationProperties.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEZez2r3eIjtFGl3ZvRSjACsgQnnA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdima767%2Fcas-events-telegram-bot%2Fblob%2Fmaster%2Fcas%2Fsrc%2Fmain%2Fjava%2Forg%2Fapereo%2Fcas%2Fsupport%2Fevents%2Fpublish%2Ftelegram%2FCasTelegramBotConfigurationProperties.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEZez2r3eIjtFGl3ZvRSjACsgQnnA&#39;;return true;">https://github.com/dima767/cas-events-telegram-bot/blob/master/cas/src/main/java/org/apereo/cas/support/events/publish/telegram/CasTelegramBotConfigurationProperties.java

D.




On Fri, Feb 23, 2018 at 3:55 AM -0500, "Julien Marchal" <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Dz-P3OkqAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">julien.m...@...> wrote:

Hi all,

I try to develop my own extension to modify CAS webflow and I want use my own properties in cas.properties.
I've made a WebflowConfiguration class and I want use CasConfigurationProperties class to read my properties.
But CasConfigurationProperties have only methods to read predefine CAS properties.

What' the best way to add properties to cas.properties and read this in my extensions classes ?

Thank's

--
You received this message because you are subscribed to the Google Groups "CAS Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Dz-P3OkqAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">cas-dev+u...@....
Visit this group at <a href="https://groups.google.com/a/apereo.org/group/cas-dev/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/a/apereo.org/group/cas-dev/&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/a/apereo.org/group/cas-dev/&#39;;return true;">https://groups.google.com/a/apereo.org/group/cas-dev/.

--
You received this message because you are subscribed to the Google Groups "CAS Developer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-dev/.