Sitemap

Showing posts with label AXF. Show all posts
Showing posts with label AXF. Show all posts

Wednesday, May 6, 2015

Add attachments without using the Managed Attachments window

SCENARIO: When using the WebCenter Content Application Adapters for PeopleSoft or E-Business Suite, attachments are typically added by logging into PSFT or EBS and opening the Managed Attachments popup window. Another method of adding attachments can be done with direct checkins to the content server, as long as certain parameters are added to the checkin data.

To add attachments without using the Managed Attachments window, the following three parameters must be added to a checkin service call. This may be useful in migrating content from one system to another, or initial batchloading. To understand how these parameters work, look at the AFObjects table in the WebCenter Content schema. This table stores these values on checkin.

  1. dAFApplication - This is the name of the EBS instance that is set as the application in the AXF_COMMAND_PARAMETERS table. If using the OAF pages in EBS, the application parameter is set in the OAF_AXF_CMD_PARAMS table.  If using PeopleSoft, this value is set in the PS_AXF_CMD_PARAMS table.  This parameter is usually the simplest one to determine, since many content items will be using the same value for this.
  2. dAFBusinessObjectType - This setting must match what is setup in PSFT or EBS to pass as the business object type. For EBS forms, this is determined using the AXF schema table AXF_FND_MAP. The AXF_FND_MAP.ENTITY_NAME column is used for EBS forms. For example, when using the Oracle form Invoices, the dAFBusinessObjectType is AP_INVOICES. If using the "Requisition" page on iProcurement, this value will be what is set in the OAF_AXF_CMD_PARAMS for that OAF page (e.g. Requisition, or REQ_HEADER, depending on how the page was setup initially in this table). When using PeopleSoft, the value will be set in the PS_AXF_CMD_PARAMS table.  If performing checkins outside of the Managed Attachments window, this value must match exactly. If the match is not exact, content items checked in outside of the Managed Attachments window will not show up when the business user logs into EBS and opens the attachments popup.
  3. dAFBusinessObject - This is the key value for the page or form. An example of the key value on the AP_INVOICES form is the invoice number. This value is typically an integer representing an ID for a invoice, requisition, purchase order, work order, etc. This must match exactly what is being used when the Managed Attachments windows is used for checkins. If the value used in direct checkins to the content server do not match, the attachments will not show up on the Managed Attachments page, and will be orphaned in the AFObjects table.


Understand that these fields are not WCC metadata fields, but data used in the AFObjects table. But like metadata field values, these can be set in local data for the checkin call to the content server. If using RIDC for a call the CHECKIN_NEW or CHECKIN_UNIVERSAL, these three settings can be added in the following manner, just like common metadata fields are added (dSecurityGroup or xCommencts are added in the same manner).
//Managed Attachments parameters - these 3 trip the AppAdpater filter so that the content item is attached via insert to the AFObjects table. 
dataBinder.putLocal("dAFApplication", "EBS_instanceA");
dataBinder.putLocal("dAFBusinessObjectType", "REQ_HEADERS"); 
dataBinder.putLocal("dAFBusinessObject", "181152");

If using a SOAP request for the checkin service call, the following example shows the fields that can be added when calling a checkin service using GenericSoapService (a.k.a GenericSoapPort).

<ns1:Field name="dAFApplication">EBS_instanceA</ns1:Field>
<ns1:Field name="dAFBusinessObjectType">AP_INVOICES</ns1:Field>
<ns1:Field name="dAFBusinessObject">1234</ns1:Field>

Again, to help understand how these values are stored on the WebCenter Content side, use SQL Developer or SQLPlus to review the AFObjects table.  To understand where these values come from on the application side, review each form or page and investigate the AXF schema to see how the form is configured to pass in the page name. For OAF pages, the table of most interest is OAF_AXF_CMD_PARAMS (and related OAF* tables). If using PSFT, the PS_AXF_CMD_PARAMS table contains the values. If using EBS forms, the AXF_FND_MAP and AXF_COMMAND_PARAMETERS table contain the values. 

Batch Content to Later Show as EBS Managed Attachments for Certain Business Entities

SCENARIO: You have numerous content items that you need to batch/bulk load into Universal Content Management (UCM) without using the EBS interface, and those items need to be tied/related to certain EBS entities.

Below is an example of using UCM IdcCommand to batch/bulkload the content items:

1. Gain a better understanding of what the EBS Managed Attachments code sends to UCM for a "New" check-in via enabling verbose system audit trace section "requestaudit" and adding an attachment to a specific business entity via the Managed Attachments EBS Zoom link. Example parameters sent to UCM are below:
requestaudit/6 10.26 17:09:44.854 IdcServer-7165:

CHECKIN_NEW [dID=8512][dDocName=UCM008514][dDocTitle=test][dUser=sysadmin][dSecurityGroup=AFDocuments][QueryText=dAFBusinessObjectType<matches>`PER_PEOPLE_F` <AND> dAFBusinessObject<matches>`6429` <AND> dAFApplication<matches>`EBS_instanceA`][xCollectionID=0][StatusCode=0][StatusMessage=Successfully checked in content item 'UCM008514'.] 0.16578499972820282(secs)

2. Using the values from the example UCM trace above, you can create a serialized hda file to use with IdcCommand. For your environment, you will need to change the values to meet your needs/trace results.

Example IdcCommand file name = <ucm install root>/bin/EBSCheckin.hda

<?hda version="10.1.3.3.2 (071031)" jcharset=UTF8 encoding=utf-8?>
doFileCopy=1
IdcService=CHECKIN_NEW
dSecurityGroup=AFDocuments
dDocType=EBSAttachment
dDocTitle=test
dDocAuthor=sysadmin
dDocAccount=
dRevLabel=1
dInDate=12/15/2010
dAFApplication=EBS_instanceA
dAFBusinessObjectType=PER_PEOPLE_F
dAFBusinessObject=6429
primaryFile=/home/oracle/Desktop/Hello.txt


3. Run IdcCommand to batch/bulk load the content item(s) from the <ucm install root>/bin directory:

IdcCommand -u sysadmin -f EBSCheckin.hda

4. IdcCommand should output "successful".

5. Log-into that same EBS entity (a Person's record).

6. Log into UCM's prompt for the Managed Attachments Zoom for that EBS entity as the same user specified in the serialized hda as the value of  "dDocAuthor".

7. Check that the batch/bulk loaded content item(s) is available via EBS.

Enable Managed Attachments for Oracle EBS Forms don't have FND Attachments configured at form level

For EBS forms that have FND Attachments enabled at the "Form" level one can configure Managed Attachments by populating the AXF_FND_MAP table (either using the AXF_MANAGED_ATTACHMENT_DATA.sql script or manually) and additional parameters can be added by populating the AXF_MA_PARAMETERS table.

For EBS forms and/or custom forms that have FND Attachments enabled at "Form Function" level only, you will need to use an alternate approach and manually add entries to the AXF_CONFIGS / AXF_COMMANDS / AXF_COMMAND_PARAMETERS tables.

You will need to collect the following values:

  • Entity (businessObjectType): the EBS entity/module (for example: AP_INVOICES)
  • Primary Key (businessObjectKey1) and Data Block Object (businessObjectValue1); the forms data block and attribute that holds the primary key value for the record (for example: INV_SUM_FOLDER.INVOICE_ID)
  • Formfunction name for the EBS form (for example: AP_APXINWKB)


DECLARE
my_entity VARCHAR2(255) := 'your_ebsentity'; --example: AP_INVOICES
my_formfunction VARCHAR2(255) := 'your_formfunction'; --example: AP_APXINWKB
my_datablockname VARCHAR2(255) := 'your_forms_datablock_name'; --example: INV_SUM_FOLDER
my_fieldname VARCHAR2(255) := 'your_datablock_fieldname'; --example: INVOICE_ID

v_formId AXF_CONFIGS.FORMID%TYPE;
v_eventId AXF_COMMANDS.EVENTID%TYPE;
v_solutionendpoint AXF_CONFIGS.SOLUTIONENDPOINT%TYPE;

BEGIN
select AXF_CONFIGS_SEQ.NEXTVAL into v_formId from dual;
select SOLUTIONENDPOINT into v_solutionendpoint from AXF_CONFIGS where formfunction='AXF_MANAGED_ATTACHMENTS';

Insert into AXF_CONFIGS (FORMID,FORMFUNCTION,SOLUTIONENDPOINT,ENTITYNAME,LOGENABLED,DATABLOCKNAME,CREATED_BY,CREATION_DATE,LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN) values (v_formId,my_formfunction,v_solutionendpoint,null,'YES','AXF_DEFAULT',0,sysdate,sysdate,0,0);

select AXF_COMMANDS_SEQ.NEXTVAL into v_eventId from dual;
Insert into AXF_COMMANDS (EVENTID,FORMID,EVENTNAME,DISPLAYMENU,COMMANDNAMESPACE,REQUIRESCONVERSATION,SORTBY,SOLUTIONNAMESPACE,MENUTYPE,SPECIAL,RESPONSIBILITY,CREATED_BY,CREATION_DATE,LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN) values (v_eventId,v_formId,'ZOOM','Managed Attachments','UCM_Managed_Attachments','NO',3,'UCM_Managed_Attachments','ZOOM',null,null,0,sysdate,sysdate,0,0);

Insert into AXF_COMMAND_PARAMETERS (PARAMETERID,EVENTID,PARAMETERNAME,DATASOURCENAME,DATABLOCKNAME,FIELDNAME,CONSTANTVALUE,CREATED_BY,CREATION_DATE,LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN) values (AXF_COMMAND_PARAMETERS_SEQ.NEXTVAL,v_eventId,'application','CONSTANT',null,null,'EBS_instanceA',0,sysdate,sysdate,0,0);

Insert into AXF_COMMAND_PARAMETERS (PARAMETERID,EVENTID,PARAMETERNAME,DATASOURCENAME,DATABLOCKNAME,FIELDNAME,CONSTANTVALUE,CREATED_BY,CREATION_DATE,LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN) values (AXF_COMMAND_PARAMETERS_SEQ.NEXTVAL,v_eventId,'businessObjectType','CONSTANT',null,null,my_entity,0,sysdate,sysdate,0,0);

Insert into AXF_COMMAND_PARAMETERS (PARAMETERID,EVENTID,PARAMETERNAME,DATASOURCENAME,DATABLOCKNAME,FIELDNAME,CONSTANTVALUE,CREATED_BY,CREATION_DATE,LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN) values (AXF_COMMAND_PARAMETERS_SEQ.NEXTVAL,v_eventId,'businessObjectKey1','CONSTANT',null,null,my_datablockname||'.'||my_fieldname,0,sysdate,sysdate,0,0);

Insert into AXF_COMMAND_PARAMETERS (PARAMETERID,EVENTID,PARAMETERNAME,DATASOURCENAME,DATABLOCKNAME,FIELDNAME,CONSTANTVALUE,CREATED_BY,CREATION_DATE,LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN) values (AXF_COMMAND_PARAMETERS_SEQ.NEXTVAL,v_eventId,'businessObjectValue1','DATA',my_datablockname,my_fieldname,null,0,sysdate,sysdate,0,0);

END;
/

The following screenshot displays the entries for transactions in Receivables.

Application Extension Framework (AXF)

This is the intermediary between the Oracle application and UCM. AXF is a web service call for Oracle apps. AXF performs one RIDC call to UCM to check for access, then responds to the app. It runs in IPM, deployed in IPM and uses IPM database tables.

In EBS menu, go to Payables - Invoices - Invoices link to open the Forms application. A saved invoice looks like this when opened.



What Does AXF do?


IPM sends a SOAP response to EBS with a UCM URL. If successful, EBS opens a browser to that URL. UCM login screen opens in browser, and then after login, Managed Attachments opens. User works with UCM in browser (independently of EBS). Standard service calls are made to UCM. There is no SOAP or RIDC used at this point.


Clicking New button pops up a checkin form specific to the integration:


Private Attachments vs. Shared Attachments

Private Attachments:
1. "Share document" option unchecked during checkin.
2. Security Group = AFDocuments
3. Not searchable in standard UCM search for anyone (except for users with specific roles, e.g. AFWrite, AFAdmin, etc).

Shared Attachments
1. "Share document" checked.
2. Allows Security group to be selected from groups that user has access to.


Enabling Managed Attachments

Enabling Managed Attachments requires certain components to be enabled:
• AppAdapterCore – Needed for all AXF integrations to UCM.
• AppAdapterEBS – Needed just for EBS to UCM integration.
• AppAdapterPSFT – Needed for PeopleSoft to UCM integration.

Other components that must be enabled:
• YahooUserInterfaceLibrary
• CheckoutAndOpenInNative
• CoreWebdav
• NativeOsUtils
• ContentFolios


How does UCM secure and separate regular content from private attachments?

• By security group: AFDocuments
• By database tables:
  • AFGrants – Grants user access privileges.
  • AFObjects – links the content items (attachments) to the invoice (business object)

When IPM calls AF_GRANT_ACCESS service, a row is written to UCM table AFGrants. Temporary access (half hour by default) granted to a user.

• dUsername: EBS/UCM user of same name. (e.g. operations)
• dAFApplication: Identifier for the instance of EBS. (VIS121)
• dAFBusinessObject: Identifier for the EBS form (e.g. invoice 1234)
• dAFBusinessObjectType: What kind of EBS entity is it? Invoice.
• dPrivilege: Defaults to Write from AppAdapterGrantPrivilege=W
• dExpirationDate: Defaults to AppAdapterGrantHours=.5 (in hours)

AFObjects contains "attachment" information, linking content items to EBS entities such as invoices.

• dAFApplication: Identifier for the instance of EBS. (VIS121)
• dAFBusinessObjectType: What kind of EBS entity is it? Invoice.
• dAFBusinessObject: Identifier for the EBS form (e.g. invoice 1234)
• dDocName: Content ID


Default Content Server profiles are provided for each business application,
• EBSProfile for Oracle E-Business Suite
• PSFTProfile for Oracle PeopleSoft.


AXF_SOLUTION_PARAMETERS Table
In IPM schema (DEV_IPM), the table AXF_SOLUTION_PARAMETERS holds information about the UCM server.


• RIDC_CONNECTION_STRING: used to call AF_GRANT_ACCESS service.
• UCM_CONNECTION_STR is used to build the URL to pass back to the requesting application (e.g. EBS).