Expand my Community achievements bar.

SOLVED

Submit data to Authoring instance

Avatar

Level 5

We have requirement to submit custom form (client is not using Forms) that resides on the public website but we're not allowed to store submitted data inside publishing JCR  but only directly to authoring instance, it's AEM on the cloud solution.

Is there any solution that will allow us to implement this ?

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

When user (anonymous) submits data, we're capturing that data in sling model on publishing, from there we could call and pass data to sling servlet running on authoring, when we have data on authoring we could store it to jcr, this should do the trick ?

 

This is problematic for a number of reasons:

* you need to store credentials on publish which they can use for authentication against the authoring instance. Brittle ...

* What do you do if a request from publish to author fails (for whatever reason)? As you are in a synchronous request/response model, any retry delays the response to your enduser. 

 

My feeling is that you are re-building functionality, which is already available in AEM Forms. Squeezing everything into the author/publish model you have right now is probably possible, but comes for the prize of additional work on your side (design/development/test + maintenance).

 

 

View solution in original post

9 Replies

Avatar

Level 5

You might want to consider using an External Data Store for this.  Possibly use a microservice to handle the transaction. 

Avatar

Level 5

Client requirement is to use JCR, they discarded option with external storage.

Avatar

Community Advisor

Hey @nbg62 , just a food for thought.. content fragment can be used  to store structured data and using AssetHttp API you can perform CRUD operation on stored CFs. 

So solution should like convert form data in CF and invoke microservice using AssetHTTP API on author server. 

 

 

Avatar

Employee Advisor

I don't think that there is a way to implement this without an external system. Assuming that the endusers (which submit that data) do not have credentials to access the author environment.

 

In that case they would need to submit their data to an external system which itself then connects to AEM author to store the data. Actually I would recommend you to use an external storage (as already suggested) or use AEM Forms. Because the effort to build and maintain such a solution is non-trivial.

 

Avatar

Level 5

Thanks Jörg,

 

When user (anonymous) submits data, we're capturing that data in sling model on publishing, from there we could call and pass data to sling servlet running on authoring, when we have data on authoring we could store it to jcr, this should do the trick ?

 

Regarding authentication from publishing to authoring, I guess we could generate a long-lived secret JWT from cloud console and use it to authenticate from publishing sling model to authoring servlet  

 

Is this approach worth considering ?

 

Avatar

Correct answer by
Employee Advisor

When user (anonymous) submits data, we're capturing that data in sling model on publishing, from there we could call and pass data to sling servlet running on authoring, when we have data on authoring we could store it to jcr, this should do the trick ?

 

This is problematic for a number of reasons:

* you need to store credentials on publish which they can use for authentication against the authoring instance. Brittle ...

* What do you do if a request from publish to author fails (for whatever reason)? As you are in a synchronous request/response model, any retry delays the response to your enduser. 

 

My feeling is that you are re-building functionality, which is already available in AEM Forms. Squeezing everything into the author/publish model you have right now is probably possible, but comes for the prize of additional work on your side (design/development/test + maintenance).

 

 

Avatar

Level 5

There are many better options as you previously mentioned, unfortunately our hands are tied and requirement is to keep everything on the cloud. We would like to use Forms but license is not available.