social enterprise java apps on heroku webinar
DESCRIPTION
In this webinar you will learn how to build Social Enterprise applications using Salesforce.com, Heroku, and Java. Through live coding and demonstrations you will learn how to instantly deploy and scale Java apps on the cloud with Heroku. You will also learn how to integrate those applications with Salesforce.com and Force.com through REST. The webinar will cover: :: An overview of Heroku :: Best practices for integrating with Salesforce.com and Force.com apps via REST :: How to build and deploy your Social Enterprise apps using Java on Heroku :: Your questions about Heroku More details: http://wiki.developerforce.com/page/Webinar:_Social_Enterprise_Java_Apps_on_Heroku_(2012-May)TRANSCRIPT
![Page 1: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/1.jpg)
Social Enterprise Java
Apps
![Page 2: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/2.jpg)
Safe harbor statement under the Private Securities Litigation Reform Act of 1995.
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward looking-statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include - but are not limited to - risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of intellectual property and other litigation, risks associated with possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-Q for the most recent fiscal quarter ended. This documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Safe Harbor Statement
![Page 3: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/3.jpg)
@forcedotcom , #forcewebinar, @Heroku,
@anand_bn, @_JamesWard
Developer Force Group
facebook.com/forcedotcom
facebook.com/heroku
Developer Force – Force.com Community
![Page 4: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/4.jpg)
Anand B Narasimhan Senior Product Manager, Heroku
@anand_bn
James L Ward Principal Developer Evangelist, Heroku
@_JamesWard
![Page 5: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/5.jpg)
- Paul Cheesbrough CIO, News International
![Page 6: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/6.jpg)
In this webinar… What is a “Social Enterprise App”
Heroku – a short intro
Hands on with Java on Heroku
Building a Social Enterprise Heroku app
Coming soon to an IDE near you
Q&A
![Page 7: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/7.jpg)
Customer Social Network
Social Profile
Market Collaborate
Work
Extend Sell
Service
The Social Enterprise
![Page 8: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/8.jpg)
Market = Engage = Heroku
5 Years Ago
Static, Passive Marketing
Today
Relevant, Active Marketing
![Page 9: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/9.jpg)
What are the
building blocks
of a
Social Enterprise App ?
![Page 10: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/10.jpg)
![Page 11: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/11.jpg)
Enterprise Apps
Visibility Infrastructure
Availability
Redundancy
YOUR APP
Failover,
Clustering, Load
Balancers, SSL
Domains
Servers: Web Servers, App
Servers, Database servers
etc
App Server
Admins, Network
Admins
System Admins, App server
Admins, DBAs
DR,Rollback,
Replication
DBAs,
System Admins
App crashes,
Alerts, Logs mining
Ops,
Production support
![Page 12: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/12.jpg)
Trust &
Manage
$heroku ps
Forget
Servers
$ heroku create
Run
Anything
worker: java –jar ..
See
Everything
$heroku logs --tail
![Page 13: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/13.jpg)
Elastic Load Balancing C
on
trol S
urf
ace A
PIs
Developer
Code
•Java
•…
Deploy
•GIT
Manage
•Heroku CLI
•Scaling
•Monitoring
User
• Web browser Acces
• API access
Heroku
Architecture
htt
p(s
)
REST
![Page 14: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/14.jpg)
Data API
Access Management
Profiles Identity Record-Level Filtering Permissions
Data
Metadata Business Data Files
Metadata API
Social Enterprise App Architecture
Addons Polyglot &
Open
Process
Model
Real time
Visibiility
Social API
![Page 16: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/16.jpg)
DEMO / HANDS ON
![Page 17: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/17.jpg)
Building a Social Enterprise
App
With
Heroku and Salesforce.com
![Page 18: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/18.jpg)
Integrating with
Salesforce.com
1.Setup OAuth
2.Update dependencies
3.Switch Entity to JSON
4.Switch DAO to Force REST API
5.Switch Spring Config to Force REST +
OAuth
6.Add Servlet Filter for Oauth
7.Add Oauth Keys to the environment
![Page 19: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/19.jpg)
Your code
Dependencies
WAR
Embedded Container
pom.xml $ mvn install
$ git push heroku
Under the
covers
1. Build
2. Slug Compile
3. Deploy to Dyno
Dyno
![Page 20: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/20.jpg)
![Page 21: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/21.jpg)
Spring MVC app
With Heroku &
Salesforce.com
And
Chatter APIs
![Page 22: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/22.jpg)
Social Feeds, Recommendations
Real time/ Push Notifications
Streaming Data
Analytics
Social
Enterpris
e App
What’s possible…
![Page 23: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/23.jpg)
is GA
Java
![Page 24: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/24.jpg)
Heroku Labs
• WAR deployment (http://bit.ly/war-deploy )
• Jenkins plugin for Heroku(http://bit.ly/heroku-ci
)
• Heroku.jar- Java Wrapper (http://bit.ly/heroku-
jar )
• Atlassian Bamboo plugin for Heroku (Email
[email protected] for more details)
you can try these out now.
We would love your feedback
![Page 25: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/25.jpg)
= like +
Coming Soon
![Page 26: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/26.jpg)
Coming Soon
All day
HEROKU ENTERPRISE DEVELOPER
WORKSHOP
Email [email protected] if you are
interested
![Page 27: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/27.jpg)
Resources Getting Started -
http://java.heroku.com
http://bit.ly/heroku-java
Toolbelt (http://toolbelt.herokuapp.com )
Heroku Dev Center : http://devcenter.heroku.com
Heroku Add-ons: http://addons.heroku.com
Git: http://help.github.com/
Webinar Source code:
Spring MVC - Force.com : http://bit.ly/KZB68y
Chatter - http://bit.ly/KgMlPP
Pusher integration - http://bit.ly/KMVInx
![Page 28: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/28.jpg)
Upcoming Events
• June 12 – Visualforce CodeTalk
http://bit.ly/codetalkheroku
• June 13 – How Salesforce.com Uses
Hadoop Webinar
http://bit.ly/hadoopheroku
• June 26 – Mobile CodeTalk
http://bit.ly/mct-wr
![Page 29: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/29.jpg)
James Ward @_JamesWard Developer Evangelist at Heroku
Anand Narasimhan @anand_bn Sr. Product Manager at Heroku
Survey: http://bit.ly/herokujavasurvey
Heroku Devcenter: http://devcenter.heroku.com
![Page 30: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/30.jpg)
APPENDIX
SFDC Integration Steps
![Page 31: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/31.jpg)
1. Setup OAuth
i. Salesforce.com > Setup > Develop >
Remote Access
ii. Add Remote Access for Dev & Prod
• Dev Callback URL: http://localhost:8080/_auth
• Prod Callback URL: https://some-app-1234.herokuapp.com/_auth
![Page 32: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/32.jpg)
2. Update dependencies <repositories>
<repository>
<id>force-rest-api</id>
<name>force-rest-api repository on GitHub</name>
<url>
http://jesperfj.github.com/force-rest-api/repository/
</url>
</repository>
</repositories>
![Page 33: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/33.jpg)
2. Update dependencies <dependency>
<groupId>com.force.api</groupId>
<artifactId>force-rest-api</artifactId>
<version>0.0.15</version>
</dependency>
<dependency>
<groupId>com.force.sdk</groupId>
<artifactId>force-oauth</artifactId>
<version>22.0.8-BETA</version>
</dependency>
<dependency>
<groupId>com.force.sdk</groupId>
<artifactId>force-springsecurity</artifactId>
<version>22.0.8-BETA</version>
</dependency>
![Page 34: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/34.jpg)
3. Switch Entity to JSON @JsonIgnoreProperties(ignoreUnknown=true)
public class Person {
@JsonProperty(value="Id")
private String id;
@JsonProperty(value="FirstName")
private String firstName;
@JsonProperty(value="LastName")
private String lastName;
![Page 35: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/35.jpg)
4. Switch DAO to Force REST
API private ForceApi getForceApi() {
SecurityContext sc = ForceSecurityContextHolder.get();
ApiSession s = new ApiSession();
s.setAccessToken(sc.getSessionId());
s.setApiEndpoint(sc.getEndPointHost());
return new ForceApi(s);
}
// Add Contact
getForceApi().createSObject("contact", person);
// Query Contacts getForceApi().query("SELECT Id FROM contact", Person.class);
// Delete Contact
getForceApi().deleteSObject("contact", id);
![Page 36: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/36.jpg)
5. Spring Config + OAuth
<fss:oauth>
<fss:oauthInfo endpoint="http://login.salesforce.com"
oauth-key="#{systemEnvironment['OAUTH_CLIENT_KEY']}"
oauth-secret="#{systemEnvironment['OAUTH_CLIENT_SECRET']}"/>
</fss:oauth>
<security:http use-expressions="true">
<security:intercept-url pattern="/people/*"
access="isAuthenticated()" />
</security:http>
<!-- https redirect support -->
<property name="redirectHttp10Compatible" value="false" />
![Page 37: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/37.jpg)
6. Add Servlet Filter for Oauth <filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
<init-param>
<param-name>contextAttribute</param-name>
<param-value>
org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
![Page 38: Social Enterprise Java Apps on Heroku Webinar](https://reader034.vdocuments.mx/reader034/viewer/2022051322/546d6978af795967298b5360/html5/thumbnails/38.jpg)
7. Add Oauth Keys
export OAUTH_CLIENT_KEY=CQ3gmEE53MVG99OxTyEMal8ytj1E3NF7...
export OAUTH_CLIENT_SECRET=0905539091246761180
heroku config:add OAUTH_CLIENT_KEY=CQ3gmEE53MVG99OxTyEMal8yt...
heroku config:add OAUTH_CLIENT_SECRET=0905539091246761180