In this blog post, we demonstrate adding a social context (conversations) to an Oracle JET based application hosted on Java Cloud Service – SaaS Extension using the embedding features of Document Cloud Service.

Document Cloud Service is an enterprise grade content sharing and collaboration platform with inbuilt social features like real-time conversations and detailed analytics.  It can also be combined with other PaaS services and easily extend these features to those services.

 

Documents Cloud Service integration via UI

I have already discussed about the Service-to-Service integration between JCS-SX and DCS in the earlier blog.  Another way of integrating with Documents Cloud Service is to use its versatile UI and ‘embed’ in your application to make available its collaboration features.

 

This integration mechanism is very simple and can be used when all the services are federated by the Shared Identity Management (SIM) with the user having access to all of these services. The Documents Cloud Service has an embeddable UI that can be shown in an iframe of the application hosted in JCS-SX. When the browser first requests this embeddable resource, SSO will kick in, and the user, behind the scenes will get seamlessly authenticated to the Document Cloud Service/Social Network Cloud Service via the Shared Identity Management.  For the subsequent requests to Document Cloud Service/Social Network Cloud Service, the SSO cookie will serve as the valid identifier that the user has logged in.

 

Since 16.3.x, Documents Cloud Service also offers conversations as embeddable content.  In this example, we will embed Conversations from Document Cloud Service in the JET application.

Step 1 - Setting up conversations in the Document cloud Service

First, login to Documents Cloud Service and create a folder using Conversations -> Create option.  If the same conversation is to be shown to multiple users, add ‘Members’ to the conversation

 

Create conversation.png

 

The created conversation would have a unique URL that identifies it – e.g.

https://docs1-<id-domain>.documents.<dc>.oraclecloud.com/documents/conversations/16014

 

 

Note that the 16014 is the Id of the conversation that is created and the conversation displays like below:

Conversation - non embed.png

 

Step 2 - Embedding the Document Cloud Service Web UI Using an IFrame

 

The Document Cloud Service provides an embeddable URL for its folders, files and conversations.  Let us implement an iframe in the home.html module that will display the embeddable URL for a particular conversation.  The embeddable URL will have ‘embed’ after the documents.  In our case :

https://docs1-<id-domain>.documents.<dc>.oraclecloud.com/documents/embed/conversations/16014

 

would display the document in an embeddable iframe as below:

Conversation - embed.png

 

Notice this doesn’t have the search and the navigation bar.

Further, the embedded Document Cloud Service content can be customized by adding parameters to the URL which will enable hidng certain UI elements, or changing layout.

E.g.https://docs1-<id-domain>.documents.<dc>.oraclecloud.com/documents/embed/conversations/16014?noopen

will display the conversations without means to open a conversation, i.e. you can only see a list of conversations

 

To see the full list of options, please consult the configuration parameters documentation

 

For the purpose of this example, I will use the basic Quick Start Oracle JET project developed in earlier blog post.  Add the iframe to the home.html module at the end

 

<iframe src='https://docs1-<id-domain>.documents.<dc>.oraclecloud.com/documents/embed/conversations/16014/' style="overflow : auto ; height : 400px ; width :  100% "> </iframe>

 

Step 3 – Configuring Document Cloud Service to allow embedding content on other domains

To allow the content to be embeddable, go to Administration -> Documents (available from the actions on the left hand pull down menu next to the profile photo) and do the following:

In the Embedded Content section, Select “Enabled".  Add your domain into the list of allowable domains in the format xyz.com:port_number

 

Without this you would get a X-Frame-Options DENY in your application and the content will not be loaded. You can see this error in the console of the browser

embed error.png

Note:

If your application and Oracle Documents Cloud Service are in different domains and SSO is not enabled, the IFrame will display a login screen and the users will have to manually provide their authentication credentials.

 

Conclusion

That is it!  Deploy to JCS-SX and run your JCS-SX JET application and you should see the output as below.

working-app.png

 

Do make sure popups are allowed for this site from the browser, since the Document Cloud Service will open a popup that allows the user to login seamlessly.

 

You can do all sorts of operations on the conversations i.e. Post/Upload Document/Close etc that you would be able to do in the full Documents Cloud Service UI.  Another feature is that if the conversation is updated by another person the same would be updated in the embedded UI automatically!

 

**The views expressed in this post are my own and do not necessarily reflect the views of Oracle.