Generate server key using Java keytool:
keytool -genkey -alias alias -keypass mypassword -keystore keystore.key -storepass mypassword
. Enable ssl into your platform_instalation/conf/server.xml
<Connector SSLEnabled="true" clientAuth="false" keystoreFile="/path_to_key/keystore.key"
keystorePass="mypassword" maxThreads="200" port="8443" protocol="HTTP/1.1" scheme="https" secure="true" sslProtocol="TLS"/>
- From Setup, click Create | Apps and click New to start defining a connected app.
- Enter the name of your application.
- Enter the contact email information, as well as any other information appropriate for your application.
- Select Enable OAuth Settings and enter the Callback URL
https://salesforce:8443/salesforce-extension/oauth/_callback
- Select OAuth Scopes : "full access".
- Click Save.
The Consumer Key and the Consumer Secret are created (click the link to reveal it).
Steps to do:
- Setup -> Customize -> Opportunity -> Buttons and Links.
- Create new custom button called "Create eXo Deal Room".
- Choose behaviour "Display in existing window without sidebar or header"
- Choose Content Source as "URL"
- Paste in the code the link below:
https://salesforce:8443/salesforce-extension/oauth?oppID={!Opportunity.Id}
6-save
Note :
- https://salesforce:8443/salesforce-extension/oauth?oppID is the link to your eXo server
- {!Opportunity.Id} dynamic query param that will be sent to the server according to the current selected opportunity.
- Go to the opportunity layout.
- Select Buttons.
- Drag and drop the newly created custom Button to the "Opportunity Detail" section (next the default standard ones "edit", "save" and "clone")
- Save.
Now if you go back to the opportunities list page and if you select any opportunity you will see that your custom button was succefully added to the layout. Clicking to that button will create an eXo space with some mapped opportunity information.
Depends on Force.com REST API Connector please refer to https://github.com/jesperfj/force-rest-api to build from source.
Open the configuration file of your Platform server ../gatein/conf/exo.properties Add the following variables:
oauth.salesforce.clientId=xxxxxx oauth.salesforce.clientSecret=zzzzzz oauth.salesforce.redirectUri=https://serverName:8443/salesforce-extension/oauth/_callback
The oauth.salesforce.clientId
parameter is the Client ID
.
The oauth.salesforce.clientSecret
parameter is the client Secret
.
Client ID
and client Secret
are generated when setup the connected application to Salesforce see Setup the Application section
The oauth.salesforce.redirectUri
parameter is the redirect Uri
used for OAuth flows to pass an access token to query the salesforce from exo server.
1- Add the base URL of eXo site as a Remote Site
NB: Due to Salesforce restrictions: - Only DNS are accepted, IP numbers can not be used. - The SSL certificate must be valid otherwise it will not be permitted. As workaround, use HTTP instead as it's possible to use both HTTP and HTTPS in the same server.
2- Deploy the Apex classes and triggers to your Production/Developer salesforce instance:
You can manually deploy them by copying their contents from the Apex Folder
Or simply you can use the GitHub Salesforce Deployment tool, by clicking on the button below:
Once deployed, you will need to edit "ConfigurationManager" class and set the "CALLOUT_ENDPOINT" to point to your server:
public static String CALLOUT_ENDPOINT{
get{
return 'http://plfent-4.3.x-pkgpriv-salesforce-integration-snapshot.acceptance5.exoplatform.org/rest/';
}
}
The primary entry point to Salesforce addon is the "create deal room" button from salesforce.
Once clicked and if first use, the user will be asked to authorize the eXo application to access Salesforce and if allowed, user will be redirected to eXo deal room.
An activity will be created marking some information about the opportunity with an external link to this deal.
Any modification on these fields from Salesforce will create new comment at eXo side notifying deal room members on this update.
Real time chatter pull :This feature will Pull Salesforce chatter post to eXo activity, so letting more people to get involved and making things more collaborative:
Mention eXo people from Salesforce will notify them at eXo side so they can know they are involved:
Content share with document preview:
Content Post from Salesforce will create activity with eXo content preview, so more readable content shared with more people:
-2- Salesforce Document Synchronizer :
Clicking on get document from salesforce will get or synchronize the opportunity space document with the SF content.
To get real time updates from Salesforce to eXo platform the main used techniques are:
-Apex triggers on specific object that do HTTP callouts calling RESTful services using the standard GET and POST:
trigger OpportunityTrackerTrigger on Opportunity (after update) {
...
HttpCallout.getContent(url)
}
To extend behavior on other component developper could trigger others object(Acount,Leads..) and send information to eXo server.
-Polling: periodically poll Salesforce to get any new data using scheduler job and using SOQL query:
public void execute(JobExecutionContext context) {
..
QueryResult<Opportunity> q= new ForceApi(c,s).query("SELECT Id,Name,Amount,CloseDate,StageName,isClosed,Description FROM Opportunity LIMIT 1000", Opportunity.class);
You can enable "OpportunityCreateActivityJob" from configuration file and configure polling period.
-OAuth: that permits eXo as third-party to access salesforce user data.