Tile API & Development FAQ

Version 22

     

    Tiles API

    Use of the Tile's API requires inclusion of the tile library within your Tile's defintion.json as a feature of the loaded Custom HTML Tile's "view" and/or "configuration" file as described in https://community.jivesoftware.com/docs/DOC-141800#jive_content_id_Tile_Features.

     

    jive.tile.getContainer()

    Resolves the current place object, if any, and passes the related Core V3 object to the suppied callback function. Only available to UIs that are presented on a place page.

    jive.tile.getContainer((container) =>{
      
    });
    

     

    jive.tile.getIdentifiers()

    Returns the Jive instance, viewer, and container identifier ID's.
    jive.tile.getIdentifiers((identifiers) =>{
    
    });
    

     

    jive.tile.onOpen()

    Event listener which is subscribed to the tile's load and executes callback, passing in two objects as parameters--one containing the configuration data and the other containing the tile options. Typically used to load the configuration data to the config view or the main view object.

     

    NOTE:

    In the configuration view, the config object will contain all saved parameters in the config.data object.

    In the view's view, the config object will contain all saved parameters in the config object.

    jive.tile.onOpen((config, options)=>{
    
    });
    

     

    jive.tile.onClose()

    Event listener which is subscribed to the tile's close and executes the callback when triggered; takes up to two objects as parameters--one containing new/updated configuration data and the other containing the tile options.

     

    NOTE:

     

    jive.tile.onClose((config, {}) =>{
    
    });
    

     

    jive.tile.getOAuth2CallbackUrl()

    Returns OAuth 2.0 callback URL as defined in the add-on's jiveclientconfiguration.json file.
    jive.tile.getOAuth2CallbackUrl();
    

     

    jive.tile.doAction()

    Creates a fly-out type of pop-up (similar to how the configuration shows up) that expands some of the Custom View Tile's UI. The view that loads is the action URL as defined (see tile action doc for a definition.json file example)

    • Dom element is an instance of HTMLElement or JQuery object in your view that when clicked triggers the action window to show.
    • Context is the context that is passed into the new action window's onOpen() method.
    jive.tile.doAction({dom element},context);
    

     

    jive.tile.close()

    Closes the current view, returning the passed data or configuration object. Tile configuration UI can pass sample data to show to the user while they are editing the page.

    This is not available to Custom View Tiles.

    jive.tile.close(function (data, sampleData){});
    

     

    jive.tile.getContent()

    Resolves the current content object, if any, and passes the related Core V3 object to the supplied callback function.
    jive.tile.getContent((content) =>{
    
    });
    

     

    jive.tile.getAddonServiceURL()

    Returns the URL of the installed Add-on.
    jive.tile.getAddonServiceURL(function (obj){});
    

     

    jive.tile.openOAuthPopup()

    TODO: Listing for comprehensiveness, but need to document
    see gadgets.oauth.Popup()
    jive.tile.openOAuthPopup(URL, windowOptions, function(openCallback){}, function(closeCallback){});
    

     

    jive.tile.getTicketId()

    Returns OAuth Ticket ID from some services.
    jive.tile.getTicketId(function (obj){});
    

     

    jive.tile.getPrivateProps()

    See: Private Properties and Extended Properties for Jive Tiles

    jive.tile.getPrivateProps(function (obj){});
    

     

    jive.tile.updatePrivateProps()

    See: Private Properties and Extended Properties for Jive Tiles

    jive.tile.updatePrivateProps(function (obj){});
    

     

    jive.tile.getExtendedProps()

    See: Private Properties and Extended Properties for Jive Tiles
    jive.tile.getExtendedProps(function (obj){});
    

     

    jive.tile.updateExtendedProps()

    See: Private Properties and Extended Properties for Jive Tiles
    jive.tile.updateExtendedProps(function (obj){});
    

     

    Custom View Tiles w/ Gala Enabled

    Since Gala uses a different domain from your Jive instance and Custom View Tiles are—like all Add-ons—loaded in an iFrame, there are browser restrictions on accessing the parent container. These functions will help get the URL's that would otherwise not be visible. The Gala service MUST be enabled:

     

    gala

    Returns an empty Object. Useful for checking if Gala service is enabled from within the Custom View Tile.
    gala;
    
    

     

     

    jive.tile.getJiveURL()

    Returns the URL of your Jive instance
    jive.tile.getJiveURL();
    

     

    jive.tile.getAppURL()

    Returns the URL of the Custom View Tile.

     

    Useful for loading assets with absolute paths.

    jive.tile.getJiveURL();
    
    

     

    OSAPI API

    Access container data and functionality provided by the Open Social API's for your tile instances. More examples can be found Using the OpenSocial API .

     

    osapi.http.{{verb}}()

    Allows the tile to make a standard HTTP requests. Returns a object containing details of request to callback after the request has been made.

     

    Allowed verbs: HEAD, GET, POST, PUT, DELETE

     

    Official documentation: Osapi.http (v0.9) - OpenSocial Documentation - OpenSocial Wiki

    For POST request examples, check out: How to POST to a Service from a Tile

    osapi.http.{{verb}}(
       'href' : {{ request url}},
       'headers' : {{headers}},
       'body' : {{body}}
    ).execute(function (response){
       // Any code you want here, including checking for success with response.error
    });
    

     

    osapi.http.{{verb}}() - SIGNED

    By providing a "authz" field with a value "signed" adds the Jive Signature header to the request for validation of HTTP requests to ensure authenticity for the request to be coming from the Jive instance.
    osapi.http.{{verb}}(
       'href' : {{request url}},
       'authz' : "signed",
       'headers' : {{headers}},
       'body' : {{body}}
    ).execute(function (response){
      // Any code you want here, including checking for success with response.error
    });