Introduction
Oracle Sales and Service modules of Oracle Fusion Applications can be extended to add WebCenter Content-based managed attachments associated with specific records of the module.
Use the solution Managed Attachments using Application Composer-based Standard Business Objects if:
- Application Composer has a standard business object available for customizing the pages for the specific module.
Use this solution Managed Attachments using Page Composer and Visual Builder Cloud Service-based Application Extension if
The module does not have a standard business object in Application Composer.
The module page is editable by Page Composer and a hyperlink can be added in the page.
The module page has exposed the following to Page Composer: Unique binding parameter(s) which can be used in the link to uniquely identify the object record (to which the attachments can be associated).
Common Steps for Managed Attachments
The steps in this section are common for the solutions based on Application Composer Standard Business Objects or VBCS-based Application Extension.
Learn to install and configure the Fusion Application adapters, enable embedding of managed attachments user interface, enable advanced security in WebCenter Content, and other key configurations you need to enable integration of Oracle Sales and Service application with WebCenter Content.
Configure WebCenter Content for FA Integration
Log in to wls-1 of WebCenter Content stack VMs and run the following commands to configure it for FA integration.
sudo su - oracle
# For existing stacks after patching (This will have latest scripts and should be used as preferred location)
cd /u01/scripts/patch/lcm/sh
# For new stacks (If in case configure_wcc_fa_adapter.sh script is not found on above path)
cd /u01/scripts/lcm/sh
For IDCS SSO-based environments
Run the configuration script with the following arguments.
sh configure_wcc_fa_adapter.sh --fa_domain <fa-domain-host> --ucm_domain <ucm domain host> --idcs_user <WCC Idcs Administrator user>
When the script prompts for password input as shown below, enter the administrator password for WebCenter Content IDCS:
Please provide IDCS User's Password:
For non-IDCS SSO environments
Run the configuration script with the following arguments.
sh configure_wcc_fa_adapter.sh --fa_domain <fa-domain-host> --ucm_domain <ucm domain host>
Enable Advanced Security in WebCenter Content
Log in to WebCenter Content as an administrator.
Navigate to Administration and then to Configuration for wcc****.
On the Configuration Information page, make a note of the value for the search engine under the System Configuration section.
Under Administration, click Oracle Advanced Security Configurations.
On the Oracle Advanced Security Configurations page, complete the following updates:
If WebCenter Content is set to use
DATABASE.METADATA
as the search engine:Select the Core QueryText Security Config check box.
Custom table names: AFOBJECTS
Custom field names: Leave this field blank.
Click Update.
If WebCenter Content is set to use
DATABASE.FULLTEXT
orOracleTextSearch
as the search engine:Select the Core QueryText Security Config check box.
Custom table names: AFOBJECTS
Custom field names: dreleasestate
Click Update.
If custom metadata is used with
DATABASE.METADATA
:Select the Core QueryText Security Config check box.
Custom table names: Leave this field blank.
Custom field names: <xCustomMetadataField1; xCustomMetadataField2; xCustomMetadataField3;...>
Click Update.
If custom metadata is used with
DATABASE.FULLTEXT
orOracleTextSearch
:Select the Core QueryText Security Config check box.
Custom table names: Leave this field blank.
Custom field names: <xCustomMetadataField1; xCustomMetadataField2; xCustomMetadataField3;...>
Click Update.
Enable Webservice Security Policy for WebCenter Content Grant Webservice
In case the required policy is already applied, skip this section.
Log in to Enterprise Manager as an administrator.
Navigate to UCM_Server1, Deployments, Oracle UCM Webservices, Modules and Components, Webservices, AfGrantService, and then to AfGrantAccessPort.
Click Attach/Detach policies.
Click Directly Attached Policies and then click Attach/Detach.
In the Available Policies section, search for
oracle/wss_http_token_service_policy
Click Attach, click Validate, and then click Ok.
Restart all WebCenter Content servers.
Configure Managed Attachments UI locale
The Managed attachments UI will automatically pick up locale from Oracle Sales and Service Application locale and display the UI in that locale. For this to work, the locale should be enabled in the WebCenter Content environment by the administrator by completing the following steps.
- Navigate to WebCenter Content, Administration, and then Localization page.
- Select the desired locale to enable it and click Update.
If the locale is not enabled in WebCenter Content or not available, then UI will use default locale.
Create a Sandbox
Create a sandbox to implement the Oracle Sales and Service application changes for this integration:
Sign in to Oracle Sales and Service application as an administrator.
Click the hamburger icon in the upper left corner of the page. Select the Configuration option from the menu and then select Sandboxes.
On the Create Sandbox page, complete the following fields:
On the Sandboxes page, click Create Sandbox.
On the Create Sandbox page, specify a name for this sandbox in the Name field (for example, WebCenter Content Records Management Integration).
From the All Tools list, select the Application Composer check box.
If you are using Page Composer and VBCS Application Extension-based solution, then select the Page Composer check box too.
Click Create and Enter.
Create WebCenter Content Grant Webservice
To enter the application composer where you'll be making your WebCenter Content integration changes, click Tools in the upper left corner of the page and then select Application Composer from the drop-down list.
Choose Common Setup and then Web Services from the left navigation menu.
On the Web Services page, click the Create a new Web Service icon.
In the Select Connection Type dialog, select the SOAP option and click OK.
On the Create SOAP Web Services Connection page, complete the following fields:
In the Name field, specify WebCenterContentGrantWebservice as the name of the folder.
In the URL field, enter
https://<WebCenter Content URL>/idcws/AfGrantAccess?WSDL
as the web service URL.Click Read WSDL.
Navigate to Security, Security Scheme, and then select Call with basic authentication.
In the Credential key field, click + to add a credential key. If credentials for this web service already exist, you can select the existing credentials, otherwise, create one using the following steps.
Credential Key - Specify a name.
User name - If WebCenter Content is configured with IDCS Single Sign-on, then specify the administrator name for WebCenter Content IDCS, otherwise, specify the administrator name for WebCenter Content Weblogic.
Password - If WebCenter Content is configured with IDCS Single Sign-on, then specify the administrator password for WebCenter Content IDCS, otherwise, specify the administrator password for WebCenter Content Weblogic.
Note: For WebCenter Content web service, use HTTPS-based URL (not HTTP-based). Also, the URL should have valid HTTPS certificates because the FA connection to the web service will not work without valid HTTPS certificates. It will not work with self-signed certificates.
Managed Attachments Using Application Composer-Based Standard Business Objects
For the module you are planning to add Managed Attachments to, use this solution if:
- Application Composer has a standard business object available for customizing the pages for the module.
Prerequisites
Complete the steps in section Common Steps for Managed Attachments if not completed already.
Configure Oracle Sales and Service Application Integration
Learn to create a mashup, and other key configurations you need to configure the Oracle Sales and Service application integration.
Create a Global Function to Call WebCenter Content Grant
Choose Common Setup and then Global Functions from the left navigation menu.
On the Global Functions page, click the Add a Global Function icon.
On the Create Global Function page, complete the following fields:
In the Function Name field, specify WebCenterContentGrantWebserviceFunction as the name of the function.
Select String from the Returns drop-down menu.
In the Parameters section, click the Add Parameter icon and add the following fields:
Name - SrNumber
Type - String
In the Edit Script field, paste the following script:
println("Executing WebCenter Content Grant Access for SR " + SrNumber); def curUserName = adf.context.getSecurityContext().getUserName(); def locale = adf.context.getLocale(); def response = [:]; // NOTE - Change this to a name corresponding to your instance def applicationName = "MyCompanySalesCloud"; def request = [ commandNamespace : "UCM_Managed_Attachments", solutionNamespace: "UCM_Managed_Attachments", username : curUserName, userContext : [], requestParameters: [ entry: [[ key : "businessObjectType", value: "ServiceRequest", ], [ key : "businessObjectKey1", value: "SRNumber", ], [ key : "businessObjectValue1", value: SrNumber, ], [ key : "application", value: applicationName, ], [ key : "labelValue1", value: "Managed Attachments - Service Request Documents", ]] ] ]; try { // Execute WebCenter Content Grant web service response = adf.webServices.WebCenterContentGrantWebservice.execute(request); // Retrieve WebCenter Content MA URL from response String ucmMaUrl = ""; String afGuidVal = ""; def responseCommands = response["responseCommands"].get(0); for (responseCommand in responseCommands) { if (responseCommand["command"] == "OPEN_BROWSER") { String url = responseCommand["value"]; // Extract afGuid url = url.substring(url.indexOf("?") + 1); String[] urlParams = url.split('&'); for (String urlParam : urlParams) { String[] nameValPair = urlParam.split('='); if (nameValPair[0] == "afGuid") { afGuidVal = nameValPair[1]; break; } } ucmMaUrl = "&afGuid=" + afGuidVal + "&locale=" + locale; println("Extracted WebCenter Content attachment url suffix " + ucmMaUrl); break; } } return ucmMaUrl; } catch (Exception e) { println("Error getting WebCenter Content Managed attachment url for SR " + SrNumber + " " + e); }
Note: For
applicationName
, enter a name for your Sales cloud instance. For example, <MyCompany>SalesCloud.About Grant webservice payload
You can specify up to 5 keys (businessObjectKey1,. businessObjectKey5) and their corresponding values (businessObjectValue1,. businessObjectValue5) respectively in the payload. The maximum character lengths of various parameters are:
applicationName: 20
businessObjectType: 100
businessObjectKey's: 80
businessObjectValue's: 80
These variables should form a unique combination to attach the documents. They should be provided the same values consistently for a given object record so that previously attached documents (if any) are retrieved using the same combination of values.
Specifying Custom Title in Managed Attachments UI
Redwood UI
For managed attachments title customization use the maHeader and maTitle url parameters described in Configuration Reference.
Non-Redwood UI
The value for the key “labelValue1” in the payload is used to customize the managed attachments UI title. The custom title will not be translated to other languages. This field is not mandatory. If this field is not provided in the payload, a default title will be present in the UI.
Click Save and Close.
Create a Mashup
A Mashup is a window into an independent external application such as WebCenter Content. To create a Mashup to embed the WebCenter Content embedded user interface (so that it can be exposed in an Oracle Sales and Service business object):
Choose Common Setup and Mashup Content from the left navigation menu.
On the Mashup Content: Web Applications page, click Register Web Application.
On the Register Web Application page, complete the following fields:
In the Name field, specify WebCenterContentManagedAttachmentsUIMashup as the name of the application.
For the Type field, select the Groovy Expression option.
In the URL Definition field, enter
https://<WebCenter Content Server Host>:<WebCenter Content Server Port>/cs/idcplg?IdcService=EMBEDLOGIN_HOME&ActAsAnonymous=true
as the WebCenter Content embedded UI URL.
Click Save and Close.
Configure Specific Business Object Integration
In order to configure specific business object integration, learn to extend the business object.
Extend the Business Object
Business objects can be extended using a Mashup (like the one created earlier) to expose an external application such as WebCenter Content within the Business Object user interface. To create a new service request page layout to include the WebCenter Content integration:
Choose Objects, then Standard Objects, then Service Request, and then Pages from the left navigation menu.
On the Service Request: Pages page, in the Details Page Layouts section, click the Duplicate Details Page Layout icon.
Note: If a custom page has already been created, then that page can be used for the WebCenter Content asset integration instead of creating a new one and step 3 can be skipped.
In the Duplicate Layout dialog, complete the following fields:
In the New Layout Name field, specify WebCenterContentEmbeddedUIIntegration as the name.
In the Source Layout field, select Standard layout from the drop-down menu.
Click Save and Edit.
In the Details Layout page, select the Add icon from the bottom of the left navigation menu in the Subtabs Region section to add the WebCenter Content embedded UI.
Select the Mashup Content option. Click Next.
On the next page, select the WebCenterContentEmbeddedAssetsUIMashup option that was created earlier and click Insert.
On the next page, complete the following fields:
In the Display Label field, enter Managed Attachments.
For the Display Icon, click Change Icon if you want to change the default icon that shows up in the service request UI as a tab.
In the Edit Script field, paste the following script:
println("Service Request Managed Attachments Tab Selected: " + SrNumber) // Create MA url based off the item SrNumber def ucmMaUrl = adf.util.WebCenterContentGrantWebserviceFunction(SrNumber); println("WebCenter Content MA Url suffix " + ucmMaUrl); return ucmMaUrl;
Click Next.
Click Save and Close.
Verify the Integration in the Sandbox
Now, verify if the integration was set up properly.
Create a New Service Request
To create a new service request:
Click the site name just to the right of the Hamburger icon in the upper left corner of the page and then select the Service tab.
In the Service page, select the Service Requests application.
On the Service Requests page, click Create Service Request.
On the Create Service Request page, complete the following fields for the service request:
In the Title field, enter the service request name (for example, My Service Request).
Click Save and Continue.
Add Attachments
Click the Managed Attachments tab to load the attached assets in the WebCenter Content embedded user interface.
Note: Sign in as the same user used in the Oracle Sales and Service application (these users must match between systems). If you're using Chrome in Incognito mode, you must allow cookies. If not already logged in to WebCenter Content, you must allow pop-ups for the log-in window to appear.
Click New.
Enter a title.
Click Browse and select the file to attach.
Click Upload.
Click Refresh to refresh the attachments, or navigate to another tab and come back to the Managed Attachments tab to refresh it.
Publish the Sandbox and Use the Integration
Once the integration is tested and is working as expected, then the changes you made can be published for public consumption.
Publish the Sandbox
For publishing, enter the following sandbox details:
Select the name of your sandbox in the upper left corner of the page, (for example, WebCenter Content Managed Attachments Integration) and then select the Sandbox Details option from the drop-down menu.
On the Sandbox Details page, click Publish to publish the sandbox.
In the warning message box, click Yes if you’re certain that the integration is working as expected and you’re ready to make these changes permanent (and public).
Use the Integration
Production users should now be able to use the WebCenter Content Managed Attachments within the context of a service request.
Organizations can now easily access, view, and upload assets associated with a service request directly from the Managed Attachments tab with all material stored within Oracle WebCenter Content. The embedded Oracle WebCenter Content Managed Attachment UI provides an easy and modern interface for contributing and storing content.
Managed Attachments Using Page Composer and Visual Builder Cloud Service-Based Application Extension
Follow this approach if:
The module does not have a standard business object in Application Composer.
The module page is editable by Page Composer and a hyperlink can be added in the page.
The module page has exposed the following to Page Composer: Unique binding parameter(s) in the page which can be used in the link to uniquely identify the object to which the attachments can be associated.
Learn how to add the Managed Attachments functionality to the Invoices page under Payables.
Prerequisites
The administrator and the users of this solution should have Custom Objects Administration role - ORA_CRM_EXTN_ROLE.
Complete the steps in section Common Steps for Managed Attachments if not completed already.
Validate Access to a Given Invoice Number for the Current User Using Fusion Cloud REST API
For a given invoice, let us validate if the current user has access to the object. Only then corresponding managed attachments of the object will be shown to the user.
Create Invoice Access Webservice
This webservice will return the invoice based on the given invoice number if the current user has access to the invoice.
To enter the Application Composer where you’ll be making your WebCenter Content integration changes, click Tools in the upper left corner of the page and then select Application Composer from the drop-down list.
Choose Common Setup and then Web Services from the left navigation menu.
On the Web Services page, click the Create a new Web Service icon.
In the Select Connection Type dialog, select the REST option and click OK.
On the Create REST Web Services Connection page, complete the following fields:
Name - InvoiceWebservice
URL - https://{faHost}/fscmRestApi/resources/11.13.18.05/invoices?q=InvoiceNumber=##InvoiceNumber##
Authentication Scheme - Propagate user identity using SAML over SSL
In Select and configure Methods against the Resource field:
Select GET.
Request Payload - Choose Schema URL.
Response Payload - Choose Code Sample and enter value as {}.
Click Save and Close.
Note
Currently, this is the Fusion Apps Cloud REST API version - 11.13.18.05. Please choose the appropriate version as per your environment.
Create a Global Function to Validate the Given Invoice
This global function calls InvoiceWebservice to check if the current user has access to the invoice object.
Choose Common Setup and then Global Functions from the left navigation menu.
On the Global Functions page, click the Add a Global Function icon.
On the Create Global Function page, complete the following fields:
In the Function Name field, specify InvoiceValidate as the name of the function.
Select void from the Returns drop-down list.
In the Parameters section, click the Add Parameter icon, and add the following fields:
Name - InvoiceNumber
Type - String
In the Edit Script field, paste the following script:
// validate InvoiceNumber is not empty InvoiceNumber = InvoiceNumber == null ? "" : InvoiceNumber.trim(); if (InvoiceNumber.length() == 0) { String msg = "Error - InvoiceNumber is empty"; println(msg); throw new oracle.jbo.ValidationException(msg); } def invoicesMap = null; // Verify if user has access to invoice object try { def invoiceWs = adf.webServices.InvoiceWebservice; invoiceWs.requestHTTPHeaders = ['Content-Type': 'application/json']; invoicesMap = invoiceWs.GET(InvoiceNumber); } catch (Exception e) { String msg = "Error accessing Invoice object for - " + InvoiceNumber + " " + e; println(msg); throw new oracle.jbo.ValidationException(msg); } // validate only one unique invoice is returned. String countStr = invoicesMap["count"]; int count = new Integer(countStr); if (count == 0) { String msg = "Error in invoice access - No invoice found with InvoiceNumber " + InvoiceNumber; println(msg); throw new oracle.jbo.ValidationException(msg); } else if (count > 1) { String msg = "Error - Multiple invoices found with InvoiceNumber " + InvoiceNumber + ". Need unique key for managed attachments"; println(msg); throw new oracle.jbo.ValidationException(msg); } else if (count != 1) { String msg = "Error in invoice access for InvoiceNumber - " + InvoiceNumber + ". Found invalid number of objects " + count; println(msg); throw new oracle.jbo.ValidationException(msg); } // Validate that api has returned correct object def retInvoiceObj = invoicesMap["items"].get(0); String retInvoiceNumber = retInvoiceObj["InvoiceNumber"]; if (!(retInvoiceNumber == InvoiceNumber)){ String msg = "Error in Invoice access - Invalid invoice found with InvoiceNumber " + InvoiceNumber; println(msg); throw new oracle.jbo.ValidationException(msg); }
Click Save and Close.
Create Custom Object-Based Webservice to Generate Managed Attachment GUID
Create a Custom Business Object
Click the “+” sign next to Custom Objects.
Enter details of the custom object as follows:
Display Label - WccManagedAttachment
Plural Label - WccManagedAttachments
Record Name Label - WccManagedAttachment
Record Name Data Type select - Automatically Generated Sequence
Sequence Format - Choose a prefix and sequence. For example: MA-{0000000}-{YY}{MM}{DD}
Object Name - WccManagedAttachment
Description - Wcc Managed Attachment
Click OK and wait for the custom object to get created.
Click Pages and click Create Default Pages.
Create a Function to Obtain and Expose the Managed Attachments GUID as a REST Webservice
For custom object WccManagedAttachment, click Server Scripts, Object Functions, and then the Add a new Object Function button.
Enter details as follows:
Function Name - GetWccMaDocsUrl
Type - Row Level
Returns - String
Visibility - Callable by External Systems
Parameters:
Create parameters of type String with the following names:
appName, boType
boKey1, boKey2, boKey3, boKey4, boKey5
boValue1, boValue2, boValue3, boValue4, boValue5
Enter script code as specified below:
// Verify if user has access to FA object if (boType == "Invoice") { String InvoiceNumber = boValue1; adf.util.InvoiceValidate(InvoiceNumber); } else { String msg = "Error - Unsupported boType - " + boType; println(msg); return msg; } // validate appName if (appName == null || appName.trim().length() == 0) { String msg = "Error - Mandatory parameter not available - appName"; println(msg); return msg; } // validate boType if (boType == null || boType.trim().length() == 0) { String msg = "Error - Mandatory parameter not available - boType"; println(msg); return msg; } // validate that boKey1 and boValue1 are available if (boKey1 == null || boKey1.trim().length() == 0) { String msg = "Error - Mandatory parameter not available - boKey1"; println(msg); return msg; } if (boValue1 == null || boValue1.trim().length() == 0) { String msg = "Error - Mandatory parameter not available - boValue1"; println(msg); return msg; } // Build request def curUserName = adf.context.getSecurityContext().getUserName(); def request = [ commandNamespace : "UCM_Managed_Attachments", solutionNamespace: "UCM_Managed_Attachments", username : curUserName, userContext : [], requestParameters: [ entry: [[ key : "application", value: appName, ], [ key : "businessObjectType", value: boType, ]] ] ]; // add key/value pairs to "entry" List<Map> entries = (List<Map>) request["requestParameters"]["entry"]; def boKeys = [boKey1, boKey2, boKey3, boKey4, boKey5]; def boValues = [boValue1, boValue2, boValue3, boValue4, boValue5]; for (int i = 0; i < 5; i++) { String boKey = boKeys.get(i); boKey = boKey == null ? "" : boKey.trim(); String boValue = boValues.get(i); boValue = boValue == null ? "" : boValue.trim(); def keyIndex = i + 1; // validate that both key and value are present if (boKey.length() > 0 && boValue.length() == 0) { def msg = "Error - For key boKey" + keyIndex + ', Value not available for boValue' + keyIndex; return msg; } if (boKey.length() == 0 && boValue.length() > 0) { def msg = "Error - For value boValue" + keyIndex + ', Key not available for boKey' + keyIndex; return msg; } // add key, for example: [ key : "businessObjectKey1", value: "InvoiceNumber" ], if (boKey.length() > 0) { def boKeyName = "businessObjectKey" + keyIndex; entries.add(["key": boKeyName, "value": boKey]); } // add value, for example: [ key : "businessObjectValue1", value: "100000" ], if (boValue.length() > 0) { def boValueName = "businessObjectValue" + keyIndex; entries.add(["key": boValueName, "value": boValue]); } } // Get Managed attachment guid try { // Execute UCM Grant webservice def response = adf.webServices.WebCenterContentGrantWebservice.execute(request); println("Grant access ws response - " + response); // Retrieve UCM MA url from response String ucmMaUrl = ""; String afGuidVal = ""; def responseCommands = response["responseCommands"].get(0); for (responseCommand in responseCommands) { if (responseCommand["command"] == "OPEN_BROWSER") { String url = responseCommand["value"]; // Extract afGuid url = url.substring(url.indexOf("?") + 1); String[] urlParams = url.split('&'); for (String urlParam : urlParams) { String[] nameValPair = urlParam.split('='); if (nameValPair[0] == "afGuid") { afGuidVal = nameValPair[1]; break; } } ucmMaUrl = "&afGuid=" + afGuidVal; println("Extracted ucm attachment url suffix" + ucmMaUrl); break; } } return ucmMaUrl; } catch (Exception e) { def msg = "Error getting UCM Managed attachment url for " + boType + " " + e; println(msg); return msg; } // If no error and not able to get url return "Error - No attachment url in response";
Click Validate and then Save and Close
These variables are mandatory to be passed to the function.
- appName, boType, boKey1, boValue1
Other key value pairs (boKey2 .. boKey5), (boValue2 .. boValue5) are optional. The pairs (if provided) should have both key and value given together.
All these variables are mapped to payload fields in WebCenter Content Grant Webservice: applicationName, businessObjectType, businessObjectKeys and businessObjectValues.
The maximum character lengths of various parameters as they are mapped to above fields are as follows:
- appName: 20
- boType: 100
- boKey's: 80
- boValue's: 80
Important
These variables should form a unique combination to attach to the documents. They should be provided the same values consistently for a given object record so that previously attached documents (if any) are retrieved using the same combination of values.
Note:
You can use the same webservice for different types of modules. For example, if you want to integrate with Expense Item object, add a condition for the variable boType like below:
...
else if (boType == "ExpenseItem") {
String ExpenseId = boValue1;
adf.util.ExpenseItemValidate(ExpenseId);
}
where ExpenseItemValidate is the global function you have to create to verify if the current user has access to the given expense item by calling Expense REST API of Fusion Cloud.
Create a Custom Object Instance to Call the Managed Attachments REST Webservice on
Select Navigator, Others, and then WccManagedAttachments.
Click Create and then Save and Close.
To get the record ID of this object, run the following command on a Linux command line shell:
curl -k --location 'https://{FAHost}/crmRestApi/resources/11.13.18.05/WccManagedAttachment_c' \ --header 'Authorization: Basic {Base64EncodedCredentials}'
where {Base64EncodedCredentials} is the credentials string “{username}:{password}” in base64 encoded form.
Note:
You might have to replace the path crmRestApi with fscmApi, hcmApi, and so on based on the module the custom object is created. For example, Financials, HCM, etc.
The Rest API version 11.13.18.05 might change based on your environment.
It returns the Managed attachments object record in JSON format.
Pick the ID of the record and note it down.
Example:
"Id" : 300100613004497,
We will call the row level REST API GetWccMaDocsUrl on this particular record. There is no other purpose for WccManagedAttachment object or this record. Its only purpose is to call this REST API. This particular record should not be deleted.
Disable Delete of WccManagedAttachment Records
As you have created the record on which you will call the REST API, you will need to disable the deletion of the records of this WccManagedAttachment object:
Select the WccManagedAttachments custom object in Application Composer.
Select Security.
In the Delete field, deselect all the options.
Click Save and Close.
Create VBCS-Based Application Extension
Note
Visual Builder Cloud Service is supported only in Chrome browser.
Create VBCS Project
Select Navigator, Configuration, and then Visual Builder to navigate to Visual Builder Cloud Service.
Click Create.
Enter a name. For example: WccManagedAttachmentProject.
Set Security to Private and Discoverable or choose Shared as per your requirements.
Click Next.
Set Template to Empty Project.
Click Next.
For Project Properties for Wiki Markup, select Markdown.
Click Next.
On the Team tab, add other members and their access to this project as per your requirements, and click Add.
Click Finish.
Wait for the project creation to finish.
Create a Fusion Application Cloud Environment
On left navigation pane, click Environments.
Click + Create Environment.
Enter an environment name (for example, FAEnvironment) and a description.
Click Create.
Select the Environment FAEnvironment.
Click Service Instances and then click + Add Instance.
Complete the following:
Instance Type - Select Oracle Cloud Applications.
Add Instance Using - Select Application Credentials.
Base URL - {FAUrl}
Instance Name - {Name}
Username - {username}
Password - {password}
Authorization Type - Basic
Click Add
Click VBCS Workspace for Application Extension
In the project, click Workspaces, New, and then Application Extension.
For Workspace, enter the extension name WccManagedAttachmentWorkspace.
The fields Extension Id and Workspace Name will be automatically populated.
For Development Environment, choose the Fusion Application Cloud Service environment created earlier (FAEnvironment).
For sandbox, choose the sandbox created earlier.
For Git Repository, select Create new repository. Enter a name and a branch for the repository.
Click Create.
Wait for the application extension creation to finish.
Create VBCS Service for Managed Attachment Webservice
Click Workspaces and then WccManagedAttachmentWorkspace to enter the workspace.
Click Services and then the + Service Connection button.
Select Define by endpoint.
Set Method to POST.
Enter the following in the URL field:
https://{FAHost}/crmRestApi/resources/11.13.18.05/WccManagedAttachment_c/{Id}/action/GetWccMaDocsUrl
where {Id} is the Id of WccManagedAttachment record we obtained from the earlier step.
Select Update from the Action Hint drop-down list.
Click Create Backend.
On the next page, enter:
Backend name - WccManagedAttachmentBackend
Authentication - Oracle Cloud Account
Click Next for service connection creation page.
Service name - WccManagedAttachmentService
Select the Accessible to application extensions checkbox.
Click the Request tab and then the Headers tab.
Click + Static Header.
Enter the following:
Name - Content-Type
value - application/vnd.oracle.adf.action+json
Click Create.
Note
For the URL, you might have to replace the path crmRestApi with fscmApi, hcmApi, and so on in the webservice URL based on the module the custom object is created. For Example: Financials, HCM, etc.
The RestApi version 11.13.18.05 might change based on your environment.
Test the Web Service Call from VBCS
You can test whether this webservice call works correctly or not by following these steps:
Click the service WccManagedAttachmentService, Endpoints, /GetWccMaDocsUrl, row with POST method and then the Test tab.
In the Body tab, enter:
Media type - application/vnd.oracle.adf.action+json
Payload as type - Text
Enter the following value:
{ "appName": "<appName>", "boType": "Invoice", "boKey1": "InvoiceNumber", "boValue1": "<InvoiceNumber>" }
You should get appropriate response based on whether the invoice with InvoiceNumber is accessible to you or not.
- If invoice is accessible, then the response will be a JSON response with value as GUID in the format “&afGuid={guid}”.
- If invoice is not accessible, then the response will be a JSON with an “{Error Message}”.
- If there is an error in the set-up, then an error indicating it will be displayed.
Create Managed Attachment UI for the Application Extension
Click Workspaces and then WccManagedAttachmentWorkspace to enter the workspace.
Click the App UIs section.
Click the + App UI button.
Enter a name for the app UI (for example: WccManagedAttachmentUI) and click Create.
In the App UI tree, click wccmanagedattachmentui, main, and then main-start.
Click the Properties tab on the right.
Click Select Page Template.
Under Page Content select Welcome Page Template and click Select.
Click Page Designer tab and then select Welcome Page Template in Design tab.
On the Design tab, select the template, select Properties, and provide a title in the Page Title field (for example: Managed Attachments).
Click the Variables tab and add variables with following IDs:
- appName, boType
- boKey1, boKey2, boKey3, boKey4, boKey5
- boValue1, boValue2, boValue3, boValue4, boValue5
For all the variables, specify the following:
Type - String
Description - You can enter the variable name or specify a suitable description.
Access for application extensions - Read/Write
Input parameter check box - Select this check box.
Pass on URL check box - Select this check box.
Add a variable with statusMessage as the ID and with the following properties:
Type - String
Description - You can enter the variable name or specify a suitable description.
Access for application extensions - Read/Write
Input parameter check box - Deselect this check box.
Add a Text Field to Show the Current Status of Processing
In the App UI tree, click wccmanagedattachmentui, main, and then main-start.
Click the Page Designer tab.
On the left navigation pane, click Components, click Text Box input field on the top with the hint text Filter, and then search by typing the word Text.
In the search results select the component named Text, drag and drop it into the Welcome Page Template.
Bind the text field to the statusMessage variable using the following steps:
Select the inserted text component on the canvas.
Click the Properties tab on the right.
Click the Text field.
Click Icon (x) with text Select variable, select Page, select variables, and then select statusMessage.
Call the REST Webservice from the VBCS Management Attachment UI to Obtain the Attachment GUID
If you are not already in the main-start element in the App UI tree, click wccmanagedattachmentui, main, and then main-start.
Click Action Chains tab and then click + Action Chain.
Enter a name (for example, WccMaActionChain).
Click Create.
Click the Event Listeners tab, click + Event Listener, click Lifecycle Events, and then vbEnter.
On the next page, for Select Action chain, select Page Action Chains and then WccMaActionChain and click Finish.
Click Action chains and then WccMaActionChain.
Select the code editor by clicking the code tab.
You should be in the WccMaActionChain code editor now.
class WccMaActionChain extends ActionChain { async run(context) { const { $page, ...} = context; // Paste Here
Copy and paste the following code in the place indicated above.
// NOTE - Before final publishing comment out console.log debug statements $variables.statusMessage = "Loading Attachments"; // Create payload const requestBody = { appName: $variables.appName, boType: $variables.boType, boKey1: $variables.boKey1, boValue1: $variables.boValue1 }; // Add boKey2/boValue2 if ($variables.boKey2 !== null) { requestBody.boKey2 = $variables.boKey2; } if ($variables.boValue2 !== null) { requestBody.boValue2 = $variables.boValue2; } // Add boKey3/boValue3 if ($variables.boKey3 !== null) { requestBody.boKey3 = $variables.boKey3; } if ($variables.boValue3 !== null) { requestBody.boValue3 = $variables.boValue3; } // Add boKey4/boValue4 if ($variables.boKey4 !== null) { requestBody.boKey4 = $variables.boKey4; } if ($variables.boValue4 !== null) { requestBody.boValue4 = $variables.boValue4; } // Add boKey5/boValue5 if ($variables.boKey5 !== null) { requestBody.boKey5 = $variables.boKey5; } if ($variables.boValue5 !== null) { requestBody.boValue5 = $variables.boValue5; } console.log("Payload to Managed attachment api " + JSON.stringify(requestBody)); // Make REST API call to custom object managed attachment function const response = await Actions.callRest(context, { endpoint: '<Service Endpoint>', body: requestBody, responseBodyFormat: 'json' }, { id: 'GetWccMaDocsUrl' }); console.log("Got FA Rest response " + JSON.stringify(response)); const managedAttachmentUrl = "https://{WCCHost}:{WCCPort}/cs/idcplg?IdcService=EMBEDLOGIN_HOME&ActAsAnonymous=true"; console.log("Response url - " + response?.body?.result); // If response has afGuid redirect to managed attachment url if (response?.body?.result?.startsWith("&afGuid=")) { let redirectUrl = managedAttachmentUrl + response?.body?.result; console.log("Redirecting to - " + redirectUrl); await Actions.openUrl(context, { history: 'replace', url: redirectUrl }); } else { console.log("Error in loading Attachments. Please contact Administrator"); $variables.statusMessage = "Error in loading Attachments. Please contact Administrator"; }
For the Rest API call, change the endpoint name {Service Endpoint} to your endpoint name.
Alternatively, you can also use the following steps:
Click the line with text {Service Endpoint}.
In properties panel click Select under Endpoint.
In the selection popup expand Services, WccMaService.
Select the element with text POST …/GetWccMaDocsUrl.
In the window with code for the selected line make sure that the other properties, that is - body, responseBodyFormat to call the API are provided as specified below.
const response = await Actions.callRest(context, { endpoint: '<Service Endpoint>', body: requestBody, responseBodyFormat: 'json' }, { id: 'GetWccMaDocsUrl' });
In the code, replace {WCCHost} and {WCCPort} with the relevant host and port values as per your environment.
const managedAttachmentUrl = "https://{WCCHost}:{WCCPort}/cs/idcplg?IdcService=EMBEDLOGIN_HOME&ActAsAnonymous=true";
In the code, there are Javascript console log statements for debugging on the browser console. Change those statements to comments before publishing the application extension.
Test the VBCS Application Extension
Click the Preview button at the top panel extreme right.
VBCS will compile the application and open a URL. The URL might fail now as we have not passed any relevant URL parameters.
Copy the URL which will be in the following format and note it down.
https://{FAHost}/fscmUI/redwood/WccManagedAttachmentUI?vbdt%3ApreferExtensionVersion=<value>
Test the URL in the browser by passing test parameters.
https://{FAHost}/fscmUI/redwood/WccManagedAttachmentUI?vbdt%3ApreferExtensionVersion=<value>&appName=<appName>&boType=Invoice&boKey1=InvoiceNumber&boValue1=<TestInvoiceNumber>
Based on the type of object you are trying to integrate, the parameters may change and the URL may have additional key values pairs boKey2, boValue2 … boKey5, and boValue5.
The VBCS application extension will call the Managed Attachment REST webservice, obtain the unique GUID for the combination of keys passed, and open the associated managed attachments page.
Note
Before the VBCS app is published, the app URL will be in the above format with a reference to the extension version which can be used for testing.
After it is published, the URL will be in the following format (without the extension version).
https://{FAHost}/fscmUI/redwood/WccManagedAttachmentUI
Use Page Composer to Insert Managed Attachments Link in Fusion Applications Page
Navigate to Payables and then Invoices.
Search and open an invoice record.
Select Tools and then Page Composer.
Click Structure.
Select the structure pane (which is available by default at the bottom of the page).
In the structure pane select the UI element on which you need to insert the hyperlink. Click the + button in the panel.
In the Add Content pop-up, select Components.
Select Hyperlink and click +Add.
In the structure pane, select the hyperlink you just added or in the Select tab, select the hyperlink component in the UI and click Edit Component.
Enter
Destination - https://{FAHost}/fscmUI/redwood/WccManagedAttachmentUI?vbdt%3ApreferExtensionVersion={value}&appName={appName}&boType=Invoice&boKey1=InvoiceNumber&boValue1=#{bindings.InvoiceNum.inputValue}
Short Desc - Documents
Target Frame - **_blank**
Text - Documents
Click OK.
Close the Page Composer by clicking Close.
Publish the Changes
Publish the VBCS Extension
On the VBCS page, for the Action Chain WccMaActionChain code, comment out the console.log debug statements as the code is now working in the environment.
Navigate to the VBCS page for the project WccManagedAttachmentProject.
Click Publish.
Select Merge Now, enter a commit message, and click Publish.
Enter Fusion Applications credentials if prompted.
This will perform a schedule build of jobs whose status can be viewed by clicking Builds on the left pane.
Wait for the publish job to complete.
Change the VBCS App Link URL to Published URL
On the Invoice page, you inserted the hyperlink as the URL under development (which has the extension version) using the steps in Use Page Composer to Insert Managed Attachments Link in Fusion Applications Page.
https://{FAHost}/fscmUI/redwood/WccManagedAttachmentUI?vbdt%3ApreferExtensionVersion=<value>&appName=<appName>&boType=Invoice&...
Change it to the published URL which does not have the extension version (retaining all other URL parameters without changes):
https://{FAHost}/fscmUI/redwood/WccManagedAttachmentUI?appName=<appName>&boType=Invoice&...
Publish the Sandbox
For publishing, enter the following sandbox details:
Select the name of your sandbox in the upper left corner of the page (for example, WebCenter Content Managed Attachments Integration) and then select the Sandbox Details option from the drop-down menu.
On the Sandbox Details page, click Publish to publish the sandbox.
In the warning message box, click Yes if you’re certain that the integration is working as expected and you’re ready to make these changes permanent (and public).
Use the Integration
Production users should now be able to use WebCenter Content Managed Attachments within the context of a payables invoice.
Organizations can now easily access, view, and upload assets associated with a payables invoice directly from the Managed Attachments tab with all material stored within Oracle WebCenter Content. The embedded Oracle WebCenter Content Managed Attachment UI provides an easy and modern interface for contributing and storing content.
Redwood UI for Managed Attachments
Default UI for Managed Attachments is Redwood based UI. URL parameters can be passed in EMBEDLOGIN_HOME IdcService URL to customize Managed Attachments.
.../cs/idcplg?IdcService=EMBEDLOGIN_HOME&<paramName>=<paramValue>
Switching to non-redwood UI for managed attachments
To switch to use non-redwood UI pass URL parameter given below to EMBEDLOGIN_HOME IdcService URL.
pageType=ClassicUI
Configuration Reference
The URL parameters supported for Redwood UI are given below
Parameter | Type | Comments |
---|---|---|
maHeader | ‘on’ | ‘off’ |
on - Header and title are shown. off - Header and title are hidden. When not provided, this option defaults to ‘off’. |
maTitle | String |
The title of the page. The title is only shown if maHeader is ‘on’. The custom title will not be translated to other languages. If not provided default title is shown. |
Adding custom metadata and searching Managed Attachments based on them
When a document is uploaded to managed attachments, a predefined set of metadata fields is automatically attached to it based on payload fields used for that attachment. The metadata fields are afApplication (from field application), businessObjectType (from field of same name) and businessObjectValue[1..5] (from fields of same name). These metadata fields can be copied to user-friendly metadata names during document checkin and can be searched based on user-friendly metadata names.
Note: The automatic metadata population feature is available only from Redwood UI.
We will use an example where businessObjectType is ‘Invoice’, businessObjectKey1 is ‘InvoiceNumber’ and businessObjectValue1 holds the invoice value.
Create new user-friendly metadata fields
- Log in to WebCenter Content as an administrator.
- Navigate to Administration, Admin Applets, Download Client and install it if necessary, Launch Client and log in.
- Click Configuration Manager.
- In tab Information Fields click Add.
- Enter InvoiceNumber and click OK.
- In details dialog for Field Caption enter a label string like InvoiceNumber.
- Select Field Type to Long Text.
- Keep other values as default and click OK.
- If you have more user-friendly named metadata fields for the attachment you can create similarly.
- Click button Update Database Design and click OK.
Create rule to copy predefined metadata to user-friendly metadata fields during managed attachments checkin
Here we will copy value of businessObjectValue1 to metadata InvoiceNumber if businessObjectType field value is Invoice during managed attachment document checkin.
- Click Rules tab.
- Click Add.
- Enter rule name as InvoiceMetadataCopy.
- Enter description as Rule to copy Invoice metadata for Managed Attachments.
- Check Use rule activation condition.
- Click Edit.
- In Conditions section click Add and enter name as InvoiceCheckin.
- In General sub-tab click option Use action and then Check In New.
- Click OK.
- Click tab Fields.
- Click Add.
- Select Field Name as InvoiceNumber and click OK.
- In next dialog keep Field Type as Edit.
- Check option Is derived field.
- Click Edit button next to it which opens a dialog.
- Click Add button next to Conditions.
- Enter Name as InvoiceNumberCopy and click OK.
- Select Field as MA Business Object Type.
- Select Operator as Matches.
- Enter value as Invoice.
- Click Add to add the condition.
- Click Compute.
- In Select Field dialog select MA Business Object Value 1 (ie businessObjectValue1) and click OK.
- In the next dialog click OK.
- In the next dialog which is Add Rule Field click OK.
If you have more metadata fields to copy you can add them in Fields tab similarly.
Create Rule to show user-friendly named custom metadata for Managed Attachments Profile
- Click Rules tab.
- Click Add.
- Enter rule name as InvoiceMetadataShow.
- Enter description as Rule to show Invoice metadata for Managed Attachments Profile.
- Click checkbox Use rule activation condition.
- Click Edit.
- In Conditions section click Add and enter name as InvoiceShow and click OK.
- In General sub-tab click option Use action and then click Content Information.
- Click OK.
- Click tab Fields.
- Click Add.
- Select Field Name as InvoiceNumber and click OK.
- In next dialog keep Field Type as Edit and Click OK.
- If you have more metadata fields to show you can add similarly.
- Click OK in next dialog.
Associate custom metadata rules to Managed Attachments Profile
- Click Profiles tab.
- Select FAProfile (ie the Managed Attachments Profile).
- Click Edit.
- In Rules section click Add.
- In next dialog for Name select InvoiceMetadataCopy and click OK.
- In Rules section click Add.
- In next dialog for Name select InvoiceMetadataShow and click OK.
- Click OK to close the Edit Profile dialog.
Now privileged users can search managed attachments based on user-friendly metadata field names.
Add appropriate permissions for privileged users to search for Managed Attachments
To search for managed attachments the user needs AFDocuments(R) permission which can be added as follows.
- Log in to WebCenter Content as an administrator.
- Navigate to Administration, Admin Applets, Download Client and install it if necessary, Launch Client and log in.
- Click User Admin.
- In menu click Security, Permissions by Role.
- Click button Add New Role.
- Enter Role Name as SearchMARole and click OK.
- In Roles section select SearchMARole.
- In Groups/Rights section select AFDocuments() and click button Edit Permissions.
- In Edit Permissions dialog box select Read and click OK.
- Click Close button.
- Login to IDCS Console as administrator.
- Click tab User Management.
- In Groups section click Create Group.
- Enter name as SearchMARole.
- In Users section select users who need the search privilege.
- Click Create.
The users in this role SearchMARole who have AFDocuments(R) permission can search for Managed Attachments.
Search for Managed Attachments based on metadata in Redwood UI
- In Redwood UI select Search tab.
- Click Open Advanced Search Drawer button next to the search text field.
- Select Profile in top right as Standard Search.
- In the list of query fields, for Profile select condition as Matches and value as FAProfile (ie Managed Attachments profile).
- The custom metadata name InvoiceNumber will be present in list of query fields.
- Put the appropriate condition and value for it and click Search.
Using custom search profile specific to custom metadata for managed attachments search
Optionally you can create a search profile specific to the custom metadata so that only metadata related to it (for example ‘Invoice’ related) and any other metadata you want will appear in advanced search dialog for searching managed attachments.
Note: The managed attachment documents are always associated with FAProfile (Managed Attachments profile). This custom search profile is to show only required fields for searching managed attachments of a certain type for example ‘Invoice’. Also, this profile is not valid to be used for managed attachments checkin.
Create custom rule to show only required fields for the custom metadata search profile
- Log in to WebCenter Content as an administrator.
- Navigate to Administration, Admin Applets, Download Client and install it if necessary, Launch Client and log in.
- Click Configuration Manager.
- Click Rules tab.
- Click Add.
- Enter rule name as InvoiceSearchShow.
- Enter description as Rule to show Invoice metadata for Managed Attachments search.
- Click tab Fields.
- Click Add.
- Select Field Name as InvoiceNumber and click OK.
- In next dialog Field Type as Edit and click OK.
- Add more metadata fields to be shown as required.
- Here you can also select a field name and select Field Type as Hidden to hide the field for the search profile.
- Click OK in next dialog.
Create custom search profile and associate rule for visible fields in search
- Click tab Information Fields.
- Select IdcProfile and click Edit Values.
- Click Add button.
- For dProfileTriggerValue enter InvoiceProfile.
- For dProfileTriggerOrder enter 1.
- Click OK.
- Click Close.
- Click Profiles tab.
- Click Add.
- Enter profile name as InvoiceProfile and click OK.
- For Display Label enter InvoiceProfile.
- Click the button next to the Trigger field.
- In the list of triggers select trigger InvoiceProfile and click OK.
- In Rules section click Add.
- For Name select rule InvoiceSearchShow.
- Click OK to close the dialog box for Add Profile.
Search for Managed Attachments using Custom Search Profile
- Login to Redwood UI. If you are already logged in, logout and login again to Redwood UI for custom search profile changes to take effect in the Redwood UI.
- In Redwood UI select Search tab.
- Click Open Advanced Search Drawer button next to search text field.
- For Profile in top select InvoiceProfile.
- In the list of query fields for Profile select condition as Matches and value as FAProfile (ie Managed Attachments profile).
- The query fields will have the fields you have configured to show or hide in the rule InvoiceSearchShow (for example InvoiceNumber).
- Put the appropriate conditions and values for them and click Search.
Troubleshooting
Issue 1: Embedding Managed Attachments Mashup in Fusion Apps page shows error or no content.
Description: There is issue in embedding Managed Attachments iframe in Fusion Apps page.
After following steps in section Configure WebCenter Content for FA Integration and restarting WebCenter Content servers check that proper configuration values for enabling iframe embedding have been automatically added in WebCenter Content configuration.
Steps:
- Log in to WebCenter Content as an administrator.
- Navigate to Administration, Admin Server and then General Configuration.
- In section Additional Configuration Variables check that following fields are present with relevant values.
AllowedDomainLists=<FA_DOMAIN>,<UCM_DOMAIN>
RemoveXFrameOption=true
AllowContentServerInAnyDomains=true
RedwoodUIFrameAncestors=<FA_DOMAIN>
IsAdvanceSecurityConfigUIEnabled=true
Known Issues
Learn about the issues you may encounter when extending Oracle Sales and Service business objects with managed attachments.
Issue 1: In Firefox browser, Managed Attachments page shows error message "Firefox Can’t Open This Page"
Description:
In the Firefox browser, the Managed Attachments page shows the error message "Firefox Can’t Open This Page". This might show up when you click the refresh button in Managed Attachments, if the browser window size changes, etc. (anything that causes the Managed Attachments embedded mashup to refresh).
Workaround for this issue: Click any other sub tabs on the page and come back to the Managed Attachments page.
Issue 2: When Trigger field is updated to "Security Group", Managed Attachments functionalities stop working.
Description:
In Configuration Manager, Profiles tab, when Trigger field is updated to "Security Group", Managed Attachments functionalities stop working. For example, user is unable to upload documents in the managed attachments UI.
Workaround for this issue:
- Navigate to Configuration Manager, Profiles tab, Profiles section, and then select FAProfile.
- Click Edit.
- In Trigger, select AFDocuments.
- Click OK.
Extending Oracle Fusion Applications with Managed Attachments
G11156-09
Last updated: June 2025
Copyright © 2025, Oracle and/or its affiliates.
Primary Author: Oracle Corporation