SlideShare a Scribd company logo
1 of 35
Download to read offline
Apex Code Analysis using the
Tooling API and Canvas
Andrew Fawcett, FinancialForce.com, CTO
@andyinthecloud
All about FinancialForce.com
Revolutionizing the Back Office
#1 Accounting, Billing and PSA Apps on the Salesforce platform

▪ Native apps
▪ San Francisco HQ, 595 Market St
▪ R&D in San Francisco, Harrogate UK, and Granada ES
▪ We are hiring! Meet us at Rehab!
Introduction
Why do I need to know more about my Apex code?
▪ Its hard to see code complexity from within the trenches
• Helps those unfamiliar learn complex code bases

▪ Tightly coupled code is harder to maintain and evolve

Goals of this Session
• What are the technologies that can help?
• Understand how to analyze your code with the Tooling API?
• Provide a take away demo of the Tooling API you can extend
Canvas: UI Integration with Salesforce
Provides a means of extending the Salesforce User Interface
▪ Chatter Tab
▪ Visualforce Tabs
▪ Publisher Actions
▪ Other areas see Canvas Developer Guide

Open to any new or existing external web page
▪ Pages can be developed and hosted within any web platform
▪ Developer SDK’s for Java and JavaScript are provided
▪ Pages must follow a specific authentication flow
Where do Canvas apps appear in Salesforce?
Chatter
Tab
Where do Canvas apps appear in Salesforce?
Visualforce Page
Where do Canvas apps appear in Salesforce?
Publisher Action
Canvas Architecture
Access Method: Signed Request (Recommended)

Canvas aware Web Site
(hold consumer secret)
https://mysite.com/mypage

Salesforce User Interface
(holds consumer secret)
Initial HTTP POST passing signed_request

Canvas Frame

User Web Page Interactions

1.

Receives HTTP POST, decodes
and validates request
2. Stores CanvasRequest and
presents page to user
3. Optionally calls back to Salesforce
via API’s using oAuth token

Salesforce API Interactions (using oAuth Token from CanvasRequest)
How do I make my web page Canvas aware?
Two Salesforce SDK’s
▪ Salesforce Canvas JavaScript SDK
▪ Salesforce Canvas Java SDK
• Includes JavaScript SDK

Handle Decoding and Parsing of the “CanvasRequest”
▪ Sent to the page when the user clicks in the Salesforce UI
▪ HTTP POST to the page via ‘signed_request’ parameter
• Contains amongst other information, oAuth token for Salesforce API access!
What is the Tooling API?
What: Manage Apex Code and Pages on the Platform
▪ More granular API than Metadata API built for …
• Building alternative IDE’s (Integrated Developer Environment)
– MavensMate
– Force.com IDE

• Build development tools
– Tools that perform further analysis on code via Symbol Table
What is the Tooling API?
▪ Use REST API bindings if you’re using a language that isn’t strongly typed, like
JavaScript.
▪ Use SOAP API bindings if you’re using a strongly typed language like Java that generates
Web service client code.
Tooling API Architecture and Objects
New Objects in the Salesforce Database
▪ Creating, querying, updating and deleting records
• NOTE: Only via Tooling API CRUD operations

▪ MetadataContainer Object
• Think, “Workspace” in your IDE for files being worked on
Tooling API Architecture and Objects
New Objects in the Salesforce Database
▪ Key Objects are ….
Use without MetadataContainer

Use with MetadataContainer

•
•
•
•

•
•
•
•

ApexClass
ApexPage
ApexComponent
ApexTrigger

ApexClassMember
ApexPageMember
ApexComponentMember
ApexTriggerMember
What is a Symbol Table?
Child of ApexClass, ApexClassMember and ApexTriggerMember
▪ Variables
▪ Methods
▪ Inner Classes
▪ External References
• Lists references to the above from other Apex Classes and Apex Triggers
• NOTE: Only available after a compile!
Birds Eye View : Symbol Table Object

Only available after an Apex
compilation!
Apex UML Canvas Application: Demo

NOTE: Code shown is from my “Building Strong Foundation: Apex Enterprise Patterns” session
Apex UML Canvas Application: Architecture
▪ Hosted on Heroku
▪ Jetty Web Server
• Java Spring MVC Framework
• SOAP Tooling API (via JAX-WS)
– via wsimport Maven plugin

▪ Web Page
• jQuery
• UMLCanvas JS Library

▪ Maven Build System
Configuring a Canvas Application in Salesforce
▪ Makes HTTP POST to URL https://localhost:8443/app/canvas
• Note: /app/ is managed by Spring MVC and forwards to Java Controllers…

▪ Setup > Create > Applications
Integrating the Canvas SDK with Spring MVC
CanvasController.java
▪ Handles the HTTP POST made by Salesforce to /canvas
▪ Uses Salesforce Canvas SDK to decode and store in HTTP session
@Controller
@RequestMapping("/canvas")
public class CanvasController {
@RequestMapping(method = RequestMethod.POST)
public String canvasRequest(@RequestParam("signed_request") String signedRequest, HttpSession session)
{
String secret = System.getenv("CANVAS_CONSUMER_SECRET");
CanvasRequest request = SignedRequest.verifyAndDecode(signedRequest, secret);
session.setAttribute("canvasRequest", request);
return "redirect:umlcanvas";
}
}
Apex UML Canvas : Code Walkthrough
UmlCanvasController.java
▪ Redirection from /canvas to /umlcanvas
▪ Page load, rendered by umlcanvas.jsp
@Controller
@RequestMapping("/umlcanvas")
public class UmlCanvasController {
@RequestMapping(method = RequestMethod.GET)
public String load(HttpSession session, Map<String, Object> map) throws Exception
{
// List classes on the page
ToolingAPIConnection toolingAPI = createToolingAPIConnection(session);
ApexClass[] apexClasses =
toolingAPI.service.query(
"SELECT Id, Name, SymbolTable " +
"FROM ApexClass"
, toolingAPI.session).getRecords().toArray(new ApexClass[0]);
for(ApexClass apexClass : apexClasses)
Apex UML Canvas : Code Walkthrough
umlcanvas.jsp

▪ Java Servlet Page (JSP)
▪ AJAX calls to
UmlCanvasController.java
▪ JavaScript calls UmlCanvas
JavaScript library to
render UML
Apex UML Canvas : Code Walkthrough
UmlCanvasController.java
▪ jQuery Ajax calls controller as user selects classes
1.

/umlcanvas/{apexclass}/symboltable
Apex UML Canvas : Code Walkthrough
UmlCanvasController.java
1.

/umlcanvas/{apexclass}/symboltable

2.

/umlcanvas/{apexclass}/compile

3.

/umlcanvas/containerasyncrequest/{id}

4.

/umlcanvas/containerasyncrequest/{id}/{classname}/symboltable
Apex UML Canvas : Code Walkthrough
UmlCanvasController.java : /{apexclass}/symboltable
Apex UML Canvas : Code Walkthrough
UmlCanvasController.java : /{apexclass}/compile
Apex UML Canvas : Code Walkthrough
UmlCanvasController.java : /{apexclass}/compile
Apex UML Canvas : Code Walkthrough
UmlCanvasController.java : /{apexclass}/compile
Apex UML Canvas : Code Walkthrough
UmlCanvasController.java : /{apexclass}/compile
Apex UML Canvas : Code Walkthrough
UmlCanvasController.java :
/containerasyncrequest/{id}
Apex UML Canvas : Code Walkthrough
UmlCanvasController.java :
/navigator/containerasyncrequest/{id}/{classname}/symboltable
Tooling API Other Features
▪ Debug Logs
▪ Execute Anonymous Apex Code
▪ Static Resources
▪ Inject Execution of Apex or SOQL Code for Debug
▪ Checkpoints to capture Heap Dumps
▪ Manage Custom Fields
▪ Accces Code Coverage Results
Other Uses of Tooling API
Ant Integration : Execute Apex Code from Ant!

Salesforce SE Execute an Apex class using Ant build script
Summary
Read Documentation closely!
▪ Force.com Tooling API Developer’s Guide
▪ Force.com Canvas Developer’s Guide

Symbol Table
▪ Has some gaps, still maturing

Spring MVC rocks!
▪ Great for those not familiar with Java Servlet API
▪ Shades of JavaScript Remoting
Andrew Fawcett
CTO,
@andyinthecloud
Apex Code Analysis Using the Tooling API and Canvas

More Related Content

What's hot

Salesforce.com Sandbox management
Salesforce.com Sandbox management Salesforce.com Sandbox management
Salesforce.com Sandbox management Ali Akbar
 
Seamless Authentication with Force.com Canvas
Seamless Authentication with Force.com CanvasSeamless Authentication with Force.com Canvas
Seamless Authentication with Force.com CanvasSalesforce Developers
 
Salesforce Cross-Cloud Architecture
Salesforce Cross-Cloud ArchitectureSalesforce Cross-Cloud Architecture
Salesforce Cross-Cloud ArchitectureThierry TROUIN ☁
 
Visualforce & Force.com Canvas: Unlock your Web App inside of Salesforce.com ...
Visualforce & Force.com Canvas: Unlock your Web App inside of Salesforce.com ...Visualforce & Force.com Canvas: Unlock your Web App inside of Salesforce.com ...
Visualforce & Force.com Canvas: Unlock your Web App inside of Salesforce.com ...Salesforce Developers
 
Making External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceMaking External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceSalesforce Developers
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce IntegrationJoshua Hoskins
 
Single Sign-On and User Provisioning with Salesforce Identity
Single Sign-On and User Provisioning with Salesforce IdentitySingle Sign-On and User Provisioning with Salesforce Identity
Single Sign-On and User Provisioning with Salesforce IdentitySalesforce Developers
 
Salesforce Security Review Tips and Tricks
Salesforce Security Review Tips and TricksSalesforce Security Review Tips and Tricks
Salesforce Security Review Tips and TricksRyan Flood
 
いまさら聞けない Amazon EC2
いまさら聞けない Amazon EC2いまさら聞けない Amazon EC2
いまさら聞けない Amazon EC2Yasuhiro Matsuo
 
Salesforce Streaming Api
Salesforce Streaming ApiSalesforce Streaming Api
Salesforce Streaming ApiJayant Jindal
 
Salesforce Streaming event - PushTopic and Generic Events
Salesforce Streaming event - PushTopic and Generic EventsSalesforce Streaming event - PushTopic and Generic Events
Salesforce Streaming event - PushTopic and Generic EventsDhanik Sahni
 
Two-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsTwo-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsSalesforce Developers
 
Building strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsBuilding strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsandyinthecloud
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilitySalesforce Developers
 
A primer on Salesforce Knowledge - what why how!
A primer on Salesforce Knowledge - what why how!A primer on Salesforce Knowledge - what why how!
A primer on Salesforce Knowledge - what why how!Avi Verma
 
Decluttering your Salesfroce org
Decluttering your Salesfroce orgDecluttering your Salesfroce org
Decluttering your Salesfroce orgRoy Gilad
 
認定 Integration Architecture デザイナー試験を復習してみた
認定 Integration Architecture デザイナー試験を復習してみた認定 Integration Architecture デザイナー試験を復習してみた
認定 Integration Architecture デザイナー試験を復習してみたTakahito Miyamoto
 

What's hot (20)

Salesforce.com Sandbox management
Salesforce.com Sandbox management Salesforce.com Sandbox management
Salesforce.com Sandbox management
 
Seamless Authentication with Force.com Canvas
Seamless Authentication with Force.com CanvasSeamless Authentication with Force.com Canvas
Seamless Authentication with Force.com Canvas
 
Salesforce Cross-Cloud Architecture
Salesforce Cross-Cloud ArchitectureSalesforce Cross-Cloud Architecture
Salesforce Cross-Cloud Architecture
 
Visualforce & Force.com Canvas: Unlock your Web App inside of Salesforce.com ...
Visualforce & Force.com Canvas: Unlock your Web App inside of Salesforce.com ...Visualforce & Force.com Canvas: Unlock your Web App inside of Salesforce.com ...
Visualforce & Force.com Canvas: Unlock your Web App inside of Salesforce.com ...
 
Making External Web Pages Interact With Visualforce
Making External Web Pages Interact With VisualforceMaking External Web Pages Interact With Visualforce
Making External Web Pages Interact With Visualforce
 
Salesforce Integration
Salesforce IntegrationSalesforce Integration
Salesforce Integration
 
Single Sign-On and User Provisioning with Salesforce Identity
Single Sign-On and User Provisioning with Salesforce IdentitySingle Sign-On and User Provisioning with Salesforce Identity
Single Sign-On and User Provisioning with Salesforce Identity
 
Salesforce Einstein: Use Cases and Product Features
Salesforce Einstein: Use Cases and Product FeaturesSalesforce Einstein: Use Cases and Product Features
Salesforce Einstein: Use Cases and Product Features
 
Salesforce Security Review Tips and Tricks
Salesforce Security Review Tips and TricksSalesforce Security Review Tips and Tricks
Salesforce Security Review Tips and Tricks
 
いまさら聞けない Amazon EC2
いまさら聞けない Amazon EC2いまさら聞けない Amazon EC2
いまさら聞けない Amazon EC2
 
Salesforce Streaming Api
Salesforce Streaming ApiSalesforce Streaming Api
Salesforce Streaming Api
 
Salesforce Streaming event - PushTopic and Generic Events
Salesforce Streaming event - PushTopic and Generic EventsSalesforce Streaming event - PushTopic and Generic Events
Salesforce Streaming event - PushTopic and Generic Events
 
Introduction to Apex for Developers
Introduction to Apex for DevelopersIntroduction to Apex for Developers
Introduction to Apex for Developers
 
Two-Way Integration with Writable External Objects
Two-Way Integration with Writable External ObjectsTwo-Way Integration with Writable External Objects
Two-Way Integration with Writable External Objects
 
Building strong foundations apex enterprise patterns
Building strong foundations apex enterprise patternsBuilding strong foundations apex enterprise patterns
Building strong foundations apex enterprise patterns
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Salesforce Deck Template
Salesforce Deck TemplateSalesforce Deck Template
Salesforce Deck Template
 
A primer on Salesforce Knowledge - what why how!
A primer on Salesforce Knowledge - what why how!A primer on Salesforce Knowledge - what why how!
A primer on Salesforce Knowledge - what why how!
 
Decluttering your Salesfroce org
Decluttering your Salesfroce orgDecluttering your Salesfroce org
Decluttering your Salesfroce org
 
認定 Integration Architecture デザイナー試験を復習してみた
認定 Integration Architecture デザイナー試験を復習してみた認定 Integration Architecture デザイナー試験を復習してみた
認定 Integration Architecture デザイナー試験を復習してみた
 

Viewers also liked

Aligning Sales & Marketing: Not Mission Impossible
Aligning Sales & Marketing: Not Mission ImpossibleAligning Sales & Marketing: Not Mission Impossible
Aligning Sales & Marketing: Not Mission ImpossibleChristine Crandell
 
Accelerate Business Velocity with NetSuite and Salesforce Integration
Accelerate Business Velocity with NetSuite and Salesforce IntegrationAccelerate Business Velocity with NetSuite and Salesforce Integration
Accelerate Business Velocity with NetSuite and Salesforce IntegrationInformatica Cloud
 
Introducing Eclipse MoDisco
Introducing Eclipse MoDiscoIntroducing Eclipse MoDisco
Introducing Eclipse MoDiscoHugo Bruneliere
 
Professional Services Automation
Professional Services AutomationProfessional Services Automation
Professional Services AutomationAmbareesh Kulkarni
 
Service Automation: Enabling The Self Service Generation - Jan-Willem Middleburg
Service Automation: Enabling The Self Service Generation - Jan-Willem MiddleburgService Automation: Enabling The Self Service Generation - Jan-Willem Middleburg
Service Automation: Enabling The Self Service Generation - Jan-Willem MiddleburgPink Elephant
 
Financial force psa and salesforce crm
Financial force psa and salesforce crmFinancial force psa and salesforce crm
Financial force psa and salesforce crmjwpurl
 
Driving Profitability with Professional Services Automation
Driving Profitability with Professional Services AutomationDriving Profitability with Professional Services Automation
Driving Profitability with Professional Services AutomationProformative, Inc.
 
Partner Success Services (Overview & Framework)
Partner Success Services (Overview & Framework)Partner Success Services (Overview & Framework)
Partner Success Services (Overview & Framework)Salesforce Partners
 
Automation & Professional Services
Automation & Professional ServicesAutomation & Professional Services
Automation & Professional ServicesMarketingArrowECS_CZ
 
Microsoft PSA: Service Automation in Action
Microsoft PSA: Service Automation in ActionMicrosoft PSA: Service Automation in Action
Microsoft PSA: Service Automation in ActionAdvaiya Solutions, Inc.
 
Educateca 3º ano desafios
Educateca 3º ano desafiosEducateca 3º ano desafios
Educateca 3º ano desafiosSílvia Rocha
 
Fichas de Avaliação Estudo do Meio_3.º Ano
Fichas de Avaliação Estudo do Meio_3.º AnoFichas de Avaliação Estudo do Meio_3.º Ano
Fichas de Avaliação Estudo do Meio_3.º AnoMarta Viegas
 
What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)Rudy De Busscher
 

Viewers also liked (17)

Uml
UmlUml
Uml
 
Aligning Sales & Marketing: Not Mission Impossible
Aligning Sales & Marketing: Not Mission ImpossibleAligning Sales & Marketing: Not Mission Impossible
Aligning Sales & Marketing: Not Mission Impossible
 
Ritesh Mehandiratta Resume
Ritesh Mehandiratta ResumeRitesh Mehandiratta Resume
Ritesh Mehandiratta Resume
 
Accelerate Business Velocity with NetSuite and Salesforce Integration
Accelerate Business Velocity with NetSuite and Salesforce IntegrationAccelerate Business Velocity with NetSuite and Salesforce Integration
Accelerate Business Velocity with NetSuite and Salesforce Integration
 
Karthik resume 2016
Karthik resume   2016Karthik resume   2016
Karthik resume 2016
 
Introducing Eclipse MoDisco
Introducing Eclipse MoDiscoIntroducing Eclipse MoDisco
Introducing Eclipse MoDisco
 
Professional Services Automation
Professional Services AutomationProfessional Services Automation
Professional Services Automation
 
Service Automation: Enabling The Self Service Generation - Jan-Willem Middleburg
Service Automation: Enabling The Self Service Generation - Jan-Willem MiddleburgService Automation: Enabling The Self Service Generation - Jan-Willem Middleburg
Service Automation: Enabling The Self Service Generation - Jan-Willem Middleburg
 
Financial force psa and salesforce crm
Financial force psa and salesforce crmFinancial force psa and salesforce crm
Financial force psa and salesforce crm
 
Driving Profitability with Professional Services Automation
Driving Profitability with Professional Services AutomationDriving Profitability with Professional Services Automation
Driving Profitability with Professional Services Automation
 
Partner Success Services (Overview & Framework)
Partner Success Services (Overview & Framework)Partner Success Services (Overview & Framework)
Partner Success Services (Overview & Framework)
 
Automation & Professional Services
Automation & Professional ServicesAutomation & Professional Services
Automation & Professional Services
 
Microsoft PSA: Service Automation in Action
Microsoft PSA: Service Automation in ActionMicrosoft PSA: Service Automation in Action
Microsoft PSA: Service Automation in Action
 
Educateca 3º ano desafios
Educateca 3º ano desafiosEducateca 3º ano desafios
Educateca 3º ano desafios
 
Ficha de avaliação de estudo do meio - 3º ano
Ficha de avaliação de estudo do meio - 3º anoFicha de avaliação de estudo do meio - 3º ano
Ficha de avaliação de estudo do meio - 3º ano
 
Fichas de Avaliação Estudo do Meio_3.º Ano
Fichas de Avaliação Estudo do Meio_3.º AnoFichas de Avaliação Estudo do Meio_3.º Ano
Fichas de Avaliação Estudo do Meio_3.º Ano
 
What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)
 

Similar to Apex Code Analysis Using the Tooling API and Canvas

Make your gui shine with ajax solr
Make your gui shine with ajax solrMake your gui shine with ajax solr
Make your gui shine with ajax solrlucenerevolution
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...SPTechCon
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and ReactMike Melusky
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsSalesforce Developers
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patternsukdpe
 
SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...Liam Cleary [MVP]
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkecker
 
Create Salesforce online IDE in 30 minutes
Create Salesforce online IDE in 30 minutesCreate Salesforce online IDE in 30 minutes
Create Salesforce online IDE in 30 minutesJitendra Zaa
 
Building intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryBuilding intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryAlek Davis
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008Caleb Jenkins
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET PresentationRasel Khan
 
RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014Henry Van Styn
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Lucas Jellema
 
Building intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryBuilding intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryAlek Davis
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologiesHosam Kamel
 
Developing Lightning Components for Communities.pptx
Developing Lightning Components for Communities.pptxDeveloping Lightning Components for Communities.pptx
Developing Lightning Components for Communities.pptxDmitry Vinnik
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...CodeMill digital skills
 

Similar to Apex Code Analysis Using the Tooling API and Canvas (20)

Make your gui shine with ajax solr
Make your gui shine with ajax solrMake your gui shine with ajax solr
Make your gui shine with ajax solr
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
SynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax DevelopmentSynapseIndia asp.net2.0 ajax Development
SynapseIndia asp.net2.0 ajax Development
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
 
Apex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong FoundationsApex Enterprise Patterns: Building Strong Foundations
Apex Enterprise Patterns: Building Strong Foundations
 
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patterns
 
SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...
 
qooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Frameworkqooxdoo - Open Source Ajax Framework
qooxdoo - Open Source Ajax Framework
 
Create Salesforce online IDE in 30 minutes
Create Salesforce online IDE in 30 minutesCreate Salesforce online IDE in 30 minutes
Create Salesforce online IDE in 30 minutes
 
Building intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryBuilding intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQuery
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014RapidApp - YAPC::NA 2014
RapidApp - YAPC::NA 2014
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
 
Building intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryBuilding intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQuery
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
 
Atlas Php
Atlas PhpAtlas Php
Atlas Php
 
Developing Lightning Components for Communities.pptx
Developing Lightning Components for Communities.pptxDeveloping Lightning Components for Communities.pptx
Developing Lightning Components for Communities.pptx
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
 
AJppt.pptx
AJppt.pptxAJppt.pptx
AJppt.pptx
 

More from Salesforce Developers

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSalesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceSalesforce Developers
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base ComponentsSalesforce Developers
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsSalesforce Developers
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaSalesforce Developers
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentSalesforce Developers
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsSalesforce Developers
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsSalesforce Developers
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsSalesforce Developers
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and TestingSalesforce Developers
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce dataSalesforce Developers
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionSalesforce Developers
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPSalesforce Developers
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceSalesforce Developers
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureSalesforce Developers
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DXSalesforce Developers
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectSalesforce Developers
 

More from Salesforce Developers (20)

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX India
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web Components
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCP
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS Connect
 
Introduction to MuleSoft
Introduction to MuleSoftIntroduction to MuleSoft
Introduction to MuleSoft
 

Recently uploaded

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 

Apex Code Analysis Using the Tooling API and Canvas

  • 1. Apex Code Analysis using the Tooling API and Canvas Andrew Fawcett, FinancialForce.com, CTO @andyinthecloud
  • 2. All about FinancialForce.com Revolutionizing the Back Office #1 Accounting, Billing and PSA Apps on the Salesforce platform ▪ Native apps ▪ San Francisco HQ, 595 Market St ▪ R&D in San Francisco, Harrogate UK, and Granada ES ▪ We are hiring! Meet us at Rehab!
  • 3. Introduction Why do I need to know more about my Apex code? ▪ Its hard to see code complexity from within the trenches • Helps those unfamiliar learn complex code bases ▪ Tightly coupled code is harder to maintain and evolve Goals of this Session • What are the technologies that can help? • Understand how to analyze your code with the Tooling API? • Provide a take away demo of the Tooling API you can extend
  • 4. Canvas: UI Integration with Salesforce Provides a means of extending the Salesforce User Interface ▪ Chatter Tab ▪ Visualforce Tabs ▪ Publisher Actions ▪ Other areas see Canvas Developer Guide Open to any new or existing external web page ▪ Pages can be developed and hosted within any web platform ▪ Developer SDK’s for Java and JavaScript are provided ▪ Pages must follow a specific authentication flow
  • 5. Where do Canvas apps appear in Salesforce? Chatter Tab
  • 6. Where do Canvas apps appear in Salesforce? Visualforce Page
  • 7. Where do Canvas apps appear in Salesforce? Publisher Action
  • 8. Canvas Architecture Access Method: Signed Request (Recommended) Canvas aware Web Site (hold consumer secret) https://mysite.com/mypage Salesforce User Interface (holds consumer secret) Initial HTTP POST passing signed_request Canvas Frame User Web Page Interactions 1. Receives HTTP POST, decodes and validates request 2. Stores CanvasRequest and presents page to user 3. Optionally calls back to Salesforce via API’s using oAuth token Salesforce API Interactions (using oAuth Token from CanvasRequest)
  • 9. How do I make my web page Canvas aware? Two Salesforce SDK’s ▪ Salesforce Canvas JavaScript SDK ▪ Salesforce Canvas Java SDK • Includes JavaScript SDK Handle Decoding and Parsing of the “CanvasRequest” ▪ Sent to the page when the user clicks in the Salesforce UI ▪ HTTP POST to the page via ‘signed_request’ parameter • Contains amongst other information, oAuth token for Salesforce API access!
  • 10. What is the Tooling API? What: Manage Apex Code and Pages on the Platform ▪ More granular API than Metadata API built for … • Building alternative IDE’s (Integrated Developer Environment) – MavensMate – Force.com IDE • Build development tools – Tools that perform further analysis on code via Symbol Table
  • 11. What is the Tooling API? ▪ Use REST API bindings if you’re using a language that isn’t strongly typed, like JavaScript. ▪ Use SOAP API bindings if you’re using a strongly typed language like Java that generates Web service client code.
  • 12. Tooling API Architecture and Objects New Objects in the Salesforce Database ▪ Creating, querying, updating and deleting records • NOTE: Only via Tooling API CRUD operations ▪ MetadataContainer Object • Think, “Workspace” in your IDE for files being worked on
  • 13. Tooling API Architecture and Objects New Objects in the Salesforce Database ▪ Key Objects are …. Use without MetadataContainer Use with MetadataContainer • • • • • • • • ApexClass ApexPage ApexComponent ApexTrigger ApexClassMember ApexPageMember ApexComponentMember ApexTriggerMember
  • 14. What is a Symbol Table? Child of ApexClass, ApexClassMember and ApexTriggerMember ▪ Variables ▪ Methods ▪ Inner Classes ▪ External References • Lists references to the above from other Apex Classes and Apex Triggers • NOTE: Only available after a compile!
  • 15. Birds Eye View : Symbol Table Object Only available after an Apex compilation!
  • 16. Apex UML Canvas Application: Demo NOTE: Code shown is from my “Building Strong Foundation: Apex Enterprise Patterns” session
  • 17. Apex UML Canvas Application: Architecture ▪ Hosted on Heroku ▪ Jetty Web Server • Java Spring MVC Framework • SOAP Tooling API (via JAX-WS) – via wsimport Maven plugin ▪ Web Page • jQuery • UMLCanvas JS Library ▪ Maven Build System
  • 18. Configuring a Canvas Application in Salesforce ▪ Makes HTTP POST to URL https://localhost:8443/app/canvas • Note: /app/ is managed by Spring MVC and forwards to Java Controllers… ▪ Setup > Create > Applications
  • 19. Integrating the Canvas SDK with Spring MVC CanvasController.java ▪ Handles the HTTP POST made by Salesforce to /canvas ▪ Uses Salesforce Canvas SDK to decode and store in HTTP session @Controller @RequestMapping("/canvas") public class CanvasController { @RequestMapping(method = RequestMethod.POST) public String canvasRequest(@RequestParam("signed_request") String signedRequest, HttpSession session) { String secret = System.getenv("CANVAS_CONSUMER_SECRET"); CanvasRequest request = SignedRequest.verifyAndDecode(signedRequest, secret); session.setAttribute("canvasRequest", request); return "redirect:umlcanvas"; } }
  • 20. Apex UML Canvas : Code Walkthrough UmlCanvasController.java ▪ Redirection from /canvas to /umlcanvas ▪ Page load, rendered by umlcanvas.jsp @Controller @RequestMapping("/umlcanvas") public class UmlCanvasController { @RequestMapping(method = RequestMethod.GET) public String load(HttpSession session, Map<String, Object> map) throws Exception { // List classes on the page ToolingAPIConnection toolingAPI = createToolingAPIConnection(session); ApexClass[] apexClasses = toolingAPI.service.query( "SELECT Id, Name, SymbolTable " + "FROM ApexClass" , toolingAPI.session).getRecords().toArray(new ApexClass[0]); for(ApexClass apexClass : apexClasses)
  • 21. Apex UML Canvas : Code Walkthrough umlcanvas.jsp ▪ Java Servlet Page (JSP) ▪ AJAX calls to UmlCanvasController.java ▪ JavaScript calls UmlCanvas JavaScript library to render UML
  • 22. Apex UML Canvas : Code Walkthrough UmlCanvasController.java ▪ jQuery Ajax calls controller as user selects classes 1. /umlcanvas/{apexclass}/symboltable
  • 23. Apex UML Canvas : Code Walkthrough UmlCanvasController.java 1. /umlcanvas/{apexclass}/symboltable 2. /umlcanvas/{apexclass}/compile 3. /umlcanvas/containerasyncrequest/{id} 4. /umlcanvas/containerasyncrequest/{id}/{classname}/symboltable
  • 24. Apex UML Canvas : Code Walkthrough UmlCanvasController.java : /{apexclass}/symboltable
  • 25. Apex UML Canvas : Code Walkthrough UmlCanvasController.java : /{apexclass}/compile
  • 26. Apex UML Canvas : Code Walkthrough UmlCanvasController.java : /{apexclass}/compile
  • 27. Apex UML Canvas : Code Walkthrough UmlCanvasController.java : /{apexclass}/compile
  • 28. Apex UML Canvas : Code Walkthrough UmlCanvasController.java : /{apexclass}/compile
  • 29. Apex UML Canvas : Code Walkthrough UmlCanvasController.java : /containerasyncrequest/{id}
  • 30. Apex UML Canvas : Code Walkthrough UmlCanvasController.java : /navigator/containerasyncrequest/{id}/{classname}/symboltable
  • 31. Tooling API Other Features ▪ Debug Logs ▪ Execute Anonymous Apex Code ▪ Static Resources ▪ Inject Execution of Apex or SOQL Code for Debug ▪ Checkpoints to capture Heap Dumps ▪ Manage Custom Fields ▪ Accces Code Coverage Results
  • 32. Other Uses of Tooling API Ant Integration : Execute Apex Code from Ant! Salesforce SE Execute an Apex class using Ant build script
  • 33. Summary Read Documentation closely! ▪ Force.com Tooling API Developer’s Guide ▪ Force.com Canvas Developer’s Guide Symbol Table ▪ Has some gaps, still maturing Spring MVC rocks! ▪ Great for those not familiar with Java Servlet API ▪ Shades of JavaScript Remoting