using code share projects in force.com

19
Using Code Share Projects in Force.com Quinton Wall: salesforce.com Richard Vanhook: EDL Consulting Developers

Upload: salesforce

Post on 23-Jan-2015

1.813 views

Category:

Documents


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Using Code Share Projects in Force.com

Using Code Share Projects in Force.com

Quinton Wall: salesforce.comRichard Vanhook: EDL Consulting

Developers

Page 2: Using Code Share Projects in Force.com

Safe HarborSafe 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 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, 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-K for the most recent fiscal year ended January 31, 2010. This documents and others 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 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.

Page 3: Using Code Share Projects in Force.com

What is Code Share?

http://developer.force.com/codeshare

Directory of Open Source Projects for Force.com

Commit. Share. Rate. Comment.

Page 4: Using Code Share Projects in Force.com

Using Code Share Projects

Search for Projects– Top Rated

– Latest Added

– All Projects

Stay Up to Date– RSS of Latest Projects

Rate & Comment– Reviews help everyone!

Page 5: Using Code Share Projects in Force.com

Installing Code Share Projects

As A Package

Via Code Repository– Eclipse plugins available (subclipse, egit etc.)

Page 6: Using Code Share Projects in Force.com

How to Start a Project – Share the Love

Login with your DE account

Create a new Project

Link it to a web code repository– Google Code etc.

Add Project Members

Add Articles and Docs.

Keep it up to date

Blog & Tweet it.

http://wiki.developerforce.com/index.php/

Creating_a_Code_Share_Project

Page 7: Using Code Share Projects in Force.com

Enough Talk….Let’s see a Project in Action!

Page 8: Using Code Share Projects in Force.com

apex-lang Overview

A collection of just over 100 apex classes aimed at

making core Apex/VF programming easier

Consists of only code - no objects, pages, etc

Has 100% code coverage

Project Website:

http://code.google.com/p/apex-lang/

Documented via my blog richardvanhook.com

Contributions are certainly welcome! Contact me at

[email protected] or post suggestion

on my blog.

Page 9: Using Code Share Projects in Force.com

Install Options

Install the Managed Package– Easiest install option but of course, the code is hidden

– All classes must prefixed with al; example: al.StringUtils

Directly add source code– Download source zip file and expand into eclipse src/classes

Just copy & paste what you need!– Use apex-lang as reference

From http://code.google.com/p/apex-lang/

Page 10: Using Code Share Projects in Force.com

String Manipulation

Use StringUtils

Ported directly from Apache Commons Lang therefore Javadoc for

StringUtils.java very much applies. (see

http://commons.apache.org/lang/api-2.5/org/apache/commons/lang/StringUtils.html

)

Examples:– All methods follow “null safe” pattern

– Empty/Blank checks: • isEmpty(), isBlank(), isNotEmpty(), isNotBlank()

– Joining Strings: • new List<String>{'a','b','c'} to 'a:b:c’

– Filtering characters

Page 11: Using Code Share Projects in Force.com

Pagination

Modified to utilize apex-lang paginationController:global class MyController implements SObjectPaginatorListener { global List<Account> records {get;private set;} global SObjectPaginator paginator {get;private set;} global MyController(){ paginator = new SObjectPaginator(5,this); paginator.setRecords([select name from Account limit 100]); } global void handlePageChange(List<SObject> newPage){ if(records == null){records = new List<Account>();} records.clear(); if(newPage != null && newPage.size() > 0){ for(SObject record : newPage){ records.add((Account)record); } } }}

VF Page:<apex:page controller="MyController"> <apex:repeat value="{!records}" var="record"> <apex:outputText value="{!record.name}"/><br/> </apex:repeat> <apex:form > <apex:commandLink value="Previous" action="{!paginator.previous}"/> &nbsp;&nbsp;|&nbsp;&nbsp; <apex:commandLink value="Next" action="{!paginator.next}"/> </apex:form> </apex:page>

Page 12: Using Code Share Projects in Force.com

Pagination

Page 13: Using Code Share Projects in Force.com

SOQL Builder

Use SoqlBuilder.cls and supporting classes

Useful for dynamically creating SOQL query strings

Think: String soql = new SoqlBuilder().fromx('Account').toSoql()

List<Account> a = Database.query(soql);

Instead of: String soql = 'select id from Account';

List<Account> a = Database.query(soql);

Above example is intentionally simplified – real world use cases for

SoqlBuilder more complex

Not intended as replacement for static query strings:List<Account> a = [select id from Account];

Page 14: Using Code Share Projects in Force.com

Recap & Summary

Before coding, search

CodeShare!

Take time to rate, commit,

and commit!

Apex-lang rocks man

Share the love!

Page 15: Using Code Share Projects in Force.com

Helpful Links

Code Share Home Page– http://developer.force.com/codeshare

Creating a Code Share Project Article– http://wiki.developerforce.com/index.php/Creating_a_Code_Sh

are_Project

Eclipse/Force.com IDE Plugins:– Subclipse (SVN): http://subclipse.tigris.org/

– eGit (GIT): http://www.eclipse.org/egit/

Apex-Lang Project Home Page– http://bit.ly/apexlang

Page 16: Using Code Share Projects in Force.com

Using Code Share Projects in Force.com

Page 17: Using Code Share Projects in Force.com

D I S C O V E R

Visit the Developer Training and Support Booth in Force.com Zone

Discover

Developer

Learning Paths

Developer training, certification and support resources

S U C C E S SFind us in the Partner Demo Area of

Force.com Zone 2nd Floor Moscone West

that help you achieve

Learn about Developer

Certifications

Page 18: Using Code Share Projects in Force.com

Remember. . .

Check Chatter for additional session information

Get your developer Workbooks and Cheat Sheets in

the Force.com Zone

Visit for more information related

to this topicDon’t forget the survey!

Page 19: Using Code Share Projects in Force.com

How Could Dreamforce Be Better? Tell Us!

Log in to the Dreamforce app to submit

surveys for the sessions you attendedUse the

Dreamforce Mobile app to submit

surveysEvery session survey you submit is

a chance to win an iPod nano!

OR