HTML Style App Artifact

Version 1

    Overview

    Developers are now able to to programmatically drop arbitrary HTML into the RTE as part of an !App Experience artifact drop.

     

    Summary of workflow:

    1. User !apps an app
    2. The app retrieves or otherwise specifies HTML to drop
    3. The app calls osapi.jive.core.container.editor().insert(...) to close the embedded experience and drop the specified HTML into the RTE

     

    Example 1

    Below is an example of directly specifying the HTML to be dropped:

     

    osapi.jive.core.container.editor().insert("<table><tr><td><b>Some markup!</b></td></tr></table>");

     

    An editor object is fetched by calling container.editor(), and to insert the HTML, the insert function is called with the raw HTML.

     

    Example 2

    Below is an example of retrieving HTML from an existing Jive content object (in this case a document), getting its HTML, and then dropping that to the page:

     

    var docId = 1801;

    osapi.jive.core.documents.get({id: docId}).execute(function(response) {

        var html = response.data.content.text;

        osapi.jive.core.container.editor().insert(html);

    }