Search In This Blog

Wednesday, February 24, 2010

My Favourite Links

OA Framework
===============
http://oracle.anilpassi.com/oa-framework.html
http://oracle.anilpassi.com/xmlimporter-in-oracle-applications-framework.html
http://apps2fusion.com/at/61-kv/317-oa-framework-page-without-login-guest-no-security
http://www.orafaq.com/wiki/JDeveloper
http://oracle.anilpassi.com/jdr-utils.html
http://oracle.anilpassi.com/oa-framework-tutorials-training.html
http://www.dulcian.com/papers/MAOP-AOTC/2002/Don'tBeAMuggle.htm
http://www.dulcian.com/papers/OracleOpenWorld/2002/What%20You%20Need%20to%20Know%20Before%20Building%20Applications%20with%20JDeveloper%209i.htm
http://apps2fusion.com/apps/oa-framework/14-fwk/151-oa-framework-screen-extension-by-embedding-a-custom-page
http://oracle.anilpassi.com/oa-framework-tutorial-01-2.html
http://oracle.anilpassi.com/oa-framework-table-based-screen-2.html
http://www.dbforums.com/oracle/1630066-jdeveloper-resolving-errors-encountered.html
http://appstechnical.blogspot.com/2007/01/oa-framework-tutorials.html
http://oraclearea51.com/oracle-technical-articles/oa-framework/oa-framework-beginners-guide/322-exporting-oa-page-definitions.html
http://oraclearea51.com/oracle-technical-articles/oa-framework/oa-framework-beginners-guide.html
http://www.oracle.com/technology/products/jdev/tips/muench/designpatterns/index.html
http://www.oracle.com/technology/pub/articles/vohra-jdev-xmlpub.html
http://mukx.blogspot.com/2010/01/upload-file-to-application-server-using.html
http://blog.cholaconsulting.com/search/label/OA%20Framework
http://sabersurge.com/oracleappsdev/index.php?option=com_content&view=article&id=54%3Afile-upload-to-database-server-oa-framework&catid=34%3Aoa-framework&Itemid=1
http://www.tier1inc.com/blog_comments.php?pid=12-----Comparing OA Framework with Forms 6i
http://oracle-applications-rama.blogspot.com/2009/01/how-to-search-apps-documents-in-google.html


Oracle Forms Web
Upload, edit and download files from/to the database with the
Webutil library
================================
http://sheikyerbouti.developpez.com/webutil-docs/Webutil_store_edit_docs.htm


Check Java Version
===============
http://java.com/en/download/installed.jsp?jre_version=1.6.0_07&vendor=Sun+Microsystems+Inc.&os=Windows+2000&os_version=5.0

Linux Commands
===============
http://www.ss64.com/bash/
http://teachmeoracle.com/unixa.html
http://www.nixblog.org/post/2008/03/14/UNIX-ID-ORACLE-SESSION
http://www.unix.com/shell-programming-scripting/84635-unix-script-detect-new-file-entry-directory.html

Register Shell Scripts As Concurrent Program
===================================
http://www.notesbit.com/index.php/scripts-oracle/oracle-applications-steps-to-register-shell-script-as-a-concurrent-program/

UTL_FILE_DIR
======================
http://oracleappstechnology.blogspot.com/2008/03/minimize-usage-of-utlfiledir.html

Oracle Applications
===============
http://becomeappsdba.blogspot.com/
http://www.ddbcinc.com/askDDBC/
http://beginapps.blogspot.com/2007_09_01_archive.html
http://knoworacle.wordpress.com/tag/apps-table/
http://appsdba4u.blogspot.com/2007/08/oracle-apps-dba-interview-questions.html
http://cnubandi.blogspot.com/
http://idbasolutions.com/category/papers/3480000-115102/3480000-final-run/
http://becomeappsdba.blogspot.com/2006/08/startup-shutdown-apps-services.html
http://oracleappss.blogspot.com/2008/07/supplier-additional-information.html
http://erp-consultancy.blogspot.com/2008/03/tds-flow-in-accounts-payable-oracle.html
http://etrm.oracle.com/license/MustLogin.html
http://oracle-magic.blogspot.com/2007/06/concurrent-request-and-its-database-sid.html
http://oracle-applications-rama.blogspot.com/
http://www.oracleappshub.com/11i/purchase-order-approval-hierarchy/
http://confluentminds.com/Trainings/SCM/Topic1.1_Ch1_Part4.html
http://forums.oracle.com/forums/thread.jspa?threadID=457983
http://download.oracle.com/docs/cd/A60725_05/html/comnls/us/alr/multins.htm
http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/
http://www.aboutoracleapps.com/2007/07/oracle-purchasing-po-faq.html
http://forums.oracle.com/forums/thread.jspa?threadID=664806&tstart=0
http://oracle.anilpassi.com/technical-interview-questions-in-oracle-apps.html
http://www.oracleappshub.com/accounts-receivable/ar-back-to-basictechnical-foundation/
http://www.oracleappshub.com/aol/setting-default-to-excel-for-exported-file-from-file-export/
http://asoracle.blogspot.com/2007/11/key-tables-financials.html
http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/switch-responsibility-icon-on-toolbar-283079
http://oracle.anilpassi.com/forms-personalizations.html
http://www.erpschools.com/Oracle_Apps_Form_Customization.asp
http://www.erpschools.com/
http://realworldoracleapps.blogspot.com/search/label/Welcome%20Note
http://oracleappsrealworld.blogspot.com/
http://mastanreddy.blogspot.com/
http://www.scribd.com/doc/3256741/Oracle-Applications-Developers-Guide
http://garethroberts.blogspot.com/2007/10/excel-file-output-from-oracle.html
http://garethroberts.blogspot.com/2008/01/changing-default-layout-format-from-pdf.html
http://erpcrmapps.blogspot.com/2008/01/using-keyboard-shortcuts.html
http://www.hrmsaces.co.uk/ubbthreads.php/forums/8/1
http://bbs.erp100.com/archiver/tid-36506.html
http://edelivery.oracle.com/EPD/WelcomePage/get_form?ARU_LANG=US
http://oraclepitstop.wordpress.com/2007/04/18/versions-of-components-in-oracle-apps/
http://www.aboutoracleapps.com/2007/08/oracle-general-ledger.html
http://oracle.anilpassi.com/oracle-payroll-tables.html
http://confluentminds.com/Trainings/SCM/Topic2.3_Ch2_Part2.html
http://aksenthil.blogspot.com/
http://knoworacle.wordpress.com/category/oracle-applications-technical/oracle-fixed-assets-technical/
https://metalink.oracle.com/
http://solutionbeacon.blogspot.com/2007/07/simple-tutorial-for-publishing-fsg.html
http://sbllc3.solutionbeacon.net/pls/a159vis2/fndgfm/fnd_help.get/US@PSA_US/fnd/@e_cp
http://apps2fusion.com/apps/oracle-hrms/oracle-hr/hrms
http://oracle.anilpassi.com/creating-customer-address-in-tca-step-by-step.html
http://www.aboutoracleapps.com/2007/07/oracle-apps-manufacturingaolforms.html
http://forums.oracle.com/forums/thread.jspa?threadID=590547
(All In one Blog) http://www.sap-img.com/oracle-database/oracle-application-hints-and-tips.htm
http://www.dba-oracle.com/art_dbazine_conc_mgr.htm
http://dineshnair.wordpress.com/
http://oracle.anilpassi.com/basic-concepts-list-of-useful-oracle-apps-articles-2.html
http://chandramatta.blogspot.com/search/label/Concurrent%20Programs------Very Useful Blog for all Topics

Interfaces
===========
(AR Customer Interface Info.)
http://sbllc3.solutionbeacon.net/pls/a159vis2/fndgfm/fnd_help.get/US@PSA_US/ar/@n_tbl_val@PSA_US
http://download-west.oracle.com/docs/cd/A60725_05/html/comnls/us/ar/cusimprt.htm#n_cust_import
http://download.oracle.com/docs/cd/A60725_05/html/comnls/us/ar/autoin05.htm#n_autoval
http://www.erpschools.com/apps/oracle-applications/Articles/General/Interfaces-and-Conversions-in-Oracle-Applications/index.aspx
(Payables)
http://sbllc3.solutionbeacon.net/pls/a159vis2/fndgfm/fnd_help.get/US@PSA_US/AP/@r_openaud@PSA_US
http://irep11i10.oracle.com/OA_HTML/OA.jsp?page=/oracle/apps/fnd/rep/webui/OpenInterfaceDetailsPG&CategoryValue=F&_ti=199580375&retainAM=Y&addBreadCrumb=Y&oapc=7&oas=biKg9_cvMvUQM4gNQIA6ug..
( Customer Interface Error Code Meaning )
http://sbllc3.solutionbeacon.net/pls/a159vis2/fndgfm/fnd_help.get/US@PSA_US/ar/@custerrs@PSA_US



FND LOAD
===========
http://oracle.anilpassi.com/fndload-for-oracle-web-adi.html

R12 Vision Instance Login
=======================
http://vis1200.solutionbeacon.net/OA_HTML/RF.jsp?function_id=1032924&resp_id=-1&resp_appl_id=-1&security_group_id=0&lang_code=US¶ms=gEzpj7eR1-rfQLgP8Ol8DQ3u3xBOeCmcdxx.JgrY94g&oas=-Q6TtBxoQEySwZJoZFr0Fw..

General
==============
http://www.httpsurf.com/
http://www.webindia123.com/history/index.html
http://download.oracle.com/docs/cd/A57673_01/DOC/api/doc/PC_22/ch02.htm
http://www.wapuser.co.cc/2009/12/how-to-hack-others-yahoo-password.html
http://www.osun.org/
http://oracle-applications-rama.blogspot.com/2009/01/how-to-search-apps-documents-in-google.html

Oracle Apps Data Structure
=======================
http://www.scribd.com/doc/404946/Oracle-Apps-Data-Structure

Oracle Apps Scripts
=================
http://www.erpschools.com/Oracle_Apps_Scripts.asp
http://www.erpschools.com/
http://scripts4oracle.blogspot.com/

Metalink Notes
===============
http://teachmeoracle.com/metalink.html
http://www.oracle.com/technology/tech/globalization/index.html

Orcale DB Concepts
===============
http://www.adp-gmbh.ch/ora/concepts/

Autoconfig
===============
http://becomeappsdba.blogspot.com/2006/10/autoconfig-in-apps-template-files.html
http://onlineappsdba.com/index.php/2008/01/28/autoconfig-in-oracle-apps-11i-r12-12i/

TroubleShooting Concurrent Managers
================
http://becomeappsdba.blogspot.com/2006/10/troubleshooting-concurrent-managers.html

NLS Language Parameters
===================
http://it.toolbox.com/wiki/index.php/ORA-12700#NLS_Parameters
http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq.htm#_Toc110410543

Trace Concurrent Request and Generate TKPROF
=======================
http://knoworacle.wordpress.com/2008/06/27/tkprof-trace-a-program/

How to find Processes running in Sunsolaris Operating System
=================================================
http://www.unix.com/sun-solaris/25208-how-find-number-processes.html

Character Set
===================
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14225/ch11charsetmig.htm
http://download.oracle.com/docs/cd/B10500_01/server.920/a96529/ch2.htm#745
http://download.oracle.com/docs/cd/B28359_01/server.111/b28298/applocaledata.htm#i634428
http://www.oracledba.co.uk/tips/character_set.htm

ASCII Characters
===================
http://www.alcyone.com/max/reference/compsci/ascii.html
http://www.oracle.com/technology/obe/obe9ir2/obe-nls/localbld/localbld.htm

Oracle SMS Getway Guide
=====================
http://www3.ozekisms.com/index.php?ow_page_number=166

Hindustan Times Corporate News
======================
http://www.hindustantimes.com/ListingPage/ListingPage.aspx?Category=Chunk-HT-UI-BusinessSectionPage-Corporate&SectionName=BusinessSectionPage&BC=CorporateNews

MS Word Mail Merge Tutorial
=======================
http://personal-computer-tutor.com/mailmerge.htm
http://www.frontpage2002.com/frontpage_2003_tutorial_guide.htm

How to start perticular Concurrent Manager
============================
http://teachmeoracle.com/forum/viewtopic.php?t=4320

Company Profile & Overview
==========================
http://info.shine.com/company/Infosys-Technologies-Ltd/102.aspx

Letter Generation using WEB-ADI
=============================
http://apps2fusion.com/at/38-ss/351-generate-recruitment-letters-web-adi

Oracle HRMS Fast Farmula Tutorial
=============================
http://www.aboutoracleapps.com/2008/11/oracle-hrms-fast-formula-tutorial.html
http://oracle.anilpassi.com/index.php?Itemid=4&id=117&option=com_content&show=1&task=view
http://www.erpschools.com/Apps/oracle-applications/articles/hrms/fast-formulas-in-hrms/index.aspx
http://www.aboutoracleapps.com/2009/01/how-to-generate-develop-or-edit.html

Oracle Workflow
========
http://oracleappstechnology.blogspot.com/2008/02/workflow-mails-not-moving-after-fresh.html
http://forums.oracle.com/forums/thread.jspa?messageID=2327979
http://apps2fusion.com/at/gt/tc/328-workflow-mailer-debugging-script-for-debugging-emails-issues
http://onlineappsdba.com/index.php/2008/07/16/oracle-workflow-notification-mailer-outbound-processing/
http://oracleebusinesssuite.wordpress.com/2008/10/18/debugging-the-approval-workflow-for-purchase-order-or-purchase-requisition/
http://oracle.anilpassi.com/workflows-business-events-training-lesson-4.html
http://oracleappstechnology.blogspot.com/2008/05/disable-retention-on-workflow-queues.html
http://www.freelists.org/post/ora-apps-dba/EXPIRED-messages-in-the-WF-NOTIFICATION-OUT-queue-THE-SOLUTION
https://csslxa03.hkcss.org.hk:16298/OA_HTML/oam/helpdoc/oam_wfoam_notificationmailerg.htm
http://arunrathod.blogspot.com/2008/08/workflow-wfload-through-unix.html
http://oracle.anilpassi.com/apps-technology/2.html
http://www.erpschools.com/Oracle_Applications_Workflow_Launching.asp
http://www.erpschools.com/Oracle_Applications_Workflow_Tutorial.asp
http://oracleebusinesssuite.wordpress.com/2008/10/18/debugging-the-approval-workflow-for-purchase-order-or-purchase-requisition/

AME
======
http://greenoracleapps.blogspot.com/

Make Packages Valid
====================
http://idbasolutions.com/3480000-115102-first-run/

DB Upgrade Context File Creation
=========================
http://forums.oracle.com/forums/thread.jspa?threadID=672921&tstart=0&messageID=2612978

Oracle PL/SQL SMS
===========================
http://forums.oracle.com/forums/thread.jspa?messageID=1827704
http://www.dbasupport.com/forums/archive/index.php/t-24763.html
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:839412906735
http://www.erpschools.com/Apps/oracle-applications/Interview-Questions/Tools/PL-SQL/default.aspx

Oracle Apps DBA
============================
http://www.teachmeoracle.com/imptables.html
http://www.dba-oracle.com/art_tr_dyn_sga.htm
http://download.oracle.com/docs/cd/A60725_05/html/comnls/us/alr/multins.htm
http://blogs.oracle.com/gverma/2007/11/accrue_economically_dont_recal.html
http://becomeappsdba.blogspot.com/2007/01/change-oracle-apps-password-fndcpass.html
http://oracleappstechnology.blogspot.com/2007/07/query-to-find-out-your-atgpfh-rollup.html
http://onlineappsdba.blogspot.com/2008/06/personalizing-login-page.html
http://www.oracleutilities.com/
http://www.shutdownabort.com/
http://www.dbatoolz.com/sql-scripts
http://krackoracle.blogspot.com/2009_02_01_archive.html

Insert BOB Object (Image) in Database and Display In Report 6i
===============================================
http://sureshvaishya.blogspot.com/2009/08/insert-blob-image-file-into-database.html
http://oracleappsexperience.blogspot.com/

Tunning Oracle Reports
==========================
http://download.oracle.com/docs/cd/B10464_05/bi.904/b13673/pbr_tune.htm#i1007365

FSG Reports
=======================
http://www.oracleappshub.com/finance/fsg-what-is-it/

XML / BI Publisher
======================
http://www.oracleappshub.com/xml-publisher/migration-of-xmlpub-templates-and-data-definitions-across-instances/#more-1084
http://blogs.oracle.com/xmlpublisher/2007/05/howto_java_concurrent_programs.html
http://blogs.oracle.com/xmlpublisher/templates/templates_rtf/
http://asun.ifmo.ru/docs/XMLP/help/en_US/htmfiles/B25951_01/T421739T421827.htm

Tuesday, February 9, 2010

Delete Records from Table (OA Page )

Step 1 :

Create method in application module as

public void deleteitemMethod(String pAction,String pEntityCode)
{

/*System.out.println("xxDebug Inside deleteItemMethod());*/
XxTest01ViewImpl pervo=getXxTest01View1();
System.out.println(pEntityCode);
Row row []=pervo.getAllRowsInRange();
for (int i=0;i {
XxTest01ViewRowImpl rowi=(XxTest01ViewRowImpl)row[i];

if (rowi.getEntityCode().toString().equals(pEntityCode))
{
rowi.remove();
getDBTransaction().commit();
return;

}
}
}

2) Call this method in your controller class's process form request as

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
String actionInMainPage = pageContext.getParameter(EVENT_PARAM);
String paramEntityCode = pageContext.getParameter("paramEntityCode");
if (actionInMainPage.equals("deleteitem"))
{
Serializable paramdelete []={actionInMainPage,paramEntityCode};
OAApplicationModule am =pageContext.getApplicationModule(webBean);
am.invokeMethod("deleteitemMethod",paramdelete);

}
}

Download File From Application Server (OA Framework)

Download file from Application Server

1) Only Page and controller is different in download file, rest all is same as upload example given earlier.

2) Create one OA page in oracle.apps.download.webui.

3) SET form property to TRUE of main region , Create one region with region style

Message component layout., set AM Defination.

4) create one submit button in main region.

Set properties as below :
Action type =fireAction
Event=download
Prompt=submit

5) create one controller class in oracle.apps.download.webui.

import all below packages :

import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.cabo.ui.data.DataObject;
import java.io.FileOutputStream;
import java.io.InputStream;
import oracle.jbo.domain.BlobDomain;
import java.io.File;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletOutputStream;
import javax.servlet.*;
import oracle.apps.fnd.framework.OAException;
import java.io.*;

6) create two methods in controller class as below :-

public void downloadFileFromServer(OAPageContext pageContext,
String file_name_with_path,
String file_name_with_ext)
{
HttpServletResponse response =
(HttpServletResponse) pageContext.getRenderingContext().getServletResponse();
if (((file_name_with_path == null) ||
("".equals(file_name_with_path))))
{
throw new OAException("File path is invalid.");
}

File fileToDownload = null;
try
{
fileToDownload = new File(file_name_with_path);
}
catch (Exception e)
{
throw new OAException("Invalid File Path or file does not exist.");
}

if (!fileToDownload.exists())
{
throw new OAException("File does not exist.");
}

if (!fileToDownload.canRead())
{
throw new OAException("Not Able to read the file.");
}

String fileType = getMimeType(file_name_with_ext);
response.setContentType(fileType);
response.setContentLength((int)fileToDownload.length());
response.setHeader("Content-Disposition", "attachment; filename=\"" + file_name_with_ext + "\"");

InputStream in = null;
ServletOutputStream outs = null;

try
{
outs = response.getOutputStream();
in = new BufferedInputStream(new FileInputStream(fileToDownload));
int ch;
while ((ch = in.read()) != -1)
{
outs.write(ch);
}

}
catch (IOException e)
{
// TODO
e.printStackTrace();
}
finally
{
try
{
outs.flush();
outs.close();
if (in != null)
{
in.close();
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

7) Create another method as below :

public String getMimeType(String s)
{
int i = s.lastIndexOf(".");
if (i > 0 && i < s.length() - 1)
{
String s1 = s.substring(i + 1);
if (s1.equalsIgnoreCase("amr"))
{
return "audio/amr";
}
if (s1.equalsIgnoreCase("mid"))
{
return "audio/midi";
}
if (s1.equalsIgnoreCase("mmf"))
{
return "application/vnd.smaf";
}
if (s1.equalsIgnoreCase("qcp"))
{
return "audio/vnd.qcelp";
}
if (s1.equalsIgnoreCase("hqx"))
{
return "application/mac-binhex40";
}
if (s1.equalsIgnoreCase("cpt"))
{
return "application/mac-compactpro";
}
if (s1.equalsIgnoreCase("doc"))
{
return "application/msword";
}
if (s1.equalsIgnoreCase("jsp"))
{
return "application/jsp";
}
if (s1.equalsIgnoreCase("oda"))
{
return "application/oda";
}
if (s1.equalsIgnoreCase("pdf"))
{
return "application/pdf";
}
if (s1.equalsIgnoreCase("ai"))
{
return "application/postscript";
}
if (s1.equalsIgnoreCase("eps"))
{
return "application/postscript";
}
if (s1.equalsIgnoreCase("ps"))
{
return "application/postscript";
}
if (s1.equalsIgnoreCase("ppt"))
{
return "application/powerpoint";
}
if (s1.equalsIgnoreCase("rtf"))
{
return "application/rtf";
}
if (s1.equalsIgnoreCase("bcpio"))
{
return "application/x-bcpio";
}
if (s1.equalsIgnoreCase("vcd"))
{
return "application/x-cdlink";
}
if (s1.equalsIgnoreCase("Z"))
{
return "application/x-compress";
}
if (s1.equalsIgnoreCase("cpio"))
{
return "application/x-cpio";
}
if (s1.equalsIgnoreCase("csh"))
{
return "application/x-csh";
}
if (s1.equalsIgnoreCase("dcr"))
{
return "application/x-director";
}
if (s1.equalsIgnoreCase("dir"))
{
return "application/x-director";
}
if (s1.equalsIgnoreCase("dxr"))
{
return "application/x-director";
}
if (s1.equalsIgnoreCase("dvi"))
{
return "application/x-dvi";
}
if (s1.equalsIgnoreCase("gtar"))
{
return "application/x-gtar";
}
if (s1.equalsIgnoreCase("gz"))
{
return "application/x-gzip";
}
if (s1.equalsIgnoreCase("hdf"))
{
return "application/x-hdf";
}
if (s1.equalsIgnoreCase("cgi"))
{
return "application/x-httpd-cgi";
}
if (s1.equalsIgnoreCase("jnlp"))
{
return "application/x-java-jnlp-file";
}
if (s1.equalsIgnoreCase("skp"))
{
return "application/x-koan";
}
if (s1.equalsIgnoreCase("skd"))
{
return "application/x-koan";
}
if (s1.equalsIgnoreCase("skt"))
{
return "application/x-koan";
}
if (s1.equalsIgnoreCase("skm"))
{
return "application/x-koan";
}
if (s1.equalsIgnoreCase("latex"))
{
return "application/x-latex";
}
if (s1.equalsIgnoreCase("mif"))
{
return "application/x-mif";
}
if (s1.equalsIgnoreCase("nc"))
{
return "application/x-netcdf";
}
if (s1.equalsIgnoreCase("cdf"))
{
return "application/x-netcdf";
}
if (s1.equalsIgnoreCase("sh"))
{
return "application/x-sh";
}
if (s1.equalsIgnoreCase("shar"))
{
return "application/x-shar";
}
if (s1.equalsIgnoreCase("sit"))
{
return "application/x-stuffit";
}
if (s1.equalsIgnoreCase("sv4cpio"))
{
return "application/x-sv4cpio";
}
if (s1.equalsIgnoreCase("sv4crc"))
{
return "application/x-sv4crc";
}
if (s1.equalsIgnoreCase("tar"))
{
return "application/x-tar";
}
if (s1.equalsIgnoreCase("tcl"))
{
return "application/x-tcl";
}
if (s1.equalsIgnoreCase("tex"))
{
return "application/x-tex";
}
if (s1.equalsIgnoreCase("textinfo"))
{
return "application/x-texinfo";
}
if (s1.equalsIgnoreCase("texi"))
{
return "application/x-texinfo";
}
if (s1.equalsIgnoreCase("t"))
{
return "application/x-troff";
}
if (s1.equalsIgnoreCase("tr"))
{
return "application/x-troff";
}
if (s1.equalsIgnoreCase("roff"))
{
return "application/x-troff";
}
if (s1.equalsIgnoreCase("man"))
{
return "application/x-troff-man";
}
if (s1.equalsIgnoreCase("me"))
{
return "application/x-troff-me";
}
if (s1.equalsIgnoreCase("ms"))
{
return "application/x-troff-ms";
}
if (s1.equalsIgnoreCase("ustar"))
{
return "application/x-ustar";
}
if (s1.equalsIgnoreCase("src"))
{
return "application/x-wais-source";
}
if (s1.equalsIgnoreCase("xml"))
{
return "text/xml";
}
if (s1.equalsIgnoreCase("ent"))
{
return "text/xml";
}
if (s1.equalsIgnoreCase("cat"))
{
return "text/xml";
}
if (s1.equalsIgnoreCase("sty"))
{
return "text/xml";
}
if (s1.equalsIgnoreCase("dtd"))
{
return "text/dtd";
}
if (s1.equalsIgnoreCase("xsl"))
{
return "text/xsl";
}
if (s1.equalsIgnoreCase("zip"))
{
return "application/zip";
}
if (s1.equalsIgnoreCase("au"))
{
return "audio/basic";
}
if (s1.equalsIgnoreCase("snd"))
{
return "audio/basic";
}
if (s1.equalsIgnoreCase("mpga"))
{
return "audio/mpeg";
}
if (s1.equalsIgnoreCase("mp2"))
{
return "audio/mpeg";
}
if (s1.equalsIgnoreCase("mp3"))
{
return "audio/mpeg";
}
if (s1.equalsIgnoreCase("aif"))
{
return "audio/x-aiff";
}
if (s1.equalsIgnoreCase("aiff"))
{
return "audio/x-aiff";
}
if (s1.equalsIgnoreCase("aifc"))
{
return "audio/x-aiff";
}
if (s1.equalsIgnoreCase("ram"))
{
return "audio/x-pn-realaudio";
}
if (s1.equalsIgnoreCase("rpm"))
{
return "audio/x-pn-realaudio-plugin";
}
if (s1.equalsIgnoreCase("ra"))
{
return "audio/x-realaudio";
}
if (s1.equalsIgnoreCase("wav"))
{
return "audio/x-wav";
}
if (s1.equalsIgnoreCase("pdb"))
{
return "chemical/x-pdb";
}
if (s1.equalsIgnoreCase("xyz"))
{
return "chemical/x-pdb";
}
if (s1.equalsIgnoreCase("gif"))
{
return "image/gif";
}
if (s1.equalsIgnoreCase("ief"))
{
return "image/ief";
}
if (s1.equalsIgnoreCase("jpeg"))
{
return "image/jpeg";
}
if (s1.equalsIgnoreCase("jpg"))
{
return "image/jpeg";
}
if (s1.equalsIgnoreCase("jpe"))
{
return "image/jpeg";
}
if (s1.equalsIgnoreCase("png"))
{
return "image/png";
}
if (s1.equalsIgnoreCase("tiff"))
{
return "image/tiff";
}
if (s1.equalsIgnoreCase("tif"))
{
return "image/tiff";
}
if (s1.equalsIgnoreCase("ras"))
{
return "image/x-cmu-raster";
}
if (s1.equalsIgnoreCase("pnm"))
{
return "image/x-portable-anymap";
}
if (s1.equalsIgnoreCase("pbm"))
{
return "image/x-portable-bitmap";
}
if (s1.equalsIgnoreCase("pgm"))
{
return "image/x-portable-graymap";
}
if (s1.equalsIgnoreCase("ppm"))
{
return "image/x-portable-pixmap";
}
if (s1.equalsIgnoreCase("rgb"))
{
return "image/x-rgb";
}
if (s1.equalsIgnoreCase("xbm"))
{
return "image/x-xbitmap";
}
if (s1.equalsIgnoreCase("xpm"))
{
return "image/x-xpixmap";
}
if (s1.equalsIgnoreCase("xwd"))
{
return "image/x-xwindowdump";
}
if (s1.equalsIgnoreCase("html"))
{
return "text/html";
}
if (s1.equalsIgnoreCase("htm"))
{
return "text/html";
}
if (s1.equalsIgnoreCase("txt"))
{
return "text/plain";
}
if (s1.equalsIgnoreCase("rtx"))
{
return "text/richtext";
}
if (s1.equalsIgnoreCase("tsv"))
{
return "text/tab-separated-values";
}
if (s1.equalsIgnoreCase("etx"))
{
return "text/x-setext";
}
if (s1.equalsIgnoreCase("sgml"))
{
return "text/x-sgml";
}
if (s1.equalsIgnoreCase("sgm"))
{
return "text/x-sgml";
}
if (s1.equalsIgnoreCase("mpeg"))
{
return "video/mpeg";
}
if (s1.equalsIgnoreCase("mpg"))
{
return "video/mpeg";
}
if (s1.equalsIgnoreCase("mpe"))
{
return "video/mpeg";
}
if (s1.equalsIgnoreCase("qt"))
{
return "video/quicktime";
}
if (s1.equalsIgnoreCase("mov"))
{
return "video/quicktime";
}
if (s1.equalsIgnoreCase("avi"))
{
return "video/x-msvideo";
}
if (s1.equalsIgnoreCase("movie"))
{
return "video/x-sgi-movie";
}
if (s1.equalsIgnoreCase("ice"))
{
return "x-conference/x-cooltalk";
}
if (s1.equalsIgnoreCase("wrl"))
{
return "x-world/x-vrml";
}
if (s1.equalsIgnoreCase("vrml"))
{
return "x-world/x-vrml";
}
if (s1.equalsIgnoreCase("wml"))
{
return "text/vnd.wap.wml";
}
if (s1.equalsIgnoreCase("wmlc"))
{
return "application/vnd.wap.wmlc";
}
if (s1.equalsIgnoreCase("wmls"))
{
return "text/vnd.wap.wmlscript";
}
if (s1.equalsIgnoreCase("wmlsc"))
{
return "application/vnd.wap.wmlscriptc";
}
if (s1.equalsIgnoreCase("wbmp"))
{
return "image/vnd.wap.wbmp";
}
if (s1.equalsIgnoreCase("css"))
{
return "text/css";
}
if (s1.equalsIgnoreCase("jad"))
{
return "text/vnd.sun.j2me.app-descriptor";
}
if (s1.equalsIgnoreCase("jar"))
{
return "application/java-archive";
}
if (s1.equalsIgnoreCase("3gp"))
{
return "video/3gp";
}
if (s1.equalsIgnoreCase("3g2"))
{
return "video/3gpp2";
}
if (s1.equalsIgnoreCase("mp4"))
{
return "video/3gpp";
}
}
return "application/octet-stream";
}

8) in process form request of the controller class call this method to download

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);

//on button click in process form request
//call this method
downloadFileFromServer(pageContext,"/cmupload/OWF_Clt_2635_WINNT.zip","/cmupload/OWF_Clt_2635_WINNT.zip");
}

9) Your controller class look like

package oracle.apps.ak.download.webui.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.cabo.ui.data.DataObject;
import java.io.FileOutputStream;
import java.io.InputStream;
import oracle.jbo.domain.BlobDomain;
import java.io.File;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletOutputStream;
import javax.servlet.*;
import oracle.apps.fnd.framework.OAException;
import java.io.*;


/**
* Controller for ...
*/
public class MyCO extends OAControllerImpl
{
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

/**
* Layout and page setup logic for a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
}

/**
* @param pageContext the current OA page context
* @param file_name_with_path - this is fully qualified file name with its path on unix application
* server. eg "/xxcrp/xxapplcrp/mukul/abc.pdf"
* @param file_name_with_ext - this is file name with extension, you wanna display user
* for download. eg- i wanna display the abc.pdf file download with name five_point_someone.pdf
* then I can pass this as "five_point_someone.pdf"
*/
public void downloadFileFromServer(OAPageContext pageContext,
String file_name_with_path,
String file_name_with_ext)
{
HttpServletResponse response =
(HttpServletResponse) pageContext.getRenderingContext().getServletResponse();
if (((file_name_with_path == null) ||
("".equals(file_name_with_path))))
{
throw new OAException("File path is invalid.");
}

File fileToDownload = null;
try
{
fileToDownload = new File(file_name_with_path);
}
catch (Exception e)
{
throw new OAException("Invalid File Path or file does not exist.");
}

if (!fileToDownload.exists())
{
throw new OAException("File does not exist.");
}

if (!fileToDownload.canRead())
{
throw new OAException("Not Able to read the file.");
}

String fileType = getMimeType(file_name_with_ext);
response.setContentType(fileType);
response.setContentLength((int)fileToDownload.length());
response.setHeader("Content-Disposition", "attachment; filename=\"" + file_name_with_ext + "\"");

InputStream in = null;
ServletOutputStream outs = null;

try
{
outs = response.getOutputStream();
in = new BufferedInputStream(new FileInputStream(fileToDownload));
int ch;
while ((ch = in.read()) != -1)
{
outs.write(ch);
}

}
catch (IOException e)
{
// TODO
e.printStackTrace();
}
finally
{
try
{
outs.flush();
outs.close();
if (in != null)
{
in.close();
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
}


/**
* @param s
* @return file mime type from its name
*/
public String getMimeType(String s)
{
int i = s.lastIndexOf(".");
if (i > 0 && i < s.length() - 1)
{
String s1 = s.substring(i + 1);
if (s1.equalsIgnoreCase("amr"))
{
return "audio/amr";
}
if (s1.equalsIgnoreCase("mid"))
{
return "audio/midi";
}
if (s1.equalsIgnoreCase("mmf"))
{
return "application/vnd.smaf";
}
if (s1.equalsIgnoreCase("qcp"))
{
return "audio/vnd.qcelp";
}
if (s1.equalsIgnoreCase("hqx"))
{
return "application/mac-binhex40";
}
if (s1.equalsIgnoreCase("cpt"))
{
return "application/mac-compactpro";
}
if (s1.equalsIgnoreCase("doc"))
{
return "application/msword";
}
if (s1.equalsIgnoreCase("jsp"))
{
return "application/jsp";
}
if (s1.equalsIgnoreCase("oda"))
{
return "application/oda";
}
if (s1.equalsIgnoreCase("pdf"))
{
return "application/pdf";
}
if (s1.equalsIgnoreCase("ai"))
{
return "application/postscript";
}
if (s1.equalsIgnoreCase("eps"))
{
return "application/postscript";
}
if (s1.equalsIgnoreCase("ps"))
{
return "application/postscript";
}
if (s1.equalsIgnoreCase("ppt"))
{
return "application/powerpoint";
}
if (s1.equalsIgnoreCase("rtf"))
{
return "application/rtf";
}
if (s1.equalsIgnoreCase("bcpio"))
{
return "application/x-bcpio";
}
if (s1.equalsIgnoreCase("vcd"))
{
return "application/x-cdlink";
}
if (s1.equalsIgnoreCase("Z"))
{
return "application/x-compress";
}
if (s1.equalsIgnoreCase("cpio"))
{
return "application/x-cpio";
}
if (s1.equalsIgnoreCase("csh"))
{
return "application/x-csh";
}
if (s1.equalsIgnoreCase("dcr"))
{
return "application/x-director";
}
if (s1.equalsIgnoreCase("dir"))
{
return "application/x-director";
}
if (s1.equalsIgnoreCase("dxr"))
{
return "application/x-director";
}
if (s1.equalsIgnoreCase("dvi"))
{
return "application/x-dvi";
}
if (s1.equalsIgnoreCase("gtar"))
{
return "application/x-gtar";
}
if (s1.equalsIgnoreCase("gz"))
{
return "application/x-gzip";
}
if (s1.equalsIgnoreCase("hdf"))
{
return "application/x-hdf";
}
if (s1.equalsIgnoreCase("cgi"))
{
return "application/x-httpd-cgi";
}
if (s1.equalsIgnoreCase("jnlp"))
{
return "application/x-java-jnlp-file";
}
if (s1.equalsIgnoreCase("skp"))
{
return "application/x-koan";
}
if (s1.equalsIgnoreCase("skd"))
{
return "application/x-koan";
}
if (s1.equalsIgnoreCase("skt"))
{
return "application/x-koan";
}
if (s1.equalsIgnoreCase("skm"))
{
return "application/x-koan";
}
if (s1.equalsIgnoreCase("latex"))
{
return "application/x-latex";
}
if (s1.equalsIgnoreCase("mif"))
{
return "application/x-mif";
}
if (s1.equalsIgnoreCase("nc"))
{
return "application/x-netcdf";
}
if (s1.equalsIgnoreCase("cdf"))
{
return "application/x-netcdf";
}
if (s1.equalsIgnoreCase("sh"))
{
return "application/x-sh";
}
if (s1.equalsIgnoreCase("shar"))
{
return "application/x-shar";
}
if (s1.equalsIgnoreCase("sit"))
{
return "application/x-stuffit";
}
if (s1.equalsIgnoreCase("sv4cpio"))
{
return "application/x-sv4cpio";
}
if (s1.equalsIgnoreCase("sv4crc"))
{
return "application/x-sv4crc";
}
if (s1.equalsIgnoreCase("tar"))
{
return "application/x-tar";
}
if (s1.equalsIgnoreCase("tcl"))
{
return "application/x-tcl";
}
if (s1.equalsIgnoreCase("tex"))
{
return "application/x-tex";
}
if (s1.equalsIgnoreCase("textinfo"))
{
return "application/x-texinfo";
}
if (s1.equalsIgnoreCase("texi"))
{
return "application/x-texinfo";
}
if (s1.equalsIgnoreCase("t"))
{
return "application/x-troff";
}
if (s1.equalsIgnoreCase("tr"))
{
return "application/x-troff";
}
if (s1.equalsIgnoreCase("roff"))
{
return "application/x-troff";
}
if (s1.equalsIgnoreCase("man"))
{
return "application/x-troff-man";
}
if (s1.equalsIgnoreCase("me"))
{
return "application/x-troff-me";
}
if (s1.equalsIgnoreCase("ms"))
{
return "application/x-troff-ms";
}
if (s1.equalsIgnoreCase("ustar"))
{
return "application/x-ustar";
}
if (s1.equalsIgnoreCase("src"))
{
return "application/x-wais-source";
}
if (s1.equalsIgnoreCase("xml"))
{
return "text/xml";
}
if (s1.equalsIgnoreCase("ent"))
{
return "text/xml";
}
if (s1.equalsIgnoreCase("cat"))
{
return "text/xml";
}
if (s1.equalsIgnoreCase("sty"))
{
return "text/xml";
}
if (s1.equalsIgnoreCase("dtd"))
{
return "text/dtd";
}
if (s1.equalsIgnoreCase("xsl"))
{
return "text/xsl";
}
if (s1.equalsIgnoreCase("zip"))
{
return "application/zip";
}
if (s1.equalsIgnoreCase("au"))
{
return "audio/basic";
}
if (s1.equalsIgnoreCase("snd"))
{
return "audio/basic";
}
if (s1.equalsIgnoreCase("mpga"))
{
return "audio/mpeg";
}
if (s1.equalsIgnoreCase("mp2"))
{
return "audio/mpeg";
}
if (s1.equalsIgnoreCase("mp3"))
{
return "audio/mpeg";
}
if (s1.equalsIgnoreCase("aif"))
{
return "audio/x-aiff";
}
if (s1.equalsIgnoreCase("aiff"))
{
return "audio/x-aiff";
}
if (s1.equalsIgnoreCase("aifc"))
{
return "audio/x-aiff";
}
if (s1.equalsIgnoreCase("ram"))
{
return "audio/x-pn-realaudio";
}
if (s1.equalsIgnoreCase("rpm"))
{
return "audio/x-pn-realaudio-plugin";
}
if (s1.equalsIgnoreCase("ra"))
{
return "audio/x-realaudio";
}
if (s1.equalsIgnoreCase("wav"))
{
return "audio/x-wav";
}
if (s1.equalsIgnoreCase("pdb"))
{
return "chemical/x-pdb";
}
if (s1.equalsIgnoreCase("xyz"))
{
return "chemical/x-pdb";
}
if (s1.equalsIgnoreCase("gif"))
{
return "image/gif";
}
if (s1.equalsIgnoreCase("ief"))
{
return "image/ief";
}
if (s1.equalsIgnoreCase("jpeg"))
{
return "image/jpeg";
}
if (s1.equalsIgnoreCase("jpg"))
{
return "image/jpeg";
}
if (s1.equalsIgnoreCase("jpe"))
{
return "image/jpeg";
}
if (s1.equalsIgnoreCase("png"))
{
return "image/png";
}
if (s1.equalsIgnoreCase("tiff"))
{
return "image/tiff";
}
if (s1.equalsIgnoreCase("tif"))
{
return "image/tiff";
}
if (s1.equalsIgnoreCase("ras"))
{
return "image/x-cmu-raster";
}
if (s1.equalsIgnoreCase("pnm"))
{
return "image/x-portable-anymap";
}
if (s1.equalsIgnoreCase("pbm"))
{
return "image/x-portable-bitmap";
}
if (s1.equalsIgnoreCase("pgm"))
{
return "image/x-portable-graymap";
}
if (s1.equalsIgnoreCase("ppm"))
{
return "image/x-portable-pixmap";
}
if (s1.equalsIgnoreCase("rgb"))
{
return "image/x-rgb";
}
if (s1.equalsIgnoreCase("xbm"))
{
return "image/x-xbitmap";
}
if (s1.equalsIgnoreCase("xpm"))
{
return "image/x-xpixmap";
}
if (s1.equalsIgnoreCase("xwd"))
{
return "image/x-xwindowdump";
}
if (s1.equalsIgnoreCase("html"))
{
return "text/html";
}
if (s1.equalsIgnoreCase("htm"))
{
return "text/html";
}
if (s1.equalsIgnoreCase("txt"))
{
return "text/plain";
}
if (s1.equalsIgnoreCase("rtx"))
{
return "text/richtext";
}
if (s1.equalsIgnoreCase("tsv"))
{
return "text/tab-separated-values";
}
if (s1.equalsIgnoreCase("etx"))
{
return "text/x-setext";
}
if (s1.equalsIgnoreCase("sgml"))
{
return "text/x-sgml";
}
if (s1.equalsIgnoreCase("sgm"))
{
return "text/x-sgml";
}
if (s1.equalsIgnoreCase("mpeg"))
{
return "video/mpeg";
}
if (s1.equalsIgnoreCase("mpg"))
{
return "video/mpeg";
}
if (s1.equalsIgnoreCase("mpe"))
{
return "video/mpeg";
}
if (s1.equalsIgnoreCase("qt"))
{
return "video/quicktime";
}
if (s1.equalsIgnoreCase("mov"))
{
return "video/quicktime";
}
if (s1.equalsIgnoreCase("avi"))
{
return "video/x-msvideo";
}
if (s1.equalsIgnoreCase("movie"))
{
return "video/x-sgi-movie";
}
if (s1.equalsIgnoreCase("ice"))
{
return "x-conference/x-cooltalk";
}
if (s1.equalsIgnoreCase("wrl"))
{
return "x-world/x-vrml";
}
if (s1.equalsIgnoreCase("vrml"))
{
return "x-world/x-vrml";
}
if (s1.equalsIgnoreCase("wml"))
{
return "text/vnd.wap.wml";
}
if (s1.equalsIgnoreCase("wmlc"))
{
return "application/vnd.wap.wmlc";
}
if (s1.equalsIgnoreCase("wmls"))
{
return "text/vnd.wap.wmlscript";
}
if (s1.equalsIgnoreCase("wmlsc"))
{
return "application/vnd.wap.wmlscriptc";
}
if (s1.equalsIgnoreCase("wbmp"))
{
return "image/vnd.wap.wbmp";
}
if (s1.equalsIgnoreCase("css"))
{
return "text/css";
}
if (s1.equalsIgnoreCase("jad"))
{
return "text/vnd.sun.j2me.app-descriptor";
}
if (s1.equalsIgnoreCase("jar"))
{
return "application/java-archive";
}
if (s1.equalsIgnoreCase("3gp"))
{
return "video/3gp";
}
if (s1.equalsIgnoreCase("3g2"))
{
return "video/3gpp2";
}
if (s1.equalsIgnoreCase("mp4"))
{
return "video/3gpp";
}
}
return "application/octet-stream";
}


/**
* Procedure to handle form submissions for form elements in
* a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);

//on button click in process form request
//call this method
downloadFileFromServer(pageContext,"/cmupload/OWF_Clt_2635_WINNT.zip","/cmupload/OWF_Clt_2635_WINNT.zip");
}

}

10) Rebuild the .jpr and run the page. Happy Coding…

Upload Files on UNIX Application Server (OA Framework)





1) Create Project in jdeveloper.
2) Create two business components as
oracle.apps.ak.upload.server and
oracle.apps.ak.upload.webui without any entity,view or application module.
3) in oracle.apps.ak.upload.server create entity object with dual table.
4) create view and application module for the same.
5) in oracle.apps.ak.upload.webui
create one OA page.
6) Also set the form property to TRUE of main region of the type pageLayout.
7) Create one region with messageComponenet Layout
Set AM Defination property.
8) Create one item of type=>messageFileUpload in the messageComponenet Layout region.
9) set prompt,additional text properties of item.
10) create one submit button under the main region.set prompt,additional text,action type=>fire action,event=>uploadFileToServer.
11) under oracle.apps.ak.upload.webui create one controller class.
import following packages in the class.

import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.cabo.ui.data.DataObject;
import java.io.FileOutputStream;
import java.io.InputStream;
import oracle.jbo.domain.BlobDomain;
import java.io.File;


12 ) create one method as below in controller class :

public void fileupload(OAPageContext pageContext, String fileuploadBeanId,String server_dir_path)
{
System.out.println("kamlesh");
DataObject fileUploadData = (DataObject) pageContext.getNamedDataObject(fileuploadBeanId);
if(fileUploadData!=null)
{
String uFileName =(String) fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
String contentType = (String) fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");

File file = new File(server_dir_path, uFileName);
FileOutputStream output = null;
InputStream input = null;

try
{
output = new FileOutputStream(file);
BlobDomain uploadedByteStream =
(BlobDomain) fileUploadData.selectValue(null, uFileName);
input = uploadedByteStream.getInputStream();
for (int bytes = 0; bytes < uploadedByteStream.getLength(); bytes++)
{
output.write(input.read());
}
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
if (input != null)
{
input.close();
}
if (output != null)
{
output.close();
output.flush();
}
}
catch (Exception ez)
{
ez.printStackTrace();
}
}

}
}


13) In process form request write as below


public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
--- your coding as below in PFR process form request-----
fileupload(pageContext,"item1","/cmload");
}

14) Rebuild your .jpr and run the page.


15) If giving error or warning paste below in Impl.java file of Entity.

public void setCreatedBy(Number number)
{
}

public void setCreationDate(Date date)
{
}

public void setLastUpdatedBy(Number number)
{
}

public void setLastUpdateDate(Date date)
{
}

public void setLastUpdateLogin(Number number)
{
}


Controller Class will be like :-

package oracle.apps.ak.upload.webui.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.cabo.ui.data.DataObject;
import java.io.FileOutputStream;
import java.io.InputStream;
import oracle.jbo.domain.BlobDomain;
import java.io.File;













/**
* Controller for ...
*/
public class MyCO extends OAControllerImpl
{
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

/**
* Layout and page setup logic for a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
}



public void fileupload(OAPageContext pageContext, String fileuploadBeanId,String server_dir_path)
{
System.out.println("kamlesh");
DataObject fileUploadData = (DataObject) pageContext.getNamedDataObject(fileuploadBeanId);
if(fileUploadData!=null)
{
String uFileName =(String) fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
String contentType = (String) fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");

File file = new File(server_dir_path, uFileName);
FileOutputStream output = null;
InputStream input = null;

try
{
output = new FileOutputStream(file);
BlobDomain uploadedByteStream =
(BlobDomain) fileUploadData.selectValue(null, uFileName);
input = uploadedByteStream.getInputStream();
for (int bytes = 0; bytes < uploadedByteStream.getLength(); bytes++)
{
output.write(input.read());
}
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
if (input != null)
{
input.close();
}
if (output != null)
{
output.close();
output.flush();
}
}
catch (Exception ez)
{
ez.printStackTrace();
}
}

}
}


/**
* Procedure to handle form submissions for form elements in
* a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
fileupload(pageContext,"item1","/cmload");
fileupload(pageContext,"item3","/cmload");
fileupload(pageContext,"item4","/cmload");
fileupload(pageContext,"item5","/cmload");
fileupload(pageContext,"item6","/cmload");
fileupload(pageContext,"item7","/cmload");
fileupload(pageContext,"item8","/cmload");
fileupload(pageContext,"item9","/cmload");
fileupload(pageContext,"item10","/cmload");
fileupload(pageContext,"item11","/cmload");
fileupload(pageContext,"item12","/cmload");
fileupload(pageContext,"item13","/cmload");

}

}


Kindly note that if your requirement is uploading files on Database server instead of Application Server then you have to create one NFS MOUNT POINT for that in Unix server. While testing this page you can give here the path of your local machine unless it won’t work because here the path given is the server path.

Wednesday, December 30, 2009

User Creation - From Personalization To Avoid Special Characters.

Open User Creation Form , Querry any one of the existing Username.Then Go to
Help => Digonostics => Custom Code => Personalize


Create one function as below :
=========================

seq: 1
description : Avoid Specila Characters in USERNAME.

Create Condition :
=============

Trigger Event :WHEN-NEW-ITEM-INSTANCE
Trigger Object :USER.USER_PASSWORD
Condition :
:USER.USER_NAME like ('%#%') or
:USER.USER_NAME like ('%@%') or
:USER.USER_NAME like ('%!%') or
:USER.USER_NAME like ('%$%') or
:USER.USER_NAME like ('%^%') or
:USER.USER_NAME like ('%&%') or
:USER.USER_NAME like ('%%%') or
:USER.USER_NAME like ('%*%') and ${item.user.user_password.navigable.current}='TRUE'

Processing Mode : Both.







Now Create Actions For the True Condition :
======================================
seq : 1
Type : Builtin
Language : All
Built Type : GO_ITEM
Argument : USER.USER_NAME

seq: 2
Type :Message
Language : All
Message Type : Error
Message Text : Username Should not Contain Special Characters like !,@,#,$,%,^,&,*.




Save.
Open New User Creation Form and try to create user with special characters.
It Throws Error : Username Should not Contain Special Characters like !,@,#,$,%,^,&,*.
when cursor is navigated to password field after entering the username.

Thanks ,
Kamlesh Nikhade
Email : Kamlesh3659@gmail.com

Friday, December 25, 2009

AP Invoice Technical Details with Functional Inputs

When Invoice Booked and Saved
=============================
One row created in ap_invoices_all and its distribution lines created in ap_invoice_distributions_all

When Invoice Validated :
======================
ap_invoice_distributions_all.MATCH_STATUS_FLAG='A'
ap_invoice_distributions_all.ACCOUNTING_EVENT_ID=NOT NULL(Here 1370092)
one row created in ap_accounting_events_all with accounting_event_id=ap_invoice_distributions_all.ACCOUNTING_EVENT_ID ap_accounting_events_all.EVENT_STATUS_CODE='CREATED' ap_accounting_events_all.SOURCE_TABLE='AP_INVOICES'
ap_accounting_events_all.SOURCE_ID=ap_invoice_distributions_all.INVOICE_ID=
AP_INVOICE_ALL.INVOICE_ID

When Invoice Accounted :
=====================
ap_invoice_distributions_all.ACCRUAL_POSTED_FLAG='Y'
ap_invoice_distributions_all.POSTED_FLAG='Y' ap_accounting_events_all.EVENT_STATUS_CODE='ACCOUNTED'
ONE ROW CREATED IN AP_AE_HEADERS_ALL where AP_AE_HEADERS_ALL. accounting_event_id=ap_accounting_events_all.accounting_event_id Rows created in ap_ae_lines_all
where AP_AE_HEADERS_ALL.ae_header_id=ap_ae_lines_all.ae_header_id as
below The number of rows generally created in ap_ae_lines_all counted as 1)
one row for invoice with ap_ae_lines_all.AE_LINE_TYPE_CODE='LIABILITY'
ap_ae_lines_all.SOURCE_TABLE='AP_INVOICES' ,ap_ae_lines_all.source_id=ap_invoices_all.invoice_id2)
Other rows are created for the invoice distribution lines (one line per invoice distribution line).ap_ae_lines_all.AE_LINE_TYPE_CODE='CHARGE',
SOURCE_TABLE='AP_INVOICE_DISTRIBUTIONS',
ap_ae_lines_all.SOURCE_ID=AP_INVOICE_DISTRIBUTIONS.INVOICE_ID

When Invoice Approved :
========================
ap_invoices_all.WFAPPROVAL_STATUS='MANUALLY APPROVED', initially it was 'REQUIRED'

When Payment Created
=====================
when payment created the one record created in ap_checks_all table.

When Payment Accounted
=============================
When payment document accounted then one row is created in ap_accounting_events_all table.
AP_invoice_payments_all.ACCOUNTING_EVENT_ID=
ap_accounting_events_all.ACCOUNTING_EVENT_ID
ap_accounting_events_all.EVENT_STATUS_CODE='ACCOUNTED'. andap_accounting_events_all.source_id=AP_INVOICE_PAYMENTS_ALL.check_id.

After Doing the Payment (paid) of invoice with Created Payment Document
=============================================================
ap_invoices_all.payment_status_flag='Y' BEFORE 'N'It creates the linKing between ap_invoices_all and ap_checks_all by AP_INVOICE_PAYMENTS_ALL.one row created in AP_INVOICE_PAYMENTS_ALL with reference of invoice id.
AP_INVOICE_PAYMENTS_ALL.ACCRUAL_POSTED_FLAG='Y'
AP_INVOICE_PAYMENTS_ALL.CASH_POSTED_FLAG='Y'
AP_INVOICE_PAYMENTS_ALL.POSTED_FLAG='Y'and when get void the AP_INVOICE_PAYMENTS_ALL.REVERSAL_FLAG='Y' unless it is 'N'
When payment got accounted the one row created in ap_accounting_events_all with ap_accounting_events_all.source_id=AP_INVOICE_PAYMENTS_ALL.check_id and AP_INVOICE_PAYMENTS_ALL.source_table='AP_CHECKS'

After Clearing Check from cash management
=====================================
open payment document and create accounting for it, showing partial now.
after successfull accounting of the document:
one line is created in AP_PAYMENT_HISTORY_all with new accounting _event_id.
AP_PAYMENT_HISTORY_all.accounting_event_id=
ap_accounting_events_all.accounting_event_idone new line created in ap_accounting_events_all with EVENT_TYPE_CODE='PAYMENT CLEARING'and AP_INVOICE_PAYMENTS_ALL.source_table='AP_CHECKS'
ap_accounting_events_all.source_id=AP_INVOICE_PAYMENTS_ALL.check_id andAP_PAYMENT_HISTORY_all.accounting_event_id=
ap_accounting_events_all.accounting_event_id
one row created in AP_AE_HEADERS_ALL with new accounting_event_id and two rows in this case created in ap_ae_lines_all with AE_LINE_TYPE_CODE='CASH CLEARING ' AND 'CASH',SOURCE_TABLE='AP_CHECKS'.

When Posted in GL (GL_POSTING)
===============================
after running the request "Payables Transfer to General Ledger".The ap_ae_lines_all.GL_SL_LINK_ID populates.AP_AE_HEADERS_ALL.GL_TRANSFER_FLAG='Y'AP_AE_HEADERS_ALL.
GL_TRANSFER_RUN_ID IS NOT NULL AP_AE_HEADERS_ALL.TRIAL_BALANCE_FLAG='Y'

Wednesday, December 16, 2009

Interview Questions Reports 6i

What are the various types of reports ?
* Tabular, Master Detail, Form, Form Letter, Mailing Labels, Matrix

2. What is the difference between Master - Detail Report and report created by breaks ?
* Master/detail data models are very similar to break report data models. However, a master/detail data model is created using two queries, each of which owns at least one group, and a data link. A break report data model is created using one query and at least two groups. While reports based on a single query are usually more efficient than reports based on multiple queries, sometimes the structure of your data tables may require you to link multiple tables.

3. What are Anchors ?
* An anchor defines the relative position of an object to the object to which it is anchored. Anchors are used to determine the vertical and horizontal positioning of a child object relative to its parent. Since the size of some layout objects may change when the report runs (and data is actually fetched), you need anchors to define where you want objects to appear relative to one another.

4. What are the various types of anchors in Reports ?
A There are two types of anchors in Oracle Reports:
* implicit (anchors that Oracle Reports creates when a report is run)
* explicit (anchors you create)

Implicit Anchors : At runtime, Oracle Reports generates an implicit anchor for each layout object that does not already have an explicit anchor. It determines for each layout object which objects, if any, can overwrite it, then creates an anchor from the layout object to the closest object that can overwrite it. This prevents the object from being overwritten. The implicit anchor functionality saves you from having to define the positioning of each object. Implicit anchors are not visible in the Layout editor. However, you can specify that the Object Navigator display anchoring information using the Object Navigator Options dialog.

Explicit Anchors : Create an anchor in the Layout editor by clicking on the Anchor tool, dragging from one edge of the child to the one of the parent's edges, then specifying the anchor's properties in its property sheet. Any anchor you create for an object will override its implicit anchoring. Explicit anchors are always visible in the Layout editor unless you specify otherwise via the Layout Options dialog

9. What are the various report triggers ? What is their order of firing ?
A There are eight report triggers. Of these there are five global triggers called the Report Triggers. They are fired in the following order :
* Before Parameter Form
* After Parameter Form
* Before Report
* Between Pages
* After Report

Apart from the above Five Report Triggers, there are three other types of triggers :
* Validation Triggers
* Format Triggers
* Action Triggers

Before Form : Fires before the Runtime Parameter Form is displayed. From this trigger, you can access and change the values of parameters, PL/SQL global variables, and report-level columns. (Note : If the Runtime Parameter Form is suppressed, this trigger still fires. Consequently, you can use this trigger for validation of command line parameters).

After Form : Fires after the Runtime Parameter Form is displayed. From this trigger, you can access parameters and check their values. This trigger can also be used to change parameter values or, if an error occurs, return to the Runtime Parameter Form. Columns from the data model are not accessible from this trigger. (Note : If the Runtime Parameter Form is suppressed, the After Form trigger still fires. Consequently, you can use this trigger for validation of command line parameters or other data).

Before Report : Fires before the report is executed but after queries are parsed and data is fetched.

Between Pages : Fires before each page of the report is formatted, except the very first page. This trigger can be used for customized page formatting. (Note : In the Previewer, this trigger only fires the first time that you go to a page. If you subsequently return to the page, the trigger does not fire again.)

After Report : Fires after you exit the Previewer, or after report output is sent to a specified destination, such as a file, a printer, or an Oracle*Mail userid. This trigger can be used to clean up any initial processing that was done, such as deleting tables. Note, however, that this trigger always fires, whether or not your report completed successfully.

Validation Triggers : Validation Triggers are PL/SQL functions that are executed when parameter values are specified on the command line and when you accept the Runtime Parameter Form. (Notice that this means each Validation Trigger may fire twice when you execute the report). Validation Triggers are also used to validate the Initial Value of the parameter in the Parameter property sheet.

Format Triggers : Format Triggers are PL/SQL functions executed before the object is formatted. The trigger can be used to dynamically change the formatting attributes of the object.

Action Triggers : Action Triggers are PL/SQL procedures executed when a button is selected in the Previewer. The trigger can be used to dynamically call another report (drill down) or execute any other PL/SQL.

19. What are Placeholder Columns ?
A A placeholder is a "dummy" column for which you can conditionally set the datatype and value via PL/SQL or a user exit. Placeholder columns are useful when you want to selectively populate a column with a value (e.g., each time the nth record is fetched, or each time a record is fetched containing a specific value, etc.).

20. What are the various Module Types in Reports ?
A You can build three types of modules with Oracle Reports:
* external queries, which are ANSI-standard SQL SELECT statements that can be referenced by modules
* external PL/SQL libraries, which are collections of PL/SQL source code that can be referenced by modules
* reports, which are collections of report-level objects and references to external queries and PL/SQL libraries (optional) that can be referenced by modules

22. What are Physical and Logical pages in Reports ?
A A report page can have any length and any width. Because printer pages may be smaller or larger than your report's "page," the concept of physical and logical pages is used.

Physical Page : A physical page (or panel) is the size of a page that will be output by your printer.

Logical Page : A logical page is the size of one page of your actual report; one logical page may be made up of multiple physical pages. The Previewer displays the logical pages of your report output, one at a time.

23. What are the various page layout sections in Oracle Reports ?
A A report has three sections : the report header pages, report body/margin pages, and report trailer pages.


27. What are various types of parameters ?
A There are two types of parameters:
* default (called system parameters)
* user-created (called bind and lexical parameters)


30. How do you reference parameters and columns in reports ?
A In two ways :
* As bind references
* As lexical references

31. What are Bind Referencing and Lexical Referencing ?
* Bind Referencing : Bind references are used to replace a single value in SQL or PL/SQL, such as a character string, number, or date. Use bind reference when you want the parameter to substitute only one value at runtime. Specifically, bind references may be used to replace expressions in SELECT, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH clauses of queries.

Lexical Referencing : Lexical references are placeholders for text that you embed in a SELECT statement. Use Lexical reference when you want the parameter to substitute multiple values at runtime. You can use lexical references to replace the clauses appearing after SELECT, FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and START WITH.

33. Can you create a group without any break columns ?
* No.

35. Types of Matrix report ?
* 1. Single query 2. Multi query 3. Nested Query 4. Matrix Break

37. In Reports, how can you print one record per page in the output ?
* Set the Maximum records per page property of the Repeating frame to 1.

38. How do you print a Report 2.5 report in character mode ?
* Set MODE = 'Character' in the Parameter form

39. What are widow lines ?
* Widow lines are the minimum number of lines of the boilerplate text or field that should appear on the logical page where the text starts to print. If the number of lines specified for this property cannot fit on the logical page, then all lines of the boilerplate are moved to the next page.

40. What are widow records ?
* Widow records are the minimum number of instances (records) that should appear on the logical page where the repeating frame starts to print. If the number of instances specified for this property cannot fit on the logical page where the repeating frame is initially triggered to print, then the repeating frame will start formatting on the next page.

41. What is 'page protect' property for objects ?
* Page protect property for an object indicates whether to try to keep the entire object and its contents on the same logical page. Checking Page Protect means that if the contents of the object cannot fit on the current logical page, the object and all of its contents will be moved to the next logical page.

42. What is the 'Print Condition Type' property ?
* 'Print Condition Type' property specifies the frequency with which you want the object to appear in the report. The Print Condition Type options indicate the logical page(s) on which the object should be triggered to print with regard to the Print Condition Object.

44. What are the various values of the 'Print Condition Type' property in Reports ?
* The various values are :
All : All means the object and all of its contents will be printed on all logical pages of the Print Condition Object. The object will be repeated on any overflow pages of the Print Condition Object and will be truncated at the logical page boundary, if necessary.

All but First : All but First means the object and all of its contents will be printed on all logical pages of the Print Condition Object except the first logical page. The object will be formatted only on overflow pages of the Print Condition Object and will be truncated at the logical page boundary, if necessary.

All but Last : All but Last means the object and all of its contents will be printed on all logical pages of the Print Condition Object except the last logical page. The object will be repeated on any overflow pages of the Print Condition Object except the last one and will be truncated at the logical page boundary, if necessary.

*Default : Default means that Oracle Reports will use object positioning to set the Print Condition Type to either *First or *Last for you. (The asterisk indicates that Oracle Reports specified the setting for you.)

First : First means that the object and all of its contents will only be printed on the first logical page of the Print Condition Object. The object will be formatted and will overflow to subsequent pages, if necessary.

Last : Last means that the object and all of its contents will only be printed on the last logical page of the Print Condition Object. The object will be formatted after the Print Condition Object and will overflow to subsequent pages, if necessary.

* For repeating frames, the print condition type property refers to every logical page of every instance (record) of the repeating frame. If you specify a Print Condition Type setting of All and a Print Condition Object setting of Enclosing Object for a field F_1, it prints in every instance of repeating frame R_1 on every logical page. If you specify a Print Condition Type setting of All but First in the above case , then the field will be printed only in those cases where a single instance (row or record) of the repeating frame spans across more than one page (which is normally not the case since many records are there in a single logical page and not one record in many pages). In such a case the field will be printed on all subsequent pages of this instance except the first page.

43. What is the 'Print Condition Object' property ?
* 'Print Condition Object' property specifies the object on which to base the Print Condition Type of the current object. For example, if you specify a Print Condition Type of All and a Print Condition Object of Anchoring Object, the current object will be triggered to print on every logical page on which its anchoring object (parent object) appears.

45. What are the various values of the 'Print Condition Object' property in Reports ?
* The various values are :
Anchoring Object : Anchoring Object is the parent object to which the current object is implicitly or explicitly anchored.
Enclosing Object : Enclosing Object is the object that encloses the current object.

46. What is the horizontal of vertical sizing property of objects ?
* Horizontal of vertical sizing property specifies how the horizontal or vertical size of the object may change at runtime to accommodate the objects or data within it.

47. What are the various values of the horizontal of vertical sizing property ?
* The various values are :
Contract : Contract means the vertical size of the object decreases, if the formatted objects or data within it are short enough, but it cannot increase to a height greater than that shown in the editor. Note : Truncation of data may occur. (You can think of this option as meaning "only contract, do not expand.")

Expand : Expand means the vertical size of the object increases, if the formatted objects or data within it are tall enough, but it cannot decrease to a height less than that shown in the editor. (You can think of this option as meaning "only expand, do not contract.")

Fixed : Fixed means the height of the object is the same on each logical page, regardless of the size of the objects or data within it. Note : Truncation of data may occur. The height of the object is defined to be its height in the editor.

Variable : Variable means the object may expand or contract vertically to accommodate the objects or data within it (with no extra space), which means the height shown in the editor has no effect on the object's height at runtime.

51. How do you display a message in reports ?
* SRW.Message

54. What are the various values of 'Print Panel Order' property of report ?
* The various values are :
Across/Down : Across/Down means the physical pages of the report body will print left-to-right then top-to-bottom.

Down/Across : Down/Across means the physical pages of the report body will print top-to-bottom and then left-to-right.

55. What is the 'Print Direction' Property of Repeating frames ?
* 'Print Direction' Property specifies the direction in which successive instances of the repeating frame appear.

56. What are the various values of the 'Print Direction' Property of Repeating frames ?
* The various values are :
Across : Across means that each instance of the repeating frame subsequent to the first instance is printed to the right of the previous instance across the logical page.

Across/Down : Across/Down means that each instance of the repeating frame subsequent to the first instance is printed to the right of the previous instance until an entire instance cannot fit between the previous instance and the right margin of the logical page. At that time, Oracle Reports prints the instance below the left-most instance on the logical page, provided there is enough vertical space left on the logical page for the instance to print completely.

Down : Down means that each instance of the repeating frame subsequent to the first instance is printed below the previous instance down the logical page.

Down/Across : Down/Across means that each instance of the repeating frame subsequent to the first instance is printed below the previous instance until an entire instance cannot fit inside the bottom margin of the logical page. At that time, Oracle Reports prints the instance to the right of the topmost instance on the logical page, provided there is enough horizontal space left on the logical page for the instance to print completely.


59. What is the 'Keep with Anchoring Object' object property ?
* 'Keep with Anchoring Object' object property indicates whether to keep an object and the object to which it is anchored on the same logical page. Checking Keep with Anchoring Object means that if the object, its anchoring object, or both cannot fit on the logical page, they will be moved to the next logical page.

60. What is 'Page Break Before' object property ?
* 'Page Break Before' object property indicates that you want the object to be formatted on the page after the page on which it is initially triggered to print. Note that this does not necessarily mean that all the objects below the object with Page Break Before will move to the next page.

61. What is 'Page Break After' object property ?
* 'Page Break After' object property indicates that you want all children of the object to be moved to the next page. In other words, any object that is a child object of an anchor (implicit or explicit) to this object will be treated as if it has Page Break Before set. Note that this does not necessarily mean that all the objects below the object with Page Break After will move to the next page.


63. What is the 'Break Order' property of columns ?
* The 'Break Order' property is the order in which to display the column's values. This property applies only to columns that identify distinct values of user-created groups (i.e., break groups). The order of column values in a default group is determined by the ORDER BY clause of the query. For column values in user-created groups, however, you must use Break Order to specify how to order the break column's values.

64. What are the various types of links ?
* The Data Link tool draws a link between a parent group and a child query. Creating a link is a drag and drop operation. Clicking and dragging from one column to another creates a link between those two columns (column to column link). Clicking and dragging from one query to another creates all possible links between columns selected by the queries based on database constraints (query to query link). Clicking and dragging between two groups creates a group-to-group link (i.e., a link with no columns).

65. Name some of the procedures in the SRW package ?
* SRW.Message, SRW.User_Exit, SRW.Do_Sql, SRW.Run_Report

66. What are the various report layout regions ?
* There are three report regions in the Layout editor :
* header
* body/margin
* trailer

Header : The report header pages appear once at the beginning of each report on a set of separate pages. They can contain text, graphics, data, and computations.

Body/Margin : The body/margin pages appear between the header and trailer pages, and are the bulk of the report. Each physical page in this section consists of a body and a margin. The body contains the majority of the report's text, graphics, data, and computations.
A top and bottom margin appear on each page, until all data within the body has been formatted. A margin may include text, graphics, page numbers, page totals, and grand totals. The default margin size is one half inch each for the top and bottom margins and zero for the left and right margins.

Trailer : The report trailer pages appear once at the end of each report on a set of separate pages. They can contain text, graphics, data, and computations.

70. What is more efficient : Maximum rows or Group Filter ?
* Maximum Rows in the Query property sheet restricts the number of records fetched by the query. A group filter determines which records to include and which records to exclude. Since Maximum Rows actually restricts the amount of data retrieved, it is faster than a group filter in most cases. If you are using a Filter of Last or Conditional, Oracle Reports must retrieve all of the records in the group before applying the filter criteria. As a result, Maximum Rows or a Filter of First is faster.