create salesforce online ide in 30 minutes

22
Create Online IDE in 30 minutes Jitendra Zaa @ilovenagpur Dev Prakash @devprakash15

Upload: jitendra-zaa-

Post on 14-Jun-2015

5.442 views

Category:

Software


1 download

DESCRIPTION

Dreaforce 2014 Session , Create Salesforce IDE with the help of Tooling API with complete Source code

TRANSCRIPT

Page 1: Create Salesforce online IDE in 30 minutes

Create Online IDE in 30 minutesJitendra Zaa@ilovenagpur

Dev Prakash

@devprakash15

Page 2: Create Salesforce online IDE in 30 minutes

Dev PrakashAssociate Director - Salesforce Practice

Page 3: Create Salesforce online IDE in 30 minutes

About Cognizant Salesforce Practice

178,600 employees globally

20,000+ Outsourcing projects in 40 countries

25+ Regionalsales offices

Market CapitalisationOver $26 billion

50+ Global Delivery Centres

1,223active customers

Founded in 1994(CTSH, Nasdaq)

HeadquartersTeaneck, NJ

8+ Years as Partner

1 of 18 Global Strategic Sis

425+ Salesforce projects delivered

800+/500+ Salesforce Trained / Salesforce Certified

Page 4: Create Salesforce online IDE in 30 minutes

Agenda• Node.js• Heroku• Twitter Bootstrap• Tooling API• Code Walkthrough• Resources and source code

Page 5: Create Salesforce online IDE in 30 minutes

Why Node.js ?• Uses same JavaScript engine which is used by Google chrome browser “V8 JavaScript runtime”

• Very popular, simple, yet powerful script

• Mostly used for developing high performance network applications

• With help of many available node modules, web application can be created. We will be using “express”

Page 6: Create Salesforce online IDE in 30 minutes

Why Heroku ?• Is leading platform as a service

• Supports many programming languages like ruby, java, php, scala, python, node.js

• Owned by Salesforce

• Heroku connect (easily connect Salesforce with applications hosted on Heroku )

Page 7: Create Salesforce online IDE in 30 minutes

Twitter Bootstrap

• Most popular html, CSS, and JavaScript framework for developing responsive, mobile first projects on the web

• Open source project by twitter

Page 8: Create Salesforce online IDE in 30 minutes

Champion of the Show – Tooling API• Released in spring 13 • Provides REST and SOAP based interface to help creating custom development tools

• Supports create, update and delete apex classes, triggers, visualforce pages and visualforce components

• Getting debug logs, heap dump and symbol tables• Still in infancy, like other Salesforce APIs this is growing with each release

Page 9: Create Salesforce online IDE in 30 minutes

Why do we need Tooling API• Force.com developer community is growing fast like Salesforce itself

• Many organizations are looking for custom functionalities around development tools to follow their standards

• Like any popular programming language, it very important to “make developers happy”

• Tooling API opens door for creating beautiful development tools which will make development efficient and easy

Page 10: Create Salesforce online IDE in 30 minutes

Jitendra ZaaSr. Consultant - Salesforce Practice

Page 11: Create Salesforce online IDE in 30 minutes

Code Walkthrough

Page 12: Create Salesforce online IDE in 30 minutes

Recap – Reading existing resources

• SELECT Id,Name FROM ApexClass

• SELECT Id,Name FROM ApexPage

• SELECT Id,Name FROM ApexTrigger

Page 13: Create Salesforce online IDE in 30 minutes

Recap – Reading body of resources• http://na1.salesforce.com/services/data/v29.0/tooling/sobjects/ApexClass/id

• http://na1.salesforce.com/services/data/v29.0/tooling/sobjects/ApexPage/id

• http://na1.salesforce.com/services/data/v29.0/tooling/sobjects/ApexTrigger/id

Page 14: Create Salesforce online IDE in 30 minutes

Recap – Creating resources• POST request to below URL with content

• http://na1.salesforce.com/services/data/v29.0/tooling/sobjects/ApexClass

• http://na1.salesforce.com/services/data/v29.0/tooling/sobjects/ApexPage

• http://na1.salesforce.com/services/data/v29.0/tooling/sobjects/ApexTrigger

Page 15: Create Salesforce online IDE in 30 minutes

Recap – Updating resources• Create MetadaContainer• Create ResourceMember• Create ContainerAsyncRequest

• Poll ContainerAsyncRequest to see if update is successful

Page 16: Create Salesforce online IDE in 30 minutes

Delete resources• Delete request to below URLs

• http://na1.salesforce.com/services/data/v29.0/tooling/sobjects/ApexClass/id

• http://na1.salesforce.com/services/data/v29.0/tooling/sobjects/ApexPage/id

• http://na1.salesforce.com/services/data/v29.0/tooling/sobjects/ApexTrigger/id

Page 17: Create Salesforce online IDE in 30 minutes

Reading Logs• List of Logs

– SELECT Id,LogUserId FROM ApexLog

• Log Body– http://na1.salesforce.com/services/data/v29.0/tooling/ApexLog/id/Body/

Page 18: Create Salesforce online IDE in 30 minutes

Symbol Table• “SymbolTable” is element in JSON returned when we read resource Body

Page 19: Create Salesforce online IDE in 30 minutes

Use ACE – JavaScript based Code Editor• To make editor more useful and professional, we can use free Library of Online Editor – Ace

• http://ace.c9.io/#nav=about

Page 20: Create Salesforce online IDE in 30 minutes

Complete Code and Demo URL• Demo - https://toolingapi.herokuapp.com/

• Demo with Ace - https://dreamforce14.herokuapp.com/

• Git (simple editor) with Heroku 1 button – https://github.com/JitendraZaa/ToolingAPI30Min

• Git (with ace) with Heroku 1 button – https://github.com/JitendraZaa/ToolingAPI30Min-AceEditor

Page 22: Create Salesforce online IDE in 30 minutes