I am using store PDF action in AEM adaptive form. As a logged in user I am able to submit successfully. But When I am trying to submit it as an anonymous user getting below error
com.adobe.aemds.guide.service.GuideStoreContentSubmission User does not have add_node permissions or its an anonymous user on /content/usergenerated/content/forms/af/something/something1/1483510140319_1
04.01.2017 11:39:00.326 *ERROR* [0:0:0:0:0:0:0:1 [1483510138542] POST /content/forms/af/somthing/somthing1/jcr:content/guideContainer.af.submit.jsp HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during response processing.
javax.jcr.RepositoryException: org.apache.sling.api.resource.PersistenceException: Resource at '/content/usergenerated/content/forms/af/something/something1/1483510140319_1' is not modifiable.
If anyone has idea about submitting AEM forms with store PDF action, please reply.
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
I do not think the out of the box action handles anonymous users . Suggest you write you own custom submit action . The sample code can be found on the demo listings URL that I sent you in the earlier responses
Views
Replies
Total Likes
Are you posting to an Author or Publish instance?
Views
Replies
Total Likes
I am submitting the form from publish instance. Actually the purpose of using store pdf action was to generate a PDF copy of submitted form. If I use Form portal action then I am not getting any problem in submitting the form from publish by an anonymous user. But can't generate PDF automatically by using this. Is there any other way achieve this?
Views
Replies
Total Likes
I have a sample which does what you are trying to do. Take a look at http://216.104.208.185. Login using your Facebook id and you should see the samples. One of the samples shows you the ability to store a PDF on AG submission
I have used custom code to do this. Generally to store anything on the publish instance you will have to make use of what is called " service user". Suggest you do some reading in this to get some background information
Views
Replies
Total Likes
thanks workflowuser for your reply. Actually I need to submit the form by an anonymous user not from a logged in user. It's throwing error while ecuting "guideStoreContentSubmission.submissionForStoreContentUsingServiceUser(authType, userSession,guideStartParameter,path);" in fd/af/components/guidesubmittype/store/post.POST.jsp for an anonymous user.
I am getting the same error for "store content" action(which is used in demo project you have shared) also if submitting the form by an anonymous user.
Views
Replies
Total Likes
Try the below link in any browser and submit the form
Views
Replies
Total Likes
yeah, working fine. But I still can't figure out why the same action is throwing an exception for me, when an anonymous user is trying to submit he form.
Views
Replies
Total Likes
I do not think the out of the box action handles anonymous users . Suggest you write you own custom submit action . The sample code can be found on the demo listings URL that I sent you in the earlier responses
Views
Replies
Total Likes
Even with custom submit action I am getting below error
javax.jcr.RepositoryException: org.apache.sling.api.resource.PersistenceException: Resource at '/content/usergenerated/content/forms/af/something/something1/1483510140319_1' is not modifiable.
I am just trying to store the submitted data under a node defined by author and calling " FormsHelper.runAction("/libs/fd/af/components/guidesubmittype/store", "post", resource, slingRequest, slingResponse) " in post.POST.jsp of my custom submit action.
Even the sample code given in above URL throwing same error while submitting the form in my local publish instance.
Have you given any additional permissions to anonymous user to store data
Views
Replies
Total Likes