Step 3: Create the Static Resources

  1. Download this static resource .zip file: streaming_api_interactive_visualforce_demo-v40.zip

  2. Extract the following files from the .zip fle:

    File NameDescription
    cometd.zipFiles for CometD version 3.1.0 and the Dojo toolkit used by demo.js. When you define a .zip archive file as a static resource, Visualforce can access the files in that archive. The .zip file becomes a virtual file system.
    demo.cssThe CSS code that formats the Visualforce page.
    demo.jsThe code used by the page to subscribe to the channel, receive and display the notifications, and unsubscribe from the channel.
    json2.jsThe JavaScript library that contains the stringify and parse methods.
    StreamingApiDemoThe Visualforce page that displays the Streaming API notifications.
  3. From Setup, enter Static Resources in the Quick Find box, then select Static Resources to add the extracted files with the following names:

    File NameStatic Resource Name
    cometd.zipcometd_zip
    demo.cssdemo_css
    demo.jsdemo_js
    json2.jsjson2_js