I was trying out tutorial Adobe Experience Manager Help | Persisting Adobe Experience Manager 6.4 JCR data using a Custom Form...
I was able to create the form and submit the data and obtain the same under the post.POST.jsp file but I think the java method addEmployeeData is not working since there are no new employee nodes being added. Is there any way to find whether the java call is working or not?
How can I know whether my instance is trying to add jcr nodes or not?
Is there any log service associated with this bundle and where it is stored. Is there any other way to test and execute the program?
If I want to change the Java code associated with the bundle how can I do that after the bundle is deployed in the server without using maven?
I would urgently require a quick debug for this issue and my java code is exactly same as per the tutorial. I would really appreciate if somebody can help me out with this. Thanks in advance.
Actually now I have given the user permission to every node in JCR and it is now working! Thanks a lot for saving my time! Meanwhile I think there are no issues with the jsp file. Also I would suggest to update the article with two things:
Give permission for all the contents of jcr to the created user.
2. Actually it doesn't seem to work when we use the FormContainer that was created as part of the article, since there is no Advanced options available. I suggest using the default Form components in the form container. I have used them inorder to compensate the missing advanced tab in the container. Attaching my screenshot here for community reference.
So my suggestion is to use all the default form components instead of using the created form components.
Thanks a lot smacdonald2008 You are awesome!
<%@include file="/libs/fd/af/components/guidesglobal.jsp" %>
String formName = request.getParameter("formName");
String formPosition = request.getParameter("formPosition");
String formOffice = request.getParameter("formOffice");
String formAge = request.getParameter("formAge");
String formDate = request.getParameter("formDate");
String formSalary = request.getParameter("formSal");
com.adobe.persist.core.EmployeeInter data = sling.getService(com.adobe.persist.core.EmployeeInter.class);
data.addEmployeeData(formOffice, formAge,formPosition, formName, formSalary, formDate);
Actually it is same as in the tutorial!
Thanks for your support.
OSGI Bundle is in active state and Sling mapping was done with the system user created. What are the possible ways to check whether the function call through jsp was successful or returned any errors?
So far my execution seems fine but no new nodes are added to the repository.
Also kindly help me to find a solution.
YOu can also create a custom log file that is based on Java packages. See this article for more details - Scott's Digital Community: Creating a custom log file for an Adobe Experience Manager project
So you can make a custom log for this project by following the above article. Replace the JAVA packages in this article with the Java packages in your Java program.
THis works - as you can see the video at the end of the article. To see if your Java is being invoked - first make sure that the OSGi bundle is in active state.
Also - did you create a system user and perform the SLING MAPPING as discussed in the article? If not - this example will not work.
Also - to change the Java logic - you need to change the code in ECLIPSE and then re-compile the bundle using MAVEN. There is simply no other way to recompile a bundle without using MAVEN (even the Eclipse DEV TOOL uses Maven) .