Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Component to save I.P. addressees in AEM that does not save the strings to a Database

Avatar

Level 6

Hi, I need to create a component to allow the web author to alter the I.P. of the connection string used in JDBC.

 

I want to create  a simple component to show which I.P.s are already captured, and allow the addition of a new I.P.

 

The real question is, which would be the best method to save the I.P. that the user enters, without having to save the info to a database outside of AEM?

Regards

 

Clive Stewart

1 Accepted Solution

Avatar

Correct answer by
Level 8

My first reaction is that using a component to do this is probably not the ideal solution. You could probably figure out how to hack a solution together but I am not sure that's really a good idea.

I assume we are talking about changing the IP address for a JDBC Connection Pool (com.day.commons.datasource.jdbcpool.JdbcPoolService). If so that is a OSGI Factory Service that allows multiple connection pools to be set up. 

The simplest solution to allow people to change the IP Address (specified in the  jdbc.connection.uri property) would be to created the needed connections as sling:OsgiConfig in the repository, and then allow people to change those nodes using CRXDE Lite. You could effectively lock down those authors access to only allow them to change those specific nodes and even that specific property using and ACL. That's not a particularly user friendly solution, but it would work. 

What you could do is write code in your component that would use JCR API to manipulate the sling:OsgiConfig nodes. This is still I think probably not the ideal approach, you'd be better off writing a custom Touch UI console to manage this if required. That would take the most effort, but be the most secure probably and user friendly. 

The final challenge is not only changing the IP Address in the current author instance, but also I assume activating that change to the publish servers. For that you'd need to write code that used the replication service to push the sling:OsgiConfig node out to the publish servers. 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 8

My first reaction is that using a component to do this is probably not the ideal solution. You could probably figure out how to hack a solution together but I am not sure that's really a good idea.

I assume we are talking about changing the IP address for a JDBC Connection Pool (com.day.commons.datasource.jdbcpool.JdbcPoolService). If so that is a OSGI Factory Service that allows multiple connection pools to be set up. 

The simplest solution to allow people to change the IP Address (specified in the  jdbc.connection.uri property) would be to created the needed connections as sling:OsgiConfig in the repository, and then allow people to change those nodes using CRXDE Lite. You could effectively lock down those authors access to only allow them to change those specific nodes and even that specific property using and ACL. That's not a particularly user friendly solution, but it would work. 

What you could do is write code in your component that would use JCR API to manipulate the sling:OsgiConfig nodes. This is still I think probably not the ideal approach, you'd be better off writing a custom Touch UI console to manage this if required. That would take the most effort, but be the most secure probably and user friendly. 

The final challenge is not only changing the IP Address in the current author instance, but also I assume activating that change to the publish servers. For that you'd need to write code that used the replication service to push the sling:OsgiConfig node out to the publish servers. 

Avatar

Level 6

Dear Orotas.

 

Thank you for your detailed response. Your answer has helped me understand the approach I need to take and in what direction to research