12.07.2015 Views

Database.com Metadata API Developer's Guide - Salesforce.com

Database.com Metadata API Developer's Guide - Salesforce.com

Database.com Metadata API Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

USING METADATA <strong>API</strong>Chapter 3Deploying and Retrieving <strong>Metadata</strong>Use the deploy() and retrieve() calls to move metadata (XML files) between a <strong>Database</strong>.<strong>com</strong> organization and a localfile system. Once you retrieve your XML files into a file system, you can manage changes in a source-code control system,copy and paste code or setup configurations, diff changes to <strong>com</strong>ponents, and perform many other file-based developmentoperations. At any time you can deploy those changes to another <strong>Database</strong>.<strong>com</strong> organization.Note: The Force.<strong>com</strong> IDE and the Force.<strong>com</strong> Migration Tool use the deploy() and retrieve() calls to movemetadata. If you use these tools, interaction with <strong>Metadata</strong> <strong>API</strong> is seamless and invisible. Therefore, most developerswill find it much easier to use these tools than write code that calls deploy() and retrieve() directly.Data in XML files is formatted using the English (United States) locale. This ensures that fields that depend on locale, suchas date fields, are interpreted consistently during data migrations between organizations using different languages. Organizationscan support multiple languages for presentation to their users.The deploy() and retrieve() calls are used primarily for the following development scenarios:• Development of a custom application (or customization) in a test database organization. After development and testing is<strong>com</strong>pleted, the application or customization is then deployed into a production organization using <strong>Metadata</strong> <strong>API</strong>.See Also:<strong>Metadata</strong> Components and TypesWorking with the Zip FileThe deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest(package.xml) that lists what to retrieve or deploy, and one or more XML <strong>com</strong>ponents organized into folders.Note: A <strong>com</strong>ponent is an instance of a metadata type. For example, CustomObject is a metadata type for customobjects, and the MyCustomObject__c <strong>com</strong>ponent is an instance of a custom object.The files retrieved or deployed in a .zip file may be unpackaged <strong>com</strong>ponents that reside in your organization (such as standardobjects), or packaged <strong>com</strong>ponents that reside within named packages.Note: <strong>Metadata</strong> <strong>API</strong> can deploy and retrieve up to 5,000 files at one time. While a specific file size limit is notenforced, you might encounter out-of-memory errors for very large files.Every .zip file contains a project manifest, a file named package.xml, and a set of directories that contain the <strong>com</strong>ponents.The manifest file defines the <strong>com</strong>ponents you are trying to retrieve or deploy in the .zip file.14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!