Full Disclosure I received this from an email from Apps Developer Relations but its soooo good I wanted to share it with all. Bottom line if your integrating your product/package/system with Sales Cloud after you've perused the standard documentation (which we are evolving rapidly) this is a treasure trove of articles/blogs/viewlets you can use..
Obviously use this in conjunction with the standard Oracle Cloud Documentation (http://docs.oracle.com/cloud/latest/salescs_gs/index.html)
Introducing the Oracle Fusion Applications Developer Relations Team
You’ll find a wealth of resources and hands-on expertise available from the Oracle Fusion Applications Developer Relations Team.
If you are evaluating or designing customizations and extensions for your Fusion Applications environment (SaaS or On-Premises) then you’ll find a wealth of resources and hands-on expertise available from this Oracle group. The team was formed to help customers and partners be successful with their development projects using the Fusion Applications platform, and provide the following publically available services:
- An extensive Blog Site with over 150 articles covering many types of customization, extension, and integration.
- An open Forum Site for technical questions from the development community.
- A popular YouTube Channel with over 100 bite-size videos demonstrating a broad range of customization and extension features.
- Whitepapers on topics including custom application development, ESS development, and Groovy and Expression Language.
So check out their resources or get in touch, and make your own development project tasks a little easier.
Some of you may be using my RESTFacade which I wrote and Oracle recently released as sample code on OTN (link).
There has been a couple of requests, or more "how to"s which I thought Id post here.
- How to add CORS support (Cross Origin Resource Sharing) support
- How to use the facade with custom fields defined in AppComposer
How to add CORS support (Cross Origin Resource Sharing) support
Adding CORs support is quite straightforward, simply open the web.xml file in the FusionRESTService project and add the following <init-param>
How to use the facade with CustomFields
This one is a little trickier. The facade uses a collection of static proxies and although I am planning to rewrite the proxies as "dynamic" proxies we're not there yet (and I need to do some reading first).
The only way to use custom fields with the facade today is to regenerate the proxies against your Sales Cloud instance. Here I will go through the steps you will need to do, however in the near future I will release some "scripts" which will do it all for you.1. Identify the correct package name
The Facade has all its proxies in projects called "FusionProxy_<Object>Service. Within this project you will find the java classes are split between two packages
- com.oracle.xmlns : This contains all the standard generated types
- oracle.demo.pts.fusionproxy.<objectName> : This one contains the proxy itself
Identify the full package name of the proxy for the object you are going to regenerate. In my example here, im going to regenerate the Opportunity object and as you can see the package name is oracle.demo.pts.fusionproxy.opportunities
2. Delete the contents of the proxy directory.
Shutdown JDeveloper, navigate to the source directory of the proxy project and delete both the src and classes
Startup JDeveloper, navigate to the FusionProxys project , in our case FusionProxy_OpportunityService, you should notice it is now "empty". If it is not the press the refresh button
4. Regenerate the proxy from scratch
- Select the project, right mouse click and select new...
- Select "Web Service proxy" from the Web Services Categories.. If it doesnt show try typing it in the search dialog
- Enter the appropriate WSDL Document. This is the Hostname of your service + Endpoint URL. You can get this information from the fusionconfig.properties file.
E.g. For opportunities it is https://<hostname>/opptyMgmtOpportunities/OpportunityService?wsdl
Hint: Check it works in a webbrowser first!
- Next, Wait a bit....
- For the package name, use the name you identified in step 1, for the Root Package leave it blank
- Un-Select "Generate As Async"
- Select "Don't generate any asynchronous methods"
- Select "Oracle/wss_username_token_over_ssl_client_policy"
- Next, then Finish
This will generate the proxy from scratch , just note the generation of the proxy may take some time.5. Go to the XJS_Beans project
Within here edit the generateClasses script and modify dummy.oracle.com with your hostname for all rows.
open a shell prompt, navigate to this directory using your shell and execute this script. This regenerates all the JAXB objects..6. Finally do a Build/Clean All followed by a Build/Make and deploy as normal
Any questions do ask! and yes as I mentioned earlier I plan to create a script to automate all of this.
Over the last year or so I've see a lot of partners migrating and integrate their applications with Oracle Sales Cloud. Interestingly I'd say 60% of the partners use the same set of design patterns over and over again. Most of the time I see that they want to embed their application into Oracle Sales Cloud, within a tab usually, perhaps click on a link to their application (passing some piece of data + credentials) and then within their application update sales cloud again using webservices.
Here are some examples of the different use-cases I've seen , and how partners are embedding their applications into Sales Cloud,
NB : The following examples use the "Desktop" User Interface rather than the Newer "Simplified User Interface", I'll update the sample application soon but the integration patterns are precisely the same
Use Case 1 : Navigator "Link out" to third party application
This is an example of where the developer has added a link to the global navigator and this links out to the 3rd Party Application. Typically one doesn't pass any contextual data with the exception of perhaps user credentials, or better still JWT Token.Techniques Used
- Adding Link to Menu Item
- Using JWT Token in Sales Cloud
Use Case 2 : Application Embedded within the Sales Cloud Dashboard
Within the Oracle Sales Cloud application there is a tab called "Sales", within this tab its possible to embed a SubTab and embed a iFrame pointing to your application. To do this the developer simply needs to edit the page in customization mode, add the tab and then add the iFrame, simples! The developer can pass credentials/JWT Token and some other pieces of data but not object data (ie the current OpportunityID etc)
Use Case 3 : Embedding a Tab and Context Linking out from a Sales Cloud object to the 3rd party application
In this usecase the developer embeds two components into Oracle Sales Cloud. The first is a SubTab showing summary data to the user (a quote in our case) and then secondly a hyperlink, (although it could be a button) which when clicked navigates the user to the 3rd party application. In this case the developer almost always passes context specific data (i.e. the opportunityId) and a security token (username password combo or JWT Token). The third party application usually takes the data, perhaps queries more data using the Sales Cloud SOAP/WebService interface and then displays the resulting mashup to the user for further processing. When the user has finished their work in the 3rd party application they normally navigate back to Oracle Sales Cloud using what's called a "DeepLink", ie taking them back to the object [opportunity in our case] they came from.
This image visually shows a "Happy Path" a user may follow, and combines linking out to an application , webservice calls and deep linking back to Sales Cloud.
- Extending a SalesCloud application with a custom button
- Using JWT Token in Sales Cloud
- Extending Oracle Sales Cloud [Opportnity] with a custom tab exposing External Content
- Retrieving Data from Oracle Sales cloud using WebServices
- Coding some groovy script to generate the URLs required (Doc 1571200.1 on MyOracle Support)
- DeepLinking to specific Oracle Sales Cloud Pages (Doc 1516151.1 on My Oracle Support)
Use-Case 4 : Server Side processing/synchronization
This usecase focuses on the Server Side processing of data, in this case synchronizing data. Here the 3rd party application is running on a "timer", e.g. cron or similar, and when triggered it queries data from Oracle Sales Cloud, then it queries data from the 3rd party application, determines the deltas and then inserts the data where required. Specifically here we are calling Oracle Sales Cloud using SOAP/WebServices and the 3rd party application is being communicated to using the REST API, for Oracle Sales Cloud one would use standard JAX-WS WebService calls and for REST one would use the JAX-RS api and perhap the Jackson api for managing JSON objects.. This is a very common use case and one which specifically lends itself to using the Oracle Java Cloud Service as the ideal application server where to host the mediator between the two applications.
- Using JWT Token in Sales Cloud
- Integrating with the Oracle Java Cloud Service
- Retrieving Data from Oracle Sales cloud using WebServices
The above is just a small set of techniques and use-cases which are used today. There are plenty of other sources of documentation and resources available on the internet but to get you started here are a few of my favourite places
- Sales Cloud General Documentation
- Sales Cloud Customize Tab is useful for general customization of Sales Cloud
- Sales Cloud Integration Tab focuses on the 3rd party integration techniques
- Official Oracle Fusion Developer Relations Blog
- Official Oracle Fusion Developer Relations YouTube Channel
When integrating SalesCloud with a 3rd party application you often need to pass the users identity to the 3rd party application so that
- The 3rd party application knows who the user is
- The 3rd party application needs to be able to do WebService callbacks to Sales Cloud as that user.
Until recently without using SAML, this wasn't easily possible and one workaround was to pass the username, potentially even the password, from Sales Cloud to the 3rd party application using URL parameters..
With Oracle Fusion R8 we now have a proper solution and that is called "JWT Token support". This is based on the industry JSON Web Token standard , for more information see here
JWT Works by allowing the user the ability to generate a token (lasts a short period of time) for a specific application. This token is then passed to the 3rd party application as a GET parameter. The 3rd party application can then call into SalesCloud and use this token for all webservice calls, the calls will be executed as the user who generated the token in the first place, or they can call a special HR WebService (UserService-findSelfUserDetails() ) with the token and Fusion will respond with the users details.
Some more details
The following will go through the scenario that you want to embed a 3rd party application within a WebContent frame (iFrame) within the opportunity screen.
1. Define your application using the topology manager in setup and maintenance
- See this documentation link on topology manager
2. From within your groovy script which defines the iFrame you wish to embed, write some code which looks like this :
def thirdpartyapplicationurl = oracle.topologyManager.client.deployedInfo.DeployedInfoProvider.getEndPoint("My3rdPartyApplication" )
def crmkey= (new oracle.apps.fnd.applcore.common.SecuredTokenBean().getTrustToken())
def url = thirdpartyapplicationurl +"param1="+OptyId+"&jwt ="+crmkey
This snippet generates a URL which contains
- The Hostname/endpoint of the 3rd party application
- Two Parameters
- The opportunityId stored in parameter "param1"
- The JWT Token store in parameter "jwt"
3. From your 3rd Party Application you now have two options
- Execute a webservice call by first setting the header parameter "Authorization" to the value "Bearer <JWT token>" then calling your webservice of choice. The webservice call will be executed against Fusion Applications "As" the user who execute the process
- To find out "Who you are" , set the header parameter "Authorization" value to "Bearer <JWT Token>" and then execute the webservice call findSelfUserDetails(), in the UserDetailsService
For more information
- Oracle Sales Cloud Documentation , specific chapter on JWT Token
- OTN samples, specifically the Rich UI With JWT Token Sample
- Oracle Fusion Applications General Documentation