Your First App in 5 Minutes!

Version 2

    Overview

    As we get started with our first app, you went through the Hey, I'm new here, how do I get started? document. Here, you had to choose the proper tool to use for working with a Jive App based its initial target audience. While the actual coding of the app will be the same for the rest of the chapters, how you setup the initial app structure and template varies slightly based on the tool you've chosen to use. This document is broken into two parts, one for the Dev Console and one for the Command Line Tools. Regardless of your chosen path, you'll be up and running in under five minutes!

     

     

    Using the Dev Console

    If you are using the Dev Console, the key step here is to use the updated application template for 6.x versions of Jive. You can find the 6.0 template here: Jive App Template.

    Once you get the new template, simply extract it to a location on your system where the app.xml can be served up and resolved by the Jive instance. Once you have the new url, you can add it to your instance following the instructions in the Developing internal local Jive Apps - using the Dev Console app document.

     

     

    Generating Your First App Using the Command Line Tools!

    When you use the Command Line Tools, you will generate an app template rather than download one from the tool.

    (Note: There is a temporary step, 3.1, that you need to follow to get the 6.0 app template.)

     

    1. Choose a short-name for your app.

    Think of the app short-name like a domain name. You want it to be easily typed and memorable for a user. When a user is using the canvas view of your app, the short-name will appear in the URL in this format:

    http[s]://<jive-instance-hostname>/apps/<app-short-name>

    • NOTE: This is a one-time decision.  The shortname you choose for your app cannot be changed at a later time.
    • If your app has a website with a domain name, you probably want to name your app to match (without the TLD, no periods (.) are allowed). So if you're "netflix.com", you would want your app short-name to be "netflix".
    • NOTE: App short-names must adhere to the following conventions:
      • 5-127 characters long
      • all lowercase letters
      • starts with a letter
      • may contain numbers, dashes, or underscores
      • Regex: ^[a-z][a-z0-9-_]{4,126}$

     

    2. Create your app via the command line. For example, if you wanted your app short-name to be "yourapp", you would type:

    $ jiveapps create yourapp        # NOTE: Substitute your own app short-name for "yourapp" 

     

    • The first time you run this command, you need to enter your Jive Apps Developer Community credentials. DOC_UPDATE_REQ
    • You may also be prompted to accept appshosting.jivesoftware.com as a known host. Type yes and continue.

     

    3. Note your app URLs and OAuth credentials. At the end of the success message, you see the App URL that you'll need to use in Jive to make sure your app shows up:

     

    Congratulations, you have created a new Jive App!
    =================================================
    Git URL:              git@apphosting.jivesoftware.com:yourapp.git
    App URL:              http://apphosting.jivesoftware.com/apps/dev/yourapp/app.xml

    OAuth Consumer Key:    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    OAuth Consumer Secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    Note: The command line tools are in the process of being updated. Because we have multiple sandboxes, it's no longer necessary to print out the sandbox URL as this will be removed.

     

    3. 1 Use the Jive 6 Template

    Also, for Jive 6, we are renovating the app template to take advantage of the new capability in Jive 6. For developers on Jive 6, once you generate the app, you simply need to delete the generated contents (which is for Jive 5) and replace them with the contents from the new template. The new template is here: Jive App Template. Make sure to commit your changes to git to get the new template added.

    $ git add -A
    $ git commit -m 'your commit message here'
    $ git push jiveapps master

    • Note: If you created an SSH key with a passphrase in the prerequisite section, you will need to enter the passphrase when you do the push. If you did not add a passphrase to your SSH key, you will not be prompted.

    Note: In the other tutorials, when we say "publish your app", what this means is to commit your changes to git so that they can be read by the Jive instance when the app is refreshed.


    4. View the app in the browser.

    You will now be able to add the app to the Jive App 6.0 sandbox.

    Once you log in, select "Apps" from the menu bar.  In the quick launcher, click on the "Jive Apps Market" link on the bottom right of the window. You will be prompted with the "app loader" tool. Simply enter the URL that was provided to you from the command line tools.

    adding app to quick launcher.jpg

     

    When you reopen the quick launcher, you should see your app!

    Screen Shot 2012-10-01 at 3.06.45 PM.png

    Clicking on your app's icon will take you to the canvas view!

     

     

    Conclusion

    That's it! Your first Jive App in under five minutes! Now that we've got a working app, let's dig down deeper and understand how it all works. You can move on to Chapter 2: Understanding the app.xml.