Share and collaborate on open-access Force.com development projects

With the new Force.com Code Share, developers across engineering organizations – or around the world – can collaborate on the development, testing and deployment of their PaaS applications. Code Share lets developers store the definitions of their Force.com applications in source control, and deploy those applications in their Developer Edition, Force.com Sandbox or production environments. Integrating with most standards-based source control management systems including CVS, Subversion and Google Code, Force.com Code Share enables developers and IT professional to apply full Application Lifecycle Management to Force.com applications. Force.com IDE and Code Share are currently in Developer Preview.


Code Share Project List

We've seeded Google Code with an initial set of open-source projects -- follow the instructions below to get started with any of these.

  • Force.com Blogging App: This code demonstrates how to create a simple blog application using Visualforce. It shows several interesting uses of Visualforce, including rich text widget from Yahoo, onload events in the page, custom controller, on-click and action complete handlers, one in javascript and the other inside a custom controller.


  • Recruiting App: This project includes the code for the employee recruiting application referenced in the book 'Creating On-Demand Applications with Force.com'.


  • Paid Time-Off Manager: This is a complete Time Off request and management application that leverages powerful Platform features such as approval processes. Please note that approval processes are not yet supported by the metadata API and this part of the app will need to be manually setup.


  • ContactData: The contact manager is an example of a custom user interface built with Visualforce , which looks nothing like the standard salesforce.com interface. This interface contains a search box and tag cloud built with Apex code. A good example to start with when building an "outside the box" user interface in Visualforce. Uses standard objects Contact and Account, adds a few custom fields to hold tags


  • SocialForce: As one of the initial OpenSocial "containers" or host sites, salesforce.com has been working closely with Google and our platform partners to rollout an initial set of tools, code and demos that allow developers to build social apps for the enterprise using the Force.com platform and OpenSocial APIs. We've decided to open-source the Apex container code on Google Code so the entire community can contribute improvements to it over time.



Prerequisites

Before proceeding to check-out a project, please note that these instructions assume you have the Force.com IDE installed and are familiar with the basic functionality of Eclipse. If not, take some time to become familiar with both before proceeding to check-out source code from a hosted repository. The Code Share feature is currently in Developer Preview.

In addition, these steps require that you have installed the Eclipse plug-in that adds support for Subversion revision control system, also known as SVN. Because this is an important feature, please install the subclipse add-in and become familiar with the documentation it provides. If you have used SVN in the past, you may be able to install the subclipse add-in and proceed with the following steps.


Install Subclipse

Follow the instructions here: http://subclipse.tigris.org/install.html

  • Be sure to uncheck Integrations containing Buckminster and Subclipse Integration for Mylyn during the plugin installation.
  • If this is the first time you have used SVN, please read the supporting documentation that comes with the Subclipse add-in



Checking Out a Project

The next step is to pick a project to checkout. These instructions will use the Mileage Tracker application from the Tour de Force lab.

Locate a Repository and Checkout

Steps to Checkout

  1. In eclipse, choose the SVN Repository Exploring perspective in the upper right-hand corner.
    • If this is not available, go to the Windows menu, Open Perspective, and Other.
  2. Right-click in the SVN Repository Explorer and select New → Repository Location
  3. Specify the URL of the repository:
    http://mileagetracker.googlecode.com/svn/trunk/

    If you have commit privileges, use https://mileagetracker.googlecode.com/svn/trunk/ instead. You will need to enter the appropriate credentials.
  4. Click Finish.
  5. Expand the SVN repository until you see the mileageproj folder.
  6. Right-click on the mileageproj folder and choose Checkout.


  7. Select "Check out as a project in the workspace". Accept the other defaults and click "Finish".
  8. Now switch to the Force.com perspective in the upper right-hand corner.
    • If this is not available, go to the Windows menu, Open Perspective, and Other.
  9. In the Package Explorer, expand the mileagetracker folder to verify that you have the following:
	src/unpackaged/applications/Mileage Tracker.app
	src/unpackaged/classes/MileageUtil.cls
	src/unpackaged/classes/MileageUtil.cls-meta.xml
	src/unpackaged/objects/Mileage__c.object
        src/unpackaged/profiles/ (an assortment of profiles)
	src/unpackaged/tab/Mileage__c.tab
	src/unpackaged/triggers/MileageTrigger.trigger
	src/unpackaged/triggers/MileageTrigger.trigger-meta.xml
        src/unpackaged/package.xml

You should now have a Force.com project with the Mileage Tracker source code.

Synchronizing artifacts from your org

  1. Right-click your project folder and select Force.com / Synchronize with Server.
  2. Click “Yes” to switch to the Team Synchronizing perspective.
  3. In the Synchronize view, expand the nodes of your project to view the artifacts that are ready to be synchronized from the server to your Force.com IDE project.
  4. Right click on your project folder and Apply Server to Project.


Sharing a Project

How to Post a Code Share project

Create a new google code repository:

  1. Navigate to http://code.google.com
  2. Choose Project Hosting
  3. Click on “Create a new project”
  4. Specify the following:
    Project Name: <yourprojectname>
    Summary: <yoursummary>
    Description: <yourdescription>
    License: <yourlicense>
    Labels: apex, mileage, tracker
  5. Click “Create Project”
  6. Click on Source Tab. Note the URL for SVN access and your username
  7. On the same page, click on googlecode.com password to get your SVN password



Create a reference to your google code SVN Repository

  1. Open your project
  2. Choose the SVN Repository Exploring perspective in the upper right-hand corner.

    If that is not available, go to the Windows menu, Open Perspective, and Other.
  3. Right-click in the SVN Repository Explorer and select New → Repository Location
  4. Specify the URL of the repository:

    https://mileagetracker2.googlecode.com/svn/trunk
  5. Click “Finish”
  6. When prompted, enter your credentials for the repository. Be sure to check Save Password”


Associate your Force.com project with the SVN Repository

  1. If you're not already, switch to the Force.com perspective.
  2. Right-click on the project and select Team → Share Project
  3. In the first step of the wizard, choose SVN
  4. In the second step, choose a SVN repository location.
  5. In the third step, choose “Use specified folder name” and specify mileageproj.
  6. Click “Finish”
  7. Another window will pop up listing all the files in your project that can be added to SVN.
  8. It is VERY IMPORTANT! to uncheck following files before proceeding:
.settings/com.salesforce.ctoolkit.prefs
References Packages
 Salesforce.schema

Including these files will prevent you and others from checking out the project using the New Project Wizard and also store your org settings (i.e., username).

Accept the remaining files and click “OK” to commit them to SVN.