Apps To Fusion

.......Our Journey from Apps To Fusion

 
  • Increase font size
  • Default font size
  • Decrease font size



Email PDF on Click of Button to the user for signature

E-mail
User Rating: / 0
PoorBest 

In this article you will learn how to implement a process whereby the information entered by a user in screen can be emailed via PDF to the same user for their electronic signature. For example, in some scenarios, a new employee needs to sign in a form electronically which specifies

 the company's policies, terms and conditions . After the employee is hired, then he/she logs into employee self service, and they select various options in a screen. Some of this information may be captured into custom table by embedding custom stack layout regions. After they click Submit button on the page, the business requirement is to email as a pdf attachment. Below is a sample code which gives a basic understanding on how to implement this scenario.


Below are the major steps which are involved in implementing the above functionality:

1) Create an XML publisher page with the required format which should be sent as a pdf attachment to the user.
2) Develop oaf page with the same format for the user to select and fill various options related to the policy.
3) Create a workflow to send the attachment to the user who submits the page.

 

 

Technically, we need to do as follows:

1)      Save the data in the page into Unix box as a pdf file.

2)      Save the pdf file into the blob column of a custom table

3)      Send the pdf along with the notification to the user who submits the page.

 

Step 1

a)      Create a custom table as follows:

CREATE  TABLE  XXX_NEWHIRE_INFO(
  PERSON_ID            NUMBER,
  SEQUENCE_ID          NUMBER, 
  OPTION_SELECT         VARCHAR2(1),
  DATE_SIGNED          DATE,
FILE_DATA            BLOB,
FILE_LOCATION        BFILE,
FILE_NAME            VARCHAR2(300),
FILE_DIR             VARCHAR2(100),
FILE_TYPE            VARCHAR2(30)                
)

b)      CREATE  SEQUENCE  XXX_SEQUENCE

INCREMENT BY 1

MINVALUE 1

START WITH 1

NOCACHE

c)       Create an xml publisher template as below. The template contains the option box to select either of the two options before submitting the page. The template is also attached with the article. Check the properties of the Option1 and Option2 fields on how to set the option box value when selected and when not selected.

 

d)      Register the template with template code as test_template

e)       Create oaf page with server and webui business components

f)        Create Application module and name it as "testAM"

g)       Create viewobject as "testVO" and the query inside the viewobject should be like below:

 

SELECT d.option_select, d.date_signed, papf.person_id, d.file_name

  FROM xxx_newhire_info d, per_people_x papf, FND_USER FUSER

 where 1 = 1

   AND FUSER.USER_ID = FND_GLOBAL.USER_ID

   AND FUSER.EMPLOYEE_ID = PAPF.PERSON_ID

   AND papf.person_id = d.person_id(+)

 

h)      Attach  VO to AM.

i)        Create a page and name it as testPG. Specify all the properties of the page. Create a controller for the page and name it as testCO.

j)        Create an oaf page layout similar to the template layout attached with 2 option buttons and a submit button. The names of the option buttons should be “option1” and “option2” and the name of the submit button should be “xxx_submit”.

k)      Check the attachments for the code involved in the processRequest and ProcessFormRequest of the testCO controller.

 

l)        The Java Code and the pl/sql code is required are in this URL

 

Comments (22)add
Thanks for the post
written by Shanti , July 14, 2010
Thank you for the post. i will get back to you with questions on this.

Regards
Shanti
report abuse
vote down
vote up
Votes: +0
Empty Blob
written by Soumya , July 15, 2010
Can you please explain why we need to create an empty blob? Saving the file into blob concept is really good. You can even email me on
report abuse
vote down
vote up
Votes: +0
...
written by pavan , July 16, 2010
It means that the LOB is initialized, but not populated with data. First we are initializing a LOB column and then populating with data.


report abuse
vote down
vote up
Votes: +0
Workflow notification is not working
written by Porwal , July 21, 2010
I am unable to see attachment in the workflow notification. I exactly followed whats specified in the docs.
report abuse
vote down
vote up
Votes: +0
error when trying to open the page
written by RUHU , July 22, 2010
I got this error, when trying to complete. All have followed the setups. I feel there is something that i might be missing on the when i created the Option1 and option2 checkbox....
Can you please let me know where i might have gone wrong....

Exception Details.

oracle.apps.fnd.framework.OAException: java.lang.ClassCastException
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:603)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)

report abuse
vote down
vote up
Votes: +0
...
written by pavan , July 23, 2010
Please explain where exactly the error is occuring. Does the error occur when you try to compile? The exception details you have sent is not complete. Try to send the entire exception you got in the page so that we can find out in which part of the code the error actually occured.

Thanks
Pavan
report abuse
vote down
vote up
Votes: +0
Getting this error
written by RUHU , July 23, 2010
usr mpxdoQmL87Idcgf072310_0523363930.fo (The system cannot find the path specified)
report abuse
vote down
vote up
Votes: +0
...
written by pavan , July 23, 2010
1) Have you checked to see if that file is being created? It is a temporary file but you should see the files being created.
2) Is the tmp directory setup properly in the config manager? please check this or check with DBA on this.
3) Make sure that you have proper permissions on that directory.
4) Make sure that there is enough space in that directory to save files.
report abuse
vote down
vote up
Votes: +0
...
written by RUHU , July 27, 2010
Currenlty, i dont see temporary being created.

checked the permissions on that directory..had 777
i aslo deleted all the files from the tmp directory just to check if it has anything to do with the space.


I Have sent an email to the DBA's, to check if tmp directory is setup correctly in the config manager.
report abuse
vote down
vote up
Votes: +0
...
written by pavan , July 27, 2010
directory should exist exactly the same on both webs & db/concurrent processing nodes. Please check with DBA.
report abuse
vote down
vote up
Votes: +0
....
written by RUHU , July 29, 2010
DBA's have said that they do dont use config manager, instead checked the APPLTMP file path in the .env file and said it is pointing to /usr/tmp/HRTEST0.

However i got this error, when trying to run this:
oracle.apps.fnd.framework.OAException: java.lang.NullPointerException
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:140smilies/cool.gif
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2679)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1682)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:50smilies/cool.gif
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
at _OA._jspService(OA.jsp:34)

report abuse
vote down
vote up
Votes: +0
...
written by RUHU , July 29, 2010
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
## Detail 0 ##
java.lang.NullPointerException
at com.oracle.apps.eglcust.pdfemail.webui.testCO.processFormRequest(testCO.java:137)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:810)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1159)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:98smilies/cool.gif
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:98smilies/cool.gif
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2675)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1682)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:50smilies/cool.gif
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
at _OA._jspService(OA.jsp:34)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)

report abuse
vote down
vote up
Votes: -1
...
written by RUHU , July 29, 2010
java.lang.NullPointerException
at com.oracle.apps.eglcust.pdfemail.webui.testCO.processFormRequest(testCO.java:137)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:810)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1159)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:98smilies/cool.gif
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1022)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:98smilies/cool.gif
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:843)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2675)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1682)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:50smilies/cool.gif
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:429)
at _OA._jspService(OA.jsp:34)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)

report abuse
vote down
vote up
Votes: +0
...
written by pavan , August 12, 2010
Did you check in the xml publisher template administration, Temporary directory path properties if the path is same as /usr/tmp/HRTEST0 ?

report abuse
vote down
vote up
Votes: +0
...
written by pushpal , August 21, 2010
thanks for the article...
report abuse
vote down
vote up
Votes: +1
Great tutorial
written by Deepesh Divakaran , October 13, 2010
It was a great tutorial Pavan. Kudos..! keep up.
report abuse
vote down
vote up
Votes: +1
MSCA/MWA framework start
written by shailendra_singh , October 23, 2010
hello ,i am new to MSCA/MWA framework ,can u tell me which editor and tools i should need.
and what updates are required..
report abuse
vote down
vote up
Votes: +2
Framework Start
written by pavan , October 24, 2010
For 11.5.10 version of Oracle Applications, you can download OAFramework Patch 4573517 from metalink and following the setups in the developer guide and start with the tutorial lessons. Check metalink for other versions.
report abuse
vote down
vote up
Votes: +0
How to find out Records
written by mmyswamy , March 02, 2011
Hi Anil,
how to find out duplicate records from the table?
Thanks,
MMYS
report abuse
vote down
vote up
Votes: +0
...
written by jang , March 06, 2011
Hi Anil,
i followed the process and conduction my own trial and error to pinpoint the issue and i am getting some error during the template helper part.
try
{
TemplateHelper.processTemplate(((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(), "XX_VMS", "test_template", ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(), ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(), inputStream, (byte)1, null, pdfFile);
File file = new File(s_filepathname);
FileOutputStream fos = new FileOutputStream(file);
BufferedOutputStream bos = null;
bos = new BufferedOutputStream(fos);
bos.write(pdfFile.toByteArray());
bos.close();
}
catch(Exception e)
{
response.setContentType("text/html");
throw new OAException(e.getMessage(), (byte)0);
}

and the error message i get

oracle.apps.fnd.framework.OAException: oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NoClassDefFoundError, msg=oracle/apps/fnd/cp/request/CpContext
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:867)
at _OAErrorPage._jspService(OAErrorPage.jsp:34)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:119)
at com.evermind.server.http.EvermindPageContext.handlePageThrowable(EvermindPageContext.java:547)
at com.evermind.server.http.EvermindPageContext.handlePageException(EvermindPageContext.java:51smilies/cool.gif
at _OA._jspService(OA.jsp:64)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)

if you can please figure out where i did wrong.

report abuse
vote down
vote up
Votes: +0
Office 2007
written by Office 2007 , December 06, 2011
I will keep your new article. I really enjoyed reading this post, thanks for sharing
report abuse
vote down
vote up
Votes: +0
Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security image
Write the displayed characters


busy
Last Updated ( Wednesday, 14 July 2010 05:57 )  

Search apps2fusion