#README for Oracle Cloud - PaaS for SaaS Sample
Sales Preparation Insight
This sample demonstrates the following aspects of Oracle Cloud integration:
Prior to meeting their existing accounts for additional sales opportunities, the sales representatives of XYZ Inc. would like to know if these accounts have any critical or long pending Service Requests (SRs) that are open and relevant to their sales process. With this insight the representatives are able to reach out to internal teams to understand more about these SRs. The sales reps would like to see the list of these SRs along with their statuses automatically show up for each account on Oracle Sales Cloud, rather than having to reach out to the Service team of their organization to obtain the same information. Additionally, the reps would also like to be current on the latest news about their accounts such as leadership changes, recent announcements, or anything else that may impact their selling ability. This insight could come from their internal research team or public websites.
The Sales Preparation Insight application is deployed to Oracle Java Cloud Service - SaaS Extension and displays the open SRs related to a given customer. The application also provides news articles from internal sources and public news that match the account name or the industry name. For the sake of simplicity this application mocks up all this data. The mock data is stored in Oracle Database Cloud Service (Database Schema). Based on the account ID, which is passed as a URL parameter to this application, different mock data is shown.
This application is then embedded as an iFrame within the Account widget of the Oracle Sales Cloud UI. Whenever a sales rep opens an account, he or she can click a sub-tab for that account that displays this embedded application.
The key objective of this sample is to show that the embedded application, although running as a protected application on Oracle Java Cloud Service - SaaS Extension, does not show a log in page when a sales rep navigates to the sub-tab. This is because of the pre-wired SSO configuration between Oracle Sales Cloud and Oracle Java Cloud Service - SaaS Extension. Since the sales rep is already signed into Oracle Sales Cloud, the embedded page is directly displayed. (See the Known Issues section at the end of this README if you encounter problems.)
All sample code is provided by Oracle for illustrative purposes only. The objective of these samples is to demonstrate the goals defined above and may not represent other best practices, either functional or technical. These sample code examples have not been thoroughly tested under all conditions. Oracle, therefore, cannot guarantee or imply security, reliability, serviceability, or function of the sample code. All sample code contained herein are provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.
Create a new user or use an existing user that exists in both Oracle Sales Cloud and Oracle Java Cloud Service - SaaS Extension. The role of this user in Oracle Sales Cloud could be Sales Administrator. There is no role logic for the user in Oracle Java Cloud Service - SaaS Extension in this sample.
Clone the Git repository to your local working directory. The steps below will assume that you are using git. However you can also download the code from OTN to your local working directory and follow the same steps below.
Run the SQL scripts included in the source code using the SQL command in Oracle Database Cloud Service (Database Schema).
git-home/sales-prep-insight-sso/DbCS/SalesPrepCreateInsert.sql
Use JDeveloper to build the ADF application EAR and deploy it to Oracle Java Cloud Service - SaaS Extension:
Open the .jws in JDeveloper or Eclipse. Further steps in this readme will refer to JDeveloper although similar steps can be performed in Eclipse.
In the IDE, open the file AccountDetailsAM.xml under Model > Application Sources > oracle.cloud.sampleapps > accountdetails > model > AccountDetailsAM, click on configurations, double click AccountDetailsAMLocal, and under the Connection type, the existing value will be YourDbCSDataSourceName. Change this to the JNDI name of the Datasource. Login to Oracle Java Cloud Service - SaaS Extension console, expand Data sources, then JNDI Location. You will find the JNDI Name. During development/debug time, you will likely be working with a local instance (instead of Oracle Java Cloud Service - SaaS Extension). In that case, you can change the connection type to JDBC URL and provide the JDBC URL of the local database.
ADF applications are automatically configured for framebusting to prevent other applications from embedding them. This measure is normally used to ensure the correct formatting and to prevent click-jacking. Because, in this special Oracle Cloud to Oracle Cloud extension use case, we require embedding, the ADF Application should be manually configured to disable Framebusting (refer to Known Issues for more details). In the IDE, open the file web.xml under ViewController > Web Content > WEB-INF. Click on the Source Tab. At the end of the last context-param XML tag and before the beginning of the filter XML tag, paste the following code:
<context-param>
<!-- Setting FRAME_BUSTING to NEVER avoids this error - Refused to display 'http://...' in a frame because it set 'X-Frame-Options' to 'sameorigin'-->
<description> Security precaution to prevent clickjacking- bust frames if the ancestor window domain (protocol, host, and port) and the frame domain are different. Another options for this parameter are always and never </description>
<param-name>org.apache.myfaces.trinidad.security.FRAME_BUSTING</param-name>
<param-value>never</param-value>
</context-param>
Deploy the application to your Oracle Java Cloud Service - SaaS Extension instance. Refer to Deploy Applications Individually Using Oracle Java Cloud Service - SaaS Extension Control for more details.
Make customizations to Oracle Sales Cloud to embed the ADF UI.
NOTE: It is critical to perform all Oracle Sales Cloud development/customization work in an activated sandbox. Not only does this aid in testing and debugging, but it also greatly simplifies un-installing/rolling back sample application extensions when required. Given that all customizations will be isolated to a sandbox, it is necessary to communicate sandbox details to others so that they can interact with sample application customizations while acting in different roles.
The steps involved in rolling back Oracle Sales Cloud customizations published from sandboxes to the main code line will not be documented here.
To run the sample:
Run the SQL script SalesPrepDropTables.sql included in the source code (under /sales-prep-insight-sso/DbCS/sql/) using the SQL command in Oracle Database Cloud Service (Database Schema).
Undeploy the application from Oracle Java Cloud Service - SaaS Extension. Refer to the Undeploy section in Deploy Applications Individually Using Oracle Java Cloud Service - SaaS Extension Control for more details.
Remove the customizations from Oracle Sales Cloud.
To learn how to further extend this sample, explore other implementation options, or develop your own application, visit the Oracle Cloud Solutions page at https://docs.oracle.com/solutions.
# | Issue | Workaround |
---|---|---|
1 | After clicking the newly added "Service Requests" tab and authenticating, the ADF page that is supposed to be embedded in the Oracle Sales Cloud's Account Details area takes up the full browser display area. Additionaly, sometimes after authenticating, a 500 error will occur and the ADF page will not display at all. If, however, the user is already authenticated with Oracle Java Cloud Service - SaaS Extension, either by authenticating directly with the Oracle Java Cloud Service - SaaS Extension login or by clicking the new tab and choosing "Sign in Using Company" previously, the ADF page will appear embedded in the Service Requests tab. | Log into Oracle Java Cloud Service - SaaS Extension prior to clicking the Service Requests tab. |
2 | ADF applications are automatically configured for framebusting to prevent other applications from embedding them. This measure is normally used to ensure the correct formatting and to prevent click-jacking. Because in this special Oracle Cloud to Oracle Cloud extension use case, we require embedding, the ADF Application should be manually configured to disable Framebusting. | Oracle will provide automated mechanisms for ensuring that framebusting is automatically disabled only for Oracle Cloud-Oracle Cloud interactions. Until then, please apply the workaround mentioned in the install steps. Note: Ensure that you always protect your ADF application for authentication |
Copyright (c) 2015, 2018 Oracle and/or its affiliates. All rights reserved