Deploy a Sample Project to Your Org
Use the Salesforce CLI to copy all project components to your org.
-
Download the Salesforce Durable Streaming Demo.zip file
from the developerforce github repository.
You can browse the contents of the project at https://github.com/developerforce/SalesforceDurableStreamingDemo. The sample app contains two Visualforce pages with related components and some common components. These common components are installed in your org when you deploy the .zip file.
Component Description cometdReplayExtension Static resource representing a CometD extension in JavaScript. This extension implements the replay mechanism for Streaming API. cometd, jquery, jquery_cometd, json2 Static resources for CometD 3.1.0, jquery, and JSON. These app components are for the Durable PushTopic Streaming page.Component Description DurablePushTopicEventDisplay A Visualforce component that uses the CometD extension cometdReplayExtension to replay events. The extension handles the handshake and subscribe calls and sets replay options. Having the replay functionality in a Visualforce component allows you to add it to your Visualforce page for reuse in your app.
DurablePushTopicStreamingController Apex controller that holds the logic behind the Visualforce page. DurablePushTopicStreamingDemo Visualforce Page Visualforce page. This page is the main page you use to generate, view, and replay durable PushTopic events. These app components are for the Durable Generic Streaming page.
Component Description DurableGenericEventDisplay A Visualforce component that uses the CometD extension cometdReplayExtension to replay events. The extension handles the handshake and subscribe calls and sets replay options. Having the replay functionality in a Visualforce component allows you to add it to your Visualforce page for reuse in your app.
DurableGenericStreamingController Apex controller that holds the logic behind the Visualforce page. StreamingChannel Custom object used for creating streaming channels. DurableGenericStreamingDemo Visualforce Page Visualforce page. This page is the main page you use to generate, view, and replay durable generic events. DurableStreamingDemo Permission Set Permission set used to grant read and create access to the StreamingChannel sObject. You use the Salesforce CLI to migrate the zip file to your org.
- To download and install the Salesforce CLI, see Install Salesforce CLI in the Salesforce CLI Setup Guide.
-
To log in to your org, enter this CLI command in a Terminal window, and then log in via
the web browser.
sf org login web
-
To deploy the zip file that you downloaded, enter this CLI command. Replace
<Path to zip file> with the path to the zip that you downloaded,
and replace <Username> with your org’s username.
sf project deploy start --metadata-dir <Path to zip file> -o <Username>
After the command executes, it prints out a list of the components that were deployed to your org.