Sie sind auf Seite 1von 131

USER GUIDE

Oracle Corporation
Web ADI Integrator Developers
Guide

Author: Alex Drexel


Creation Date: October 31, 2002
Last Updated: October 12, 2005
Document Ref: 01
Version: 2.1

Approvals:

John Richardson

Brett Hooker

Error! AutoText entry not defined. Copy Number _____


Document Control

Change Record
6

Date Author Version Change Reference

18-Apr-02 Alex Drexel 1 No Previous Document


24-Jun-02 Alex Drexel 1.1 Changes to include more info on Parameter UI and
PL/SQL
23-Aug-02 Alex Drexel 1.2 Added Expanded Cols and general edits.
19-Sept-02 Alex Drexel 1.3 Added Reporting Mode
4-Nov-02 Bernardine Rodgers 1.4 Updated API Definitions for 8.3
8-Nov-02 Alex Drexel 1.5 Removed References to Directory and other tables,
columns, and parameters not present in 8.3.
Updated Calling Web ADI.
10-Mar-04 Alex Drexel 1.6 Instructed Integrator developers to create their own
parameter definitions for upload parameters in
section 7.2.1. Noted the parameters in LOV
parameter lists that are optional in section 5.1.2.
23-Sep-04 Alex Drexel 1.7 Updates per bug 3901271. Added additional
information regarding Java validators and Function
security.
09-Mar-05 Alex Drexel 1.8 Added more detail to section Uploading Code
Combination Identifier For Key Flexfield Values

17-Mar-05 Alex Drexel 1.9 Updated section added in v1.8.


03-May-05 Alex Drexel 2.0 Updated the val obj class to use when defining key
flexfields.
10-Oct-05 David Groves 2.1 Added section on calendar component and security

Contributors

Name Position Contribution

Katherine Peet Product Analyst Definitions in Glossary

Document Reference

Author Document Name

David Groves Web ADI Parameters DLD


Component Parameters DLD
Web ADI PA
Download_DLD_CreateDoc
Web ADI Download Metadata DLD
TokenRedirectNoReview
Paul Cross Insert to API and Multi-Table Upload DLD
Metadata Importer DLD
Gordon Hooker Web ADI Download Stored SQL DLD
Mapping Template Page Flow DLD
Kathryn Dobinson Metadata Driven Upload Parameters DLD
Web ADI Download Passed SQL DLD
Alex Drexel Integrator Developers Guide

ii
Company Confidential - For internal use only
Reviewers

Name Position

John Richardson Group Manager

Distribution

Copy No. Name Location

1 Library Master Project Library Files On line

iii
Company Confidential - For internal use only
Contents

Document Control ..................................................................................................................ii

Glossary.................................................................................................................................... 7

1. Overview ................................................................................................................. 10
1.1. Functionality .................................................................................................... 10
1.2. Integrator Development ................................................................................. 10
2. Defining an Integrator ........................................................................................... 12
2.2 Associate Form Function(s) with Integrator ........................................................ 12
To Delete an Association .............................................................................................. 13
To Update an Association ............................................................................................ 13
3. Adding Interfaces ................................................................................................... 15
3.1. Creating a PL/SQL API Interface ................................................................. 15
3.2. Creating a Table Interface .............................................................................. 19
3.3. Uploading to Multiple Interface Tables or APIs ......................................... 20
4. Updating Interface Columns/API Parameters .................................................. 21
4.1. Create Interface Columns............................................................................... 21
4.2. Interface Columns Concepts.......................................................................... 23
5. Creating Components ............................................................................................ 33
5.1. Creating Table Validated Components ........................................................ 33
5.2. Creating Date Picker Components................................................................ 37
5.3. Creating JAVA Validated Components ....................................................... 40
SQL Java Class ............................................................................................................... 41
Validator Java Class ...................................................................................................... 44
Implementing a Group Validator Java Class............................................................. 48
Component Java Class .................................................................................................. 50
Implementing the Component Java Class.................................................................. 51
Metadata for Java Validation .............................................................................................. 55
BNE Parameter Definition Tables ............................................................................... 55
BNE Parameter List Tables........................................................................................... 56
BNE Parameter List Items Table.................................................................................. 57
BNE Component Tables................................................................................................ 57
BNE Interface Column(s) Tables ................................................................................. 58
6. Defining an Importer ............................................................................................. 61
6.1. Indicate Importer Type................................................................................... 61
6.2. Define Master Parameter List ........................................................................ 62
6.3. Enter Metadata for Steps in Master List....................................................... 64

iv
Company Confidential - For internal use only
7. Defining Upload Parameters ................................................................................ 78
7.1. Upload Parameters Screen ............................................................................. 78
7.2. Create Upload Parameter List ....................................................................... 78
8. Creating Content .................................................................................................... 81
8.1. Stored SQL........................................................................................................ 81
8.2. Text File............................................................................................................. 83
8.3. Java .................................................................................................................... 84
9. Reporting Only Documents .................................................................................. 86
9.1. Reporting only with Data Entry Interfaces.................................................. 86
9.2. Reporting only Interfaces, Mappings and Layouts .................................... 86
10. Creating Layouts and Mappings.......................................................................... 87
10.1. Creating Layouts ............................................................................................. 87
10.2. Creating Mappings ......................................................................................... 89
11. Calling the Create Doc Page Flow........................................................................ 92
11.1. Available Parameters...................................................................................... 92
11.2. Sending Parameters to BneApplicaitonService........................................... 93
APPENDIX A Parameter UI............................................................................................. 97
Accessing Parameter UI................................................................................................ 97
Defining Parameter Lists .............................................................................................. 97
Defining Parameter List Items ..................................................................................... 97
Defining a Parameter Definition ................................................................................. 97
Associating a Parameter Definition to a Parameter.................................................. 98
Testing Your Parameter List ........................................................................................ 98
APPENDIX B Shipping Your Integrator......................................................................... 99
Applications 11i ............................................................................................................. 99
Applications 12 .............................................................................................................. 99
APPENDIX C - Sample Code............................................................................................ 102
Sample SQL Class - BneOAPeriodNameSQL (GL Journals Period Name
LOV/Validator) ........................................................................................................... 102
Sample Validator Class - BneOAPeriodNameValidator (GL Journals Period
Name LOV/Validator) ............................................................................................... 104
Sample Component Class - BneOAPeriodNameComponent (GL Journals Period
Name LOV) .................................................................................................................. 114
Sample Metadata for the Period Name Java Validation ........................................ 120
BNE Parameter List Sample Metadata for the Period Name Validator/LOV . 123
BNE Parameter List Items Sample Metadata for the Period Name
Validator/LOV ............................................................................................................ 123
BNE Component Sample Metadata for the Period Name Validator/LOV...... 124
BNE Interface Column(s) Sample Metadata for the Period Name
Validator/LOV ............................................................................................................ 125
BNE Interface Column(s) Sample Group Validator (Reversal Group Validator)125
APPENDIX D Security .................................................................................................... 127
Examples - Download................................................................................................. 128
Decorator for BneStoredSQL for securing parameters........................................... 128
Examples Upload / LOV......................................................................................... 130
Security Contexts ......................................................................................................... 130
Input Filter .................................................................................................................... 131

v
Company Confidential - For internal use only
General Coding Considerations ................................................................................ 131

vi
Company Confidential - For internal use only
Glossary

Asynchronous Call
An asynchronous call occurs where the uploading of data to interface tables is a separate
process from importing interfaced table data to Oracle Applications (i.e. they dont happen at
the same time).

When an upload occurs, an import program is called and the request id is returned to the user.
Oracle Applications proceeds to run the import program in the background and it is up to the
user to manually check whether the import program was successful in its processing. This
means the submission of the upload and the completion of the import program are not
synchronized, hence the usage of the asynchronous terminology.

Client
Some software requiring a function to be performed by another piece of software (the Server).
Clients pass parameters to Servers

Content
This is the information that will be downloaded into the Viewer. Multiple Contents can be
defined for a single Content Class. The Content that is passed to or selected in the Create
Document page flow determines the Content Class that will be used to derive the Content data.

Content Column
A name defined in metadata to represent a column that exists in the Content. Users map the
Content Columns to interface columns/API parameters so that data is downloaded to the
appropriate fields in the document.

Content Class
This is the java code containing the business and processing rules that can be plugged into
the Web ADI Download architecture. This code processes the parameters that are passed to
Web ADI, to retrieve information from the selected Content.

Create Document Page Flow


This page flow consists of a set of Web ADI screens from which an end user can select from
several parameters to create a document on the client machine. The parameters that a user can
select include: Language, Viewer, Integrator, Layout, Content and Mapping. Additional
parameters may be required depending on the Content selected.

Document Creation Shortcut Settings


These settings are the parameters that are supplied to the Create Document page flow. These
parameters are passed to the Create Document page flow either when a user selects a
Document Creation Shortcut from the Documents page in the Create Document page flow or
when the Create Document page flow is called directly from an application or form. (Aside: the
Documents page the first page in the Create Document page flow but will not be displayed
until a Shortcut has been saved.)
Dynamic Parameter
A dynamic parameter is a parameter defined by metadata stored in the Web ADI repository,
but its value must be determined at run-time.

Integrator
An Integrator is a Web ADI term used to encapsulate all of the information required to move
data to/from a desktop application into Oracle Applications. An Integrator definition may
include information about open interface tables, validation, business rules, and data that can be
downloaded.

Integrator Developer
The Integrator Developer is a developer who defines the metadata required within Web ADI.
The metadata includes: the Integrator, table/view definitions, Layouts, Mappings, SQL
statements and parameters. The Integrator Developer will usually be a System Administrator
or a user with a more advanced understanding of Web ADI, and knowledge of the tables and
business rules associated with the product being integrated with.

Interface
Interface is a Web ADI term for the column definitions from a particular API or Interface
table/view to be used for uploading data into the database. Multiple Interfaces can be defined
for a single Integrator.

Language
This is the Language in which a document will be generated, and in which all interaction within
the document will be conducted.

Layout
A Layout tells Web ADI which columns will be displayed in the Desktop Application document
and how those columns will be displayed, including formatting. Web ADI provides a set of
screens that users and Integrator Developers can use to create their own Layouts. Integrator
Developers are able to provide Layouts as seed data.

Mapping
A Mapping is defined to link the columns from the Content to the columns in a table/API
Interface. For example, the columns in a SQL query that are downloaded into an MS Excel
spreadsheet are mapped to the columns in an open interface table into which the downloaded
information will be uploaded.

Parameter
A parameter is a name / value pair used to pass information between a client and a server. The
parameter may be known by a textural (string) name, or a position in a list. The parameter
value must have a data type, which one is known and understood by the client and server.

There is generally a description available for the parameter value that is displayed to the user.
Example: param name = bne:integrator, datatype = string, param value =
231:JOURNALS_11I with description Journals for Applications 11i.

8
Company Confidential - For internal use only
Server
Some software that does a job for a Client. Servers receive parameters from Clients.

Static Parameter
A static parameter is a parameter completely defined by metadata stored in the Web ADI
repository. A static parameter can be read and a value obtained immediately either by a default
value stored against it, or a specific stored value.

Synchronous Call
A synchronous call occurs where the uploading of data to interface tables and import to Oracle
Applications occur in one process. A synchronous call entails submitting the import program,
waiting for the import program to finish running, determining the success or failure of the
import and returning these details to the user. In this scenario, the user will not have to
manually check whether the import program completed successfully.

Viewer
A Viewer is a Web ADI term for the desktop application in which a document will be
generated.

9
Company Confidential - For internal use only
1. Overview
1.1. Functionality

Web ADI allows Oracle Applications developers to rapidly create desktop interfaces to their own Applications.
They can bring Oracle Application data and business rules to a desktop application such as Excel to give users
more flexibility in entering, modifying and modeling data.

By updating metadata, Integrator Developers can have Web ADI:

Create a formatted document on the desktop containing application specific fields for data entry.

Import data from the database or a text file to a document.

Provide List of Values within a document.

Upload data from the desktop document to Oracle Applications.

Validate fields in the document and provide instant feedback (error/confirmation messages) during the
upload process.

All of this is done is done over the Web; no client install is necessary. Users need only IE and a viewer installed
on their PCs. The viewer currently supported is Excel.

1.2. Integrator Development

The above functionality is applied to your application through the development of an Integrator. Creating an
Integrator involves updating Web ADI tables. This metadata is used By Web ADI to capture the business rules of
your product so that they may be enforced on the desktop. Most of the metadata is created through PL/SQL
packages and HTML UI. There may be cases when tables are updated through SQL Plus.

To enable upload, Integrator Developers must identify the tables or APIs a document will point to. They then
describe the columns/parameters of those tables/APIs and how they should be validated. Integrator developers
may also describe the program they use to import data from interface tables to application base tables. Web ADI
will look at this metadata to automatically call the import program after it has successfully uploaded data to the
interface. Parameters shown to users that govern the upload process can also be defined. In addition, users may
want to download information into the document, edit then upload to Oracle Applications. To enable download,
metadata on what will be downloaded is entered. Information on how the downloaded data is mapped to
columns in the document is also created. Some Integrators my only allow users to download information to a
document for analysis, and not provide upload.

Developing an Integrator involves the following steps:

Define an Integrator

Define Interfaces

Define Interface Columns

Create Components

Define Importer

10
Company Confidential - For internal use only
Defining Upload Parameters

Creating Content(s)

Creating Layouts and Mappings

This document describes these steps in detail and provides information on how Web ADI can be invoked.

Note: The Apache HTTP listener must be restarted when a record is


updated through SQL Plus if the change is to be viewed in the
application.

Note: All product teams must read and understand APPENDIX D


Security before shipping an Integrator solution. Web ADI, as a
Desktop Application, introduces a number of additional challenges
that need to be addressed above that which is typical in a pure HTML
web environment.

11
Company Confidential - For internal use only
2. Defining an Integrator
A PL/SQL script is available for Integrator Developers to quickly create the core metadata of an Integrator. This
includes a data-source type, and an Integrator Definition.

2.1 Create Integrator

Call the following PL/SQL package to create the core metadata for your Integrator:
BNE_INTEGRATOR_UTILS.CREATE_INTEGRATOR
(P_APPLICATION_ID IN NUMBER,
P_OBJECT_CODE IN VARCHAR2,
P_INTEGRATOR_USER_NAME IN VARCHAR2,
P_LANGUAGE IN VARCHAR2,
P_SOURCE_LANGUAGE IN VARCHAR2,
P_USER_ID IN NUMBER,
P_INTEGRATOR_CODE OUT VARCHAR2);

Parameter Description

P_APPLICATION_ID The identifier for an application. An example would be 101 for General
Ledger
P_OBJECT_CODE A string of 20 chars or less. The only valid characters are: Uppercase
'A'..'Z', '0'..'9' and '_'. This string must be unique within the application
ID. The API will use this code to generate the P_INTEGRATOR_CODE.
P_INTEGRATOR_CODE = P_OBJECT_CODE + _INTG
P_INTEGRATOR_USER_NAME The Integrator name displayed to users on the Integrator page in the
Create Document Page Flow. The standard format for Integrator name is
<Product Name> - <Module/Function Name>. An example would be
General Ledger - Journals.
P_LANGUAGE The language the User Integrator Name will be stored against
P_SOURCE_LANGUAGE The Language that the User Integrator Name will be translated from
P_USER_ID Oracle Applications user ID
P_INTEGRATOR_CODE This is generated by the API. It uniquely identifies your Integrator within
your application and can be used when calling the Web ADI service.

2.2 Associate Form Function(s) with Integrator


You must associate at least one form function with your integrator. Web ADI will check to see if a users current
responsibility has access to any one of the associated form functions before a document is created, an upload is
conducted, or an LOV is rendered. Associated form functions will also be checked before a user can define a layout
or a mapping for an Integrator. Do not use the Create Document form function; it should be a form function your
team ships.

Call the following Package:

BNE_SECURITY_UTILS_PKG.ADD_OBJECT_RULES

( P_APPLICATION_ID in NUMBER,
P_OBJECT_CODE in VARCHAR2,
P_OBJECT_TYPE in VARCHAR2,
P_SECURITY_CODE in VARCHAR2,
P_SECURITY_TYPE in VARCHAR2,
P_SECURITY_VALUE in VARCHAR2,
P_USER_ID in NUMBER);

Parameter Description

12
Company Confidential - For internal use only
Parameter Description

P_APPLICATION_ID Application ID of your


product
P_OBJECT_CODE Enter the code of the
Integrator you want to apply
the security rule to.
P_OBJECT_TYPE Pass INTEGRATOR
P_SECURITY_CODE Security Code uniquely
identifies the security rule.
P_SECURITY_TYPE Enter FUNCTION
P_SECURITY_VALUE A comma separated list of
functions that grant access to
your integrator. These form
functions must exist on your
instance or an error will be
received when calling the
package.
P_USER_ID Updates CREATED_BY and
LAST_UPDATED_BY
Columns. The value for this
parameter should be the seed
user. When extracted to an
LDT file, this value should
translate to the Oracle user.

To Delete an Association
Call the following Package:

BNE_SECURITY_UTILS_PKG.DELETE_OBJECT_RULES

( P_OBJECT_APP_ID in NUMBER,
P_OBJECT_CODE in VARCHAR2,
P_OBJECT_TYPE in VARCHAR2,
P_SECURITY_APP_ID in NUMBER,
P_SECURITY_CODE in VARCHAR2);
Parameter Description

P_OBJECT_APP_ID Application ID of your


product
P_OBJECT_CODE Enter the code of the
Integrator that has the
security rule you you want to
delete.
P_OBJECT_TYPE Pass INTEGRATOR
P_SECURITY_APP_ID Application ID of your
product
P_SECURITY_CODE Pass the security rule you
want to delete.

To Update an Association
Call the following Package:

BNE_SECURITY_UTILS_PKG.UPDATE_OBJECT_RULES

( P_OBJECT_APP_ID in NUMBER,
P_OBJECT_CODE in VARCHAR2,
P_OBJECT_TYPE in VARCHAR2,
P_SECURITY_APP_ID in NUMBER,

13
Company Confidential - For internal use only
P_SECURITY_CODE in VARCHAR2,
P_SECURITY_TYPE in VARCHAR2,
P_SECURITY_VALUE in VARCHAR2,
P_USER_ID in NUMBER);

Parameter Description

P_OBJECT_APP_ID Application ID of your


product
P_OBJECT_CODE Enter the code of the
Integrator you want to apply
the security rule to.
P_OBJECT_TYPE Pass INTEGRATOR
P_SECURITY_APP_ID Application ID of your
product
P_SECURITY_CODE Security Code uniquely
identifies the security rule.
P_SECURITY_TYPE Enter FUNCTION
P_SECURITY_VALUE A comma separated list of
functions that grant access to
your integrator. These forrm
funcitons must exist on your
instance or an error will be
received when calling the
package..
P_USER_ID Updates CREATED_BY and
LAST_UPDATED_BY
Columns. The value for this
parameter should be the seed
user. When extracted to an
LDT file, this value should
translate to the Oracle user.

14
Company Confidential - For internal use only
3. Adding Interfaces
A PL/SQL API is provided to create Interfaces for an Integrator. An Interface identifies a database table or PL/SQL
API that you will be populating with Web ADI. More than one Interface can be defined for an Integrator; the API
must be run each time an Interface is to be added.

It is possible to create an Interface that does not provide upload, but only allows users to download data into the
document for reporting purposes. If this is what is required, skip to section 8 and create a Content for your
Integrator, then run the API described in section 9.2.

3.1. Creating a PL/SQL API Interface

Creating an Interface for an API involves calling an API that will generate a parameter list. This list is then
updated to identify all the parameters in the API and their Attributes. Lastly, the parameters that will be
updates from the desktop will be related to records created in BNE_INTERFACE_COLS_B; this will enable
users to create layouts that include the API parameters defined in the list.

3.1.1. Run the following PL/SQL package to create an Interface for a PL/SQL API:
BNE_INTEGRATOR_UTILS.CREATE_INTERFACE_FOR_API
(P_APPLICATION_ID IN NUMBER,
P_OBJECT_CODE IN VARCHAR2,
P_INTEGRATOR_CODE IN VARCHAR2,
P_API_PACKAGE_NAME IN VARCHAR2,
P_API_PROCEDURE_NAME IN VARCHAR2,
P_INTERFACE_USER_NAME IN VARCHAR2,
P_PARAM_LIST_NAME IN VARCHAR2,
P_API_TYPE IN VARCHAR2,
P_API_RETURN_TYPE IN VARCHAR2 DEFAULT NULL,
P_UPLOAD_TYPE IN NUMBER,
P_LANGUAGE IN VARCHAR2,
P_SOURCE_LANG IN VARCHAR2,
P_USER_ID IN NUMBER,
P_PARAM_LIST_CODE OUT VARCHAR2,
P_INTERFACE_CODE OUT VARCHAR2);

Parameter Description

P_APPLICATION_ID The identifier for an application. An example would be 101 for General
Ledger
P_OBJECT_CODE A string of 20 chars or less. The only valid characters are: Uppercase
'A'..'Z', '0'..'9' and '_'. This string must be unique within the application
ID.
P_API_PACKAGE_NAME The package name that contains your PL/SQL API procedure.
P_LANGUAGE The language the User Integrator Name will be stored against
P_SOURCE_LANGUAGE The Language that the User Integrator Name will be translated from
P_USER_ID Oracle Applications user ID
P_INTEGRATOR_CODE Set to the Integrator Code that was created in section 2.
Query BNE_INTEGRATORS_TL to look up the code of any
Integrator.

P_API_PROCEDURE_NAME The procedure name of your PL/SQL API.


P_INTERFACE_USER_NAME The user name for the Interface, but is not seen in the UI at
this time

15
Company Confidential - For internal use only
Parameter Description

P_PARAM_LIST_NAME Your Interface to an API will require an associated list of


parameters. Set to be the name of this parameter list. This
value will not be seen by users.
Set P_API_TYPE PROCEDURE or FUNCTION
P_API_RETURN_TYPE The Function Return Data Type.
P_UPLOAD_TYPE Set to 0, 1 or 2. 0 = Custom Upload Type (uses
BNE_INTERFACES_B.UPLOAD_OBJ_NAME to obtain
class name to load). 1= upload to Table. 2 = Upload to
PL/SQL API
P_LANGUAGE The language your Interface name will be stored against
P_SOURCE_LANGUAGE The language the Interface name will be translated from
Set P_USER_ID ID to a valid Oracle Applications user ID

3.1.2. Identify Attributes of the PL/SQL API


3.1.2.1. Look up the PARAM_LIST_CODE created in the previous step in the Parameter UI (See
Appendix A for more information on Parameter UI).

3.1.2.2. Press the Edit button next to the Attributes label in the Define Parameter list screen. Enter the
details about the function name and return type for the PL/SQL function. When you are
finished, press Apply and return to the Define Parameter List screen.

Field Name Field Description

ATTRIBUTE1 Type of API call. (FUNCTION or PROCEDURE.)


ATTRIBUTE2 Name of PL/SQL function or procedure including the
package name.
ATTRIBUTE3 Function Return Data Type. This attribute will be
ignored if the API is a PROCEDURE
ATTRIBUTE4 Whether the return value is used to retrieve the error
messages (Y/N). This attribute will be ignored if the API
is a PROCEDURE.
ATTRIBUTE5 Perform a call to FND_MESSAGES. (Y/N). This attribute
is used for a FUNCTION and PROCEDURE

Example :

16
Company Confidential - For internal use only
3.1.3. Use the Add Another Row button to identify all the parameters that exist in your API to the
parameter list. A parameter must be added to the list for every PL/SQL function/parameter
declaration and PL/SQL parameter for the function call. In addition, the order in which these
parameters are defined in the parameter list must be the exact order in which they are defined in the
PL/SQL API

3.1.3.1. After pressing Add Another Row, you will be presented with the Define Parameter
Screen. Use this screen to enter the details for each parameter you add the list.

Field Name Field Description

NAME Name of parameter. This value needs to be


the exact name of the parameter in your API.
This value is not translatable.
Data Type This is the data Type for the default value for
this parameter.
Value Default value for the parameter if known.
Description Description of parameter. E.g. Journals for
Applications 11i. This is in the language of
the user. Note, a description must be entered
if a default value is defined.
Formula An environment variable or similar that the
default value can be derived from. E.g.
$env$.userid 1318 as a number if
DATATYPE=NUMBER

17
Company Confidential - For internal use only
Example:

3.1.3.2. Identify attributes for each parameter you define in the list. User the edit button next to the
Attributes label (see above) to access the attributes for each parameter you define. If you have
default values defined within your API definition for a particular parameter, these default values
must also be set in Attribute 5. For example, if you have NULL being the default value for row_id
in your API definition, you must also enter NULL in Attribute 5 when identifying this parameter
in the parameter list.

Field Name Filed Description

ATTRIBUTE1 PL/SQL parameter name


ATTRIBUTE2 PL/SQL parameter data type.
ATTRIBUTE3 PL/SQL parameter access. (IN / OUT / INOUT)
ATTRIBUTE4 Used for returning error messages. (Y/N)
ATTRIBUTE5 Default value for the PL/SQL parameter. You
must use single quotes around any string that is to
be used as a default value (i.e. FULL)
ATTRIBUTE6 Size of the variable.

Example:

18
Company Confidential - For internal use only
3.1.4. Create records in BNE_INTERFACE_COLS_B for every PL/SQL API parameter you wish to pass
values to from a document on the desktop. Relate a parameter identified in the parameter list with a
record in BNE_INTERFACE_COLS_B by entering the parameters sequence number in
BNE_INTERFACE_COLS_B.UPLOAD_PARAM_LIST_ITEM_NUM. See Updating Interface
Columns/API Parameters for more information on creating records in this table.

3.2. Creating a Table Interface


You can upload amounts to a table from a desktop document such as Excel. Fields in the document
will represent columns in a table that will be updated when the document is uploaded.

3.2.1. Run the following PL/SQL API to create a Table Interface:

BNE_INTEGRATOR_UTILS. CREATE_INTERFACE_FOR_TABLE
(P_APPLICATION_ID IN NUMBER,
P_OBJECT_CODE IN VARCHAR2,
P_INTEGRATOR_CODE IN VARCHAR2,
P_INTERFACE_TABLE_NAME IN VARCHAR2,
P_INTERFACE_USER_NAME IN VARCHAR2,
P_LANGUAGE IN VARCHAR2,
P_SOURCE_LANG IN VARCHAR2,
P_USER_ID IN NUMBER,
P_INTERFACE_CODE OUT NOCOPY VARCHAR2);

Parameter Description

P_APPLICATION_ID The identifier for an application. An example would be 101 for General
Ledger
P_OBJECT_CODE A string of 20 chars or less. The only valid characters are: Uppercase
'A'..'Z', '0'..'9' and '_'. This string must be unique within the application
ID. This string will be used to generate P_INTERFACE_CODE.
P_INTERFACE_CODE = P_OBJECT_CODE + _INTF.
P_INTEGRATOR_CODE Set to the Integrator code the Interface will be defined under
P_LANGUAGE The language the User Integrator Name will be stored against
P_SOURCE_LANGUAGE The Language that the User Integrator Name will be translated from
P_USER_ID Oracle Applications user ID
P_INTERFACE_CODE This is generated by the API. It uniquely identifies your Integrator within
your application and can be used when calling the Web ADI service.

P_INTERFACE_TABLE_NAME the name of the table you will be updating


P_INTERFACE_USER_NAME is the user name for your interface. Currently, this is not seen by users.

19
Company Confidential - For internal use only
3.2.2. Create records in BNE_INTERFACE_COLS_B for every column in your table. Not the
INTERFACE_CODE created in 3.2.1. This will be needed to create your interface columns. See
Updating Interface Columns/API Parameters for more information on this step.

3.3. Uploading to Multiple Interface Tables or APIs

To define layouts that upload to more than one Interface table or API, you simply define more than one
Interface for an Integrator. The list of fields a user has to choose from when defining their layouts will
contain all of the Interfaces you have defined. After you have defined your Interfaces, update
BNE_INTERFACES.UPLOAD_ORDER with a numeric value for each Interface to indicate the order in
which each Interface is updated when users upload their documents. This will be useful when uploading
to APIs since APIs must often be called in a particular order.

20
Company Confidential - For internal use only
4. Updating Interface Columns/API Parameters
The columns/parameters of the Interface tables/APIs must be identified in metadata. The metadata described in this
section facilitates the core Web ADI services including upload, validation, defining Layouts, defining Mappings, and
list of values.

4.1. Create Interface Columns

Metadata must be entered for evey API Parameter or table column that exists in your Interface. This
information is stored in BNE_ITNERFACE_COLS_B (TL). Follow the instructions below to enter identify
your columns.

4.1.1. An Interface Columns Integrator is available for you to quickly create/edit interface column
metadata.

4.1.1.1. You must run the following script if you do not see a Web ADI Interface Columns
Integrator on the Integrator page of the Create Document Page flow.

update bne_integrators_b

set enabled_flag = 'Y'

where application_id = 231

and integrator_code = 'INTERFACE_COLS';

4.1.1.2. To quickly create interface columns using Excel, enter the Create Document Page flow
and select Web ADI Interface Columns Integrator and the All Columns layout. The APIs you

21
Company Confidential - For internal use only
called in the previous section may have already created many of these records for you. If you
want to download records already created for your Interface, select Interface Columns for the
Content and enter the Interface Code you created in the previous section 3. Records will be
downloaded into Excel, where they can be changed/created and uploaded.

4.1.2. Below is a list of fields that will appear in the spreadsheet and their descriptions. * = Required

Column (Field) Name Description

APPLICATION_ID The identifier for the application.


INTERFACE_CODE* Object Code of the Interface. Select INTERFACE_CODE, INTERFACE_NAME
from BNE_INTERFACES_B to get this value.
SEQUENCE_NUM Unique ID for every record that is assigned to the same INTERFACE_CODE. So
you could have the same SEQUENCE_NUM for two records in this table, but they
would have to be assigned to different INTERFACE_CODEs.
INTERFACE_COL_TYPE* (Type) 1 indicates that this column/parameter exists in the interface table/API. 2
indicates that the column is an alias that can exist in the layout but is not an actual
column in the interface table.
INTERFACE_COL_NAME* Name of the interface table column or API Parameter to be updated. Interface
(Name) table columns MUST BE ENTERED IN UPPERCASE.
ENABLED* Y/N field indicating if this interface column/API parameter will be updated or
included in a Web ADI Layout.
UPLOAD_PARAM_LIST_ITEM_N Identifier of parameters for a PL/SQL API upload. Match this value with the
UM value of SEQ_NUM in BNE_PARAMETER_LIST_ITEMS to identify the parameter
being uploaded to.
REQUIRED_FLAG (Required) Y/N field. A Y value will force this column/parameter to be included in all
layouts for an Integrator. Users will be required to enter a value for this
column/parameter in the document. Columns that cannot be set to NULL in the
database and parameter values that are required should have this field set to Y.
A N value will allow a User to optionally select this column when defining new
layouts for an Integrator. All columns/parameters with the ENABLED field set
to N should have a NULL value in this column.
DISPLAY_FLAG (Display) Y/N field determines whether or not the column/parameter will be displayed in
the layout. If NO, the user will not be able to select this column to be included in
the layout. If NO and REQUIRED_FLAG = YES, then the column/parameter will
be included in the sheet but wont be seen by the user. This configuration can be
used with the DEFAULT_VALUE column to have all sheets pass a hidden default
value.

FIELD_SIZE (Size) The size of the column in the interface table or character length for a parameter.
Web ADI uses this value to validate data in the document.
DEFAULT_TYPE Indicates the form of the DEFAULT_VALUE. Valid values for this field are
SQL, ENVIRONMENT, CONSTANT, and TABLELOOKUP. CONSTANT uses
the actual value in DEFAULT_VALUE for this field upon upload.
ENVIRONMENT Indicates an environmental variable defined in
DEFAULT_VALUE . SQL indicates a SQL statement exists in DEFAULT_VALUE
that will be used to determine the value to be used for this field during upload.
TABLELOOKUP will default the value from another column. Default values are
not automatically inserted into the document when it is created, they are derived
at upload time.
DEFAULT_VALUE Default value to be used for the field when it uploaded. This value will not be
automatically inserted into the document when it is created, but will be used for
upload if no value exists for it in the document; i.e., The value in the document
will be uploaded if one exists, and the default value will be ignored.
SEGMENT_NUMBER Indicate the position within the group.
GROUP_NAME Indicates the group the column/parameter is assigned to
OA_FLEX_CODE (Flex Code) Flexfield structure identifier.
OA_CONCAT_FLEX (Concat Flex) Concatenates the value entered for this column/parameter into one cell in a
spreadsheet.
READ_ONLY Y/N. If YES, then the user cant change this value and it is placed in the context
section of the document.
VAL_TYPE (Validation Type) Indicates the Validation Type. Valid values are DESCFLEX,
DESCFLEXCONTEXT, DESCFLEXSEG, GROUP, JAVA, KEYFLEX,
KEYFLEXSEG, and TABLE. This column is left null if no validation other than
validating the DATA_TYPE/FIELD_SIZE /NOT_NULL_FLAG is to be done.

22
Company Confidential - For internal use only
Column (Field) Name Description

VAL_ID_COL (Val id ID) Column to query when Web ADI constructs its SQL Query. This will be the
actual value inserted into the Interface Table
VAL_MEAN_COL (Valid This is the column that contains the user value for values in VAL_ID_COL. These
Meaning) are the values shown in the LOV shown in the worksheet.
VAL_DESC_COL (Valid Desc) Column that contains the description for values in VAL_ID_COL. These values
are shown in the description section of the LOV.
VAL_OBJ_NAME (Valid Object) Table or Java class that is called to validate values in the sheet. If VALTYPE =
TABLE, then the name of the table to query is placed in this column (e.g.
FND_LOOKUPS). If VALTYPE =JAVA, then specify the Java class to call when
validating the column (e.g.
oracle.apps.bne.integrator.validators.BneAccountingFlexValidator).
VAL_ADDL_W_C (Valid Where) Enter an additional Where Clause to add to a Table Validated column.
DATA_TYPE Three values can be entered in this column. 1 = value in database/API must be a
number; 2 = value in the database/API must be varchar; 3 = value in the
database/API must be a date. Web ADI will use this value to validate data in the
document.
NOT_NULL_FLAG Indicates that column in the DB or parameter for the API cannot be null. Web
ADI uses this value to validate data in the document..
VAL_COMPONENT_APP_ID Application ID of component to be called in BNE_COMPONENTS
(Valid Component)
VAL_COMPONENT_CODE Name of Component from BNE_COMPONENTS that will be called to retrieve
the LOV for this field. TABLE and JAVA VAL_TYPES require this field to have a
value if an LOV is to be retrieved. See Creating Components for more details.
SUMMARY_FLAG Indicates if value for this column/parameter can be summed up in the document.
MAPPING_ENABLED_FLAG* Indicates whether a column/parameter can be included in a Mapping so that it
can be mapped to a content column. (Y/N)
Prompt Left Column header for field if in the Header region of the document. This value
must be entered if the column header is to appear in the document and if the
column is to be displayed in the Mapping and Layout UI.
Prompt Above Column header for field if in the Lines region of the document. This value must
be entered if the column header is to appear in the document and if the column is
to be displayed in the Mapping and Layout UI.
User Hint Text Text to appear in the hint section for the column. This is the area between the
data entry cells and the Header.
Language Language that will be entered in the TL Table
SOURCE_LANGUAGE Language prompts will be translated from
OA_FLEX_NUM (Flex Number) Flexfield structure identifier.
OA_FLEX_APPLICATION_ID Flexfield structure identifier.
(Flex Application)
DISPLAY_ORDER Default order in which the columns/parameters are displayed in the document
EXPANDED_SQL_QUERY For expanded columns. This is the query that will be run to return the number of
periods to be displayed in the worksheet.
(User ID) ID that will be used to populate CREATED_BY and LAST_UPDATED_BY

4.2. Interface Columns Concepts

4.2.1. Table Validation/ LOV Retrieval


You can have Web ADI run a simple SQL statement to perform validation for a field during upload. This
information can also be used to return a list of values within the document. Indicate a field will use Table
Validation by entering TABLE in VAL_TYPE.

Use the following columns to use a SQL statement for validation during upload:

VAL_OBJ_NAME: Enter the Table to be queried.

VAL_ID_COL: Enter the column name for the query.

23
Company Confidential - For internal use only
VAL_ADDL_WC: Enter an additional where clause. Tokens can be used when forming the where
clause for your query:

o Profile Options: $PROFILES$.[Profile Option Name]

o Responsibility ID: $ENV$.RESPID

o Oracle User ID: $ENV$.USERID

o Language: $ENV$.LANG

o Session ID: $ENV$.SESSIONID

o Application ID: $ENV$. APPID

Use these columns if you want to provide LOVs that use the above SQL statement:

VAL_COMPONENT_CODE: Code of the component (from BNE_COMPONENTS_B) that will be


used to retrieve the LOV. See Creating Components for more details.

VAL_COMPONENT_APP_ID: Application ID that was used to define the component.

VAL_MEAN_COL (optional): If entered, values in this column will be displayed to users in the LOV.
These meaning values will be entered into the document; ADI will translate them to their
corresponding ID values during the upload process.

The following are example values for these columns:

Column Value

VAL_OBJ_NAME FND_CURRENCIES
VAL_ID_COL CURRENCY_CODE
VAL_ADDL_WC ENABLED_FLAG = 'Y' AND CURRENCY_FLAG = 'Y' AND
TRUNC(NVL(START_DATE_ACTIVE, SYSDATE)) <= TRUNC(SYSDATE) AND
TRUNC(NVL(END_DATE_ACTIVE, SYSDATE)) >= TRUNC(SYSDATE) OR
CURRENCY_CODE = 'STAT'

VAL_COMPONENT_ OA_CURRENCY_CODE
CODE
VAL_COMPONENT_ 231
APPID

4.3. Java Validation/LOV Retrieval


This type of validation/LOV retrieval is used for fields requiring more complex queries against the database.
Static SQL cant simply be defined in the repository as in Table Validation. The Web ADI Integrator Developer
creates these Java classes. Luckily, the Web ADI development team has created classes that can be used as
templates to help developers quickly create their own. See Creating Components for more information.

Indicate a field will use Java Validation by entering JAVA in VAL_TYPE. Enter the class name to be used for
validation during the upload process in VAL_OBJ_NAME. If a LOV is to be provided, enter the key to the
Component that will be used to retrieve the LOV in VAL_COMPONENT_CODE.

4.4. Group Validation


Is validation on one field in your document dependent on the value of another? Do you have several fields that
are validated the same way? If so, Group Validation is the answer. It is used to validate values from different

24
Company Confidential - For internal use only
columns at once. This is done when validation involves values in different columns being dependent on one
another. It is also done to pool segments having the same validation under a parent whose record defines how
validation will be performed for each, rather than entering validation information for all the child records.
However, when Group Validation is complete, validation on individual fields is run. If one of the records has a
different VAL_OBJ_NAME, that piece of validation code will be run for the field in addition to the group
validation. Steps to set up Group Validation:

Identify the dependent fields.

Create a parent record. It does not appear in the sheet, nor is uploaded. Identify the field as a parent
by inserting GROUP for VAL_TYPE.

Assign the dependent fields and the parent to the same group.

Enter the Java class to perform the group validation in the parents VAL_OBJECT_NAME column.

A simple example of an instance to use group validation is the entered debit and credit columns in the GL
Journals Integrator (GL_INTERFACE table). Validation on each field is dependent on the value in the other. An
example of one business rule is that the values in ENTERED_DR and ENTERED_CR must not both be null.

INTERFACE_COL_NAME DISPLAYED_FLAG GROUP VAL_TYPE INTERFACE_COL_TYPE VAL_OBJ_NAME

ENTERED_DR Y ENTERED 1
ENTERED_CR Y ENTERED 1
ENTERED_PARENT N ENTERED GROUP 2 oracle.apps.bne.validat
ors.enterDebitCreditval
idator

A parent field must be created to capture values for group validation. ENTERED_PARENT is identified as the
parent of the group by inserting GROUP for VAL_TYPE. It does not exist in the interface table, nor will it
appear in the sheet for editing. It merely acts as a placeholder for validation; the Java class to perform the Group
Validation is assigned to it in VAL_OBJECT_NAME. All three fields are assigned to the ENTERED group.

Note: Remember, validation can be run on individual columns in addition to them being validated as part of a
group.

An example where Group Validation is used in conjunction with validation done for individual members of the
group is Reference7 and Reference 8 (Reverse Journal, Reversal Period) in the GL Journals Integrator. Group
validation is used to verify that a period is entered when Reference7 is Y. In addition to this check,
REFERENCE7 TABLE validated and REFERENCE8 is JAVA validated.

INTERFACE_COL_NAME DISPLAYED_FLAG GROUP VAL_TYPE INTERFACE_COL_TYPE VAL_OBJ_NAME

REFERENCE7 Y REVERSAL TABLE 1 FND_LOOKUPS


REFERENCE8 Y REVERSAL JAVA 1 apps.bne.validators.per
iodvalidator
REVERSAL_PARENT N REVERSAL GROUP 2 apps.bne.validators.rev
tableformattingvalidato
r

Just as in the last example, a parent is created and assigned to a group with the dependent fields. This field will
not be uploaded, nor will it be displayed to users. The Java class to perform the group validation is assigned to
the parent in VAL_OBJ_NAME. In addition to being Group Validated, REFERENCE7 is being TABLE validated
against FND_LOOKUPS (VAL_ID_COL and VAL_ADDL_WC not shown). REFERENCE8 is being JAVA
validated with the pervalidator class.

25
Company Confidential - For internal use only
4.5. Key Flexfield Validation/LOV Retrieval
Web ADI supports List of Values and the validation of Key Flexfields. Group Validation is used to accomplish
this. The following is done to enable Key Flexfield validation/LOV:

4.5.1. Enter records for the Key Flexfield Segments.

Indicate Key Flexfield segments by entering KEYFLEXSEG in VAL_TYPE.

These fields are not displayed in the spreadsheet but exist in the Table/API. They are not
displayed because Web ADI does not know what KFF segments from the interface table to
display when creating the document.

Assign the segments to a group.

4.5.2. Create a parent field for the Key Flexfield group.

Set INTERFACE_COL_TYPE = 2 since this field does not exist in the interface table.

Set DISPLAY_FLAG = Y since this field will be selected in the mapping UI when the user
wants the key flexfield to be included in the worksheet.

Add this field to the group containing the segment fields.

Enter KEYFLEX for VAL_TYPE to identify it as the parent.

Enter oracle.apps.bne.integrator.validators.BneKFFValidator in VAL_OBJ_NAME. This is the


class that will validate the Key Flexfield.

Enter the code that is used to retrieve the Key Flexfield structure in OA_FLEX_CODE.

Enter N in OA_CONCAT_FLEX. The segments for Key Flexfields are kept in separate
columns in the document.

Insert Record into BNE_COMPONENTS_B:

1. APPLICATION_ID: Your application ID

2. COMPONENT_CODE: OA_FLEX

3. COMPONENT_JAVA_CLASS:
oracle.apps.bne.integrator.component.BneOAFlexComponent

Enter OA_FLEX for VAL_COMPONENT_CODE (not shown in example below). This


value is required to enable List of values for the Key Flexfield

Enter your product ID for VAL_COMPONENT_APP_ID.

Example:

INTERFACE_COL DISPLAYED_ GROUP VAL_TYPE INTERFACE OA_FLEX OA_CONCAT_ VAL_OBJ_NA


_NAME FLAG _COL_TYPE _CODE FLEX ME

SEGMENT1 N ACCOUNT KEYFLEXSEG 1


SEGMENT2 N ACCOUNT KEYFLEXSEG 1
SEGMENT3 N ACCOUNT KEYFLEXSEG 1

26
Company Confidential - For internal use only
INTERFACE_COL DISPLAYED_ GROUP VAL_TYPE INTERFACE OA_FLEX OA_CONCAT_ VAL_OBJ_NA
_NAME FLAG _COL_TYPE _CODE FLEX ME

ACCOUNT_FLEX_ Y ACCOUNT KEYFLEX 2 GL# N oracle.apps.bne.v


FIELD alidators.BneKFF
Validator

4.6. Uploading Code Combination Identifier For Key Flexfield Values


There may be a case where you want to display Key Flexfield values to user within the worksheet, but upload the
code Combination Identifier (CCID) that represents the Key Flexfield values to a single column in the interface
table.

4.6.1. Create a parent field for the Key Flexfield.


The INTERFACE_COL_NAME should be the column in your interface table that youre
uploading the CCID to. If uploading to an API, the UPLOAD_PARAM_LIST_ITEM_NUM
value should match the sequence number in the parameter list of the parameter that
captures the CCID.
Set DISPLAY_FLAG = Y since this field will be selected in the mapping UI when the user
wants the key flexfield to be included in the worksheet.

Set INTERFACE_COL_TYPE = 1 since the key flexfield segments displayed in the


worksheet will be uploaded as a single value to this column.

Enter a new GROUP_NAME for the parent field (youll later assign the segments to this
group).

Enter KEYFLEXID for VAL_TYPE to identify it as the parent.

Enter oracle.apps.bne.integrator.validators.BneKFFValidator in VAL_OBJ_NAME. This is the


class that will validate the Key Flexfield

Enter the code that is used to retrieve the Key Flexfield structure in OA_FLEX_CODE.

Enter N in OA_CONCAT_FLEX. The segments for Key Flexfields are kept in separate
columns in the document.

Insert Record into BNE_COMPONENTS_B if one does not already exist for your product
ID:

1. APPLICATION_ID: Your application ID

2. COMPONENT_CODE: OA_FLEX

3. COMPONENT_JAVA_CLASS:
oracle.apps.bne.integrator.component.BneOAFlexComponent

Enter OA_FLEX for VAL_COMPONENT_CODE (not shown in example below). This


value is required to enable List of values for the Key Flexfield

Enter your product ID for VAL_COMPONENT_APP_ID.

4.6.2. Enter records for the Key Flexfield Segments.

27
Company Confidential - For internal use only
Indicate Key Flexfield segments by entering KEYFLEXIDSEG in VAL_TYPE.

The INTERFACE_COL_NAME needs to be in the following format: [Interface Col Name


of Parent field]_SEGMENT1........SEGMENT2..SEGMENTn.

Set DISPLAY_FLAG = N. These fields are not displayed in the mapping UI.

Set INTERFACE_COL_TYPE = 2 since these fields do not exist in the interface table or API.

Assign the segments to a the same group the parent segment belongs to.

Example:

INTERFACE_COL DISPLAYED_ GROUP VAL_TYPE INTERFACE OA_FLEX OA_CONCAT_ VAL_OBJ_NA


_NAME FLAG _COL_TYPE _CODE FLEX ME

ACCTCCID_SEGM N ACCOUNT KEYFLEXIDS 2


ENT1 EG
ACCTCCID_SEGM N ACCOUNT KEYFLEXIDS 2
ENT2 EG
ACCTCCID_SEGM N ACCOUNT KEYFLEXIDS 2
ENT3 EG
ACCTCCID Y ACCOUNT KEYFLEXID 1 GL# N oracle.apps.bne.v
alidators.BneKFF
Validator

4.7. Descriptive Flexfield Validation/LOV Retrieval


Web ADI supports List of Values and the validation of Descriptive Flexfields. Group Validation is used to
accomplish this. The following is done to enable Descriptive Flexfield validation/LOV:

4.7.1. Create records for each DFF segment.

Indicate a field is a DFF segment by entering DESCFLEXSEG in VAL_TYPE

Set DISPLAY_FLAG to N for all segments. This is because Web ADI does not know what
DFF segments to display when the sheet is created. The Flexfield structure is returned once
the user enters a context value

Add the DFF segments to a group by entering a meaningful name for the group in the
Group Name field.

INTERFACE_COL_TYPE should be set to 1 since the segments exist in the table/API.

4.7.2. Create a parent record for the group. It will be visible in the document, but does not exist in the
table/API

Set DISPLAY_FLAG to Y.

Set INTERFACE_COL_TYPE to 2.

Assign the parent to the group its segments belong to.

Set OA_FLEX_CODE to the code that is used uniquely identify the Key DFF structure.

28
Company Confidential - For internal use only
Enter Y for OA_CONCAT_FLEX. The values for all the DFF segments will be
concatenated into the context column in the document.

Enter DESCFLEX for VAL_TYPE. This indicates that this field is the parent of its DFF
group.

Enter oracle.apps.bne.integrator.validators.BneDFFValidator for VAL_OBJECT_NAME.


This is the Java code that validates DFF segments.

Insert Record into BNE_COMPONENTS_B:

1. APPLICATION_ID: Your application ID

2. COMPONENT_CODE: OA_FLEX

3. COMPONENT_JAVA_CLASS:
oracle.apps.bne.integrator.component.BneOAFlexComponent

Enter OA_FLEX for VAL_COMPONENT_CODE. This entry is required to enable List of


Values.

Enter your product ID for VAL_COMPONENT_APP_ID.

4.7.3. Create a context field for the Descriptive Flexfield group. This context segment captures a value
that is used to determine the DFF structure is needed. The Context column is visible in the
document and exists in the interface table.

Enter Y for DISPLAY_FLAG. This field must be available to allow the user to enter a value
to retrieve the DFF structure.

Enter 1 for INTERFACE_COL_TYPE.

Assign to the group.

Enter the unique code for the DFF structure in OA_FLEX_CODE.

Enter N for OA_CONCAT_FLEX.

Enter DESCFLEXCONTEXT for VAL_TYPE. This value indicated that this field is the
context segment for the group.

Insert Record into BNE_COMPONENTS_B:

1. APPLICATION_ID: Your application ID

2. COMPONENT_CODE: OA_FLEX

3. COMPONENT_JAVA_CLASS:
oracle.apps.bne.integrator.component.BneOAFlexComponent

Enter OA_FLEX in VAL_COMPONENT_CODE. This will enable the LOV for the context
field.

Enter your product ID for VAL_COMPONENT_APP_ID.

29
Company Confidential - For internal use only
Example:

INTERFACE_COL_ DISPLAYE GROUP VAL_TYPE INTERFACE OA_FLEX OA_CONCA VAL_OBJ_NA


NAME D_FLAG _COL_TYPE _CODE T_FLEX ME

ATRRUBUTE1 N JNLLINEDFF DESCFLEXSEG 1


ATTRUBUTE2 N JNLLINEDFF DESCFLEXSEG 1
ATTRIBUTE3 N JNLLINEDFF DESCFLEXSEG 1
JOURNAL_LINE_D Y JNLLINEDFF DESCFLEX 2 GL_JE_LI Y .apps.bne.valid
FF NES
CONEXT Y JNLLINEDFF DESCFLEXCO 1 GL_JE_LI N
NTEXT NES

4.8. Replicating Fields


Web ADI can upload a value entered for a field in a document into multiple interface columns/API parameters.
This involves identifying a master field (i.e. the value from this field will be replicated), then referencing that
field when creating records for the replicating columns in BNE_INTERFACE_COLS_B. Enter records in
BNE_INTERFACE _COLS for the replicated interface columns as follows:

REQUIRED_FLAG DISPLAY_FLAG DEFAULT_TYPE DEFAULT_VALUE

Y N TABLELOOKUP $table$.InterfaceName.InterfaceColName

4.9. Default Values


Default values set in BNE_INTERFACE_COLS_B are generated at upload time. A default value will be uploaded
for a column if a value for it does not exist in the document. Enter values in DEFAULT_TYPE and
DEFAULT_VALUE in BNE_INTERFACE_COLS_B to have Web ADI generate default values at upload time. If
you wish to automatically place default values in the document when it is created, use DEFAULT_TYPE and
DEFAULT_VALUE in BNE_LAYOUT_COLS_ALL; See section 9.1.7 for more information.

Default values can be stored in metadata. Alternatively, SQL statements, environmental variables, and Java code
can all be used to generate default values. DEFAULT_TYPE describes the value in DEFAULT_VALUE. This
column has four possible values:

SQL: DEFAULT_VALUE is a SQL statement to be run to derive the default value in the document.

ENVIRONMENT: DEFAULT_VALUE is an environmental variable to be inserted into the document. Valid


variables in DEFAULT_VALUE are DATABASE, OAUSER.ID, SOB.Set.Of.Books.Name, LANGUAGE, and
SYSDATE

CONSTANT: DEFAULT_VALUE itself will be inserted into the document as a default value.

JAVA: DEFAUTL_VALUE contains a Java class that will be run to generate a default value.

4.10. Expanded Columns


You may have a case where the number of columns in the document must be determined at run time. For
example, a budget integrator uploading to an interface table containing 60 period columns
(PERIOD1_AMOUNT, PERIOD2_AMOUNT,PERIOD60_AMOUNT) would require this functionality. The
range of periods the user requires in the document could not be determined at design time. The expanded
columns functionality allows an integrator developer to specify a SQL statement that will be used at run time to
retrieve the list of columns and column headers. Follow the instructions below to enable expanded columns.

30
Company Confidential - For internal use only
4.10.1. Use the Web ADI Interface Cols Integrator to identify each column in the interface table that
could possibly exist in the document.

4.10.1.1. Assign each column to a GROUP called PERIODAMTS

4.10.1.2. Enter EXPANDEDSQLSEG for VAL_TYPE.

4.10.1.3. Mapping Enabled = Y.

4.10.1.4. Type = 1

4.10.1.5. Display = N

4.10.1.6. Set the SEGMENT_NUMBER sequentially to indicate the order that the columns are to
be displayed in the document. This number is also used to match the column name
returned from BNE_EXPANDED_COLS_SQL with a column in the document.

4.10.2. Create one record in the spreadsheet to be the Parent segment of the interface columns. This is
the row that will be selectable in the LAYOUTS screen.

4.10.2.1. Group Name=PERIODAMTS


4.10.2.2. Val Type = EXPANDEDSQL
4.10.2.3. OA Concat Flex = N
4.10.2.4. Type = 2
4.10.2.5. Display = Y
4.10.2.6. Mapping Enabled = N
4.10.3. Create a Layout that includes the parent segment by selecting Define Layout from the PHP.
Select your integrator and include the parent segment in the lines region of the layout.

4.10.4. Insert into BNE_INTERFACE_COLS_B. EXPANDED_SQL_QUERY for the parent record.

4.10.4.1.1. Define a SQL statement that returns the Group column names and Segment Number
reference. This statement should return a result set of 2 fields. The first will be interpreted
as the Column name visible to the user. The second will be used to link with the segment
number within the Group. This allows Web ADI to link a name with an interface column.
Note that bind variables can be used so the SQL statement can be edited at run-time.

Example:

SELECT PERIOD_NAME, PERIOD_NUM


FROM GL_PERIOD_STATUSES
WHERE PERIOD_YEAR = 2002
AND APPLICATION_ID = 101
AND SET_OF_BOOKS_ID = 1
AND PERIOD_NUM >= $PARAMS$.PERIODFROM
AND PERIOD_NUM <= $PARAMS$.PERIODTO

4.10.4.1.2. When the create doc service is called with the layout that contains the parent
segment. Web ADI will run the SQL statement above to determine what segments in the
group will appear in the spreadsheet. In the example above, the values for the
PERIODFROM PERIODTO parameters would be passed in the http request when the Web
ADI service is called at run-time. See calling the Create Doc Page Flow for more information
on calling the Web ADI service.

31
Company Confidential - For internal use only
32
Company Confidential - For internal use only
5. Creating Components
A component is an object defined in metadata that provides a list of values for a field in a document. They are the
values specified in VAL_COMPONENT_APP_ID and VAL_COMPONENT_CODE in BNE_INTERFACE_COLS_B.

Attention: You must make sure that the code you plug into the Web ADI SDK is
functionally secure. Users must be prevented from manipulating a URL or a value in
the worksheet that would give them access to restricted values.

5.1. Creating Table Validated Components

You must create a component for every Table Validated field requiring an LOV within the document. A Java
class has been provided to offer this functionality, but metadata must be entered for each LOV to handle
properties such as table headers and window captions. Use the following steps to create a Table Validated
Component.

5.1.1. Create Component


Insert a record into BNE_COMPONENTS_B and TL tables. This record registers the component and tells
Web ADI what Java class to reference when retrieving the LOV and performing validation.
APPLICATION_ID The identifier for your application
COMPONENT_CODE A unique code within your application ID for the
component.
OBJECT_VERSION_NUMBER Set this to 1
COMPONENT_JAVA_CLASS Set this to BneOAValueSet
PARAM_LIST_APP_ID The identifier for your application
PARAM_LIST_CODE Se t this to the code you create in 5.1.2
LANGUAGE Set this to US
SOURCE_LANG Set this to US
USER_NAME This user value is currently not used by the
application.

5.1.2. Create a Parameter List for the Component


This list contains all of the parameters required by the LOV component. Lists have a one to one relationship
with Table Validated components.

5.1.2.1. Access the Parameter List UI and enter a name and Code for your parameter list. Make
the name meaningful and relate it to the field. The Code needs to be the Code you entered for the
component in BNE_COMPONENTS_B.PARAM_LIST_CODE. Check the Persistent Box and add
comments if needed. Press Save when finished.

5.1.2.2. Add the Following Parameters to the Parameter list by pressing Add Another Row.

33
Company Confidential - For internal use only
Parameter Name table-column-alias
Value If the table-select-column does not exist in table-
columns, then enter the table-select-column here to
create an alias for the table-column you wish to have
inserted into the sheet. This is a comma delimited
list.
Description
Parameter Definition Copy the 231:TABLE_COLUMN_ALIAS parameter
definition under your own application ID and use
the copy for this parameter.

Parameter Name table-select-column


Value Enter the
BNE_INTERFACE_COLS_B.INTERFACE_COL_NAM
E of the column you wish the selected LOV to update
in the document
Description
Parameter Definition Copy the 231:TABLE_SELECT_COLUMN parameter
definition under your own application ID and use the
copy for this parameter

Parameter Name table-columns


Value Enter the select columns in the query specified in
BNE_INTERFACE_COLS_B to be displayed in the
lOV. That is, enter one or all values specified in
VAL_DESC_COL, VAL_ID_COL VAL_MEAN_COL
VAL_MSG_COL. This is a comma delimited list.
Description
Parameter Definition Copy the 231:TABLE_COLUMNS parameter
definition under your own application ID and use
the copy for this parameter.

The following parameters are not required for the LOV parameter list. Only add them if you wish to override default
behavior:

Parameter Name table-block-size


Value (Use default from definition This determines the
number of records that will be displayed in the LOV
at one time)
Description
Parameter Definition Copy the 231:TABLE_BLOCK_SIZE parameter
definition under your own application ID and use
the copy for this parameter.
Default used when this 10
parameter is not added
to the list

Parameter Name window-height


Value (Use default from definition this indicates the
height of the display window)
Description
Parameter Definition Copy the 231:WINDOW_HEIGHT parameter

34
Company Confidential - For internal use only
definition under your own application ID and use
the copy for this parameter.
Default used when this 450
parameter is not added
to the list

Parameter Name window-width


Value (Use default from definition this indicates the
width of the display window)
Description
Parameter Definition Copy the 231:WINDOW_WIDTH parameter
definition under your own application ID and use
the copy for this parameter.
Default used when this 350
parameter is not added
to the list

The parameter definitions you created for the parameters above can be re-used when creating more than one table
validated component within your application.

The following two parameters will require a new definition to be created every time a parameter list is created for a
table validated component. This is because their values are translated and specific to each LOV.

Parameter Name table-headers


Value Leave blank to use default in parameter definition
this is Comma-delimited list of table column headers
that will appear in the LOV screen.
Description
Parameter Definition Press the Definition Button to create definition

Definition:
Name Table-headers {Name of Interface Column}
Source (Integrator Name):Components
Category Data
Description Comma-delimited list of table column headers. This
parameter has an individual parameter definition so
it can get translated default values.
Data Type String
Default Value (Enter the headers of each column you wish to
appear in the LOV)
Store as Translatable Checked
Max Size 100
Display Size 100

Name window-caption
Value (Leave blank to use default in parameter definition
this is the title to be placed on window caption bar)
Description Enter meaningful description
Parameter Definition Press the Definition Button to create definition

Definition:
Name Window-caption {Name of Inter face column}

35
Company Confidential - For internal use only
Source (Integrator Name):Components
Category Data
Description This is what is displayed in the window caption
Data Type String
Default Value Enter what you want to be displayed in the LOV
windows caption.
Store as Translatable Checked
Max Size 100
Display Size 100

5.1.3. Assign Component to a field in BNE_INTERFACE_COLS_B


5.1.3.1. Identify the Interface Column in BNE_INTERFACE_COLS_B that will use the
component. You can use the Web ADI Interface Cols Integrator to download your
interface column metadata.

5.1.3.2. Update the VAL_COMPONENT_CODE and VAL_COMPONENT_APP_ID (Valid


Component) columns in the spreadsheet created by the Web ADI Interface Cols Integrator.

Column (Field) Name Description

INTERFACE_CODE Object Code of the Interface. Select INTERFACE_CODE, INTERFACE_NAME


from BNE_INTERFACES_B to get this value.
SEQUENCE_NUM Unique ID for every record that is assigned to the same Application ID/
INTERFACE_CODE. So you could have the same SEQUENCE_NUM for two
records in this table, but they would have to be assigned to different
AppID/Interface Code combinations.
VAL_COMPONENT_CODE Key to Component
(Valid Component)
VAL_COMPONENT_APP_ID Application ID that was used to create the above component

36
Company Confidential - For internal use only
5.2. Creating Date Picker Components

Web ADI has developed a standard Calendar Component to act as a LOV for date fields. A Java class has
been provided to offer this functionality, but metadata must be entered for each LOV to handle properties
such as the window caption. Use the following steps to create a Calendar Component.

5.2.1. Create Component


Insert a record into BNE_COMPONENTS_B and TL tables. This record registers the component and tells
Web ADI what Java class to reference when retrieving the LOV and performing validation.
APPLICATION_ID The identifier for your application
COMPONENT_CODE A unique code within your application ID for the component.
OBJECT_VERSION_NUMBER Set this to 1
COMPONENT_JAVA_CLASS Set this to
oracle.apps.bne.integrator.component.BneCalendarComponent

PARAM_LIST_APP_ID The identifier for your application
PARAM_LIST_CODE Se t this to the code you create in 5.1.2
LANGUAGE Set this to US
SOURCE_LANG Set this to US
USER_NAME This user value is currently not used by the application.

5.2.2. Create a Parameter List for the Component


This list contains all of the parameters required by the LOV component.

5.2.2.1. Access the Parameter List UI and enter a name and Code for your parameter list. Make
the name meaningful and relate it to the field. The Code needs to be the Code you entered for the
component in BNE_COMPONENTS_B.PARAM_LIST_CODE. Check the Persistent Box and add
comments if needed. Press Save when finished.

5.2.2.2. Add the Following Parameters to the Parameter list by pressing Add Another Row.

37
Company Confidential - For internal use only
Parameter Name table-select-column
Value Enter the
BNE_INTERFACE_COLS_B.INTERFACE_COL_NAM
E of the column you wish the selected LOV to update
in the document
Description
Parameter Definition Copy the 231:TABLE_SELECT_COLUMN parameter
definition under your own application ID and use the
copy for this parameter

The following parameters are not required for the LOV parameter list. Only add them if you wish to override default
behavior:

Parameter Name window-height


Value (Use default from definition this indicates the
height of the display window)
Description
Parameter Definition Copy the 231:WINDOW_HEIGHT parameter
definition under your own application ID and use
the copy for this parameter.
Default used when this 220
parameter is not added
to the list

Parameter Name window-width


Value (Use default from definition this indicates the
width of the display window)
Description
Parameter Definition Copy the 231:WINDOW_WIDTH parameter
definition under your own application ID and use
the copy for this parameter.
Default used when this 220
parameter is not added
to the list

Parameter Name table-columns


Value Enter the columns to send to the LOV for use in
determining start/end dates. This is a comma
delimited list of the form
INTERFACE_NAME.COLUMN_NAME.
Description
Parameter Definition Copy the 231:TABLE_COLUMNS parameter
definition under your own application ID and use
the copy for this parameter.

The parameter definitions you created for the parameters above can be re-used when creating more than one
component within your application.

The following two parameter will require a new definition to be created every time a parameter list is created for a
table validated component. This is because their values are translated and specific to each LOV.

Name window-caption

38
Company Confidential - For internal use only
Value (Leave blank to use default in parameter definition
this is the title to be placed on window caption bar)
Description Enter meaningful description
Parameter Definition Press the Definition Button to create definition

Definition:
Name Window-caption {Name of Inter face column}
Source (Integrator Name):Components
Category Data
Description This is what is displayed in the window caption
Data Type String
Default Value Enter what you want to be displayed in the LOV
windows caption.
Store as Translatable Checked
Max Size 100
Display Size 100

5.2.3. Assign Component to a field in BNE_INTERFACE_COLS_B


5.2.3.1. Identify the Interface Column in BNE_INTERFACE_COLS_B that will use the
component. You can use the Web ADI Interface Cols Integrator to download your
interface column metadata.

5.2.3.2. Update the VAL_COMPONENT_CODE and VAL_COMPONENT_APP_ID (Valid


Component) columns in the spreadsheet created by the Web ADI Interface Cols Integrator.

Column (Field) Name Description

INTERFACE_CODE Object Code of the Interface. Select INTERFACE_CODE, INTERFACE_NAME


from BNE_INTERFACES_B to get this value.
SEQUENCE_NUM Unique ID for every record that is assigned to the same Application ID/
INTERFACE_CODE. So you could have the same SEQUENCE_NUM for two
records in this table, but they would have to be assigned to different
AppID/Interface Code combinations.
VAL_COMPONENT_CODE Key to Component
(Valid Component)
VAL_COMPONENT_APP_ID Application ID that was used to create the above component

5.2.4. Creating your own Calendar Component


It is possible that the Integrator Developer may wish to implement their own calendar
component using the Web ADI component as a base. This provides flexibility in
creating code that sets sart/end dates, or the currently selected date based on business
rules relevant to the column in question.

This may be done by extending the BneCalendarComponent and over-riding some (or
all) of the following methods:
listOfValuesInit()
getListOfValueParameters()
getMinCalendarValue()

39
Company Confidential - For internal use only
getMaxCalendarValue()
getDefaultCalendarValue()

These are documented in detail in the product Javadoc.

5.3. Creating JAVA Validated Components

Your field may require an LOV or validation that is more complex than Table Validation. Valid fields could depend
on a number of parameters, including some entered or existing in the document. Complex business rules will require
the creation of a Java Validated record in BNE_INTERFACE_COLS_B. Creating a Java validated field involves the
following steps:

9 Create Java Class

9 Enter a record for the component into BNE_COMPONENTS_B/_TL

9 Create Parameter List for the component

9 Create parameter definitions for the class

9 Attach Parameters required by the class to the Parameter List

9 Assign Component to a column in BNE_INTERFACE_COLS_B. This includes putting the component key in
VAL_COMPONENT_CODE, an application ID in BNE_VAL_COMPONENT_APP_ID and entering the Java
Class in VAL_OBJ_NAME.

Java validation includes the following two types of functionality; provide List of Values
for fields in the Web ADI documents and validation of data at upload time. For the
purposes of this document, each shall be referred to as LOVs (List of Values) and Upload
Validators respectively.

Java Validation allows business rules to be used for the following purposes:

To determine the data to be displayed to a user in an LOV.

To determine whether a value is valid prior to uploading it to the database.

There are three main Java classes associated with Java Validation:

1.1.1.1 SQL Java Class


This class contains all of the SQL queries required for Java Validation: including LOVs
and Upload Validators.

1.1.1.2 Validator Java Class


This class contains all the business logic for Java Validation: including LOVs and Upload
Validators. The LOV code is separate to the Upload Validator code, but the code for both
is maintained in this class.

For more complex solutions where the validation of one interface column is conditional
upon the validation of one or more other interface columns, a Group Validator will need
to be implemented.

40
Company Confidential - For internal use only
For example: if any one of three columns is required to contain a value at the time of
upload, but none of the columns is defined as a required column, then a Group Validator
can be used at Upload time to ensure that one of the three columns contains a value.

1.1.1.3 Component Java Class


This class contains all the business logic and setup information for generating the List of
Values (LOV) page in the Web ADI document. This class is not required for the
implementation of an Upload Validator.

As part of the Java Validation implementation, metadata corresponding to the LOV and
Upload Validator must be seeded in the BNE database schema.

Sample metadata and sample Java Classes are included in the Appendices of this
document.

This documentation assumes that you already have fundamental Web ADI objects
created, i.e. an Integrator, Interface, Interface Columns, Layout and Mapping.

NOTE: Only experienced Java developers should write the three Java classes required to
implement an LOV or Upload Validator.

1.1.1.4 Naming Standards


The following naming standard is a guideline for naming your Java classes:

Prefix each class name with your application short name, e.g. Bne, Gl, etc.

Suffix with SQL/Validator/Component depending on the type of class being


written.

Use the same name for all three classes that make up the LOV and/or Upload Validator.
This usually includes the name of the field in the Web ADI document for which the Java
Validation is being implemented.

e.g. ApplFieldNameSQL, ApplFieldNameValidator, ApplFieldNameComponent; or

BnePeriodNameSQL, BnePeriodNameValidator,
BnePeriodNameComponent

Use the Java standard of InitCaps for your class names, as shown in the example above.

SQL Java Class

This class contains all the SQL queries required to generate the List of Values (LOV)
applicable to the Interface Column, and all the SQL queries required to perform the
Upload Validation for the same Interface Column. Usually these queries are the same.

The SQL queries required for the Upload Validator include all queries required to verify
business rules pertaining to the data being uploaded into the database. Usually one or
more queries are required to validate a single field.

For example (as per the BneOAPeriodNameSQL class Appendix A), when validating
the Period Name column in a GL Journal, you may need the following SQL queries:

41
Company Confidential - For internal use only
1. When uploading an Accounting Date and a Period Name, you need to run a
query to confirm that the Accounting Date falls within the Period.

2. It is also necessary to check that the Period is valid.

Both queries are required to ensure that a more accurate and meaningful error message
is displayed to the user.

For a Java Validator that incorporates several business rules, several queries may be used
to generate different Lists of Values dependent on the business rules. The following two
examples help to illustrate how this can be done:

Example 1 Generic example:

IF A and B THEN

Generate List of Values C

ELSE IF A

Generate List of Values D

ELSE

Generate List of Values E

END IF

Example 2 Period Name example:

IF an Accounting Date has been entered in the spreadsheet THEN

Generate a List of all Periods that include the Accounting Date

ELSE

Generate a List of all Open or Future Enterable Periods

END IF

1.1.1.5 Implementing the SQL Java Class


This class must be written as a public class that extends BneBaseSQL. The class only requires a
Constructor method.

For a Validator/LOV requiring only one SQL query, the following signature should be used for
the Constructor:

public BneApplFieldNameSQL(BneWebAppsContext context,


String extraSQL)

For a Validator/LOV requiring two or more SQL queries, the following signature should be
used for this Constructor:

public BneApplFieldNameSQL(BneWebAppsContext context,

42
Company Confidential - For internal use only
int queryNumber,
String extraSQL)

The parameters for the SQL Java class Constructor are as follows:

Parameter Value, Description

Context 800, this is the Application ID for Oracle HR.


queryNumber Object version.
extraSQL

1.1.1.6 context
This parameter contains all the JDBC session information required to prepare the SQL query.

1.1.1.7 queryNumber
This parameter is used to identify the query to be prepared when the Constructor is called.
A switch statement is used to hold the different queries using a number to represent each
case. It is important to include a default case in the switch statement to handle any invalid
query numbers.

For example:

switch (queryNumber)
{
case 1:
query.append(SELECT );
break;

case 2:
query.append(SELECT );
break;

default:
throw IllegalArgumentException (with meaningful message);
}

extraSQL
This parameter is used to pass the value selected from the LOV by the user in the Web ADI
document. This is only used by the Upload validator, and is appended to the appropriate
query to restrict the results using the user-selected value.

The pseudocode for the SQL Java class Constructor is as follows:


- Build up the query in a StringBuffer
- Append the string in the extraSQL parameter to the StringBuffer
if the extraSQL parameter is not null
- Call the BneBaseSQL.setQuery method to prepare the SQL query

To summarise how this class will be used:

43
Company Confidential - For internal use only
The SQL queries in this class will be run:

Firstly to generate the List of Values to be displayed in the List of Values page; and

Secondly, to validate the user-selected value at upload time.

For Upload Validation extra SQL is appended to the Where criteria of the query limiting the
query results to values matching the user-selected value. Therefore, the value being
uploaded is only valid if one or more rows are returned by the query, and invalid when no
rows are returned.

Validator Java Class

The Web ADI platform has been designed to allow the use of Java Validators to allow more
complex logic to be used to validate the data in a spreadsheet before it is uploaded into the
database.

Some examples of the complex logic that can be incorporated into the Java Validators:

Profile options determine the validation that will be done depending on the profile
option value.

Other system setup anything that can be queried from the database can be used
within your validator class to assist in validating the interface column(s) in the Web
ADI document.

There are two types of Java validators: Field Validators and Group Validators.

Field Validators
Individual interface columns can be validated using a field validator. This is the most
common type of validator. Other interface column values for the same record that have been
entered in the spreadsheet can be used to help validate the individual interface column.

Group Validators
An interface column can be part of a group. All columns that form part of the group are
validated as a complete set of columns.

For example, the SEGMENT columns in the GL_INTERFACE table that make up an
Accounting Flexfield account need to be validated as a complete set, not as individual values.
So, by identifying each SEGMENT column as being part of an
ACCOUNTING_FLEXFIELD_GROUP, when group validation is performed, all of the
segment values for the group are collected and validated together as a set.

The metadata and code together determine whether a validator is a field or group validator.
Refer to the section: Metadata for Java Validation.

44
Company Confidential - For internal use only
1.1.1.8 Implementing a Field Validator Java Class
An individual field validator class should be a public class that extends the
BneUploadValidator class. The BneUploadDomainInterface and BneUploadValidatorInterface
are both implemented in the BneUploadValidator abstract class.

All validators should extend the BneUploadValidator class, which provides default
implementations of a number of methods in the two Interfaces. The default implementations
do not enforce any additional validation.

Methods that MUST be implemented for an Upload Validator

startupValidator
This method is called once at the beginning of the Upload Validation process. Use this
method to perform setup steps that only need to be performed once. For example, look
up a profile option value. This value is not different for each row of data, and therefore
only needs to be derived once.

The signature for this method is as follows:

public BneUploaderMessage[] startupValidator


(BneWebAppsContext context,
Hashtable requestParameters,
Hashtable columnValues)

validateColumn
This method is called once for each different value being uploaded for the interface
column. If the value being validated is the same as the last value that was validated (in
the same upload), the validation will not occur again. The signature for this method is as
follows:

public BneUploaderMessage[] validateColumn


(BneWebAppsContext context,
Hashtable requestParameters,
Hashtable columnValues,
BneUploadColumn currentColumn)

45
Company Confidential - For internal use only
The logic for this method is as follows:

- Get the currentColumn value

- Create a SQL handle to the SQL Query by calling the SQL class constructor
(pass the additional WHERE clause criteria in the extraSQL parameter)
E.g. COLUMN_NAME = ?

- Run the SQL (from the SQL class) passing the following values:
- CurrentColumn value (bind variable for extraSQL)
- Any other required values from the columnValues hashtable
- Any other required values (derived within the class)

- If the SQL Result Set contains 1 or more records


- Set the record as FineGrainValid
- Else
- Return an uploadError message in the BneUploaderMessage array.
- End if

shutdownValidator
This method is called once at the end of the Validation process. Ensure that any SQL
handles are closed in this method. The signature for this method is as follows:

public BneUploaderMessage[] shutdownValidator()

Methods that can be optionally implemented


The following method can be optionally implemented for an individual field validator:

finalValidation
This method is processed after all rows have been validated. This allows for validation to
be carried out that for the entire set of rows in the Upload document, if required. The
signature for this method is as follows:

public BneUploaderMessage[] finalValidation


(BneWebAppsContext context,
Hashtable requestparameters)

Useful methods provided by the upload interfaces


The following protected methods are available for use within your validator class:

uploadError
This method can be used to simplify the formatting of an Upload Error message. This is
an error message and will prevent the upload from occurring. A message should be
passed to this method in the msgStr parameter. This message should explain what the
error is and how the error can be fixed. The signature for this method is as follows:

protected BneUploaderMessage[] uploadError


(BneUploadColumn currentColumn,
String msgStr,
String className)

46
Company Confidential - For internal use only
uploadException
This method can be used to simplify the formatting of an Upload Exception message.
This is an error message and will prevent the upload from occurring. Two messages
should be passed to this method. The first message should describe the error that has
occurred or what caused the error. This message should be passed to the method in the t
parameter. The second message should explain how the error can be fixed. This message
should be passed to this method in the msgStr parameter. The signature for this method
is as follows:

protected BneUploaderMessage[] uploadException


(BneUploadColumn currentColumn,
String msgStr,
String className,
Throwable t)

uploadWarning
This method can be used to simplify the formatting of a Warning message. This is a
warning message only and will not prevent the upload occurring. The signature for this
method is as follows:

protected BneUploaderMessage[] uploadWarning


(BneUploadColumn currentColumn,
String msgStr,
String className)

Methods that MUST be implemented for an LOV

getDomainParameters
This method must create and return a String array of all the interface column names
whose values are required to generate the List of Values.

The signature for this method is as follows:

public String[] getDomainParameters ()

getDomainValues
This method must generate and return an SQL result set containing the values to be
displayed in the List of Values.

The signature for this method is as follows:

public BneResultSet getDomainValues


(BneWebAppsContext context,
Hashtable columnValues,
BneCompositeSQLCriteria criteria) throws BneException

The logic for this method is as follows:


Determine which SQL query must be used to generate the List of Values

Create a SQL handle to the SQL Query by calling the SQL class constructor
(the extraSQL parameter is usually passed as null)

47
Company Confidential - For internal use only
Run the SQL (from the SQL class) passing any values required for binding
e.g. Any other required values from the columnValues hashtable,
Any other required values (derived within the class)

Return the SQL result set

Methods that can be optionally implemented for an LOV

shutdownValidator
This method is called once at the end of the LOV/Validation process. Ensure that any
SQL handles are closed in this method. The signature for this method is as follows:

public BneUploaderMessage[] shutdownValidator()

Implementing a Group Validator Java Class

Group validation is performed after all individual field validation is complete. Classes that are
written as group validators must extend the BneUploadGroupValidator abstract class. The
methods included in this class are as follows:

getDomainParameters and getDomainValues


Default implementations for these methods exist in the BneUploadGroupValidator class
therefore, there is no need to implement them.

startupValidator
This method is called once at the beginning of the LOV/Validation process. Use this method
to perform setup steps that only need to be performed once. For example, look up a profile
option value. This value is not different for each row of data, and therefore only needs to be
derived once.

The signature for this method is as follows:

public BneUploaderMessage[] startupValidator


(BneWebAppsContext context,
Hashtable requestParameters,
Hashtable columnValues)

validateGroup
This method validates a group of values in a single row. It is called repeatedly throughout
the upload validation process. Access to the entire row of data is available via the
columnValues Hashtable.

The signature for this method is as follows:

public BneUploaderMessage[] validateGroup


(BneWebAppsContext context,
Hashtable requestParameters,
Hashtable columnValues,
BneInterface bneinterface,

48
Company Confidential - For internal use only
BneInterfaceCol interfaceCol)

The logic for this method is as follows:

- Get the columnValues for the columns in the group

- Compare the values as required by the business rules.

- If the validation fails


- Return an uploadError message in the BneUploaderMessage array.
- Else
- Return an empty BneUploaderMessage array
- End if

shutdownValidator
This method is called once at the end of the LOV/Validation process. Ensure that any SQL
handles are closed in this method. The signature for this method is as follows:

public BneUploaderMessage[] shutdownValidator()

Methods that can be optionally implemented for a Group Validator

finalValidation
This method is processed after all rows have been validated. This allows for validation to
be carried out that for the entire set of rows in the Upload document, if required. The
signature for this method is as follows:

public BneUploaderMessage[] finalValidation


(BneWebAppsContext context,
Hashtable requestparameters)

Useful methods provided by the upload interfaces


The following protected methods are available for use within your group Validator class:

uploadError
This method can be used to simplify the formatting of an Upload Error message. This is
an error message and will prevent the upload from occurring. A message should be
passed to this method in the msgStr parameter. This message should explain what the
error is and how the error can be fixed. The signature for this method is as follows:

protected BneUploaderMessage[] uploadError


(BneUploadColumn currentColumn,
String msgStr,
String className)

uploadException
This method can be used to simplify the formatting of an Upload Exception message.
This is an error message and will prevent the upload from occurring. Two messages
should be passed to this method. The first message should describe the error that has
occurred or what caused the error. This message should be passed to the method in the t
parameter. The second message should explain how the error can be fixed. This message

49
Company Confidential - For internal use only
should be passed to this method in the msgStr parameter. The signature for this method
is as follows:

protected BneUploaderMessage[] uploadException


(BneUploadColumn currentColumn,
String msgStr,
String className,
Throwable t)

Component Java Class

This class contains all the business logic and setup information for generating the List of Values
(LOV) page for an Interface Column in the Web ADI document. This class is not required for
the implementation of an Upload Validator.

Properties relating to the information displayed in the LOV window and how it will be
displayed can be derived from four different places. These properties are referred to as
Component Parameters. Web ADI uses the following order of precedence when using these
Component Parameters to generate the LOV page:

1. Values set at run-time in the Component Java class.

2. Parameter List items values can be defined against each item in a Parameter List.

3. Parameter Definitions a Parameter Definition is linked to a Parameter List Item. If the


Parameter List Item does not have its own value, the Parameter Definition default value
is used.

4. Hard-coded defaults - when values are not defined in metadata or set within the
Component Java class, Web ADI will use the hard-coded defaults to create the LOV
page.

1.1.1.9 Hard-coded Defaults


The following hard-coded defaults are defined in the BneAbstractListOfValues java class.
These values can only be changed by including them in a Parameter List or by setting them in
the Component Java class.

Component Parameter Default Valid Values Description


Name

Datasource Must be text. ID of the target datasource.


Language Must be text. Sets the language for the form to operate in.
table-destination Must be text. Destination for post table results to, for
example http://myhost/myservlet.
table-headers Must be text. Comma-delimited list of table column
headers
table-columns Must be text. Comma-delimited list of table columns
table-column-alias Must be text. Comma-delimited list of column aliases, if
empty then the column names will be used.
table-column-hidden Must be text. Comma-delimited list of columns to be
rendered hidden.
table-column-sort no, yes, ascending, Comma-delimited list of column to sort
descending order, values are; { no, yes, ascending,
descending }
table-detail-uix Must be text. Oracle UIX Elements to display in the table

50
Company Confidential - For internal use only
Component Parameter Default Valid Values Description
Name

detail.
table-block-size 10 Must be a number. Determines the number of records to
display.
table-long-list false true, false Determines if the results are too long to
display and restricts first; values are; { true,
false }
table-select-column Must be text. Select column, comma-seperated list of
columns to be selected. If aliases exist then
use the alias name. Example: NAME,DEPT
table-select-type _SINGLE_SELECTION _SINGLE_SELECTION, Type of table selection; values are; {
_MULTIPLE_SELECTION SINGLE , MULTIPLE }"
table-filter true true, false Display table filter on select columns;
values are; {true, false}
window-caption Search and Select Must be text. Title to place on window caption bar.
window-width 350 Must be a number. Width of display window.
window-height 450 Must be a number. Height of display window

Table 1 Hard-Coded Defaults

Business logic is usually incorporated in the Validator class, however, the same logic can be
used in the Component class to determine the type of LOV that is displayed. For example, for a
date field, a Calendar may be displayed in one case, but a list of specific dates in another case.

Implementing the Component Java Class

Lists Of Values are CABO/UIX pages with exposed DOM interaction for use with Viewers.
The Component class determines the look and feel of the CABO/UIX page and the data that
will be displayed on the page.

The Component class must extend the BneAbstractListOfValues abstract class. The methods
included in this class are as follows:

init method
This method instantiates the Validator class and then calls the getDomainParameters
method using the instantiation to create a String array of the interface column names
required by the validator. The signature for this method is as follows:

public void init


(BneBajaContext context,
Page page,
PageEvent event)

Parameter Description

context Interface providing context information about the current request,


and providing access to generic Baja services.
page Identifies the LOV page.
event Interface for events triggered on the page. Encapsulates a servlet
request.

51
Company Confidential - For internal use only
getListOfValueParameters method
This is an abstract method within the BneAbstractListOfValues class and therefore requires
an implementation within the Component class. This method creates a BneParameterList
object consisting of one record for each parameter in the parameter list created by the
getDomainParameters method call. Each record consists of the Parameter name and a
description for the parameter in the format Oracle Applications
GL_INTERFACE.<parameter_name> field.. The signature for this method is as follows:

public void getListOfValueParameters ()

handleListOfValues method
This is an abstract method within the BneAbstractListOfValues class and therefore requires
an implementation within the Component class. This class calls public methods to set up the
information for the table that will be displayed in the LOV, for example: setTableFilter,
setPageTitle, setTableData, setTableColumns, setTableHeaders, and setTableSelectColumn.
Return null from this method. The signature for this method is as follows:

public BneBajaPage handleListOfValues


(BneBajaContext context,
Page page,
PageEvent event,
BneLOVControlBean bean) throws BneException

Parameter Description

context Interface providing context information about the current request,


and providing access to generic Baja services.
page Identifies the LOV page.
event Interface for events triggered on the page. Encapsulates a servlet
request.
bean Holds information about the LOV control.

This method will use the following logic:

Call handlePageParameters

For all validator parameters


Get the parameter value
Place the parameter name and parameter value in a hashtable
End for

If a filter value has been entered in the LOV window


Add the filter value to the searchCriteria
End if

Set the LOV table data using public methods:


TableFilter
PageTitle
TableData
TableColumns
TableHeaders
TableSelectColumns

52
Company Confidential - For internal use only
handlePageParameters method
This method retrieves the filter field and filter value from the LOV page using an Http
Request. Two String instance variables need to be defined to hold these two values:
m_filterField and m_filterValue.The signature for this method is as follows:

private void handlePageParameters


(BneBajaContext context,
Page page,
PageEvent event) throws BneException

Parameter Description

context Interface providing context information about the current request,


and providing access to generic Baja services.
page Identifies the LOV page.
event Interface for events triggered on the page. Encapsulates a servlet
request.

53
Company Confidential - For internal use only
getTableData method
This method generates the result set for the LOV by calling the Validator class
getDomainValues method. This method processes each record in the result set returned by
the getDomainValues method to create a Vector containing all the valid values for the LOV.
A DictionaryData construct is created using the data in the Vector. This Validator class
shutdownValidator method is called to close off any open SQL handles. The signature for
this method is as follows:

public DictionaryData [] getTableData


(BneWebAppsContext bneWebAppsContext,
BneLOVControlBean bean,
Hashtable parameterValues,
BneCompositeSQLCriteria criteria)
throws BneException

Parameter Description

bneWebAppsConte This is the BneWebAppsContext that provides us with a valid


xt session to use when preparing the SQL statement.
bean Holds information about the LOV control.
parameterValues This is a hashtable containing the list of all columns and their values
which are required for the SQL to derive the list of values.
criteria This is of type BneCompositeSQLCriteria and contains all the details
for the Component LOV.

getLOVProcessorType method
This is an abstract method within the BneAbstractListOfValues class and therefore requires
an implementation within the Component class. This method must return an LOV type. The
LOV types have been defined using the following constants (include java class
oracle.apps.bne.framework.BneConstants to use these contants):

Constant Name Data Value Description


Type

BNE_LOV_TYPE_TABLE String TABLE Data in the LOV page will be formatted in a


table.
BNE_LOV_TYPE_FORM String FORM Not currently used.
BNE_LOV_TYPE_FLEX String FLEX Used for DFF and KFF LOVs.
BNE_LOV_TYPE_CALENDAR String CALENDAR A date picker will be displayed in the LOV
page.

The LOV Processor Type is set at the time the Document is created. The signature for this
method is as follows:

public String getLOVProcessorType()

54
Company Confidential - For internal use only
getComponentName method
This method returns a hard-coded string containing the name of the component, i.e.
BneOAFieldName.

getComponentVersion method
This method returns a hard-coded string containing the revision number of the component.
Use the token $ Revision: $ as your string. This will return the current revision number for
the Component class.

Metadata for Java Validation


Metadata must be created in the following tables and in the order shown below:

BNE_PARAM_DEFNS_B, BNE_PARAM_DEFNS_TL

BNE_PARAM_LISTS_B, BNE_PARAM_LISTS_TL

BNE_PARAM_LIST_ITEMS

BNE_COMPONENTS_B, BNE_COMPONENTS_TL

BNE_INTERFACE_COLS_B

Integrator Developers should use the Parameter UI supplied with Web ADI to create the
Parameter List, Parameter List Items and Parameter Definitions. The Parameter UI can be
accessed using the following URL:

http://server:port/oa_servlets/oracle.apps.bne.webui.BneApplicationService?bne:page=BneParameter

This section describes each of the columns in the tables listed above. Sample metadata is
included in Appendix D - Sample Metadata for the Period Name Java Validation.

BNE Parameter Definition Tables

Below is a description of the columns within the BNE_PARAM_DEFNS_B and BNE_PARAM_DEFNS_TL


tables.

BNE_PARAM_DEFNS_B

Column Name Data Type Size Description

APPLICATION_ID NUMBER 15 Application ID eg. 101 for Oracle General Ledger


PARAM_DEFN_CODE VARCHAR2 30 Unique parameter definition code. Must be all Caps
Underscores are acceptable.
OBJECT_VERSION_NUMBER NUMBER 15 This is a version number for the Parameter Definition. Set
to 1 on creation. Increment this number every time a
value changes for any of the columns in this record.
PARAM_NAME VARCHAR2 240 A meaningful name/description of the Parameter

55
Company Confidential - For internal use only
Column Name Data Type Size Description

Definition.
PARAM_SOURCE VARCHAR2 240 This is the source requiring the parameter definition. This
is a text entry field.
PARAM_CATEGORY NUMBER 5 Categorys include: Miscellaneous, Position, Appearance,
Behaviour, Data, Field.
DATATYPE NUMBER 1 Data Types include: String, Number, Date, Boolean.
DEFAULT_REQUIRED_FLAG VARCHAR2 1 Is a value required for this parameter? Y/N
DEFAULT_VISIBLE_FLAG VARCHAR2 1 Is this parameter visible to the user? Y/N
DEFAULT_USER_MODIFYABLE_FLAG VARCHAR2 1 Is the user able to change this parameter value? Y/N
DEFAULT_STRING VARCHAR2 2000 Set a default value of type VARCHAR2.
DEFAULT_DATE DATE Set a default value of type DATE.
DEFAULT_NUMBER NUMBER Set a default value of type NUMBER.
DEFAULT_BOOLEAN_FLAG VARCHAR2 1 Set a default value of type boolean.
DEFAULT_FORMULA VARCHAR2 240 Supply a format mask for the default value.
VAL_TYPE VARCHAR2 2 Validation types include: None, Fnd Lookups, Value Set
MAX_SIZE NUMBER 5 The maximum size of the parameter value.
DISPLAY_TYPE NUMBER 1 Display Types include: List Box, CheckBox, Radio
Buttons, Text Field, Password Field.
DISPLAY_STYLE NUMBER 1 Display Styles include: None, Vertical Horizontal
DISPLAY_SIZE NUMBER 5 The size of the value to be displayed to the user. This
should not exceed the MAX_SIZE value.

BNE_PARAM_DEFNS_TL

Column Name Data Type Size Description

APPLICATION_ID NUMBER 15 Application ID eg. 101 for Oracle General Ledger


PARAM_DEFN_CODE VARCHAR2 30 Unique parameter definition code. Must be all Caps
Underscores are acceptable.
LANGUAGE VARCHAR2 4 Standard Apps Language column.
SOURCE_LANG VARCHAR2 4 Standard Apps Language column.
USER_NAME VARCHAR2 240 A meaningful name/description of the Parameter
Definition.
DEFAULT_STRING VARCHAR2 2000 Set a default value of type VARCHAR2. This is defined in
the TL table when the value is to be translated.
DEFAULT_DESC VARCHAR2 240 Set the default description for the parameter.
PROMPT_LEFT VARCHAR2 240 This is an internal representation of the Component
parameter and must match an appropriate Component
parameter name. See Table Hard-Coded Defaults.
PROMPT_ABOVE VARCHAR2 240 This is an internal representation of the Component
parameter and must match an appropriate Component
parameter name. See Table Hard-Coded Defaults.
USER_TIP VARCHAR2 2000 Describe the purpose of the parameter to the user.

BNE Parameter List Tables

BNE_PARAM_LISTS_B

Column Name Data Type Size Description

APPLICATION_ID NUMBER 15 Application ID eg. 101 for Oracle General Ledger


PARAM_LIST_CODE VARCHAR2 30 Unique parameter list code. Must be all Caps Underscores
are acceptable.
OBJECT_VERSION_NUMBER NUMBER 15 This is a version number for the Parameter List. Set to 1 on
creation. Increment this number every time a value changes
for any of the columns in this record.
PERSISTENT_FLAG VARCHAR2 1 Set to Y to mark this as a permanent parameter list.
COMMENTS VARCHAR2 240 Comments describing what the list is used for.

56
Company Confidential - For internal use only
BNE_PARAM_LISTS_TL

Column Name Data Type Size Description

APPLICATION_ID NUMBER 15 Application ID eg. 101 for Oracle General Ledger


PARAM_LIST_CODE VARCHAR2 30 Unique parameter list code. Must be all Caps Underscores
are acceptable.
LANGUAGE VARCHAR2 4 Standard Apps Language column.
SOURCE_LANG VARCHAR2 4 Standard Apps Language column.
USER_NAME VARCHAR2 240 A meaningful name for the Parameter List.

BNE Parameter List Items Table

Parameters that are different from the hard-coded defaults are included in the Parameter List.
Add one item for each parameter.

1.1.1.10 BNE_PARAM_LIST_ITEMS
Link an existing Parameter Definition to a Parameter List item by setting the
PARAM_DEFN_APP_ID and PARAM_DEFN_CODE values.

Column Name Data Type Size Description

APPLICATION_ID NUMBER 15 Application ID eg. 101 for Oracle General Ledger


PARAM_LIST_CODE VARCHAR2 30 Unique parameter list code. Must be all Caps Underscores
are acceptable. (This is the same value used for the Param
List in section 2.6.4)
SEQUENCE_NUM NUMBER 15 Each parameter in a single parameter list must have a
unique number. Numbering must start at 1 and increment
by one for each parameter.
PARAM_DEFN_APP_ID (FK1) NUMBER 15 The Parameter Definition Application ID eg. 101 for Oracle
General Ledger
PARAM_DEFN_CODE (FK1) VARCHAR2 30 The unique Parameter Definition code.
STRING_VALUE VARCHAR2 2000 Set a value of type VARCHAR2.
DATE_VALUE DATE Set a value of type DATE.
NUMBER_VALUE NUMBER Set a value of type NUMBER.
BOOLEAN_VALUE_FLAG VARCHAR2 1 Set a value of type boolean.
FORMULA_VALUE VARCHAR2 240 Supply a format mask for the value.
DESC_VALUE VARCHAR2 240 Description for the value. This is usually the same as the
parameter value defined in one of the VALUE columns.

BNE Component Tables

BNE_COMPONENTS_B
Link an existing Parameter List to a Component by setting the PARAM_LIST_APP_ID and
PARAM_LIST_CODE values.

Column Name Data Type Size Description

57
Company Confidential - For internal use only
Column Name Data Type Size Description

APPLICATION_ID NUMBER 15 This is the APPLICATION_ID for your Application, e.g. The
APPLICATION_ID for GL is 101.
COMPONENT_CODE VARCHAR2 30 Unique Component code. This should be as meaningful as
possible for the Component, e.g.
GL_ACCOUNTING_DATE_COMPONENT. Must be all
caps.
OBJECT_VERSION_NUMBER NUMBER 15 This is a version number for the Component. Set to 1 on
creation. Increment this number every time a value changes
for any of the columns in this record.
COMPONENT_JAVA_CLASS VARCHAR2 240 This must be the fully qualified Component java class name,
e.g.
oracle.apps.bne.integrator.components.BneFieldNameComp
onent
PARAM_LIST_APP_ID (FK1) NUMBER 15 The Parameter List Application ID.
PARAM_LIST_CODE (FK1) VARCHAR2 30 The Parameter List Code.

BNE_COMPONENTS_TL

Column Name Data Type Size Description

APPLICATION_ID NUMBER 15 This is the APPLICATION_ID for your Application, e.g. The
APPLICATION_ID for GL is 101.
COMPONENT_CODE VARCHAR2 30 Unique Component code. This should be as meaningful as
possible for the Component, e.g.
GL_ACCOUNTING_DATE_COMPONENT. Must be all
caps.
LANGUAGE VARCHAR2 4 Standard Apps Language column.
SOURCE_LANG VARCHAR2 4 Standard Apps Language column.
USER_NAME VARCHAR2 240 A meaningful name for the Component.

BNE Interface Column(s) Tables

For a Field Validator/LOV, only the VAL_TYPE, VAL_OBJ_NAME,


VAL_COMPONENT_APP_ID and VAL_COMPONENT_CODE columns need to be updated
for the individual Interface Column that requires the Validator/LOV.

For a Group Validator/LOV, an additional Interface Column needs to be created. The


GROUP_NAME column needs to be updated for each of the Interface Columns that are
validated by the Group Validator/LOV.

1.1.1.11 Field Validator/LOV


Update the following columns in the BNE_INTERFACE_COLS_B table against the Interface Column
that requires the Validator/LOV. Link an existing Component to an Interface Column by setting the
VAL_COMPONENT_APP_ID and VAL_COMPONENT_CODE values. Link an Upload Validator to
an Interface Column by setting the VAL_TYPE and VAL_OBJ_NAME values.

BNE_INTERFACE_COLS_B

Column Name Data Type Size Description

APPLICATION_ID NUMBER 15 This is the APPLICATION_ID for your Application, e.g. The

58
Company Confidential - For internal use only
Column Name Data Type Size Description

APPLICATION_ID for GL is 101.


INTERFACE_CODE VARCHAR2 30 Unique Interface code. This should be as meaningful as
possible for the Interface, e.g. GL_INTERFACE_115. Must
be all caps.
OBJECT_VERSION_NUMBER NUMBER 15 This is a version number for the Interface Column. Set to 1
on creation. Increment this number every time a value
changes for any of the columns in this record.
SEQUENCE_NUM NUMBER 15 Each interface column for a single Interface must have a
unique number. Numbering must start at 1 and increment
by one for each interface column.
VAL_TYPE VARCHAR2 20 The validation type for Java validators is always JAVA.
VAL_OBJ_NAME VARCHAR2 240 This must be the fully qualified Validator java class name,
e.g.
oracle.apps.bne.integrator.validators.BneFieldNameValidat
or
VAL_COMPONENT_APP_ID (FK1) NUMBER 15 The Component Application ID.
VAL_COMPONENT_CODE (FK1) VARCHAR2 30 The Component Code.
LOV_TYPE VARCHAR2 30 LOV Types include: NONE, STANDARD, POPLIST. For
Java LOV Components, the type will always be
STANDARD.
OFFLINE_LOV_ENABLED_FLAG VARCHAR2 1 This only applies to Oracle Sales Offline. Set this to N.

1.1.1.12 Group Validator/LOV


A new record is created in the BNE_INTERFACE_COLS tables for the Validation Group. The exising
Interface Column records for the columns to be included in the group validation are updated to be a
part of the group.

BNE_INTERFACE_COLS_B - Validation Group


A new Interface Column is defined for the Group Validator. Metadata for this new interface column
should be as follows: (Refer to Appendix E for a Group Validator metadata example)

Column Name Data Type Size Description

APPLICATION_ID NUMBER 15 This is the APPLICATION_ID for your Application, e.g. The
APPLICATION_ID for GL is 101.
INTERFACE_CODE VARCHAR2 30 Unique Interface code. This should be as meaningful as
possible for the Interface, e.g. GL_INTERFACE_115. Must
be all caps.
SEQUENCE_NUM NUMBER 15 Each interface column for a single Interface must have a
unique number. Numbering must start at 1 and increment
by one for each interface column.
INTERFACE_COL_TYPE NUMBER 15 As the parent of a Group, the interface column type must be
set to 2.
INTERFACE_COL_NAME VARCHAR2 50 This is the name of the Group with _PARENT appended to
it.
ENABLED_FLAG VARCHAR2 1 Is the group/parent column enabled? Y/N
REQUIRED_FLAG VARCHAR2 1 The Group Validator will always run when pre-validation is
checked in the Upload Parameters page.
DISPLAY_FLAG VARCHAR2 1 This column is not used. This is set to the default of N.
READ_ONLY_FLAG VARCHAR2 1 This column is not used. This is set to the default of N.
NOT_NULL_FLAG VARCHAR2 1 This column is not used. This is set to the default of N.
SUMMARY_FLAG VARCHAR2 1 This column is not used. This is set to the default of N.
MAPPING_ENABLED_FLAG VARCHAR2 1 This column is not used. This is set to the default of N.
GROUP_NAME VARCHAR2 30 This is the name of the group. The group/parent interface
column and all interface columns to be included in the
group must have the same GROUP_NAME.

59
Company Confidential - For internal use only
Column Name Data Type Size Description

VAL_TYPE VARCHAR2 20 The Validation Type must be set to GROUP.


VAL_OBJ_NAME VARCHAR2 240 This must be the fully qualified GroupValidator java class
name, e.g.
oracle.apps.bne.integrator.validators.BneGroupNameGroup
Validator
LOV_TYPE VARCHAR2 30 This column is not used. This is set to the default of
NONE.
OFFLINE_LOV_ENABLED_FLAG VARCHAR2 1 This column is not used. This is set to the default of N.

BNE_INTERFACE_COLS_B Interface Columns included in the Validation Group


For each Interface Column to be validated by the Group Validator/LOV, update the GROUP_NAME
column to contain the GROUP_NAME defined by the new Interface Column definition (see above).

Column Name Data Type Size Description

APPLICATION_ID NUMBER 15 This is the APPLICATION_ID for your Application, e.g. The
APPLICATION_ID for GL is 101.
INTERFACE_CODE VARCHAR2 30 Unique Interface code. This should be as meaningful as possible for the
Interface, e.g. GL_INTERFACE_115. Must be all caps.
SEQUENCE_NUM NUMBER 15 Each interface column for a single Interface must have a unique number.
Numbering must start at 1 and increment by one for each interface
column.
GROUP_NAME VARCHAR2 30 The GROUP_NAME defined against the Group/Parent interface column
must be inserted in this column for all Interface Columns to be included
in the Group Validation.

60
Company Confidential - For internal use only
6. Defining an Importer
If an Integrator is uploading to interface tables, it is possible to have Web ADI automatically invoke the program
used to move data from the interface tables to application base tables. The upload process will call the import
program after records have been inserted into the interface tables. The results of the import program can be
retrieved to users. All the information Web ADI needs to call the import program is defined in metadata. The
following steps to define an Importer:

9 Indicate Importer type

9 Define master parameter list

9 Define a parameter list for each parameter (step) in the master list

6.1. Indicate Importer Type

You must choose what import type your integrator will use, then update Web ADI metadata.

6.1.1. Asynchronous Concurrent Request


An asynchronous concurrent request will run in the background after records are inserted into interface
tables. The results of the import program are not returned to the user, so they may not know if the data
has been imported successfully. Only the request ID is returned, assuring the user that the import
process was invoked successfully. Pre-validation functionality offered by Web ADI is usually used with
this type of import. Pre-validation should mirror the validation done by the import program. If data is
found to be invalid, error messages will be returned to user, records will not be inserted into interface
tables, and the import process will not be invoked. This is done to assure users that the data they have
uploaded will reach application base tables by successfully passing validation done by the asynchronous
concurrent request. Although extra development time may be required to offer pre-validation, Oracle
Application System administrators are give flexibility in load balancing resources used for importing
data. Users may experience faster upload times compared to the other two methods since the completion
of an upload is not dependent on the import program completing.

6.1.2. Synchronous concurrent request


A synchronous concurrent request call will be monitored by Web ADI until its completion. The results of
the import program will be returned to users. Pre-validation is not a necessity in this case, since the
validation built into the import program is used to generate messages that will be returned to the
desktop. Performance may be an issue with this type of import. End users will not complete their upload
process until the concurrent request has finished. Oracle Application System administrators must assure
that the concurrent requests finish quickly for Web ADI users to avoid long upload wait times. Unlike the
asynchronous call, the import program must be called every time an upload is done. Having many users
uploading data may put a substantial load on resources during peak hours.

6.1.3. PL/SQL API


A PL/SQL API call is similar to the synchronous concurrent request call in that Web ADI waits for the
import program to finish, and returns messages to the desktop. However, the concurrent request
queuing process is not used. The import program is called directly, insuring that the import is run
immediately. This eliminates upload wait time due to the concurrent request queuing process, but server
resource issues remain since the import program must be called every time an upload is done.

6.1.4. Enter Import type for your Integrator


Update BNE_INTEGRATORS_B.IMPORT_TYPE to indicate the type of import to use. The following
values are valid:

Value Description
1 Asynchronous concurrent request
2 Synchronous concurrent request
3 PL/SQL API

6.2. Define Master Parameter List

The import process is broken down into individual steps/processes that need to occur to perform an import.
These steps are metadata driven and can be arranged differently to cater to each type of import. The steps are
defined within a master parameter list assigned to the Integrator. With exception to the
SUCCESS_MESSAGE, each step/parameter in the master list has its own parameter list to provide the
required metadata to complete its part of the import process.

6.2.1. Create Parameter List

6.2.1.1. Access the Parameter list UI and enter a name for your import parameter list. It
should be in the form of: (Integrator Name): Import Master List. A parameter list
ID will be given as soon as you press Save.

6.2.1.2. Associate the parameter list with your integrator by inserting the PARAM_LIST_ID
created above into BNE__INTEGRATORS.IMPORT_PARAM_LIST

6.2.2. Attach Parameters to Master List


The parameters within the master list provide an ordered sequence of basic steps that are to be executed
to either retrieve data for other steps in the import or to perform the import. Results of previous steps can
be used to execute another step in the list. An IMPORT hashtable exists to provide cashing for values that
have been retrieved from steps that have been executed. There are six different types of import steps that
can be used to together in performing an import:

Step Name Description

SQL A SQL Statement


PLSQL A PL/SQL API call
CONCURRENT_REQUEST A call to the concurrent request submission API
SEQUENCE The retrieval of the next value of a sequence
GROUP The setting up a collection of values to be used as a group. The import process will
repeat for each unique key established by the group.
SUCCESS_MESSAGE A message definition to be returned to the user if the import succeeds.
ROW_MAPPING A column mapping between the interface columns and the row ID of the sheet
ERRORED_ROWS A column definition that can identify which interface table rows that have not
successfully imported.
ERROR_LOOKUP A SQL query to lookup the values of rows that have failed to import
CLEANUP_SQL Run a SQL statement if an exception occurs during any of the upload steps.
CLEANUP_PLSQL Run a PL/SQL API if an exception occurs during any of the upload steps.

6.2.2.1. Master List Rules for Each Import Type

Asynchronous Concurrent Request

An asynchronous concurrent request call requires a call to


FND_REQUEST.SUBMIT_REQUEST and the request ID is returned to the viewer. The
rules relating to an asynchronous request are:
There must be at least 1 step which is of type CONCURRENT_REQUEST.
There must only be one CONCURRENT_REQUEST.
There can be any number of PL/SQL, SQL, and sequence steps before the
concurrent request.
There can be a GROUP step to define what the grouping of rows will be, but there
only must be at most one group definition.

62
Company Confidential - For internal use only
There may be multiple success messages.
There may be a row mapping but one is not required for an import. If a success
message is not defined then a standard Web ADI success message will be returned.
There must not be any ERROR_LOOKUP, ERRORED_ROWS steps.
There may be only one CLEANUP_SQL or CLEANUP_PLSQL step, but not both.

The associated parameter lists with each of these parameters will define what the
metadata is for the individual steps.

Synchronous Concurrent Request


Web ADI monitors the concurrent request until it has finished and returns the result of the
import to the desktop application. The setup is similar to the Asynchronous call, but
ROW_MAPPING, ERRORED_ROWS and ERROR_LOOKUP steps are required. The row
mapping provides a one-to-one relationship between the rows in the spreadsheet and the
rows in the interface table. This mapping is important for a synchronous Importer as it is
the mechanism to report back to users the rows in the spreadsheet that have failed the
import.
The rules for a concurrent request are:
There must be at least 4 steps: a CONCURRENT_REQUEST, ERRORED_ROWS,
ERROR_LOOKUP and ROW_MAPPING.
There must only be one ROW_MAPPING, one ERROR_LOOKUP, one
ERRORED_ROWS and one CONCURRENT_REQUEST.
The CONCURRENT_REQUEST must be followed by the ERRORED_ROWS step,
which in turn be followed by the ERROR_LOOKUP step.
There can be any number of PL/SQL, SQL, and sequence steps before the
concurrent request.
There can be a GROUP step to define what the grouping of rows will be, but there
only must be at most one group definition.
There may be multiple success messages. If a success message is not defined then a
standard Web ADI success message will be returned.
There may be only one CLEANUP_SQL or CLEANUP_PLSQL step, but not both.

PL/SQL API Call

The PL/SQL API call is used when a concurrent request is not to be used as the method of
import. An API call does not include a CONCURRENT_REQUEST step.

The rules for a PL/SQL API call are:


There must be at least one PL/SQL import step.
There can be any number of PL/SQL, SQL and sequence calls, but the last call must
be PL/SQL.
There may be multiple success messages. If a success message is not defined then a
standard Web ADI success message will be returned.
A single ROW_MAPPING may be defined for the PL/SQL API.
A single ERROR_ ROWS may be performed after the PL/SQL API has been called,
only if a ROW_MAPPING and single ERROR_LOOKUP exist.
The ERRORED_ROWS step must be followed by the ERROR_LOOKUP step.
There can be a GROUP step to define what the grouping of rows will be, but there
only must be at most one group definition.
There must not be any CONCURRENT_REQUEST steps.
There may be only one CLEANUP_SQL or CLEANUP_PLSQL step, but not both

63
Company Confidential - For internal use only
6.2.2.2. View the descriptions of each step in 6.3 and add the steps to the master parameter
list using the Add Another Row button in the Parameter UI. Use the Step Names
described in 6.2.2 for the Parameter Name.

6.3. Enter Metadata for Steps in Master List

Parameter lists and Attributes will need to be defined for each step in the master list. See the selections
below for instructions on setting up the metadata for each type of import step.

6.3.1. SQL statement

The SQL statement step type defines the metadata required to perform a SQL clause. If the SQL is a select
statement then the values that have been selected can be retrieved back into the collection that is stored
for retrieving values from queries that have been executed. Bind variables can be used to define the
inputs of the query and Return variables are used to retrieve values from the SQL. Bind variables are
used to define Insert and Update statements without knowing the data at design time. The return
variables are used in select statements, and represent the columns in the select declaration. Return values
are values from columns defined in the select declaration section of the select query (e.g. status from
select status from gl_interface). To enable a SQL statement step:

6.3.1.1. Create a new parameter list through the parameter UI. Name the parameter list:
(Integrator Name): SQL Step.

6.3.1.2. Enter the parameters for the SQL step parameter list. The first parameter in the list is
the SQL statement that is to be executed and the rest of the parameters identify
bind/return variables.

Below is an example of a SQL step parameter list. The SQL statement is defined in
the first parameter and the bind variables used in the SQL statement are defined
thereafter:

6.3.1.2.1. Press Add Another Row to define the SQL statement to run. Once the Define
Parameter window opens, set the Data Type to String, and enter the SQL statement into
the Value field. Use the following format for a SQL statement: SELECT column_names

64
Company Confidential - For internal use only
FROM table_names WHERE column = $PARAM$.parameter_name. DO NOT enter a
semi-colon at the end of the SQL statement.

6.3.1.2.2. Press Add Another Row to define the parameters being used in the SQL
statement. The name of the parameter is used to map between the SQL statement and
the bind/return variables. In the above definition, the $PARAM$.parameter_name is
replaced with the value that is derived from the metadata for the parameter in the
parameter list with the same name (i.e parameter_name). This method of replacing
$PARAM$ tokens with the associated parameter values works for any SQL statement.
The parameter in the SQL statement must be the same case as the parameter name in the
list.

For select statements, the column_names also needs to be defined as parameters in the
list. Make sure to the name of the parameter matches the colum_name in the SQL
statement. The parameter in the SQL statement must be the same case as the parameter
name in the list.

6.3.1.2.3. Press the edit button next to the Attributes button in the Parameter Definition
screen. The attributes screen will let you enter metadata that determines how the
parameter value is derived.

ATTRIBUTE DESCRIPTION VALID


VALUES

ATTRIBUTE1 Whether the parameter is defining a bind or a return variable. Web ADI stores RETURN
resulting values for columns in select statements if ATTRIBUTE1=RETURN. BIND
ATTRIBUTE2 The unique name of the bind/return variable to be used in subsequent steps. The
value added to the IMPORT hashtable uses the value in this column as the key.
ATTRIBUTE3 The Source the parameter value will be retrieved from. IMPORT
ENV
REQUEST
ATTRIBUTE4 What value is to be used to get the value from the Source
ATTRIBUTE5 Data type of the bind/return value
ATTRIBUTE6 Position of the return value in the select statement [optional]. Web ADI looks up 1..Number
the value for the parameter in the SQL statement result set by using the column of return
position in the select statement. If no value is supplied for ATTRIBUTE6 or is values
invalid, then the value will be looked up using the parameter name. Web ADI will
have better performance if a valid value is entered in this column.; it will take
more time to look up the value if the parameter name is used.

Description of Valid Sources (ATTRIBUTE3):

Value Description

IMPORT Value will come from a previously executed step (SQL query, PL/SQL call, Sequence
number retrieval or from the group definition). The hashtable key for the value is entered
in the name column (ATTRI BUTE4). Use this Source if you want to derive the value
from the value of a column that has been uploaded by the user. To do this, the interface
column needs to be identified in a Group step. Enter the
interface_table_name.column_name in ATTRIBUTE4.
ENV An environment variable. Valid names (ATTRIBUTE4) are userid, language, respid,
appid.
REQUEST Use this source type when parameter values are sent from the upload parameters page.
Names (ATTRIBUTE4) need to match the param_name in the parameter list for the
UPLOAD_PARAM_LIST.

Note: A limitatio
6.3.1.3. En of this
nter design is that
the parameter list currently
ID createda above
SQL statem
in theent
SQLis restricted to
step parameter in the master list.
2000 characters.Open the Define Parameter screen for the SQL parameter; set the Data Type to
Number, and enter the parameter list ID in the Value field.

65
Company Confidential - For internal use only
6.3.1.4. Example: To execute the SQL call: select je_source_name from gl_je_sources where
user_je_source_name = $PARAM$.je_source_param. The je_source_name returned
will be stored in the hash table and available for use in a later step. A bind variable
will be used to edit the where clause. This value will come from a value the user
uploades from the document on the desktop to GL_INTERFACE.
USER_JE_SOURCE_NAME.

6.3.1.4.1. Create the Following Parameters in the SQL step parameter list.

Field Name Description

Sequence number 1
Name SQL_Statement
Value select je_source_name from gl_je_sources where user_je_source_name =
$PARAM$.je_source_name_param
Data Type String

Sequence number 2
Name Je_source_name

SEQ_NUM 3
PARAM_NAME Je_source_param

6.3.1.4.2. Define Atributes for each parameter by pressing the edit button next to the
Attibutes label in the Define Parameter screen.

Field Name Value

For the je_source_name parameter:


ATTRIBUTE1 RETURN
ATTRIBUTE2 je_source_name
ATTRIBUTE3 NULL
ATTRIBUTE4 NULL
ATTRIBUTE5 VARCHAR2
ATTRIBUTE6 1

For the je_source_param:


ATTRIBUTE1 BIND
ATTRIBUTE2 User_je_source_name
ATTRIBUTE3 IMPORT
ATTRIBUTE4 GL_INTERFACE. USER_JE_SOURCE_NAME
ATTRIBUTE5 VARCHAR2
ATTRIBUTE6 1

6.3.1.5. Enter the parameter list ID created for the SQL step parameter in the master list.
Open the Define Parameter screen for the SQL parameter; set the Data Type to Number, and
enter the parameter list ID in the Value field.

6.3.2. PL/SQL API Call


The PL/SQL API import step allows for a PL/SQL API to be called to either perform the import or
perform setup/value retrieval for the import. The PL/SQL API call will be dynamically generated and
values returned from any output parameters will be placed into the IMPORT hash table using the
parameter/API name as the key. A parameter list will be created to define the API and the API calls
parameters. To enable a PL/SQL API step:

6.3.2.1. Create a parameter list for the PLSQL step. Name it (Integrator Name):PLSQL Step

66
Company Confidential - For internal use only
6.3.2.2. Press the Add Another Row in Define Parameter List screen for the PLSQL step.
Name the Parameter: (Procedure Name). Press the edit attributes button to enter
information about the PL/SQL procedure.

Field DESCRIPTION VALID VALUES

ATTRIBUTE1 Type of API call. (FUNCTION or PROCEDURE)


ATTRIBUTE2 Name of the PL/SQL function or procedure
ATTRIBUTE3 Function Return Data Type. This must be one of the values defined in
rule two of the next section.
ATTRIBUTE4 Whether the return value is used to retrieve the error messages. The Y/N
returned error message is obtained from the first that provides the
message in the following order: FND_MESSAGES, Return Value,
Parameter
ATTRIBUTE5 Perform a call to FND_MESSAGES. . Y/N

6.3.2.3. Create additional parameters in the list for every parameter in the API call. A record
must be created for all the API parameters. Attributes must be defined for every
parameter as well. Press the edit attributes button in the Define Parameter screen for
each parameter in the list to access the attribute window.

Field DESCRIPTION VALID VALUES

ATTRIBUTE1 PL/SQL parameter name. This


name must be unique
ATTRIBUTE2 PL/SQL parameter data type. BINARY_INTEGER, BOOLEAN, CHAR, CHARACTER,
DATE, DEC, DECIMAL, DOUBLE PRECISION, FLOAT, INT,
INTEGER, LONG, NATURAL, NCHAR, NUMBER,
NUMERIC, NVARCHAR2, PLS_INTEGER, POSITIVE, REAL,
SMALLINT, STRING, VARCHAR, VARCHAR2
ATTRIBUTE3 PL/SQL parameter access. IN / OUT / INOUT
ATTRIBUTE4 Used for returning error messages. Y/N
ATTRIBUTE5 Default value for the PL/SQL For a String default value, the default value must be quoted.
parameter. (I.E. String data value of hello should be defined as hello)
ATTRIBUTE6 Size of the variable.
ATTRIBUTE7 The source of the value. IMPORT
ENV
REQUEST
ATTRIBUTE8 Name/ID within ATTRIBUTE7
used to identify the value
ATTRIBUTE9 Parameter List ID for mapping
between the value provided and
the one to be passed into the API
parameter
ATTRIBUTE10 Modification clause around
parameter (E.g. TO_CHAR(?) )

ATTRIBUTE9 is used to store a Parameter List ID to a parameter list where the


parameters provide a mapping between string values. For example, a simple
parameter list would convert true/false into Y/N.
The records in BNE_PARAM_LIST_ITEMS would look like this:

Column DESCRIPTION

PARAM_NAME True
STRING_VALUE Y

PARAM_NAME False
STRING_VALUE N

67
Company Confidential - For internal use only
ATTRIBUTE10 is used when the data provided needs to have some formatting
applied before it gets passed in as a parameter. This attribute should only be used
in very rare cases. The main case where this attribute would be used is for passing
a DATE value from the import into a PL/SQL API as a VARCHAR2 parameter. In
the situation where a the date is required in MM/ DD/YYYY format, the
ATTRIBUTE10 value would be: TO_CHAR(?, MM/DD/YYYY)

The ? character is used to represent the parameter being declared.

Description of valid sources (ATTRIBUTE7):

Value Description

IMPORT Value will come from a previously executed step (SQL query, PL/SQL call, Sequence
number retrieval or from a column value in a group definition). The hashtable key for the
value is entered in the name column (ATTRI BUTE8). Use Import if you would like to use
a value the user has entered into the desktop document; make sure that column is
included in a GROUP step. Enter tablename.column from the group definition in
ATTRIBUTE8.
ENV An environment variable. Valid names (ATTRIBUTE8) are userid, language, respid,
appid.
REQUEST Use this source type when parameter values are sent from the upload parameters page.
Names (ATTRIBUTE8) need to match a parameter name for the parameter list used for
UPLOAD_PARAM_LIST.

6.3.2.4. Enter the parameter list ID created above in the PLSQL step parameter in the master
list. Open the Define Parameter screen for the PLSQL parameter; set the Data Type
to Number, and enter the parameter list ID in the Value field.

6.3.3. Concurrent Request Submission


The concurrent request submission step type allows for the definition of the parameters required for a
concurrent request. A parameter list is needed to store the definitions the parameters required for calling
FND_REQUEST.SUBMIT_REQUEST.

6.3.3.1. Create a parameter list through the parameter list UI. Give the Parameter list a name
in the form of: (Integrator name): Concurrent Request Step.

6.3.3.2. Use the Add Another Row button to add the following parameters to the parameters
list.
Seq 1
Name Application
Data Type String
Value (Leave Blank)

Seq 2
Name Program
Data Type String
Value (Leave Blank)

Seq 3
Name Description
Data Type String
Value (Leave Blank)

68
Company Confidential - For internal use only
Seq 4
Name Run Date
Data Type String
Value (Leave Blank)

Seq 5
Name Sub request
Data Type String
Value (Leave Blank)

Seq 5N (Add as many parameters to


the list as needed by your import
program)
Name (Name of parameter)
Data Type String
Value (Leave Blank)

Seq N+1
Name End Of Concurrent Request Parameters
Data Type String
Value (Leave Blank)

Seq N+2
Name Rest of Parameters Defaults
Data Type String
Value (Leave Blank)

6.3.3.2.1. Add the following Attributes to all the parameters in the list except the Last
Parameter.

Field DESCRIPTION VALID VALUES

ATTRIBUTE1 Type of API call. (FUNCTION or PROCEDURE)


ATTRIBUTE2 Name of the PL/SQL function or procedure
ATTRIBUTE3 Function Return Data Type. This must be one of the values defined
in rule two of the next section.
ATTRIBUTE4 Whether the return value is used to retrieve the error messages. The Y/N
returned error message is obtained from the first that provides the
message in the following order: FND_MESSAGES, Return Value,
Parameter
ATTRIBUTE5 Perform a call to FND_MESSAGES. . Y/N

6.3.3.2.2. Add the following Attributes to the Rest of Parameter Defaults parameter

ATTRIBUTE DESCRIPTION

ATTRIBUTE1 Default value for the remaining parameters in the


FND_REQUEST.SUBMIT_REQUEST call.
ATTRIBUTE2 The number of times the default value is required to be repeated.

6.3.3.2.3. Enter the parameter list ID created above in the CONCURRENT_REQUEST step
parameter in the master list. Open the Define Parameter screen for the CONCURRENT-

69
Company Confidential - For internal use only
REQUEST parameter; set the Data Type to Number, and enter the parameter list ID in
the Value field.

6.3.4. Sequence ID Retrieval


The sequence retrieval is used to retrieve the next value from a database sequence and place it into the
IMPORT hashtable. Only one parameter needs to be defined in this steps parameter list.

6.3.4.1. Create a parameter list using the parameter UI. Name the list (Integrator Name):
Sequence

6.3.4.2. Press the Add Another Row button to add a parameter to the list. The Data Type
should be String. The name you enter for the parameter is the key you will use to
reference the sequence value from the hash table. Enter the name of the sequence in
the Value field.

6.3.4.3. Example:

Field DESCRIPTION

Name l_run_id
Data Type String
Value GL_JOURNAL_IMPORT_S

6.3.4.4. Enter the parameter list ID created above in the SEQUENCE step parameter in the
master list. Open the Define Parameter screen for the SEQUENCE step parameter; set the
Data Type to number, and enter the parameter list ID in the Value field.

6.3.5. Group Definition


The Group Definition creates a collection of columns that identify rows that are imported together as a
group. The grouping assures that all steps in an Importer (excluding GROUP and ROW_MAPPING
steps) are repeated for every group of records found in the interface table. Columns are identified in the
parameter list to form the primary key for determining the unique set of interface table records.

A common usage for the group step is to save values uploaded by the user to the hash table, which can
then be referenced by later steps. For example, perhaps your users are entering Person ID into a
spreadsheet, which must then be used as a parameter in the call to a PL/SQL import program (PLSQL
step). To accomplish this, the TABLENAME.PERSON.ID would be added to the group definition.
During upload, Web ADI will look to see what value was uploaded to TABLENAME.PERSON.ID and
store it in the hash table. This value can then be used when calling an import program (PLSQL step).

6.3.5.1. Create a parameter list in the Parameter UI. Make the Name of this list (Integrator
Name): Group Step.

6.3.5.2. Use the Add Another Row button to create a parameter in the list for every column
you wish to be part of the group.

Field DESCRIPTION

Name Table name. Column name. E.g.


GL_INTERFACE.SET_OF_BOOKS_ID

All the steps in the master list are executed for every group of records uniquely
identified by the group definition. As a consequence, you are unable to repeatedly
perform all of the steps except for one and then run that step separately. For

70
Company Confidential - For internal use only
example, you could not run the SQL to insert into the GL_INTERFACE_CTL table
multiple times but only submit a concurrent request once.

If a master parameter list contains both a GROUP definition and a


CONCURRENT_REQUEST, each group that is imported will have a new request
ID. The viewer will have multiple messages returned to it with the different
concurrent request IDs.

6.3.5.3. Enter the parameter list ID created above in the group step parameter in the master
list. Open the Define Parameter screen for the GROUP parameter; set the Data Type
to Number, and enter the parameter list ID in the Value field.

6.3.6. Success Message


The success message step defines what message is returned to the desktop when the import process has
been successfully completed. Replaceable tokens can be inserted into the string to show the request ID or
other values returned from the IMPORT hash table. The tokenized values can be defined by appending
the $import$.requestid or $import$.<key for IMPORT>. The success message is unique among the import
steps as it can be defined without having to have a separate parameter list defined. Since this string will
be translated into other languages, a parameter definition must be defined that contains the string as a
default value.

6.3.6.1. Look up the master parameter list and press the Update button next to the
SUCCESS_MESSAGE parameter.

6.3.6.2. Press the Definition button in the Define Parameter screen; set the Data Type to
String, and enter the success message in the Default value field. An example would
be: Journal Import Request ID $import$.requested.

71
Company Confidential - For internal use only
6.3.7. Row Mapping
The Row Mapping step enables Web ADI to match a row in the interface table with its corresponding row
in the spreadsheet. Columns in the interface table are identified in this step to create the primary key in
identifying unique records in both the spreadsheet and interface table. Web ADI will map the interface
table rows to spreadsheet rows using this key. In most cases this set of columns will be the primary key
of the interface table. The primary use of this mapping is to be able to return error messages for
individual rows that failed. The name field for each parameter stores the column names that are to be
used in the mapping.

6.3.7.1. Create a parameter list using the Define Parameters UI.

6.3.7.2. Use the Add Another Row button to add a parameter for every column required to
be in the mapping (uniquely identifies records).

Field DESCRIPTION

NAME Column name. E.g. GL_INTERFACE.SET_OF_BOOKS_ID


Data Type String

6.3.7.3. Enter the parameter list ID created above in the Value field for the
ROW_MAPPING step record in the master list. Make sure the Data Type is set to Number.

If there are no columns in the interface that can provide a one-to-one mapping between the interface row
and the row in the spreadsheet, then the best that the error reporting can be is a message in the upload
page stating that there was an error with the import.

6.3.8. Errored Row Definitions

The Errored Row Definitions step enables Web ADI to identify rows that have failed the import. A SQL
query is defined that will be run by Web ADI to determine the rows that did not pass validation done by
the import program.

The SQL Query can contain Bind variables which can be used to provide input values into the query.
The query provided must contain at least one column in the select clause but the SELECT statement can
be SELECT * and the error rows step will know what columns are in the interface table. It is
reccomended that SELECT * be used to make sure all of the necessary values are retireved in the SQL
statement.

6.3.8.1. Create a parameter list with the parameter list UI.


6.3.8.2. Use the Add Another Row button to create the first parameter in the list. Set the Data
Type to String and enter the SQL query into the value field.
6.3.8.3. Add addiitonal parameter s to the parameter list for each bind variable in the SQL
statement. Define the following attributes for each bind variable parameter:

ATTRIBUTE DESCRIPTION VALID VALUES

ATTRIBUTE1 Whether the parameter is defining a bind variable. BIND


ATTRIBUTE2 The name of the bind/return variable (can be used in subsequent
calls)
ATTRIBUTE3 The source of the value. IMPORT
ENV
REQUEST
ATTRIBUTE4 What name is to be used to get the value from the collection
ATTRIBUTE5 Data type of the bind/return value

6.3.8.3.1. A description of the values from ATTRIBUTE3:

72
Company Confidential - For internal use only
IMPORT Value will come from a previously executed SQL query, PL/SQL
call, Sequence number retrieval or from the group definition.
ENV An environment variable
REQUEST Value will come from the HTTP request (Upload Parameters).

6.3.8.4. Enter the parameter list ID created above into the value field in the
ERRORED_ROWS parameter in the master parameters list. Make sure the Data Type for the
ERRORED_ROWS parameter is Number.

6.3.8.5. Example: Define Errored Rows query where the errored all errored records in the
GL_INTERFACE have the value EM01 in the STATUS column.
6.3.8.5.1. Create a parameter list and add the first parameter which will contain the
following SQL statement in the Value field.
SELECT * FROM GL_INTERFACE WHERE REQUEST_ID = $PARAM$.request_id AND
STATUS = EM01

6.3.8.5.2. Add a parameter to the list for the request_id bind variable. Set name to
request_id. Set Attribute1 = BIND; Attribute2 = requested; Attribute3 = IMPORT;
Attribure5 = requested; Attribure6=NUMBER

6.3.9. Error Message Lookup


The error message lookup step is used to retrieve full textual error messages for the errored rows. This
functionality does not apply for an asynchronous call since the import process stops after the request has
been made. A SQL statement is entered in metadata to run for every errored row. Error codes in the
status column can be used to look up meaningful messages. These messages then can be returned to the
viewer. There can only be one return variable from the SQL statement. This variable is a VARCHAR2
error message that will be returned to the user.

6.3.9.1. Create a parameter list using the parameter list UI.

6.3.9.2. Use the Add Another Row button to add the first parameter to the list. This
parameter is the SQL statement that is to be executed Use the following format for a
SQL statement: SELECT column_names FROM table_names WHERE column =
$PARAM$.parameter_name.

6.3.9.3. Create parameters in the list for each bind/return variable that exists in the SQL
statement.

The name of each parameter is used as the mapping between the SQL statement and
the bind/return variables. Make sure the parameter name in the SQL statement and
in the parameter use the same case.

In 6.3.9.2, the $PARAM$.parameter_name is replaced with the value that is derived


from the metadata for the parameter in the parameter list with the name of
parameter_name.

The column_names also needs to be defined as parameters in the list.


"column_name should be entered as the name for the parameter in the list.

Column Name Description

SEQ_NUM 1
STRING_VALUE The SQL statement
PARAM_LIST_ID Parameter List ID created for the ERROR_LOOKUP step

SEQ_NUM N
PARAM_NAME Name of the bind/return parameters used in the SQL statement

73
Company Confidential - For internal use only
Column Name Description

PARAM_LIST_ID Parameter List ID created for the ERROR_LOOKUP step

6.3.9.4. Define attributes for each parameter in the list except the first. The details of the
parameters attributes are as follows:

ATTRIBUTE DESCRIPTION VALID VALUES

ATTRIBUTE1 Whether the parameter is defining a return or a bind variable RETURN


BIND
ATTRIBUTE2 The name of the bind/return variable (can be used in subsequent
calls)
ATTRIBUTE3 The source of the value. IMPORT
ENV
REQUEST
INTERFACE_TABLE
ATTRIBUTE4 What name is to be used to get the value from the collection. If
ATTRIBUTE3 =INTERFACE_TABLE then the value of will provide
what the interface & column name for the INTERFACE_TABLE.
ATTRIBUTE5 Data type of the bind/return value
ATTRIBUTE6 Position of the return value in the select statement [optional] 1..Number of return
values

6.3.9.5. Enter the parameter list ID created above into the value field in the
ERROR_LOOKUP step parameter in the master list. Make sure the Data Type is set to
number.

6.3.9.6. Example: A call to FND_LOOKUPS for errored rows in GL_INTERFACE.


6.3.9.6.1. Create a parameter list and add the fololwing parameters.

Column Name Description

Sequence Number 1
Value SELECT MEANING FROM FND_LOOKUPS WHERE LOOKUP_TYPE =
PSP_SUSP_AC_ERRORS AND LOOKUP_CODE = $PARAM$.error_code
Data Type String

Sequence Number 2
Name Meaning
Data Type String

Sequence Number 3
Name error_code
Data Type String

6.3.9.6.2. Define attributes for each bind/return parameter.

Column DESCRIPTION

For the Meaning


Parameter:
ATTRIBUTE1 RETURN
ATTRIBUTE2 error_msg
ATTRIBUTE3 NULL
ATTRIBUTE4 NULL
ATTRIBUTE5 VARCHAR2
ATTRIBUTE6 NULL

For the
error_code
parameter

74
Company Confidential - For internal use only
ATTRIBUTE1 BIND
ATTRIBUTE2 error_status
ATTRIBUTE3 INTERFACE_TABLE
ATTRIBUTE4 GL_INTERFACE. STATUS
ATTRIBUTE5 VARCHAR2
ATTRIBUTE6 1

6.3.10. Cleanup SQL statement

The Cleanup SQL statement step defines the metadata required to run a SQL statement, but will only be
run when an exception occurs in one of the other import steps. If the SQL is a select statement then the
values that have been selected are saved to the IMPORT hash table. Bind variables can be used to define
what is used in the query and Return variables will be used to retrieve values from the SQL. Bind
variables are used in both SQL and Insert/Update statements to allow the statement to be defined
without knowing the data at design time. The return variables are only used in select statements, and
represent the columns in the select declaration. Return values are values from columns defined in the
select declaration section of the query (e.g. the status part of select status from gl_interface). The first
parameter in the list is the SQL statement that is to be executed and the rest of the parameters will
provide the details of the bind/return variables.

6.3.10.1. Create a parameter list using the parameter list UI.


6.3.10.2. Use the Add Another Row button to create the first parameter in the list that contains
the SQL statement. Set the Data Type to String. Enter the SQL statement in the Value filed in
the Define Parameter screen. Use the following format for the SQL statement:

SELECT column_names FROM table_names WHERE column = $PARAM$.parameter_name

6.3.10.3. Use the Add Another Row button to add parameters to the list for every bind and
return variables defined in the SQL statement. The parameter name will be used as the
mapping between the SQL statement and the bind/return variables. In the above definition,
the $PARAM$.parameter_name will replaced with the value that is derived from the
metadata for the parameter in the parameter list with the name of parameter_name. This
method of replacing $PARAM$ tokens with the associated parameter values works for any
SQL statement not just select statements.

For select statements, the column_names will also need to be defined as parameters in the list
where the column_name will also be the name of the parameter. The values returned from the
columns in the select statement will be retrieved by going through the parameter list and for
every parameter that has ATTRIBUTE1=RETURN

6.3.10.3.1.1. Define the following attributes for each bind/return parameter

ATTRIBUTE DESCRIPTION VALID VALUES

ATTRIBUTE1 Whether the parameter is defining a bind or a return variable. RETURN


BIND
ATTRIBUTE2 The name of the bind/return variable (can be used in subsequent
calls)
ATTRIBUTE3 The source of the value. IMPORT
ENV
REQUEST
ATTRIBUTE4 What name is to be used to get the value from the collection
ATTRIBUTE5 Data type of the bind/return value
ATTRIBUTE6 Position of the return value in the select statement [optional] 1..Number of return
values

75
Company Confidential - For internal use only
6.3.11. Cleanup PL/SQL API Call

The Cleanup PL/SQL API import step allows for a PL/SQL API to be called if an exception occurs in any
of the import steps. This step can be used to roll back work done in steps prior to the error. From the
metadata the PL/SQL API call will be dynamically generated and run. The first parameter in the
parameter list will define the API and the API calls parameters.

6.3.11.1. Create a parameter list using the Parameter UI. Set the Name of the parameter list to
(Integrator Name):CLEANUP_SQL .
6.3.11.2. Press Add Another Row to create the first parameter in the list. This parameter will
describe the API. Assign the following attributes to the parameter:

ATTRIBUTE DESCRIPTION VALID VALUES

ATTRIBUTE1 Type of API call. (FUNCTION or PROCEDURE)


ATTRIBUTE2 Name of the PL/SQL function or procedure
ATTRIBUTE3 Function Return Data Type
ATTRIBUTE4 Whether the return value is used to retrieve the error messages Y/N
ATTRIBUTE5 Perform a call to FND_MESSAGES. . Y/N

6.3.11.3. Add additional parameters to the list for each of the parameters within the API call.
Assign the following attributes to each parameter:

ATTRIBUTE DESCRIPTION VALID VALUES

ATTRIBUTE1 PL/SQL parameter name.


Name must be unique.
ATTRIBUTE2 PL/SQL parameter data type. BINARY_INTEGER, BOOLEAN, CHAR, CHARACTER,
DATE, DEC, DECIMAL, DOUBLE PRECISION, FLOAT,
INT, INTEGER, LONG, NATURAL, NCHAR,
NUMBER, NUMERIC, NVARCHAR2, PLS_INTEGER,
POSITIVE, REAL, SMALLINT, STRING, VARCHAR,
VARCHAR2
ATTRIBUTE3 PL/SQL parameter access. IN / OUT / INOUT
ATTRIBUTE4 Used for returning error messages. Y/N
ATTRIBUTE5 Default value for the PL/SQL If the default value is a string, then the value entered for
parameter. this attribute must be quoted.
ATTRIBUTE6 Size of the variable.
ATTRIBUTE7 The source of the value. IMPORT
ENV
REQUEST
ATTRIBUTE8 Name/ID within ATTRIBUTE3
used to identify the value
ATTRIBUTE9 Parameter List ID for mapping
between the value provided and
the one to be passed into the
API parameter
ATTRIBUTE10 Modification clause around
parameter (E.g. TO_CHAR(?) )

Rules for PL/SQL parameter data:

ATTRIBUTE9 is used to store a Parameter List ID to a parameter list where the parameters
provide a mapping between string values. E.g. A simple parameter list would convert
true/false into Y/N.

An example of this would be:


Mapping List:

Parameter 1 name=true, value=Y


Parameter 2 name=false, value= N

76
Company Confidential - For internal use only
ATTRIBUTE10 is used when the data provided needs to have some formatting applied before
it gets passed in as a parameter. This attribute should only be used in very rare cases. The
main case where this attribute would be used is for passing a DATE value from the import into
a PL/SQL API as a VARCHAR2 parameter. In the situation where a the date is required in
MM/ DD/YYYY format, the ATTRIBUTE10 value would be: TO_CHAR(?, MM/DD/YYYY)

Note: The ? character is to be used to represent the parameter being declared.

77
Company Confidential - For internal use only
7. Defining Upload Parameters

Parameters that govern the upload process must be defined for every Integrator. These parameters can determine
what rows are uploaded, how they are pre-validated, and whether or not an import process is invoked. They
may also contain parameters required by your Integrators import program. Parameter values can be defaulted in
metadata; they can be passed to the create document service by the calling form function; others can be displayed
as options to users at runtime in the Upload Parameters screen.

7.1. Upload Parameters Screen

The Upload Parameters screen is accessed by pressing Parameters after selecting Upload from the Oracle
menu. This screen presents users with options that affect how their data is uploaded to Oracle Applications.
Parameters are arranged vertically in a single column. Below is an example:

7.1.1. Editing the Upload Parameters Screen

The browser window title bar can be edited by updating BNE_INTEGRATORS_TL.TITLE_BAR


The Primary Header can be edited by updating BNE_INTEGRATORS_TL.UPLOAD_HEADER. Its
default value is Upload Parameters
The parameters that exist in the upload parameters screen are determined by the upload parameter
list you create for your Integrator. The order of the parameters in the list determines the order in
which the parameters are displayed. The following widgets can be used to render parameters in the
Upload Parameters screen:
o Check Box
o Radio Button
o Pull Down list
o Text Field
o Password Field
o Tip text and labels for all the above

See Create Upload Parameter List for more details.

7.2. Create Upload Parameter List

A parameter list will be created for an Integrator to define all the parameters that will be used for upload.
Some parameters will have default values and not be displayed in the Upload Parameters screen; others will
be defaulted but displayed. Parameter values can also be selected by users in the Upload Parameters screen.
The following steps cover the creation of an upload parameter list for your Integrator.

7.2.1. Define parameter list

78
Company Confidential - For internal use only
A parameter list will be created that contains all upload parameters. Three specific parameters must
always be defined in an upload list, and others can be added that relate to the import program being
used.

7.2.1.1. Use the parameter list UI to define a parameter list. Use the Add Another Row
button to add the following parameters to the list:

Column Name Description

Sequence 1
Definition Copy the 231:ROWS parameter definition under your
own application ID and use the copy for this
parameter.
Name Bne:rows
Value Y
Description True

Sequence 2
Definition Copy the 231:VALIDATION parameter definition
under your own application ID and use the copy for
this parameter.
Name Bne:validation
Value Y
Description True

Sequence 3
Definition Copy the 231:IMPORT parameter definition under
your own application ID and use the copy for this
parameter.
Name Bne:import
Value Y
Description True

7.2.1.2. Add additional parameters to the list if you have any parameters for your import
program that need to be chosen by the user at upload time, or just seen by the user as
upload time (view default being used). You may also define parameters and their
values that need to be passed to the import program that are not seen or displayed to
the user (not visible, but passed in the background).
7.2.1.2.1. Press the Definition button in the Define Parameter window to indicate more
information about each parameter. Tips:

Parameters in a list can be set so that they do are not displayed to users in the
upload parameters screen. Use the Default Required, Default Visible, and
Default user Modifiable checkboxes to determine how the parameter will be
displayed.
Parameters that rely on runtime data to determine whether or not to display can
be linked to a class that will set this value when run. Enter the class name in the
Java Processor Class field.
Display type indicates the type of widget to use in displaying the parameter to
users. Check Box, Radio Button, List Box, Text Box, and Password Field are the
supported display types.
Radio buttons and list boxes can retrieve their valid values from value sets or
from FND_LOOKUPS. Use the Validation Type field to indicate how the
parameter will be validated and enter the Value Set ID or
FND_LOOKUP.LOOKUP_TYPE in the validation value field.
Use the Display Style field to display radio buttons vertically or horizontally.

7.2.2. Assign Upload Parameter List to Integrator

79
Company Confidential - For internal use only
7.2.2.1. Assign the parameter list to your Integrator by updating
BNE_INTEGRATORS_B.UPLOAD_PARAM_LIST with the parameter list ID created
in 7.2.1.1.

80
Company Confidential - For internal use only
8. Creating Content
Web ADI has the ability to import data into a document as it is being created on the desktop. Integrator
developers create Content definitions to identify the data to be downloaded, and any required parameters.
This data can come from a variety of sources.

Enter a SQL statement in metadata

Allow users to import data from a text file

Create a Java class to dynamically generate source data and provide custom UI for parameter entry.

This chapter section describes the process of enabling each of these types of Content in Web ADI metadata.

Attention: You must make sure that the code you plug into the Web ADI SDK is
functionally secure. Users must be prevented from manipulating a URL or a value in
the worksheet that would give them access to restricted values.

8.1. Stored SQL

A SQL statement can be plugged into metadata that is run by Web ADI to retrieve a result set, which is
imported into the document using a mapping (maps fields in SQL statement to fields in document; see section
9.2). You may specify bind variables in the SQL statement, whose values can be passed at runtime. Each
Stored SQL statement requires a Content definition. Follow the steps below to define a stored SQL Content.

8.1.1. Create Content Definition

Call the following PL/SQL API to create the Content:

BNE_CONTENT_UTILS.CREATE_CONTENT_STORED_SQL
(P_APPLICATION_ID IN NUMBER,
P_OBJECT_CODE IN VARCHAR2,
P_INTEGRATOR_CODE IN VARCHAR2,
P_CONTENT_DESC IN VARCHAR2,
P_COL_LIST IN VARCHAR2,
P_QUERY IN VARCHAR2,
P_LANGUAGE IN VARCHAR2,
P_SOURCE_LANGUAGE IN VARCHAR2,
P_USER_ID IN NUMBER,
P_CONTENT_CODE OUT NOCOPY VARCHAR2);

A description of each parameter:

Parameter Description

APPLICATION_ID The identifier for the application.


P_OBJECT_CODE A string of 20 chars or less. The only valid characters are: Uppercase 'A'..'Z',
'0'..'9' and '_'. This string must be unique within the application ID. This string
will be used to generate P_CONTENT_CODE. P_CONTENT_CODE =
P_OBJECT_CODE + _CNT.
P_INTEGRATOR_CODE The Code of the Integrator you wish to crate the content for. Query
BNE_INTEGRATORS.INTEGRATOR_CODE for this value.
P_CONTENT_DESC The Content page in the Create Document Page flow will display this value.
P_COL_LIST A comma delimited list of columns that are in the select clause of the query. In
the example given for P_QUERY, PERIOD_NAME, START_DATE,
END_DATE would be passed into this parameter.

81
Company Confidential - For internal use only
Parameter Description

P_QUERY The SQL statement that will be run to generate the data to be
downloaded to the desktop. This SQL statement can contain
bind variables in the form of $PARAM$.ParameterName.
Example:
SELECT PERIOD_NAME, START_DATE, END_DATE FROM
GL_PERIOD_STATUSES WHERE START_DATE >=
$PARAM$.startDate AND END_DATE <= $PARAM$.endDate
P_CONTENT_CODE Out parameter that uniquely identifies the content. This is
generated based on P_OBJECT_CODE.
P_LANGUAGE Languge the P_CONTENT_DESC will be stored against.
P_SOURCE_LANG Languate P_CONTENT_DESC will be translated from.
P_USER_ID The ID of your Application will be used to populate the WHO columns

Note: The parameters above (startDate, endDate) must be defined in


the parameter list attached to the Content.

8.1.2. Define Parameter for the Content


If your SQL statement contains bind variables, a parameter list must be created to supply values for each
of the variables. The parameter list should contain parameters for all the variables you have defined in
your SQL statement.

8.1.2.1. Use the Parameter UI to create a parameter list. Use the following format for a name:
(Integrator Name) Content: (Meaningful description).

8.1.2.2. Add a parameter to the list for every parameter that appears in the SQL. The name
of the parameter must exactly match the parameter name used in the SQL statement
(must also be in the same case).

8.1.2.2.1. Press the Definition button for each parameter to add details on how the
parameter will behave. Instructions entered into the user tip field will be displayed to
users who must enter a value for this parameter after choosing the Content. You can
indicate what UI widget web ADI will use to render the parameter value selection to the
user. The method in which the parameter value is validated is also indicated in this
parameter definition.

8.1.2.3. Insert into BNE_CONTENTS_B.PARAM_LIST_CODE and PARAM_LIST_APP_ID.


This is the code of the list you created in 8.1.2.1.

8.1.3. Create Content Columns


The content columns define the columns in the select statement that can be mapped to fields in the
document. A record must be created for every source column you wish to map and download to a
document. The PL/SQL AP you ran to create the content automatically creates these columns based on
P_COL_LIST parameter. The actual column names have been entered into a TL table and will be visible
to users when creating mappings to associate columns in the select statement to columns in the
document. You may want to edit the TL table to make the column names more meaningful to users.

8.1.3.1. Update BNE_CONTENT_COLS_TL

Column Name Description

CONTENT_CODE* Unique Code of Content


SEQUENCE_NUM* Ordinal number specifying the content
LANGUAGE* Language USER_NAME will be defined against.
SOURCE_LANG* Language USER_NAME will be translated from.
USER_NAME* User name of Content source. E.g. User ID. This is what will

82
Company Confidential - For internal use only
Column Name Description

display for this column in the Mapping UI

8.2. Text File

It is possible to import a text file into a document. Use the following steps to implement this type of Content
for your Integrator. Only one Text File Content needs to be created to allow users to import text files.

8.2.1. Create Content Definition


8.2.1.1. Call the BNE_Content_Utils.CREATE_CONTENT_TEXT package and pass it the
following parameters:
BNE_CONTENT_UTILS.CREATE_CONTENT_TEXT
(P_APPLICATION_ID IN NUMBER,
P_OBJECT_CODE IN VARCHAR2,
P_INTEGRATOR_CODE IN VARCHAR2,
P_CONTENT_DESC IN VARCHAR2,
P_NO_OF_COLS IN NUMBER,
P_COL_PREFIX IN VARCHAR2,
P_LANGUAGE IN VARCHAR2,
P_SOURCE_LANGUAGE IN VARCHAR2,
P_USER_ID IN NUMBER,
P_CONTENT_CODE OUT NOCOPY VARCHAR2)

This package will create the content definition, parameter list and all of the content columns that will
be seen in the mapping UI.

Descriptions of each parameter:

Parameter Description

P_APPLICATION_ID The identifier for the application.


P_OBJECT_CODE A string of 20 chars or less. The only valid characters are: Uppercase
'A'..'Z', '0'..'9' and '_'. This string must be unique within the application
ID. This string will be used to generate P_CONTENT_CODE.
P_CONTENT_CODE = P_OBJECT_CODE + _CNT.
P_INTEGRATOR_CODE The code of the Integrator you wish to crate the content
for. Query
BNE_INTEGRATORS_B.INTEGRATOR_CODE for this
value.
P_CONTENT_DESC Text File
P_NO_OF_COLS The maximum number of columns in your text files. Then
number of content columns the API creates is determined
by this parameter. Then name for each content column
will be set numerically (1, 2, 3..P_NO_OF_COLS). A
prefix will be added to the front of each number if a value
for P_COL_PREFIX is set.
P_COL_PREFIX This prefix will be appended to the beginning of each
content column name that appears in the mapping UI.
Passing this parameter is optional.
P_CONTENT_CODE Unique Key for Content. This is generated from the P_OBJECT_CODE.
P_LANGUAGE Language P_CONTENT_DESC will be defined against.
P_SOURCE_LANG Languate P_CONTENT_DESC will be translated from.
P_USER_ID The ID of your Application will be used to populate the
WHO columns

83
Company Confidential - For internal use only
8.3. Java

It is possible to create your own Content Class for download. This may be done if the simple UI
prompting users for parameter values required for download is inadequate. In addition, passing a SQL
statement, or plugging a SQL statement into metadata to generate a result set may not be viable options.
Steps to implement a Java Content:

9 Create the Java class

9 Create Content Definition

9 Create Parameter Definitions

9 Create Parameter List for the Content

9 Create Content Columns

8.3.1. Create the Java Class


This section which describes creatingthe Java class is an open issue.

8.3.2. Create Content Definition


Call the BNE_Content_Utils.CREATE_CONTENT_DYNAMIC_SQL package.
PROCEDURE CREATE_CONTENT_DYNAMIC_SQL
(P_APPLICATION_ID IN NUMBER,
P_OBJECT_CODE IN VARCHAR2,
P_INTEGRATOR_CODE IN VARCHAR2,
P_CONTENT_DESC IN VARCHAR2,
P_CONTENT_CLASS IN VARCHAR2,
P_COL_LIST IN VARCHAR2,
P_LANGUAGE IN VARCHAR2,
P_SOURCE_LANGUAGE IN VARCHAR2,
P_USER_ID IN NUMBER,
P_CONTENT_CODE OUT NOCOPY VARCHAR2);

Parameter Description

APPLICATION_ID The identifier for the application.


P_OBJECT_CODE The code for the content definition. A string of 20 chars or less. The only valid
characters are: Uppercase 'A'..'Z', '0'..'9' and '_'. This string must be unique
within the application ID.
P_INTEGRATOR_CO The Code of the Integrator you wish to crate the content for. Query
BNE_INTEGRATORS.INTEGRATOR_CODE for this value.
DE
P_CONTENT_DESC Text File
P_CONTENT_CLASS oracle.apps.bne.webui.control.NameDownloadControl
P_COL_LIST Tab delimited list of the columns that will exist in the result set generated by
your Java class. These column names must match the names that appear in the
select statement generated by your Java Class. These columns will be mapped
to columns in the document.
P_LANGUAGE Language P_CONTENT_DESC will be defined against
P_SOURCE_LANG Language P_CONTENT_DESC will be translated from.
P_USER_ID The ID of your Application will be used to populate the WHO columns
P_CONTENT_CODE Unique key for your content. This is generated from the P_OBJECT_CODE.
P_CONTENT_CODE = P_OBJECT_CODE + _CNT

Note: You may want to update BNE_CONTENT_COLS_TL.USER_NAME to provide more


meaningful names for users to see in the Mapping UI.

84
Company Confidential - For internal use only
8.3.3. Create Parameter List for Content
8.3.3.1. Use the Parameter UI to create a parameter list for the content. Add a parameter to
the list for every parameter required by the content class.

8.3.3.1.1. Press the definition button in the Define Parameter screen to determine how
these parameters will be selected by users in the Web ADI Create Document Page flow.

8.3.3.2. Insert the parameter list code created in 8.4.3.1 into


BNE_CONTENTS_B.PARAM_LIST_CODE and PARAM_LIST_APP_ID for the
content created in 8.4.2.

85
Company Confidential - For internal use only
9. Reporting Only Documents
It is possible to download Content to a document without giving users the ability to upload. When the
document is created, the Upload option in the Oracle menu will not appear. Layouts and Mappings based on
Interfaces designed for upload can be used to generate reporting documents. Alternatively, Reporting only
documents can be created with Interfaces and Mappings specifically made for Reporting and do not have the
ability to facilitate Upload.

9.1. Reporting only with Data Entry Interfaces

The Interfaces, Layouts and Mappings that have been created for uploading data can be used to generate
Reporting Only documents. This can be done by setting the bne:reporting parameter to Y when the Web
ADI service is called. This parameter is displayed in the Web ADI Pageflow as Reporting Only. If the box
is checked, then the document you create will not have the upload option.

9.2. Reporting only Interfaces, Mappings and Layouts

Interfaces, Mappings and Layouts can be flagged as reporting only. This means that regardless of the
bne:reporting parameter value, when a layout is selected that is based on a Reporting Interface, the resulting
document will always be generated without the upload option. This method of providing reporting
documents can be used when you simply want to download Content to a document that will never be
uploaded. To enable users to download a Content for reporting purposes:

9.2.1. Run the Following API to create an Interface and Mapping based on the Content.
BNE_CONTENT_UTILS. ENABLE_CONTENT_FOR_REPORTING
(P_APPLICATION_ID IN NUMBER,
P_OBJECT_CODE IN VARCHAR2,
P_INTEGRATOR_CODE IN VARCHAR2,
P_CONTENT_CODE IN VARCHAR2,
P_LANGUAGE IN VARCHAR2,
P_SOURCE_LANGUAGE IN VARCHAR2,
P_USER_ID IN NUMBER,
P_INTERFACE_CODE OUT NOCOPY VARCHAR2,
P_MAPPING_CODE OUT NOCOPY VARCHAR2);

Parameter Description

APPLICATION_ID The identifier for the application.


OBJECT_CODE The code for the Mapping and interface to be created. A string of 20 chars or less.
The only valid characters are: Uppercase 'A'..'Z', '0'..'9' and '_'. This string must be
unique within the application ID.
P_INTEGRATOR_CODE The Code of the Integrator you wish to crate the interface and mapping for. Query
BNE_INTEGRATORS.INTEGRATOR_CODE for this value.
P_CONTENT_CODE The code of the content you wish to create the interface and mapping for.
P_LANGUAGE US
P_SOURCE_LANG US
P_USER_ID The ID of your Application will be used to populate the WHO columns
P_INTERFACE_CODE The code of the interface that will be created.

The name of the Interface that is created will be {Content Name} Reporting Interface. The name of the
Mapping that is created will be {Content Name} Reporting Mapping.

9.2.2. Once the API has been run, Layouts can be created for a reporting Interface that will allow
users to create their documents.

86
Company Confidential - For internal use only
10. Creating Layouts and Mappings
10.1. Creating Layouts

A Layout is a parameter given to the Create document service that indicates what columns are to be included
in a document. The placement of these columns within the document is also indicated by the Layout.
Layouts can be seeded with your application. Layouts can be defined to create documents that do not offer
upload, in addition to ones that provide upload capability. UI exists for Layout creation:

10.1.1. Select Define Layout on the self service home page

10.1.2. Select an Integrator and press Go.

10.1.3. The following screen shows all of the Layouts that have been defined for an Integrator. The
Reporting column indicates layouts that can only be used to create document that do not provide
upload. Press Define Layout to create a new layout, or update, duplicate or delete existing
layouts.

10.1.4. Enter a Name and Key for your Layout and select a Field List. The Key is a unique code that
that is used to reference the Layout when calling the BneApplicationService. It must be a string of
20 characters or less. The only valid characters are: Uppercase 'A'..'Z', '0'..'9' and '_'.

10.1.5. Select a Field List. The Field list selection determines the group of columns available to you
when determining which columns to include in your Layout. It also determines whether or not
your Layout can be used to create a document for upload purposes. The first selection in the drop
down box will allow a Layout to be generated for upload. This Field list contains all of the columns

87
Company Confidential - For internal use only
defined for Interfaces created for upload (BNE_INTERFACES_B.UPLOAD_TYPE = 1). All of the
other values in the LOV provide lists of columns that can be used to create Layouts that do not offer
upload.

10.1.6. Enter the location for the required columns (header/Lines).

10.1.7. Select the optional fields to be included in the Layout and their location (header/Lines).

Note: UI does not exist to define the column order in the document when a particular Layout is
used. Update BNE LAYOUT COLS.SEQUENCE NUM to accomplish this.

88
Company Confidential - For internal use only
10.1.8. Enter default values you would like to automatically appear for columns when the document
is created. There are five types of defaults you may set:
10.1.8.1. None Default Type when no Default Value is set.
10.1.8.2. Constant - Default Type used when the actual value in Default Value is used as the
default.
10.1.8.3. Environment Default Type when Default Value is an environmental variable. Valid
environmental variables are: language, oauser.id, database, sob.SetOfBooksName, and
sysdate., sob.setofbooksname, sob.setofbooksid, sob.chartofaccountsid, sob.periodsetname,
sob.accountedperiodtype, sob.currencycode, sob.latestencumbranceyear, sob.adbflag,
sob.consolidationflag, sob.transactioncalendarid, sob.mandate, sob.maxdate
10.1.8.4. Parameter Default type when Default Value is the name of a parameter passed to
BneApplicaionService.
10.1.8.5. SQL Default Type used when a SQL statement is entered into Default Value. Web
ADI will run this SQL and automatically populate the document with the result. If more than
one value is returned from the query, the first value returned will be used. You may use the
following tokens in the SQL statement entered in Default Value:
$profile$.profileName
$env$.userid
$env$.appid
$env$.respid
$env$.language

10.2. Creating Mappings

A Mapping links Content columns to Interface columns. This relationship between the columns in the result
set of a download and the destination column is needed for Web ADI to import data into the document.

UI exists for Mapping Creation (Note that Mappings for reporting Interfaces are not created through the
Mapping UI, but are created by the API in section 9.2):

10.2.1. Select Define Mapping on the Self- Service home page.

10.2.2. Select an Integrator and press Go.

10.2.3. Select the Content you wish to map and press GO. This screen will not appear if you only
one Content exists for the chosen Integrator.

89
Company Confidential - For internal use only
10.2.4. Press Define Mapping or update, duplicate or delete an existing Mapping.

10.2.5. Enter a Name and Key for your Mapping and the number of columns it will Map. The Key is
a unique code that is used to reference the Mapping when calling the BneApplicationService. It can
be a string of 20 chars or less. The only valid characters are: Uppercase 'A'..'Z', '0'..'9' and '_'.

10.2.6. Use the LOVs to match Content columns with Interface columns. Press Apply when
finished.

90
Company Confidential - For internal use only
91
Company Confidential - For internal use only
11. Calling the Create Doc Page Flow
The create document page flow can be called from either a pre defined form-function on the PHP, or from
within a Self Service Application. The oracle.apps.bne.webui.BneApplicationService servlet is called to
invoke the create document process. It may be called with the parameters described in this chapter.

If a required parameter is not supplied, UI will be displayed to prompt users for a value. Supplied
parameters will be validated by the page flow when it is initialized, and any parameters that are in error will
need to be reselected by the user at run time. If all of the parameters are correct, the user will see either the
Review page, or if bne:noreview is supplied, the document will be created immediately.

11.1. Available Parameters

11.1.1. Core Parameters


Core parameters are fundamental the Create Document Page flow, not to any control. They must be
supplied for a document to be created. If they are not passed by the calling form function, then users will
be prompted for values in the Create Document Page Flow.

Parameter Required Description

Bne:page X Set to BneCreateDoc to call the Create Document Page flow.


bne:language The language to display in the Viewer. E.g. US. This parameter does not have a
dependency on another parameter.
Bne:reporting Set to Y to create documents that do not offer upload. Set to N to create documents
that offer upload capability.
bne:viewer The Viewer to use. The value of this parameter must be in the form of Application
ID:Viewer Code.. E.g. bne:viewer=231:WORD2000. This parameter does not have a
dependency on another parameter.
bne:integrator The Integrator to use. This value is dependent on bne:viewer. The value of this
parameter must be in the form of Application ID:Integrator Code.. E.g.
bne:integrator=231:JOURNALS_115.
bne:layout The Layout to use when generating the document. This value is dependent on the
bne:integrator value. The value of this parameter must be in the form of Application
ID:Layout Code.. E.g. bne:layout=231: FUNCT_ACT_SINGLE_11I.
bne:content The data to import into the viewer. This parameter is dependent on the Integrator.
The value of this parameter must be in the form of Application ID:ContentCode.. E.g.
bne:content=231:NONE.

Note that bne:page=BneCreateDoc must be used to invoke the create document process. All
other parameters may not be set in the call, but can be left for users to choose at runtime through
the Create Document UI.

11.1.2. Content Specific Parameters


Content specific parameters are parameters specified in metadata for a particular Content being used.
Depending on bne:content, any number of parameters may be required. These are listed in the parameter
list attatched to the Content. Use the value in BNE_CONTENTS_B.PARAM_LIST_CODE for the Content
to find the required list of parameters in the parameter UI.

Bne:map is also required if a Content other than None is selected. This parameter points to a mapping
defined in metadata that relates source and destination columns.

Parameter Required Description

Content Parameters Any of the parameters defined in the parameter list associated with the
content being passed. The list is identified in
BNE_CONTENTS_B.PARAM_LIST_CODE. Look up this parameter list
in the Parameter UI to get a list of available parameters.
bne:map This parameter is dependent on the content. It specifies the mapping to

92
Company Confidential - For internal use only
Parameter Required Description

be used for download. The value of this parameter must be in the form
of Application ID:Mapping Code.. E.g.
bne:map=231:INTERFACE_TABLE_MAP

11.1.3. Pageflow Parameters


Pageflow Parameters determine how the Web ADI Page flow will behave to users.

Parameter Required Description

bne:redirect-portal A URL to redirect the user to after the Viewer has been created. If this is
not supplied, the user will be redirected to their personal home page.
The value can be any valid URL starting with http:// or https://
Example: bne:redirect-portal=http://www.oracle.com.
bne:noreview If this parameter is sent with any value the Create Document Review
page will not be displayed. Example: bne:noreview=anything

11.1.4. Upload Parameters

The upload parameters you have defined for your Integrator may be passed to the document creation
service. Use the value in BNE_INTEGRATORS_B.UPLOAD_PARAM_LIST_CODE and
UPLOAD_PARAM_LIST_APP_ID for your Integrator to view the required list of parameters in the
parameter UI. To pass an upload parameter you have to provide values that are correct for the
parameter. Then you can add the parameter to the URL as &<paramName>=<paramValue>

Example:

http://adi.us.oracle.com/servlets/oracle.apps.bne.webui.BneApplicationService?bne:page=BneCreateD
oc&bne:language=US&bne:rows=FLAGGED&bne:validation=NONE&bne:import=false

You can also send the upload parameters in a list:

http://adi.us.oracle.com/servlets/oracle.apps.bne.webui.BneApplicationService?bne:page=BneCreateD
oc&bne:language=US&bne:param-list=231:LIST_ON
As long as the passed parameter is defined in UPLOAD_PARAM_LIST_CODE tied to the Integrator and
has a valid value, that value will be used as an upload parameter, and not the default value defined in
metadata. The passed parameters are stored in the worksheet. Therefore, the passed parameters will be
used even if user saves the sheet, logs out of Self-Service and uploads at a later time.

11.2. Sending Parameters to BneApplicaitonService

Core parameters are sent on the HTTP command line in three different ways:

Application ID: Code. E.g. bne:integrator=231:JOURNALS_115

Application Short Name: Code. E.g bne:integrator= BNE:JOURNALS_115

USER_NAME: USER_NAME in TL table. E.g. bne:integrator=USER_NAME: General Ledger -


Journals

Content and Upload parameters are defined by the Integrator developer and are sent in the form of
name=value&name=value.

Example:

93
Company Confidential - For internal use only
http://adcsrv06.au.au.oracle.com:8080/servlet/BneApplicationService?bne:page=BneCreateDoc&bne:lan
guage=US&bne:viewer=231:EXCEL2000&bne:integrator=BNE:JOURNALS_115&bne:layout=231:FUNC
T_ACT_SINGLE&bne:content=231:ADDRESS&firstname=Jim

SQL wild cards are supported for Codes and USER_NAME values. E.g. bne:layout=BNE:USER%. If a
Wild Card returns one parameter value, then users will not be prompted to select that value in the Create
Document Page Flow. If multiple parameter values are returned, users will be prompted to select a value
from the filtered list. Note: Wildcards cannot be used for Application IDs or Application Short Names.

Profile options and environmental variables can be referenced when sending parameter values to
BneApplicationService. The formats to use when referencing profile options and environmental variables
are $Env$.variable_name and $Profiles$.profile_name respectively. For example, Web ADI will reference
profile option XXXX for the current applications user to resolve the Integrator value when
bne:integrator=231:$Profiles$.XXXX is passed. You must make sure the resolved parameter value
conforms to one of the three different parameter standards mentioned earlier in this section.

11.2.1. Secured List of Values


You may pass more than one value for a parameter. If this is done, the LOV for the parameter in the
Create Document Page flow will be limited to the list of parameter values passed to the create document
service. For example, you may want to limit the list of layouts available to a user. If no parameter is
passed for bne:layout, all of the layouts defined for an Integrator will be selectable on the Layout Page in
the Create Document Page Flow. You can limit the list of available layouts a person has access to by
having the form function pass a comma separated list of Application ID/Short Name:layout codes or
USER_NAME: Strings to the bne:layout parameter. E.g.
bne:layout=231:TST1,BNE:TST2,USER_NAME:test3,USER_NAME:test4%. When the user navigates to
the layout page after clicking the form function, he or she will only have the test1, test2, test3, test4, test41
and test412 layouts to choose from.

11.2.2. URL Encoding


When sending parameters in the URL, you must play by URL rules. This means invalid characters must
be escaped. Parameters may be sent on the URL as GET parameters (in the browsers address field on the
end of the URL), or as POSTed data from a HTML form.

To convert a String, each character is examined in turn:

The ASCII characters 'a' through 'z', 'A' through 'Z', '0' through '9', and ".", "-", "*", "_" remain the same.
The space character ' ' is converted into a plus sign '+'.

All other characters are converted into the 3-character string "%xy", where xy is the two-digit
hexadecimal representation of the lower 8-bits of the character.

If you are sending from a HTML form, this is done for you. If it is seeded in a form-function, strings
with the % wildcard and URLS (in bne:redirect-portal) need attention.

Example:

Sending the following parameters

bne:language Am%

be:layout 231:FUNCT_ACT

bne:redirect-portal http://www.google.com/search?sourceid=navclient&q=servlet redirect http

The following URL is needed.

94
Company Confidential - For internal use only
http://adi.us.oracle.com/servlet/oracle.apps.bne.webui.BneApplicationService?bne:page=BneCreateDoc&
bne:language=Am%25&bne:layout=231:FUNCT_ACT&bne:redirect-
portal=http%3A%2F%2Fwww.google.com%2Fsearch%3Fsourceid%3Dnavclient%26q%3Dservlet+redire
ct+http

The characters that were converted:

% --> %25, : --> %3A, / --> %2F, ? --> %3F, = --> %3D, & --> %26, space --> +

Note: Parameter values that have an & or % in their names cannot be


passed. Avoid creating parameters of this kind in metadata.

11.2.3. Length Limitations

If data is POSTed to BneApplicationService (ie a HTML for that does a POST), large amounts of data may
be sent to us.

If data is GETed to BneApplicationService (A GET is performed when a URL is entered directly into the
IE Address line, when an HTML form calls BneApplicaitonService, and when a Self-Service form function
calles BneApplicaitonService), then you are limited to a total address length of about 1800 characters.
This is a browser restriction.

11.2.4. Parameter Lists


Rather than passing all the parameters to Web ADI at runtime, you may save the parameters and their
values in metadata. This is done by defining a parameter list and calling that list at runtime.

Create Parameter List in Metadata using the Parameter List UI

Note the Parameter List Code.

Call Create Doc with parameter bne:param-list=Application ID/Short Name::Code.

Any parameters in the list will over-ride parameters sent on the http command line.

Example:

http://adi.us.oracle.com:8080/servlet/oracle.apps.bne.webui.BneApplicationService?bne:page=BneCreate
Doc&bne:language=US&bne:param-list=SQLGL:F_SINGLE_JNL_FR

If the F_SINGLE_JNL_FR Parameter List has a parameter bne:language=FR, then the value used is FR.

11.2.5. Document Creation Shortcuts

At the end of the Create Document Page flow, users are presented with the option of saving a document
creation shortcut. Shortcuts can be saved in two ways:

Selections are saved to shortcut that will appear on the first page of the Create Document Page
Flow. All users must do is select the shortcut, and all of their saved parameter values will be
used to generate a document.

Selections are saved to a Self-Service Form Function. The name you enter for the shortcut will be
used to create the Function Name and User Function Name (BNE_Shortcut Name). A system
administrator must search for this form function and attach it to a menu so it appears in the PHP.

95
Company Confidential - For internal use only
Only the core and content specific parameters are saved as document creation shortcuts. bne:redirect-
portal, bne:review, bne:param-list or passthrough params are not saved. This is because of a limit to the
amount of data that can be saved to a self-service menu item.

96
Company Confidential - For internal use only
APPENDIX A Parameter UI
Parameter UI was included with Web ADI 8.2. This allows you to quickly create, duplicate, and delete,
Parameter Lists, Parameter List Items, Parameter Definitions and Attributes.

Accessing Parameter UI
1. Click on the Create Doc link from the Web ADI menu.
2. Replace BneCreateDoc with BneParameter
3. The Define Parameter List page should be displayed.
4. This can also be imbedded in the form function on your Self-Service page. Log into Applications as
System Administrtor. Navigate to Applicaton=>Function and create a new form function with the
following values:

Field Value

Function BNE_DEFINE_PARAMS
Type SSWA SERVLET
Parameters Bne:page=BneParameter
HTML Call oracle.apps.bne.webui.BneApplicationService

Defining Parameter Lists


1. Select your application and press GO. All parameter lists are defined under an application.
2. Set the Parameter List Code, Name and Comments to meaningful values.
3. Enter values for any other fields. Ensure you have supplied values for all mandatory fields (those fields
with asterisks next to their labels).
4. Once you have entered all values, click on the Save button. The parameter list code cannot be changed
once the parameter list has been saved.

NOTE: the Parameter List Code is displayed at the top of the page once
the Parameter List has been saved.

Defining Parameter List Items

To add Parameters to the Parameter List, click on the Add Another Row button in the Parameters table at the
bottom of the Define Parameter List page.

1. Enter a meaningful Name for the Parameter. If creating a parameter list for a component, see the list of
parameters to add to the parameter list in section 5.1.4.
2. Enter values for all other fields. All three values: Data Type, Value, and Description must be entered,
either all three against the Parameter, or all three against the Parameter Definition. Values entered against
the Parameter will take precedence over values entered against the Parameter Definition. Data Type must be
String if you are defining a component for a parameter.
3. Click on the Save button.
4. To save the Parameter in the List, and to save these changes to the database, click the Save button at the
bottom of the Define Parameter List page.

Defining a Parameter Definition

To define a new Parameter Definition, click on the Definition button at the bottom of the Define Parameter
page.

97
Company Confidential - For internal use only
1. Enter a meaningful Name, Code, and Source.
2. Enter a Data Type, Default Value and Default Description. All three values: Data Type, Default Value,
and Default Description must be entered, either all three against the Parameter, or all three against the
Parameter Definition. Values entered against the Parameter will take precedence over values entered against
the Parameter Definition. For all Component Parameters, a Data Type of String MUST be used.
3. Select a Category that is relevant to the Parameter being defined.
4. Once all values have been entered, click the Save button.

Associating a Parameter Definition to a Parameter


By defining a Parameter Definition, it is not automatically linked to a Parameter. To link a Parameter Definition
to a Parameter you need to do the following:

1. Click on the Search Light icon next to the Parameter Definition label on the Define Parameter page.
2. After selecting the Parameter Definition from the displayed list, click on the Save button.
3. To save this change to the database, click on the Save button on the bottom of the Define Parameter List
page.

Testing Your Parameter List


After saving your parameter list, you can test that your Parameter List has been defined correctly by clicking on
the Test button at the bottom of the Define Parameter List page.

Click on the Apply button after entering valid values. If you are returned to the Define Parameter List page,
your parameter list items has been correctly defined. Otherwise, an error message is displayed.

Press the Reset button to reset the Parameter List items to their default values for more testing.

98
Company Confidential - For internal use only
APPENDIX B Shipping Your Integrator
Web ADI metadata can be extracted out of your seed instance and delivered as part of a patch to customers. All
objects created in metadata are striped by Application ID and are uniquely identified by a combination of
Application ID & Code. To prevent conflicts, you must only extract and ship metadata under your products
Application ID. It is the responsibility of product owners to prevent duplicate codes for the same object (e.g.
layouts, mappings) from being shipped within the same Application ID.

See this link for more information on FNDLOAD http://www-apps.us.oracle.com/atg/plans/r115/fndloadqr.txt

Applications 11i

Ldt files containing the metadata are generated using FNDLOAD. The control files that are required to generate
the ldts are included in the Web ADI 8.3 patch. The following are the available lcts that can be used to
export/import your metadata:

bnecomp.lct Components

bnecont.lct Contents

bneint.lct Integrators

bnelay.lct Layouts

bnemap.lct Mappings

bneparamlist.lct Parameter Lists

bness.lct Stylesheets

bnevw.lct Viewers

The following lcts are available but are generally not used for extraction because they relate to runtime
information:

bneuserset.lct User Settings

bnelaylob.lct Extracts data from the BNE_LAYOUT_LOBS table.

bnefile.lct Extracts data describing text files that have been uploaded to the middle tier.

Note: The Application Short Name of your product is a required


parameter when running the above lcts.

Applications 12

As of R12, Web ADI is shipping all of its metadata using a single lct file located under
$BNE_TOP/patch/115/import/bneintegrator.lct. We recommend all teams to use this lct file starting in R12. All new
features will be made available in the lct file only, and not dual maintained in the old lct files. The header of this lct file is
reproduced below, it contains instructions on how to use it to extract metadata for including in a patch.
# FILENAME
# bneintegrator.lct
#
# DESCRIPTION

99
Company Confidential - For internal use only
# Loader DOWNLOAD/UPLOAD configuration file for all INTEGRATOR related data.
# Using this lct file with one DOWNLOAD command, you should be able to download
# everything required for a Web ADI Integrator to run.
# @since R12
#
# NOTES
# It is STRONGLY recommended that project teams download data using only the BNE_INTEGRATORS entity
# and not piecemeal (as has been done in the past). This will produce a single ldt file per
integrator,
# or many integrators per ldt file.
#
# Download your integrator as follows:
# - All Integrators for an application:
# $ FNDLOAD apps/apps 0 Y DOWNLOAD bneintegrator.lct bneintegrators.ldt BNE_INTEGRATORS
INTEGRATOR_ASN=BNE
#
# - A specific Integrator:
# $ FNDLOAD apps/apps 0 Y DOWNLOAD bneintegrator.lct bneNewMsgs.ldt BNE_INTEGRATORS
INTEGRATOR_ASN=BNE INTEGRATOR_CODE=FND_NEW_MESSAGES_INTG
#
# - Two Integrators:
# $ FNDLOAD apps/apps 0 Y DOWNLOAD bneintegrator.lct bneNewMsgs.ldt BNE_INTEGRATORS
INTEGRATOR_ASN=BNE INTEGRATOR_CODE_LIST=FND_NEW_MESSAGES_INTG,JOURNALS_115
#
# If you have problems with this script, log a bug against product BNE (bugId 1171), component INSTALL
#
# ENTITIES AND PARAMETERS
# BNE_INTEGRATORS
# INTEGRATOR_ASN : Integrator Application Short Name
# INTEGRATOR_CODE : Integrator Code
# or
# INTEGRATOR_CODE_LIST: A comma separated list of integrator codes (without wildcards).
#
# Note: You should only use one of the INTEGRATOR_CODE and INTEGRATOR_CODE_LIST parameters at one
time.
# Note: Due to the way the DOWNLOAD section works, it is possible to download multiple integrators if
one
# integrator code is a substring of another.
# Code >> :INTEGRATOR_CODE_LIST is not null AND instr(:INTEGRATOR_CODE_LIST, V.INTEGRATOR_CODE)
> 0)
# will match INTEGRATOR_CODE XYZ_INTEG and XYZ_INT when using INTEGRATOR_CODE_LIST
XYZ_INTEG01,XYZ_INTEG02
# Please be aware of this when downloading entities.
#
#
# BNE_QUERIES
# QUERY_ASN : Query Application Short Name
# QUERY_CODE : Query Code
#
# BNE_PARAM_LISTS
# PARAM_LIST_ASN : Parameter Application Short Name
# PARAM_LIST_CODE : Parameter List Code
#
# BNE_COMPONENTS
# COMPONENT_ASN : Component Application Short Name
# COMPONENT_CODE : Component List Code
#
# BNE_SECURED_OBJECTS
# SECURED_OBJECT_ASN : Secured object application short name
# SECURED_OBJECT_CODE : Secured object code short name
# SECURED_OBJECT_TYPE : Secured object type.
#
# BNE_VIEWERS
# VIEWER_ASN : Viewer Application Short Name
# VIEWER_CODE : Viewer Code
#
# The following entity is internal to the Web ADI project team. DO NOT USE IT.
# All menu entries for an Integrator will be exported with the integrator
# using the BNE_INTEGRATORS entity.
# ENTITY BNE_ROOT_MENUS
# MENU_ASN : Menu Application Short Name
# MENU_CODE : Menu Code
#
# All entities in this file are related as shown (entities with a * may be DOWNLOADED separately),
# not all FKs are shown for brevity:
#
# ENTITIES
# * BNE_INTEGRATORS
# |
# +-<BNE_GRAPHS
# | |
# | +-<BNE_GRAPH_COLUMNS
# |
# +-<BNE_INTEGRATOR_VIEWERS
# |
# +-<BNE_IMPORT_PROGRAMS

100
Company Confidential - For internal use only
# |
# +-<BNE_INTERFACES
# | |
# | +-<BNE_INTERFACE_COLS
# | |
# | +-<BNE_INTERFACE_KEYS
# | |
# | +-<BNE_INTERFACE_KEY_COLS
# |
# +-<BNE_DUPLICATE_PROFILES
# | |
# | +-<BNE_DUP_INTERFACE_PROFILES
# | |
# | +-<BNE_DUP_INTERFACE_COLS
# |
# +-<BNE_CONTENTS
# | |
# | +-<BNE_CONTENT_COLS
# | |
# | +--BNE_STORED_SQL >--BNE_QUERIES
# |
# +-<BNE_MAPPINGS
# | |
# | +-<BNE_MAPPING_LINES
# |
# +-<BNE_LAYOUTS
# |
# +-<BNE_LAYOUT_BLOCKS
# |
# +-<BNE_LAYOUT_COLS
#
# * BNE_COMPONENTS
#
# * BNE_QUERIES
# |
# +--BNE_SIMPLE_QUERY
# |
# +-<BNE_RAW_QUERY
#
#
# * BNE_PARAM_LISTS>---------------+
# | |
# +-<BNE_PARAM_GROUPS |
# | | |
# | +-<BNE_PARAM_GROUP_ITEMS>-+--BNE_ATTRIBUTES
# | V |
# +-<BNE_PARAM_LIST_ITEMS>------+
# V |
# +--BNE_PARAM_DEFNS>-------+
# |
# +-<BNE_PARAM_OVERRIDES
#
# * BNE_SECURED_OBJECTS
# V
# +--BNE_SECURITY_RULES
#
# * BNE_ROOT_MENUS
#
# * BNE_VIEWERS

101
Company Confidential - For internal use only
APPENDIX C - Sample Code
Sample SQL Class - BneOAPeriodNameSQL (GL Journals Period Name LOV/Validator)

/*
* +=======================================================================+
* | Copyright (c) 2003 Oracle Corporation, Redwood Shores, CA, USA |
* | All rights reserved. |
* +=======================================================================+
* | HISTORY |
* | |
* | 27-Jun-2003 John Smith Created. |
* | |
* +=======================================================================+
*/
package oracle.apps.bne.utilities.oa;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;

import oracle.apps.bne.exception.BneException;

import oracle.apps.bne.framework.BneTrace;
import oracle.apps.bne.framework.BneWebAppsContext;

import oracle.apps.bne.utilities.sql.BneBaseSQL;

import oracle.apps.fnd.common.VersionInfo;

/**
* Class BneOAPeriodNameSQL
* <p>
* This class contains all of the SQL queries required for the Period Name
* LOV and Upload validation.
*
* @author John Smith
* @version $Revision: $ $Date: $
*/

public class BneOAPeriodNameSQL extends BneBaseSQL


{
// Field RCS_ID
public final static String RCS_ID = "$Header: $";

// Field RCS_ID_RECORDED
public final static boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "oracle.apps.bne.utilities.oa");

/**
* Method: BneOAPeriodNameSQL
* <p>
* Construct the object.
* You must call super() within this constructor.
* To properly destruct this object and clean up any cursors YOU MUST run close();
*
* @param context - This is all the session information for the current user
session.
* @param queryNumber - The number identifying the query to be used to create the
SQL Handle.
* Valid query numbers are:
* 1 - query to retrieve all open and future enterable budget
periods.
* 2 - query to retrieve all open and future enterable
periods containing a specific
* date (Actual Journals only)
* 3 - query to retrieve all open and future enterable
periods (Actual Journals only)
* 4 - query to retrieve all open and future enterable
periods containing a specific

102
Company Confidential - For internal use only
* date (Encumbrance Journals only)
* 5 - query to retrieve all open and future enterable
periods (Encumbrance Journals only)
* @param extraSQL - The string to contain the additional SQL criteria to limit
the SQL result
* set to the value selected by the user in the Web ADI
document. When calling the
* constructor for the LOV component, pass null to this
parameter.
*
* @throws SQLException on any SQL problem.
* @throws BneException on any internal WebADI problem.
*/
public BneOAPeriodNameSQL(BneWebAppsContext context, int queryNumber, String
extraSQL)
throws SQLException, BneException
{
super();

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameSQL:BneOAPeriodNameSQL() Start");

if (context == null)
{
throw new IllegalArgumentException("BneOAPeriodNameSQL - parameter:
context, a valid context must be passed to this constructor.");
}

Connection con = context.getJDBCConnection();


StringBuffer qry = new StringBuffer();

switch ( queryNumber )
{
case 1:
qry.append("SELECT DISTINCT PS.PERIOD_NAME, PS.PERIOD_YEAR,
PS.PERIOD_NUM " +
"FROM GL_PERIOD_STATUSES PS, GL_BUDGET_PERIOD_RANGES BPR,
GL_BUDGET_VERSIONS BV, GL_BUDGETS B " +
"WHERE B.SET_OF_BOOKS_ID = ? " +
"AND BV.BUDGET_VERSION_ID = ? " +
"AND B.BUDGET_NAME = BV.BUDGET_NAME " +
"AND BV.BUDGET_VERSION_ID = BPR.BUDGET_VERSION_ID " +
"AND BPR.PERIOD_YEAR = PS.PERIOD_YEAR " +
"AND PS.PERIOD_NUM BETWEEN BPR.START_PERIOD_NUM AND
BPR.END_PERIOD_NUM " +
"AND BV.BUDGET_TYPE = B.BUDGET_TYPE " +
"AND UPPER(B.BUDGET_TYPE) = 'STANDARD' " +
"AND PS.SET_OF_BOOKS_ID = ? " +
"AND PS.APPLICATION_ID = 101 " +
"AND PS.PERIOD_TYPE = ? " +
"AND PS.PERIOD_YEAR <= B.LATEST_OPENED_YEAR " +
"AND PS.ADJUSTMENT_PERIOD_FLAG = 'N' ");
break;

case 2:
qry.append("SELECT PS.PERIOD_NAME, PS.START_DATE, PS.END_DATE,
PS.PERIOD_NUM, PS.PERIOD_YEAR " +
"FROM GL_PERIOD_STATUSES_ACTUAL_V PS " +
"WHERE PS.SET_OF_BOOKS_ID = ? " +
"AND TRUNC(PS.START_DATE) <= TRUNC(?) " +
"AND TRUNC(PS.END_DATE) >= TRUNC(?) ");
break;

case 3:
qry.append("SELECT PS.PERIOD_NAME, PS.START_DATE, PS.END_DATE,
PS.PERIOD_NUM, PS.PERIOD_YEAR " +
"FROM GL_PERIOD_STATUSES_ACTUAL_V PS " +
"WHERE PS.SET_OF_BOOKS_ID = ? ");
break;

case 4:
qry.append("SELECT PS.PERIOD_NAME, PS.START_DATE, PS.END_DATE,
PS.PERIOD_NUM, PS.PERIOD_YEAR " +
"FROM GL_PERIOD_STATUSES_ENC_V PS " +
"WHERE PS.SET_OF_BOOKS_ID = ? " +
"AND TRUNC(PS.START_DATE) <= TRUNC(?) " +
"AND TRUNC(PS.END_DATE) >= TRUNC(?) ");
break;

103
Company Confidential - For internal use only
case 5:
qry.append("SELECT PS.PERIOD_NAME, PS.START_DATE, PS.END_DATE,
PS.PERIOD_NUM, PS.PERIOD_YEAR " +
"FROM GL_PERIOD_STATUSES_ENC_V PS " +
"WHERE PS.SET_OF_BOOKS_ID = ? ");
break;

default:
throw new IllegalArgumentException("BneOAPeriodNameSQL - parameter:
queryNumber, must be a number from 1 to 5.");
}

if (extraSQL != null &&


!extraSQL.trim().equals(""))
{
qry.append("AND " + extraSQL);
}

qry.append(" ORDER BY PS.PERIOD_YEAR DESC, PS.PERIOD_NUM DESC ");

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameSQL:BneOAPeriodNameSQL() SQL = "


+
qry);
setQuery(con, qry.toString());
m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameSQL:BneOAPeriodNameSQL() End");
}

Sample Validator Class - BneOAPeriodNameValidator (GL Journals Period Name


LOV/Validator)
/*
* +=======================================================================+
* | Copyright (c) 2003 Oracle Corporation, Redwood Shores, CA, USA |
* | All rights reserved. |
* +=======================================================================+
* | HISTORY |
* | |
* | 27-Jun-2003 John Smith Created. |
* | |
* +=======================================================================+
*/

package oracle.apps.bne.integrator.validators.gl;

import java.sql.Date;
import java.sql.SQLException;
import java.sql.Timestamp;

import java.text.SimpleDateFormat;

import java.util.Enumeration;
import java.util.Hashtable;

import oracle.apps.bne.exception.BneException;
import oracle.apps.bne.exception.BneFatalException;
import oracle.apps.bne.exception.BneMissingParameterException;
import oracle.apps.bne.exception.BneSQLException;

import oracle.apps.bne.framework.BneConstants;
import oracle.apps.bne.framework.BneLogger;
import oracle.apps.bne.framework.BneTechStack;
import oracle.apps.bne.framework.BneTrace;
import oracle.apps.bne.framework.BneWebAppsContext;

import oracle.apps.bne.integrator.upload.BneUploadColumn;
import oracle.apps.bne.integrator.upload.BneUploaderMessage;
import oracle.apps.bne.integrator.validators.BneUploadValidator;

import oracle.apps.bne.repository.BneResourceString;

104
Company Confidential - For internal use only
import oracle.apps.bne.utilities.BneStringUtils;
import oracle.apps.bne.utilities.oa.BneOACurrencyCodeSQL;
import oracle.apps.bne.utilities.oa.BneOAPeriodNameSQL;
import oracle.apps.bne.utilities.oa.BneSOBDetails;
import oracle.apps.bne.utilities.sql.BneCompositeSQLCriteria;
import oracle.apps.bne.utilities.sql.BneSQLStatement;
import oracle.apps.bne.utilities.sql.BneResultSet;

import oracle.apps.fnd.common.VersionInfo;

/**
* Class BneOAPeriodNameValidator
* <p>
* Implementation of BneUploadValidatorInterface and BneUploadDomainInterface
* for the Period Name interface column for the "General Ledger - Journals"
* Integrator.
* <p>
* The implementation of the BneUploadValidatorInterface validates the
* Period Name interface column.
* <p>
* The implementation of the BneUploadDomainInterface generates a List of Values
* for the Period Name interface column.
*
* @author John Smith
* @version $Revision: $ $Date: $
*/

public class BneOAPeriodNameValidator extends BneUploadValidator


{

/** Field RCS_ID */


public final static String RCS_ID = "$Header: $";

/**
* RCS version insertion into <code>VersionInfo</code> on class loading.
*/
public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion(RCS_ID,
"oracle.apps.bne.integrator.validators.gl");

// The following constants refer to each of the SQL queries that exist in the
BneOAPeriodNameSQL class.
public static final int BUD_JOURNAL_NO_ACCT_DATE = 1;
public static final int ACT_JOURNAL_WITH_ACCT_DATE = 2;
public static final int ACT_JOURNAL_NO_ACCT_DATE = 3;
public static final int ENC_JOURNAL_WITH_ACCT_DATE = 4;
public static final int ENC_JOURNAL_NO_ACCT_DATE = 5;

// Logger to be used as needed. All log messages will be written to the bne.log file.
These messages
// will NOT be transalated, and are to be used for debugging purposes only.
private BneLogger m_Logger = BneLogger.getInstance();

// Hashtable to store cached SQL Handles.


private Hashtable m_Statements = null;

/**
* Method: startupValidator
*
* This method initializes the SQL statement cache for the Period Name validator.
*
* @param context - All the valid session information for the current user session.
* @param requestParameters - A hashtable containing the document and upload page
parameters and
* their associated values.
* @param columnValues - A hashtable containing all the values for the current upload
row in the spreadsheet.
* @return Any relevant upload messages.
*/
public BneUploaderMessage [] startupValidator(BneWebAppsContext context,
Hashtable requestParameters,
Hashtable columnValues)
{
m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.startupValidator() Start");
m_Statements = new Hashtable(); // Initialise the SQL statement cache.
m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.startupValidator() End");
return (new BneUploaderMessage [0]);

105
Company Confidential - For internal use only
}

/**
* Method: getDomainParameters
*
* <p>Get the domain parameters. This is the union of all parameters that will be
used for the LOV Component.
*/
public String[] getDomainParameters ()
{
return(new String[] {"SET_OF_BOOKS_ID",
"ACTUAL_FLAG",
"ACCOUNTING_DATE",
"BUDGET_VERSION_ID",
"PERIOD_NAME"});
}

/**
* Method: getDomainValues
*
* <p>This method gets the values to be displayed in the Period Name Cabo/UIX LOV
page.
*
* <p>The following parameters are used within this method:
*
* SET_OF_BOOKS_ID
* ACTUAL_FLAG
* ACCOUNTING_DATE
* BUDGET_VERSION_ID
* PERIOD_NAME
* Period Type - this is derived from the Set of Books Details record.
*
* <p>
* Period Name LOV and Validation for Actual and Encumbrance Journals is only
available for
* Oracle Applications 11i and above.
*
* @param context - All the valid session information for the current user session.
* @param columnValues - A hashtable containing all the values for the current row in
the spreadsheet.
* @param criteria - All the details for the Period Name LOV component.
*
* @return SQL result set of Periods
*
* @throws BneException
*
*/
public BneResultSet getDomainValues (BneWebAppsContext context,
Hashtable columnValues,
BneCompositeSQLCriteria criteria) throws
BneException
{
m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.getDomainValues() Start");

SimpleDateFormat tempDateFormat = new SimpleDateFormat("yyyy-MM-dd");


tempDateFormat.setLenient(false);

String actualFlag = null;


String budgetString = null;
String sobIDString = null;
String tempAccountingDate = null;
Date accountingDate = null;
long budgetVersionId = -1;
long setOfBooksId = -1;

BneOAPeriodNameSQL SQLHandle = null;


BneResultSet rs = null;
BneSQLStatement extraSQL = new BneSQLStatement();

// If the user has entered criteria in the filter fields on the LOV page,
// add this restriction to the query by placing it in the extraSQL parameter
// which will be passed to the BneOAPeriodNameSQL constructor.

if (criteria != null)
{

106
Company Confidential - For internal use only
extraSQL = criteria.evaluate(extraSQL);
}

// Get the value for the ACTUAL_FLAG interface column.


actualFlag = (String)columnValues.get("ACTUAL_FLAG");

if (actualFlag == null)
{
throw new
BneMissingParameterException(BneResourceString.getMlsString("LOV_NO_ACTUAL_FLAG"));
}

// Get the Set of Books ID value from the spreadsheet.


sobIDString = (String)columnValues.get("SET_OF_BOOKS_ID");

if (sobIDString == null)
{
throw new
BneMissingParameterException(BneResourceString.getMlsString("UPL_ER_NO_SOB"));
}
else
{
setOfBooksId = Long.parseLong(sobIDString);
}

// Get all the Set of Books information for the current user.
BneSOBDetails sob = BneSOBDetails.getSOBDetails(context);

// Confirm the Set of Books in the spreadsheet matches the current user's Set of
Books.
if (setOfBooksId != sob.getSetOfBooksID())
{
throw new
BneMissingParameterException(BneResourceString.getMlsString("UPL_ER_SOB_MATCH"));
}

if ("B".equals(actualFlag)) //Budget Journal


{
// Get the Budget Name referenced by BUDGET_VERSION_ID interface column name
budgetString = (String)columnValues.get("BUDGET_VERSION_ID");

if (budgetString == null || budgetString.trim().equals(""))


{
m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.getDomainValues()
No Budget Name in the Spreadsheet.");
throw new
BneMissingParameterException(BneResourceString.getMlsString("UPL_ER_NO_BUDGET_VERSION"));
}
else
{
try
{
// Get the Budget Version ID using the BneOACurrencyCodeSQL class.
// NOTE: Instead of calling using the BneOACurrencyCodeSQL class, the
relevant query could
// have alternatively been included in the BneOAPeriodNameSQL
class. This is simply a case of
// reusing of existing code. The BneOACurrencyCodeSQL class is
not included in this document.

budgetVersionId =
Long.parseLong(BneOACurrencyCodeSQL.getBudgetId(context, budgetString));
} catch (SQLException e)
{
String errMsg =
BneResourceString.getMlsString("UPL_ER_BUDGET_VERSION_ID");
m_Logger.log(BneTrace.TRACE,
"BneOAPeriodNameValidator.getDomainValues() Error retrieving budget version Id " +
e);
throw new BneSQLException(errMsg, e);
}
}

String accountedPeriodType = sob.getAccountedPeriodType();

try
{

107
Company Confidential - For internal use only
SQLHandle = new BneOAPeriodNameSQL(context, BUD_JOURNAL_NO_ACCT_DATE,
extraSQL.getStatement());
m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.getDomainValues()
SQLHandle created to Budget Query.");
BneSQLStatement sqlStmt = new BneSQLStatement(SQLHandle.getQuery(),
new Object []{ new Long(setOfBooksId), new Long
(budgetVersionId),
new Long(setOfBooksId),
accountedPeriodType });

sqlStmt.append("", extraSQL.getBindValues());
rs = SQLHandle.getBneResultSet(sqlStmt.getBindValuesAsArray());

} catch (Exception e)
{
throw new BneFatalException (e.toString());
}
}

// Check that this is an 11i instance - Period Name support is only available for
Actual and Encumbrance
// journals in Applications 11i and above.

else if ((BneTechStack.getMiddleTierAppsRelease() > 11) && ("A".equals(actualFlag)


|| "E".equals(actualFlag)))
{
try
{
//Get the Accounting Date value from the spreadsheet.
tempAccountingDate = (String)columnValues.get("ACCOUNTING_DATE");

if (tempAccountingDate == null || tempAccountingDate.equals("")) //if


there is no Accounting Date
{
if ("A".equals(actualFlag))
{
SQLHandle = new BneOAPeriodNameSQL(context,
ACT_JOURNAL_NO_ACCT_DATE, extraSQL.getStatement());

m_Logger.log(BneTrace.TRACE,
"BneOAPeriodNameValidator.getDomainValues() SQLHandle created to +
Actual Query - no Accounting Date in
spreadsheet.");
}
else
{
SQLHandle = new BneOAPeriodNameSQL(context,
ENC_JOURNAL_NO_ACCT_DATE, extraSQL.getStatement());

m_Logger.log(BneTrace.TRACE,
"BneOAPeriodNameValidator.getDomainValues() SQLHandle created to +
Encumbrance Query - no Accounting
Date in spreadsheet.");
}
BneSQLStatement sqlStmt = new BneSQLStatement(SQLHandle.getQuery(),
new Object []{ new Long(setOfBooksId) });

sqlStmt.append("", extraSQL.getBindValues());
rs = SQLHandle.getBneResultSet(sqlStmt.getBindValuesAsArray());

}
else
// If an Accounting Date has been entered in the spreadsheet by the user,
then the LOV is limited to
// Periods that contain the Accounting Date.
{
java.util.Date utilDate = tempDateFormat.parse(tempAccountingDate);
accountingDate = new java.sql.Date(utilDate.getTime());

if ("A".equals(actualFlag))
{
SQLHandle = new BneOAPeriodNameSQL(context,
ACT_JOURNAL_WITH_ACCT_DATE, extraSQL.getStatement());

m_Logger.log(BneTrace.TRACE,
"BneOAPeriodNameValidator.getDomainValues() SQLHandle created to Actual +
Query - limit by Accounting Date.");

108
Company Confidential - For internal use only
}
else
{
SQLHandle = new BneOAPeriodNameSQL(context,
ENC_JOURNAL_WITH_ACCT_DATE, extraSQL.getStatement());

m_Logger.log(BneTrace.TRACE,
"BneOAPeriodNameValidator.getDomainValues() SQLHandle created to +
Encumbrance Query - limit by
Accounting Date.");
}

BneSQLStatement sqlStmt = new BneSQLStatement(SQLHandle.getQuery(),


new Object []{ new Long(setOfBooksId),
accountingDate, accountingDate });

sqlStmt.append("", extraSQL.getBindValues());

rs = SQLHandle.getBneResultSet(sqlStmt.getBindValuesAsArray());
}
} catch (Exception e)
{
m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.getDomainValues()
Caught unknown exception: " + e);
throw new BneFatalException (e.toString());
}
}
// If this is an Actual or Encumbrance journal on an 11.0 instance, throw an
exception as
// this is not supported.
else
{
m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.getDomainValues()
Exception: Period Name cannot be +
uploaded for Actual and Encumbrance Jnls in
R11.0 ");
throw new BneFatalException
(BneResourceString.getMlsString("UPL_ER_PERIOD_NAME_LOV"));
}

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.getDomainValues() End");

return rs;
}

/**
* Method: validateColumn
*
* <p>This method validates the Period Name on a per-line basis.
*
* @param context - All the valid session information for the current user session.
* @param requestParameters - A hashtable containing the document and upload page
* parameters and their associated values.
* @param columnValues - A hashtable containing all the values for the current upload
row in the spreadsheet.
* @param currentColumn - Information about the column being uploaded. This includes
the
* column name and value.
* @return An empty BneUploaderMessage array is returned when the column is valid, and
a
* BneUploaderMessage array containing relevant upload messages is returned
when
* the column is invalid. Messages can be error, exception or warning
messages.
* Warning messages will not stop the Upload process.
*/
public BneUploaderMessage [] validateColumn(BneWebAppsContext context,
Hashtable requestParameters,
Hashtable columnValues,
BneUploadColumn currentColumn)
{
m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.validateColumn() Start");

SimpleDateFormat tempDateFormat = new SimpleDateFormat("yyyy-MM-dd");


tempDateFormat.setLenient(false);

109
Company Confidential - For internal use only
BneUploadColumn tempBudgetName = null;
BneUploadColumn tempActualFlag = null;
BneUploadColumn tempAccountingDate = null;
boolean accountingDateFlag = false;
Date accountingDate = null;
long setOfBooksId = -1;
long budgetVersionId = -1;
String budgetName = null;
String periodName = null;
String actualFlag = null;
String key = null;

// Get the interface name to allow for retrieval of the column values - i.e.
GL_INTERFACE
String tableName = currentColumn.getInterfaceName();
BneSQLStatement extraSQL = new BneSQLStatement(" PS.PERIOD_NAME LIKE ?");

Object sqlHandleObject = null;


Object[] row = null;
BneOAPeriodNameSQL SQLHandle = null;

try
{
// Get all information for the ACTUAL_FLAG upload column.
tempActualFlag =
(BneUploadColumn)columnValues.get(BneStringUtils.concatSeperatorUnlessEmpty(tableName,
"ACTUAL_FLAG",

BneConstants.BNE_DEFAULT_SEPARATOR));
if ( tempActualFlag == null )
{
throw new Exception(BneResourceString.getMlsString("UPL_ER_ACTUAL_FLAG"));
}

BneSOBDetails sob = BneSOBDetails.getSOBDetails(context); // Get all the Set


of Books information for the current user.
setOfBooksId = sob.getSetOfBooksID();
periodName = (String)currentColumn.getColumnValueAsObject(); // Get the
PERIOD_NAME column value from the spreadsheet.

// Get the ACTUAL_FLAG column value from the ACTUAL_FLAG upload column
information.
actualFlag = (String)tempActualFlag.getColumnValueAsObject();

if ( "B".equals(actualFlag) ) // Budget Journal


{
// Get all information for the BUDGET_VERSION_ID upload column.
tempBudgetName =
(BneUploadColumn)columnValues.get(BneStringUtils.concatSeperatorUnlessEmpty(tableName,
"BUDGET_VERSION_ID",
BneConstants.BNE_DEFAULT_SEPARATOR));

if ( tempBudgetName == null)
{
currentColumn.flagColumnAsInvalid();
String msgStr =
BneResourceString.getMlsString("UPL_ER_NO_BUDGET_VERSION");
return (uploadError(currentColumn, msgStr,
"BneOAPeriodNameValidator"));
}
else
{
// Get the BUDGET_VERSION_ID column value from the BUDGET_VERSION_ID
upload column information.
budgetVersionId = Long.parseLong(tempBudgetName.getColumnValue());
}

// Get Period Type from the SOB details.


String accountedPeriodType = sob.getAccountedPeriodType();

// Cache on composite key of:


// actualFlag value, Set of Books ID value, accountingDateFlag
// Use commas as separators.
key = actualFlag + "," +
setOfBooksId + "," +
accountingDateFlag;

110
Company Confidential - For internal use only
m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.validateColumn key
= " + key);

// Next, get the cached SQL Handle based on the key, however if it does
not exist,
// it must be created and added to the cache.
sqlHandleObject = m_Statements.get(key);
SQLHandle = null;

if (sqlHandleObject != null)
{
SQLHandle = (BneOAPeriodNameSQL)sqlHandleObject;
}
else
{
SQLHandle = new BneOAPeriodNameSQL(context, BUD_JOURNAL_NO_ACCT_DATE,
extraSQL.getStatement());
m_Statements.put(key, SQLHandle);
}

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.validateColumn() "


+
", budgetName = " + budgetName +
", accountedPeriodType = " + accountedPeriodType +
", setOfBooksId = " + setOfBooksId +
", periodName = " +
(String)currentColumn.getColumnValueAsObject());

row = SQLHandle.getFirstRow(new Object []{ new Long(setOfBooksId), new


Long(budgetVersionId),
new Long(setOfBooksId),
accountedPeriodType, periodName });

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.validateColumn()
got " + ((Integer)row [0]).intValue());

// If one or more rows are returned from the query, then the column value
is Valid.
if (((Integer)row[0]).intValue() > 0)
{
currentColumn.flagColumnAsFineGrainValid();
return (new BneUploaderMessage[0]);
}
else
{
String msgStr =
BneResourceString.getMlsString("UPL_ER_PERIOD_INVALID");
return (uploadError(currentColumn, msgStr,
"BneOAPeriodNameValidator"));
}
}
else if ((BneTechStack.getMiddleTierAppsRelease() > 11) &&
("A".equals(actualFlag) || "E".equals(actualFlag)))
{
// Period Name is not a mandatory interface column therefore the column is
defined as FineGrainValid when it
// does not contain a value.
if (periodName == null || periodName.equals(""))
{
currentColumn.flagColumnAsFineGrainValid();
return (new BneUploaderMessage[0]);
}

tempAccountingDate =
(BneUploadColumn)columnValues.get(BneStringUtils.concatSeperatorUnlessEmpty( tableName,
"ACCOUNTING_DATE",
BneConstants.BNE_DEFAULT_SEPARATOR));

if (tempAccountingDate == null)
{
throw new Exception
(BneResourceString.getMlsString("UPL_ER_NO_ACCOUNT_DATE"));
}

// Set the accountingDateFlag to false to mark that the SQL result set is
not

111
Company Confidential - For internal use only
// limited by accountingDate - first we want to check that the period is
in an open
// or future-enterable period. The accounting date is not required for
this check.
accountingDateFlag = false;
key = actualFlag + "," +
setOfBooksId + "," +
accountingDateFlag;

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.validateColumn key


= " + key);

sqlHandleObject = m_Statements.get(key);
SQLHandle = null;

if (sqlHandleObject != null)
{
SQLHandle = (BneOAPeriodNameSQL)sqlHandleObject;
}
else
{
// The following query ensures that the Period is an open or future-
enterable period. (This is the
// first business rule that is checked)

if ("A".equals(actualFlag))
{
SQLHandle = new BneOAPeriodNameSQL(context,
ACT_JOURNAL_NO_ACCT_DATE, extraSQL.getStatement());
}
else
{
SQLHandle = new BneOAPeriodNameSQL(context,
ENC_JOURNAL_NO_ACCT_DATE, extraSQL.getStatement());
}

m_Statements.put(key, SQLHandle);

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.validateColumn() "


+
", setOfBooksId = " + setOfBooksId +
", periodName = " +
(String)currentColumn.getColumnValueAsObject());

row = SQLHandle.getFirstRow(new Object []{ new Long( setOfBooksId ),


periodName });

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.validateColumn()
got " + ((Integer)row[0]).intValue());

// if the query returns no rows, then return an Upload error.


if (((Integer)row[0]).intValue() <= 0)
{
String msgStr = BneResourceString.getMlsString(
"UPL_ER_PERIOD_INVALID");
return (uploadError(currentColumn, msgStr,
"BneOAPeriodNameValidator"));
}

// Set the accountingDateFlag to true to mark that the SQL result set is
// limited by accountingDate. This tests that the Accounting Date falls
within
// the selected Period.
accountingDateFlag = true;
key = actualFlag + "," +
setOfBooksId + "," +
accountingDateFlag;

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.validateColumn key


= " + key);

sqlHandleObject = m_Statements.get(key);
SQLHandle = null;

112
Company Confidential - For internal use only
// The following query ensures that the Period includes the accounting
date. (This is the second
// business rule that is checked)

if (sqlHandleObject != null)
{
SQLHandle = (BneOAPeriodNameSQL)sqlHandleObject;
}
else
{
if ("A".equals(actualFlag))
{
SQLHandle = new BneOAPeriodNameSQL(context,
ACT_JOURNAL_WITH_ACCT_DATE, extraSQL.getStatement());
}
else
{
SQLHandle = new BneOAPeriodNameSQL(context,
ENC_JOURNAL_WITH_ACCT_DATE, extraSQL.getStatement());
}
m_Statements.put(key, SQLHandle);
}

java.util.Date utilDate =
tempDateFormat.parse(tempAccountingDate.getColumnValue());
accountingDate = new java.sql.Date(utilDate.getTime());

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.validateColumn() "


+
", setOfBooksId = " + setOfBooksId +
", accountingDate = " + accountingDate.toString() +
", periodName = " +
(String)currentColumn.getColumnValueAsObject());

row = SQLHandle.getFirstRow(new Object []{ new Long(setOfBooksId),


accountingDate, accountingDate, periodName });

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.validateColumn()
got " + ((Integer)row[0]).intValue());

// If one or more rows are returned from the query, then the column value
is Valid.
// i.e. The Accounting Date falls within the selected Period.
if (((Integer)row[0]).intValue() > 0)
{
currentColumn.flagColumnAsFineGrainValid();
}
else
{
String msgStr = BneResourceString.getMlsString("UPL_ER_PER_NO_ACTDT");
return (uploadError(currentColumn, msgStr,
"BneOAPeriodNameValidator"));
}
}
currentColumn.flagColumnAsFineGrainValid();
return (new BneUploaderMessage[0]);
}
catch (Exception e)
{

// Return an upload error for any unexpected exceptions.


String msgStr = BneResourceString.getMlsString("UPL_ER_OBTAIN_PERIOD");
return (uploadException(currentColumn, msgStr, "BneOAPeriodNameValidator",
e));
}
}

/**
* Method: shutdownValidator
*
* <p>This method closes the Period Name validator. Any open cursors are closed in
* this method.
*
* @return Any relevant upload messages. An empty array of BneUploaderMessage is
returned
* when there are no errors.

113
Company Confidential - For internal use only
*/
public BneUploaderMessage [] shutdownValidator ()
{

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.shutdownValidator()
Start");

if (m_Statements != null)
{
Enumeration stmts = m_Statements.keys();
while (stmts.hasMoreElements())
{
Object k = stmts.nextElement();
Object o = m_Statements.get(k);
BneOAPeriodNameSQL SQLHandle = (BneOAPeriodNameSQL)o;
SQLHandle.close();
m_Statements.remove(k);
}
m_Statements = null;
}

m_Logger.log(BneTrace.TRACE, "BneOAPeriodNameValidator.shutdownValidator() End");


return (new BneUploaderMessage[0]);
}
}

Sample Component Class - BneOAPeriodNameComponent (GL Journals Period Name


LOV)
/*
* +=======================================================================+
* | Copyright (c) 2003 Oracle Corporation, Redwood Shores, CA, USA |
* | All rights reserved. |
* +=======================================================================+
* | HISTORY |
* | |
* | 27-Jun-2003 John Smith Created. |
* | |
* +=======================================================================+
*/

package oracle.apps.bne.integrator.component.gl;

import java.sql.ResultSetMetaData;
import java.sql.SQLException;

import java.util.Hashtable;
import java.util.Vector;

import javax.servlet.http.HttpServletRequest;

import oracle.apps.bne.exception.BneException;
import oracle.apps.bne.exception.BneParameterException;
import oracle.apps.bne.exception.BneSQLException;
import oracle.apps.bne.exception.BneMissingParameterException;

import oracle.apps.bne.framework.BneBajaContext;
import oracle.apps.bne.framework.BneBajaPage;
import oracle.apps.bne.framework.BneConstants;
import oracle.apps.bne.framework.BneWebAppsContext;

import oracle.apps.bne.integrator.component.BneAbstractListOfValues;
import oracle.apps.bne.integrator.validators.gl.BneOAPeriodNameValidator;

import oracle.apps.bne.parameter.BneParameter;
import oracle.apps.bne.parameter.BneParameterList;

import oracle.apps.bne.repository.BneResourceString;

import oracle.apps.bne.utilities.sql.BneCompositeSQLCriteria;
import oracle.apps.bne.utilities.sql.BneResultSet;
import oracle.apps.bne.utilities.sql.BneSimpleSQLCriteria;

import oracle.apps.bne.webui.control.BneLOVControlBean;

114
Company Confidential - For internal use only
import oracle.apps.fnd.common.VersionInfo;

import oracle.cabo.servlet.Page;
import oracle.cabo.servlet.event.PageEvent;

import oracle.cabo.ui.data.DictionaryData;

/**
* Class BneOAPeriodNameComponent
*
*
* @author John Smith
* @version $Revision: $ $Date: $
*/
public class BneOAPeriodNameComponent extends BneAbstractListOfValues
{

/** Field RCS_ID */


public final static String RCS_ID = "$Header: $";

/**
* RCS version insertion into <code>VersionInfo</code> on class loading.
*/
public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion(RCS_ID,
"oracle.apps.bne.integrator.component.gl");

/**
* Private variables
*/
private BneWebAppsContext m_bneWebAppsContext = null;
private BneOAPeriodNameValidator m_validator = null;
private String[] m_validatorParameters = null;

//
// Basic Filter Search Values
//
private String m_filterField = null;
private String m_filterValue = null;

/**
* Method: getLOVProcessorType
* <p>
* The viewer processes the Period Name LOV as a TABLE.
*
* @return the viewer processor type TABLE.
*/
public String getLOVProcessorType()
{
return BneConstants.BNE_LOV_TYPE_TABLE;
}

/**
* Method: init
* <p>
* This method instantiates the BneOAPeriodNameValidator class and calls
getDomainParameters
* to create a String array of the interface column names required by the Component.
*
* @param context The interface providing context about the current http request,
and
* providing access to generic Baja Services.
* @param page Identifies the Period Name LOV page.
* @param event The interface for events triggered on the Period Name LOV page.
Encapsulates
* a servlet request.
*
*/
public void init (BneBajaContext context,
Page page,
PageEvent event)
{
if (m_validator == null)
{
m_validator = new BneOAPeriodNameValidator();

115
Company Confidential - For internal use only
m_validatorParameters = m_validator.getDomainParameters();
}
}

/**
* Method: handleListOfValues
* <p>
* This method returns a BneBajaPage containing display information for the Period
Name LOV page.
*
* @param context The interface providing context about the current http request,
and
* providing access to generic Baja Services.
* @param page Identifies the Period Name LOV page.
* @param event The interface for events triggered on the Period Name LOV page.
Encapsulates
* a servlet request.
* @param bean Holds information about the Period Name LOV.
*
* @return a BneBajaPage
*
* @throws BneException
*
*/
public BneBajaPage handleListOfValues (BneBajaContext context,
Page page,
PageEvent event,
BneLOVControlBean bean) throws BneException
{
BneWebAppsContext ctx = context.getBneWebAppsContext();
BneCompositeSQLCriteria searchCriteria = null;
Hashtable parameterValues = new Hashtable();
String tableHeaderString =
BneResourceString.getMlsString("LOV_PERIOD_NAME");
String[] tableHeaders = {tableHeaderString};
String[] tableColumns = {"PERIOD_NAME"};
String[] tableSelectColumn = {"PERIOD_NAME"};

handlePageParameters(context, page, event);

for (int index = 0; index < m_validatorParameters.length; index++)


{
String validatorValue = getParameterValue(ctx, m_validatorParameters[index]);
if (validatorValue != null)
{
parameterValues.put(m_validatorParameters[index], validatorValue);
}
}

if ((m_filterValue != null) && !m_filterValue.trim().equals(""))


{
searchCriteria = new BneCompositeSQLCriteria();
BneSimpleSQLCriteria simpleCriteria = new
BneSimpleSQLCriteria(BneSimpleSQLCriteria.NONE, "PS.PERIOD_NAME",

BneSimpleSQLCriteria.TYPE_NONE,

BneSimpleSQLCriteria.LIKE, m_filterValue,

BneSimpleSQLCriteria.TYPE_STRING);
simpleCriteria.setSearchsCaseInsensitivity(true);
searchCriteria.addCriteria(simpleCriteria);
}

setTableFilter(true);
setPageTitle(getParameterValue(context.getBneWebAppsContext(), "window-caption"));
setTableData(getTableData(ctx, bean, parameterValues, searchCriteria));
setTableColumns(tableColumns);
setTableHeaders(tableHeaders);
setTableSelectColumn(tableSelectColumn);

return null;
}

/**
* Method: getListOfValueParameters
* <p>

116
Company Confidential - For internal use only
* This method creates a BneParameterList object consisting of one record for each
parameter in the
* m_validatorParameters String array (created in the init method).
*
* @throws BneParameterException
*/
public void getListOfValueParameters () throws BneParameterException
{

for (int index = 0; index < m_validatorParameters.length; index++)


{
String parameterName = m_validatorParameters[index];
String desc = "Oracle Applications GL_INTERFACE." + parameterName + " field.";
addComponentParameter(new BneParameter(parameterName, "", desc));
}
}

/**
* Method: handlePageParameters
* <p>
* This method does an http get to retrieve the values entered in the filter fields in
the Period Name LOV page.
*
* @param context The interface providing context about the current http request,
and
* providing access to generic Baja Services.
* @param page Identifies the Period Name LOV page.
* @param event The interface for events triggered on the Period Name LOV page.
Encapsulates
* a servlet request.
*
* @throws BneException
*/
private void handlePageParameters (BneBajaContext context,
Page page,
PageEvent event) throws BneException
{
HttpServletRequest httpRequest = context.getServletRequest();

m_filterField = httpRequest.getParameter("listOfValues:bne:filterField");
m_filterValue = httpRequest.getParameter("listOfValues:bne:filterValue");
}

/**
* Method: getTableData
*
*
* @param bneWebAppsContext All the valid session information for the current user
session.
* @param bean Holds information about the Period Name LOV control
* @param parameterValues This is a hashtable containing the list of all columns and
their
* values that are required by the SQL that will derive the
list of values.
* @param criteria This contains all the details for the Period Name LOV Component.
*
* @return a DictionaryData object containing all the Period values that will be
displayed on the LOV page.
*
* @throws BneException
*
*/
public DictionaryData [] getTableData (BneWebAppsContext bneWebAppsContext,
BneLOVControlBean bean,
Hashtable parameterValues,
BneCompositeSQLCriteria criteria) throws
BneException
{
DictionaryData sqlRow = null;
Vector myRows = new Vector();
BneResultSet rs = null;
ResultSetMetaData rsmd = null;

try
{
String columnValue = null;

117
Company Confidential - For internal use only
rs = m_validator.getDomainValues(bneWebAppsContext, parameterValues,
criteria);

if (rs != null)
{
rsmd = rs.getResultSet().getMetaData();

while (rs.next())
{
sqlRow = new DictionaryData();

for (int i = 1; i <= rsmd.getColumnCount(); i++)


{
columnValue = rs.getString(i);

if (columnValue == null)
{
sqlRow.put(rsmd.getColumnName(i), "");
}
else
{
sqlRow.put(rsmd.getColumnName(i), columnValue);
}
}

myRows.addElement(sqlRow);
}
}
}
catch (SQLException e)
{
throw new
BneSQLException(BneResourceString.getMlsString("UPL_PERIOD_NAME_SQL_EXCEPTION"), e);
}
catch (BneMissingParameterException mpe)
{
bean.addError(mpe.getMessage());
}
finally
{
m_validator.shutdownValidator();
}

DictionaryData[] allData = new DictionaryData [myRows.size()];

for (int index = 0; index < myRows.size(); index++)


{
allData[index] = (DictionaryData) myRows.elementAt(index);
}

return allData;
}

/**
* Method: getComponentName
*
* @return a String containing the name of the Component.
*
*/
public String getComponentName ()
{
return "BneOAPeriodName";
}

/**
* Method: getComponentVersion
*
* @return a String containing the revision identifier for the Component.
*
*/
public String getComponentVersion ()
{
return "$Revision: $";

118
Company Confidential - For internal use only
}
}

119
Company Confidential - For internal use only
Sample Metadata for the Period Name Java Validation

1.1.1.13 BNE Parameter Definition Sample Metadata for the Period Name Validator/LOV
The following three parameter definitions are defined for the Period Name example.

1.1.1.14 BNE_PARAM_DEFNS_B

Column Name Column Value

APPLICATION_ID 231
PARAM_DEFN_CODE OA_PER_NAME_WIN_CAP
OBJECT_VERSION_NUMBER 1
PARAM_NAME Web ADI Components: OA_PERIOD_NAME window-caption
PARAM_SOURCE WEBADI:Components
PARAM_CATEGORY 3
DATATYPE 1
DEFAULT_REQUIRED_FLAG N
DEFAULT_VISIBLE_FLAG Y
DEFAULT_USER_MODIFYABLE_FLAG Y
VAL_TYPE 1
MAX_SIZE 100
DISPLAY_TYPE 4
DISPLAY_STYLE 1
DISPLAY_SIZE 100

APPLICATION_ID 231
PARAM_DEFN_CODE TABLE_BLOCK_SIZE
OBJECT_VERSION_NUMBER 1
PARAM_NAME table-block-size
PARAM_SOURCE WEBADI:Components
PARAM_CATEGORY 5
DATATYPE 2
DEFAULT_REQUIRED_FLAG N
DEFAULT_VISIBLE_FLAG Y
DEFAULT_USER_MODIFYABLE_FLAG Y
DEFAULT_NUMBER 25
VAL_TYPE 1
MAX_SIZE 100
DISPLAY_TYPE 4
DISPLAY_STYLE 1
DISPLAY_SIZE 10

120
Column Name Column Value

APPLICATION_ID 231
PARAM_DEFN_CODE TABLE_SELECT_COLUMN
OBJECT_VERSION_NUMBER 1
PARAM_NAME table-select-column
PARAM_SOURCE WEBADI:Components
PARAM_CATEGORY 5
DATATYPE 1
DEFAULT_REQUIRED_FLAG N
DEFAULT_VISIBLE_FLAG Y
DEFAULT_USER_MODIFYABLE_FLAG Y
VAL_TYPE 1
MAX_SIZE 100
DISPLAY_TYPE 4
DISPLAY_STYLE 1
DISPLAY_SIZE 20

BNE_PARAM_DEFNS_TL

Column Name Column Value

APPLICATION_ID 231
PARAM_DEFN_CODE OA_PER_NAME_WIN_CAP
LANGUAGE US
SOURCE_LANG US
USER_NAME Title to place on window caption bar.
DEFAULT_STRING Search and Select Period Name
DEFAULT_DESC Search and Select Period Name
PROMPT_LEFT window-caption
PROMPT_ABOVE window-caption
USER_TIP Title to place on window caption bar.

APPLICATION_ID 231
PARAM_DEFN_CODE TABLE_BLOCK_SIZE
LANGUAGE US
SOURCE_LANG US
USER_NAME Determines if the number of records to display.
DEFAULT_DESC Number of records to show in an lov
PROMPT_LEFT table-block-size
PROMPT_ABOVE table-block-size
USER_TIP Determines if the number of records to display.

APPLICATION_ID 231
PARAM_DEFN_CODE TABLE_SELECT_COLUMN
121
Company Confidential - For internal use only
Column Name Column Value

LANGUAGE US
SOURCE_LANG US
USER_NAME Select column, comma-seperated list of columns to be selected. If aliases exist
then use the alias name. Example: NAME,DEPT
PROMPT_LEFT table-select-column
PROMPT_ABOVE table-select-column
USER_TIP Select column, comma-seperated list of columns to be selected. If aliases exist
then use the alias name. Example: NAME,DEPT

122
Company Confidential - For internal use only
BNE Parameter List Sample Metadata for the Period Name Validator/LOV

The following parameter list is defined for the Period Name example.

BNE_PARAM_LISTS_B

Column Name Column Value

APPLICATION_ID 231
PARAM_LIST_CODE COMP_PERIOD_NAME
OBJECT_VERSION_NUMBER 1
PERSISTENT_FLAG Y
COMMENTS This list is used for the OA_PERIOD_NAME Component.

BNE_PARAM_LISTS_TL

Column Name Column Value

APPLICATION_ID 231
PARAM_LIST_CODE COMP_PERIOD_NAME
LANGUAGE US
SOURCE_LANG US
USER_NAME Web ADI: OA_PERIOD_NAME Component

BNE Parameter List Items Sample Metadata for the Period Name Validator/LOV

BNE_PARAM_LIST_ITEMS

Column Name Column Value

APPLICATION_ID 231
PARAM_LIST_CODE COMP_PERIOD_NAME
123
Company Confidential - For internal use only
Column Name Column Value

SEQUENCE_NUM 1
PARAM_DEFN_APP_ID 231
PARAM_DEFN_CODE TABLE_SELECT_COLUMN
STRING_VALUE PERIOD_NAME
DESC_VALUE PERIOD_NAME

APPLICATION_ID 231
PARAM_LIST_CODE COMP_PERIOD_NAME
SEQUENCE_NUM 2
PARAM_DEFN_APP_ID 231
PARAM_DEFN_CODE OA_PER_NAME_WIN_CAP
PARAM_NAME window-caption

APPLICATION_ID 231
PARAM_LIST_CODE COMP_PERIOD_NAME
SEQUENCE_NUM 3
PARAM_DEFN_APP_ID 231
PARAM_DEFN_CODE TABLE_BLOCK_SIZE
STRING_VALUE 25
DESC_VALUE 25

BNE Component Sample Metadata for the Period Name Validator/LOV

BNE_COMPONENTS_B

Column Name Description

APPLICATION_ID 231
COMPONENT_CODE OA_PERIOD_NAME
OBJECT_VERSION_NUMBER 1
COMPONENT_JAVA_CLASS oracle.apps.bne.integrator.component.gl.BneOAPeriodNameComponent
PARAM_LIST_APP_ID 231
PARAM_LIST_CODE COMP_PERIOD_NAME

BNE_COMPONENTS_TL Table

Column Name Description

APPLICATION_ID 231
124
Company Confidential - For internal use only
Column Name Description

COMPONENT_CODE OA_PERIOD_NAME
LANGUAGE US
SOURCE_LANG US
USER_NAME OA_PERIOD_NAME Component

BNE Interface Column(s) Sample Metadata for the Period Name Validator/LOV

BNE_INTERFACE_COLS_B Table

Column Name Description

APPLICATION_ID 231
INTERFACE_CODE GL_INTERFACE_115
OBJECT_VERSION_NUMBER 1
SEQUENCE_NUM 83
VAL_TYPE JAVA
VAL_OBJ_NAME oracle.apps.bne.integrator.validators.gl.BneOAPeriodNameValidator
VAL_COMPONENT_APP_ID 231
VAL_COMPONENT_CODE OA_PERIOD_NAME
LOV_TYPE STANDARD
OFFLINE_LOV_ENABLED_FLAG N

Sample Metadata for a Group Validator

BNE Interface Column(s) Sample Group Validator (Reversal Group Validator)

BNE_INTERFACE_COLS_B - New Group Validator Column


A new Interface Column is defined for the Group Validator. Metadata for this new interface column should be as follows: (The metadata below
is a sample from the Reversal Group Validator used for the General Ledger Journals Integrator)

125
Company Confidential - For internal use only
Column Name Column Value

APPLICATION_ID 231
INTERFACE_CODE GL_INTERFACE_115
SEQUENCE_NUM 138
INTERFACE_COL_TYPE 2
INTERFACE_COL_NAME REVERSAL_PARENT
ENABLED_FLAG Y
REQUIRED_FLAG N
DISPLAY_FLAG N
READ_ONLY_FLAG N
NOT_NULL_FLAG N
SUMMARY_FLAG N
MAPPING_ENABLED_FLAG N
GROUP_NAME REVERSAL
VAL_TYPE GROUP
VAL_OBJ_NAME oracle.apps.bne.integrator.validators.gl.BneOAReversalGroupValidator
LOV_TYPE NONE
OFFLINE_LOV_ENABLED_FLAG N

BNE_INTERFACE_COLS_B Including Interface Columns in the Validation Group


For each Interface Column to be validated by the Group Validator/LOV, update the GROUP_NAME column to contain the GROUP_NAME
defined by the new Interface Column definition (see above). Continuing the above example, two interface columns use the REVERAL group:

Column Name Column Value

APPLICATION_ID 231
INTERFACE_CODE GL_INTERFACE_115
SEQUENCE_NUM 58
INTERFACE_COL_NAME REFERENCE7
GROUP_NAME REVERSAL

APPLICATION_ID 231
INTERFACE_CODE GL_INTERFACE_115
SEQUENCE_NUM 59
INTERFACE_COL_NAME REFERENCE8
GROUP_NAME REVERSAL

126
Company Confidential - For internal use only
APPENDIX D Security
Web ADI provides a level of function security within its framework that allows
declarative rules to be applied to an integrator to lock out users who should not be
able to access an Integrator. This level of security is mandatory in Web ADI (refer
section 2.2 Associate Form Function(s) with Integrator).

This function security does not prevent the writer of the Integrator introducing
security holes that allow valid users to perform illegal actions. This is something the
Integrator Developer must be aware of as they develop their solution, in a similar
manner as they would when writing OA pages.

Web ADI, as a desktop application, introduces a number of additional challenges


that need to be addressed above that which is typical in a web environment.

Spreadsheets may exist for a long time. They may be saved, copied, emailed
and re-used a number of times.

Spreadsheets can be reused by a different user than the one that created it.

The conditions/data that the spreadsheet was created under may have
changed.

When a Web ADI spreadsheet is generated, information is placed in the code of the
sheet that allows that spreadsheet to interact with the middle tier using business
rules defined for the Integrator. Placing this information in the spreadsheet allows
the sheet to be reused over large periods of time.

This information is generated from parameters defined by the Integrator Developer,


such as:

Content Parameters,

Upload Parameters,

Create Document Object parameters and

LOV Parameters.

Some of these parameter values may be particular to the user that created the sheet,
and to the user selections made when creating the sheet; this is up to the Integrator
Developer when creating the Integrator. Web ADI does not understand what these
parameters mean, they are specific to the problem domain of the Integrator
Developer.

These parameter values can be tampered in the spreadsheet by a user, and the
tampered value will be sent to the middle tier. Any parameter whose value is used
for configuration must be checked for validity before use by code running in the
middle tier.

The previous discussion on parameters does not include the spreadsheet user data
itself, which may also need to be checked. For example, Spreadsheet values that
allow configuration such as the ledger must be re-checked to ensure the entered
value is valid for the user.

127
Examples - Download

For example, a stored SQL download may have a parameter that is the userid of a
user to download data for. This userid is supposed to be the user running the
Integrator solution. If this userid is declared as a content parameter it will be stored
in the spreadsheet and passed to the download service when the download is
performed (either at sheet creation or on any number of subsequent downloads
even months later when run as a different user).

Scenario 1: Sheet is cleared of data and emailed to another user (user 2).

Result 1: User 2 downloads again sees user 1s data

Scenario 2: User modifies the sheet and changes the user id.

Result 2: User sees another persons data

Both of these scenarios are the result of trusting data/parameters coming from the
client. In this example they can be simply fixed by using a token in the SQL query
$env$.userid which will be bound with the logged in users userid whoever that
user may be when they run the sheet. This is an example of using secure middle tier
information protected by the login process.

Another solution, and one more applicable for complex parameter situations is to re-
check the parameters when sent to the sheet i.e. always be suspicious of everything
sent from the client. The following decorator may be used as an example of how
this may be done for a stored SQL control.

Decorator for BneStoredSQL for securing parameters


/*
* +=======================================================================+
* | Copyright (c) 2000 Oracle Corporation, Redwood Shores, CA, USA |
* | All rights reserved. |
* +=======================================================================+
* | HISTORY |
* | 12-Aug-2004 David Groves Created. |
* +=======================================================================+
*/
// package MUST be changed to be under product teams $psa.
package oracle.apps.bne.webui.control;

import java.sql.Connection;

import java.util.Enumeration;
import java.util.Hashtable;

import oracle.apps.bne.exception.BneException;
import oracle.apps.bne.exception.BneParameterException;

import oracle.apps.bne.framework.BneKey;
import oracle.apps.bne.framework.BneTrace;
import oracle.apps.bne.framework.BneWebAppsContext;

import oracle.apps.bne.repository.BneMapObject;

import oracle.apps.bne.webui.control.BneStoredSQLControl;

import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.common.WebAppsContext;

/**
* This class is presented as an example of how project teams may do additional validation

128
Company Confidential - For internal use only
* for their stored SQL contents, where the query cannot contain the logic necessary (i.e it's
* too hard to put into a single SQL query).<p>
*
* Project teams need to create their own copy of this class under their own java directories
* ($psa/java) and ship it in their patch. DO NOT ship it under the Web ADI (bne) area,
* product teams will need to change the package as appropriate.<p>
*
* Project teams will also need to change the BNE_CONTENTS_B.CONTENT_CLASS column for their content
* to point to this class. For example, replace <br>
* 'oracle.apps.bne.webui.control.BneStoredSQLControl'<br>
* with <br>
* 'oracle.apps.XXX.webui.control.BneExampleStoredSQLControl'<p>
* If this contnet has already been shipped, remember to update the LAST_UPDATE_DATE on this
* SEED data row so FNDLOAD will upload it.
*
* @author David Groves david.groves@oracle.com
U U

* @version $Revision$
*/

public class BneExampleStoredSQLControl extends BneStoredSQLControl


{

/** Field RCS_ID */


public final static String RCS_ID = "$Header: 2004/06/18 04:45:21 dagroves Exp $";

/** Field RCS_ID_RECORDED */


// product teams to update this appropriately.
public final static boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion( RCS_ID,
"oracle.apps.bne.webui.control" );

/**
* Open the datasource for reading. This method is called before any data is read with next().
*
* @param context see BneWebAppsContext definition.
* @param mapDefinition the map object for the selected mapping template.
* It can be used to obtain data such as column separator.
* @param controlParameters name/value pairs (Strings) of the parameters to use to do the download. These
* have been sent form the viewer via HTTP and have not been converted into their correct datatypes or
* decoded into BneParameters for simplicity.
* @param environmentParameters environmental parameters. Initially there are two parameters that the
* control should conform to:<ol><li>
* NLS_NUMERIC_CHARACTERS - the characters that act as decimal and thousand separators. Eg. ".,"</li><li>
* NLS_DATE_FORMAT - the date format to return dates in. Note that this is a Java SimpleDateFormat format
* mask, similar but different to the standard Oracle data format mask. Eg. "yyyy-MM-dd"</li></ol>
* @param contentId key to content.
* @param layoutId key to layout. This is used by some implementations to restrict the columns sent to the
* client.
* @throws BneException
* @see BneDownloadDataInterface
*/
public void open (BneWebAppsContext context,
BneMapObject mapDefinition,
Hashtable controlParameters,
Hashtable environmentParameters,
BneKey contentId,
BneKey layoutId)
throws BneException
{
// Connection and wac that may be useful for obtaining data/running queries.
Connection con = context.getJDBCConnection();
WebAppsContext wac = context.getWebAppsContext();

// Application specific parameter checks are placed here.


// In this example, the parameters are enumerated over and logged.
// Specific implementations may like to get their known parameters using:
// String value = (String)controlParameters.get("myKnownKey");
Enumeration enum = controlParameters.keys();
while (enum.hasMoreElements())
{
String key = (String)enum.nextElement();
String value = (String)controlParameters.get(key);
m_Logger.log(BneTrace.DETAIL, "BneExampleStoredSQLControl.open() parameter: " + key +
", value" + value);

if ("my_param_key".equalsIgnoreCase(key) && "bad_value".equalsIgnoreCase(value))


{
// This parameter value is bad, reject the download.
throw new BneParameterException("Invalid parameter value for parameter: " + key);
}
}

129
Company Confidential - For internal use only
// At this point, all parameters are determined to be valid. Do the "default" action.
super.open(context, mapDefinition, controlParameters, environmentParameters, contentId, layoutId);
}
}

Examples Upload / LOV


For example, a financials spreadsheet has a chart of accounts generated into it. This chart of accounts specifies a
subset of applications data that this user is allowed to see (via LOVs) and Upload.

When uploading, the chart of accounts sent with the upload data needs to be tested against the chart of accounts
currently assigned to the user. If they are not the same, an error needs to be generated and the upload halted.

The following scenarios need to be catered for:

The user does not have access to the chart of accounts


The chart of accounts is not valid
The chart of accounts is valid but disabled (or expired)

When performing LOVs, the chart of accounts may be sent to the LOV and the LOV data filtered by this value.
The Chart of Accounts value needs to be validated before use in the LOV, and if invalid an error should be
generated.

Security Contexts

130
Company Confidential - For internal use only
For some applications, these concepts will be handled with a security context defined for that application
(virtual private database), in which case little or no code will be required as data that is not relevant to the user
will not be available. Caution should be used to ensure all data falls into this security context.

For other applications, explicit code checks are required.

Input Filter
All data sent to the Web ADI middle tier is scanned for input filter violations. This includes HTTP parameters
and all upload data points (every cell in the spreadsheet).

The input filter checks will not catch bad data values however, this needs to be done by the Integrator Developer.

General Coding Considerations

Always use bind variables in queries

Never concatenate data in SQL (SQL injection)

Apply your business logic on the middle tier

131
Company Confidential - For internal use only

Das könnte Ihnen auch gefallen