Building better examples...

Version 1

    Overview

    The skeleton application that we generate using Jiveapps create (and also provide as part of the dev console app) is a great place to get started. However, there are a number of best practices and idoms that we need to do a better job of pointing out to developer and showing you "how it's done". We'll be addressing these in two parts. The first is to create a series of "vingettes"; small stand-alone examples that will show a specific technique, best practice, etc.. Next, we'll put these together into a more complete & well formed sample app. We'll do as much of this on the Jive Apps git hub as we can. Feel free to jump in and contribute!!

     

    Stuff to show...

    Here's a list of things that we need to demonstrate in the first pass. We'd love your feedback if you think we are missing something.

    Many of these code examples will have "gists" associated with them at the Jive Apps GitHub.

     

    When you see the app icon jiveappiconsmall.png, you can use the the Jive code runner app to automatically load and execute them (after adding the code runner to your sandbox). Enjoy!

     

    Get

    Code

    Concept/API

    Illustration Points & Links

    BEST PRACTICE: Resource Checking PatternCheck for the methods on an object BEFORE invoking the operation
    BEST PRACTICE: Understanding privacy fieldsExplain what fields are available in
    BEST PRACTICE: Relative URLs
    BEST PRACTICE: Understanding Owner & ViewerThe code should call out the difference between owner and viewer.
    BEST PRACTICE: Getting the URL for the app for linking outside of jive

    See: https://developers.jivesoftware.com/community/message/1898#1898 common use case is to link from an outside property back to the app. Need to show how to get the app url that you can put in a browser and then be taken to canvas view.

    BEST PRACTICE: Checking to see if a user is enabledWe've had bugs raised b/c people don't check to see if a user is enabled.
    BEST PRACTICE: Make all emails opt-in

    Use a user preference to determine if emails should be sent to the user.

    BEST PRACTICE: How to embed an iframe w/in an app
    BEST PRACTICE:

    How to construct externally resolveable app links to a specific view. With view params.

    (Goshido - people invite, call back blank)

    jiveappiconsmall.pngGet viewer friendsSee: Get Viewer Friends
    Data Pipelining

    Make sure to include xml:ns is the script tag

    Preloadsigned fetch on preload
    Data Context
    ListenersAutomatically update views when data changes, e.g. a listener on updates.
    Preload
    Batch Requests
    Dynamic Height

    Working with viewport and dynamic height to avoid scrollbars

    Preferred Height
    Minimessage
    jiveappiconsmall.pngIterate over a collection of activites

    This will show how to retrieve a collection of activites for a user. It will also demonstrate how to use the iterator capability to work with collections.

    See: Activity Iterator

    jiveappiconsmall.pngJive UserSee: Get Jive USer
    jiveappiconsmall.pngPeople PickerSee: People Picker
    jiveappiconsmall.pngPlace Picker

    Make sure to include contentType parameter!

    osapi.jive.core.places.requestPicker({success : pickerHandler, contentType : "discussion" }); DOC_LINK_REQ 5.0.2 PlacePicker requires contentType parameter!

    jiveappiconsmall.pngCreate a private discussion
    jiveappiconsmall.pngCreating a discussion

    Best Practice: Resource checking pattern

    jiveappiconsmall.pngCreating a documentSee: "Create document with attachment"
    jiveappiconsmall.pngGet documents and commentsSee: Get documents and comments
    jiveappiconsmall.pngPost a basic activity to What Matters (WM:A)See: What Matters: Activity (Part I Basic)
    jiveappiconsmall.pngPost a more complete WM:ASee: What Matters: Activity (Part II: Intermediate)
    Posting Activities to WMUsing roll up (Not authorized to view the specified discussion 2511)
    Posting Notifications
    Posting Actions w/link back to app
    Using the search API
    Using ViewsExplain how sub views get combined if inline in the app.xml
    jiveappiconsmall.pngUser preferencesSee: User preferences
    Custom User Prefs
    App data
    OpenSocial Templates & OSML

    Show auto update on templates. Show require for data context.

    Make sure to point out adding the namespace

    Custom tag libraries (JAML & app defined)
    Jive Templates with theme roller (need legal approval for license)
    Working with binary content -- file upload
    Working with images, e.g. relative URLs
    Integrating with a third party service, e.g. twitter, YUI, LinkedIn Public API
    Working with the org chartBest Practice: Resource checking pattern
    Show difference between friends, followers, following
    Sharing via the share API
    Get supported fieldsHow to introspect on the instance
    Tabs(lower priority) Is this really used? They are pretty "un-styled" compared to something like jquery.
    Skins(lower priority) Does this have any value?

     

     

    Next Step 2: Incorporating a Home Server

    The next step is to add a home server to our sample app. We'll make it easy to setup the server so you can see what's going on. Again, let us know if there's anything else you'd like to see in here.

     

    Concept/API

    Illustration Points & Links

    BEST PRACTICE: Signed FetchAll remote requests should be signed.
    BEST PRACTICE: User MappingDo not use email as the user identity--use jive instance id + jive user id
    Proxied content

    Tie into auto-provisioning of users/billing.

    Dynamic business logic based on what's sent to the home server, e.g. produce a map of where everyone is based on location.

    Application Lifecycle Events
    Incorporating Flash
    Internationalization
    Posting activities via app gateway