Passing values from external application to Forms

Avatar

Avatar
Give Back
Level 1
barithaya
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
View profile

Avatar
Give Back
Level 1
barithaya
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
View profile
barithaya
Level 1

27-08-2018

Hi,

We have a mobile app and there is a need to integrate adaptive form within the app.

For this integration, session handover happens from the mobile app to the adaptive form created as below :

https://<host>/content/forms/af/mobileservice.html

this html we need to call from our mobile app and we will call the url and in post method will passon the customer number for single signon.

classification=K_EDGE|0&ip=1.1.1.1&msg=1111222|C123E7C37A52DC98CD56347CF9E2D794|2066884979|MCHMEFNISH&channel=mobile

data marked in bold is customer details that we pass on for integration, which has the customer details.

GET & POST method are the only options  available to integrate with any third party applications.

If we use GET method then the site is working fine.

But when we use the POST method to call the url, we are getting error as below:

25.04.2018 13:45:07.702 *ERROR* [42.106.236.63 [1524644107699] POST /content/forms/af/mobileservice.html HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during response processing.

javax.jcr.nodetype.ConstraintViolationException: No matching property definition: classification = K_EDGE|0

  at org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate.setProperty(NodeDelegate.java:522)

  at org.apache.jackrabbit.oak.jcr.session.NodeImpl$35.perform(NodeImpl.java:1375)

  at org.apache.jackrabbit.oak.jcr.session.NodeImpl$35.perform(NodeImpl.java:1363)

  at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:208)

  at org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(ItemImpl.java:112)

  at org.apache.jackrabbit.oak.jcr.session.NodeImpl.internalSetProperty(NodeImpl.java:1363)

Please help or let me know in case of additional details required.

Replies

Avatar

Avatar
Boost 5
Level 3
lesutton1
Level 3

Likes

9 likes

Total Posts

47 posts

Correct reply

14 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 5
View profile

Avatar
Boost 5
Level 3
lesutton1
Level 3

Likes

9 likes

Total Posts

47 posts

Correct reply

14 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 5
View profile
lesutton1
Level 3

27-08-2018

If you are trying to create a pre-fill service, you can use the standard 'dataRef' in your URL. You can also read the URL by looking at the request to retrieve any parameters passed in.

public InputStream getDataXMLForDataRef(DataXMLOptions dataXMLOptions) throws FormsException {

  String ref = dataXMLOptions.getDataRef();

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

28-08-2018

Checked with the team. The response was:

Post method is not supported by default for Form render. Customer has to add post.jsp via customization.

  One strategy they could use is to post to a custom end point within AEM that do internal forward (via get call) to form.

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

28-08-2018

The use case is not very clear, can you share more details on how you are passing the Data and have you written your own servlet?

Avatar

Avatar
Validate 1
Level 6
Jared_Langdon
Level 6

Likes

19 likes

Total Posts

305 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 6
Jared_Langdon
Level 6

Likes

19 likes

Total Posts

305 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
Jared_Langdon
Level 6

31-08-2018

Lee.  How do you "read the URL by looking at the request to retrieve any parameters passed in" from the getDataXMLForDataRef method of the custom pre-fill service?

Avatar

Avatar
Give Back
Level 1
barithaya
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
View profile

Avatar
Give Back
Level 1
barithaya
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 1
View profile
barithaya
Level 1

10-09-2018

We implemented this by creating a custom servlet and passing the data in POST method to the servlet and then internally calling the adaptive form.

Thanks

Avatar

Avatar
Validate 1
Level 6
Jared_Langdon
Level 6

Likes

19 likes

Total Posts

305 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 6
Jared_Langdon
Level 6

Likes

19 likes

Total Posts

305 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
Jared_Langdon
Level 6

10-09-2018

Can you explain what you mean by "calling the adaptive form"?  Can you provide some lines of Java from your servlet that corresponds to "calling" the form?  Thanks.