Skip navigation

So I've started to combine some of my code snippets into a project, and have published it on github here: pokeshot/JiveDotNetSDK · GitHub

 

This is most certainly work in progress. Currently it consists of the (partial) object model and the code for request validation for signed requests coming from Jive going to a WebAPI endpoint.

 

I would like to get some feedback from the developer community on the format of the project going forward

 

  • keep as is, as a collection of individual code pieces, with eventually better documentation
  • convert it into a regular ASP.Net web application (likely MVC and WebAPI) and implement a full sample app

 

I'd really like to get your feedback on this.

 

Upcoming things that I will add, once I clean things up:

  • OAuth dance for getting client credentials for using the REST Api
  • Webhook support
  • Add-on registration WebAPI controller (this depends on the feedback to my question above)
  • Request validation for MVC Views
  • Language/i18n support (Jive apps do not use the standard language headers)
  • Code for registering tiles and pushing data to them
  • Code for consuming data from the data export API

 

Let me know if I am missing anything.

It's that time of year again, the time for JiveWorld!  Last year, JiveWorld attendee feedback couldn’t be more clear:  more developer stuff!   More developer sessions, more chances to learn from Jive engineering and more opportunities to meet others extending and developing on the Jive platform.  This year, we are proud to announce the JiveWorld14 – Developer Conference (in a conference), and its packed with an agenda that will keep any developer wired for 3 days straight!  So check out the details below and dont forget to Register Today as a Developer for JiveWorld14!

 

Developer Conference Keynote

matt-mccullough-400x400.jpeg

Matthew McCullough is an energetic 15 year veteran of enterprise software development, open source education, and co-founder of Ambient Ideas, LLC, a Denver consultancy. Matthew currently is VP of Training at GitHub.com, author of the McCullough and Berglund on Mastering Git - O'Reilly Media series, speaker at over 30 national and international conferences, author of three of the top 10 DZone RefCards, and President of the Denver Open Source Users Group.

 

His current topics of research center around project automation: build tools (Gradle), distributed version control (Git, GitHub), Continuous Integration (Jenkins, Travis) and Quality Metrics (Sonar). Matthew resides in Denver, Colorado with his beautiful wife and two young daughters, who are active in nearly every outdoor activity Colorado has to offer.

 

As avid fans of his work at OSCON and in the GitHub community, we are extremely excited to have Matthew speaking this year to kick-off our developer conference!

 


 

Double the Developer Sessions & Jive Engineering Access

With Jive's platform capabilities growing each year, it just makes sense for us to equally increase the exposure at our largest developer event of the year.  This year's JiveWorld14 Developer Conference consists of 15 sessions spread across 2 days that cover every facet of Jive Add-On development.  These sessions are led by Jive engineers who excel in their mastery of the following topics (respectively):

  • Core REST API
  • Tiles, Streams & Templates
  • Jive Apps
  • Analytics w/the Data Export Service
  • Mobile SDK (iOS & Android)
  • Cartridges w/Jive Anywhere
  • External Storage Framework
  • Producteev - Task Management API

By popular demand, we will also have our experts there to talk about best practices and strategies for integrating Sharepoint & Office 365 with the Jive Platform!

 

In addition to having sessions, the Jive Developer Hacker Lounge will be staffed by the same engineers throughout the JiveWorld14 Developer Conference.

 

Have a question about one of the presentations, or perhaps your own integration idea? Stop by the Hacker Lounge to get your questions answered! 

 


 

2 x Hackathon Experience:  Open Hackathon & Beer Dark 30

Back by popular demand, the JiveWorld14 Open Hackathon* will take place in the Hacker Lounge, Tuesday, October 21st, 2014.

 

Have a project you'd like to hack on with the experts?

Or, perhaps you'd like to work with us to build out some of our Open Source initiatives on GitHub, such as:

 

Note: We will also open up the ability for remote developers to hack along with us using GitHub and the Jive Community.**

 

Get your best work done late at night? 

 

So do we!  Hence our Beer Dark 30* event that takes place from 9pm - 1am on Wednesday, October 22nd, 2014. You're a developer in Vegas, what else would you do late at night beside eat pizza, drink beer and code?
(dont answer that)

 

And as if you needed yet even more reasons to attend the JiveWorld14 Developer Conference ...

 

30+ Chances To Win a new bttn

bttn_how.png

 

Meet the bttn - the simplest internet user interface in the world

  • A stand-alone physical push button that connects to the internet
  • Simply press the bttn and your Magic Happens™

 

We will be giving away 30+ of these awesome internet gadgets to developers who come to the JiveWorld14 Developer Conference and participate in the fun developer challenges at the Hackathon's and Hacker Loungers.  There will be lots of opportunities to win for developers of all skill ranges, so whether you are a novice or a veteran ... we've got you covered!

 

So in true #BeerJS fashion, simply bring your laptop and a healthy appetite for coding, pizza, fun and beer and you are ready to get the most out of the JiveWorld14 Developer Conference!

 


 

Stay tuned to the Developer community for more details about registration for the developer events.

Learn more about Developer Agenda here, and dont forget to Register as a Developer Today!

 

Let's See You At JiveWorld14 Developer Conference ... And Let's Brew Up Something Awesome ... Together!

 

 

* Both events are FREE (to JiveWorld registrants), we simply ask that you register so we can accurately order the Beer and Pizza! (registration details coming soon)

** Remote participation limited to the Open Hackathon ONLY.  (remote participation details coming soon)

So I recently stumbled across this video I had uploaded to Youtube a few years back. I had completely forgotten about it.

This was in the Jive 3.0 or 4.0 days, I believe.

 

So this was a document browser for Jive, I wrote using an awesome, but sadly mostly forgotten technology from Microsoft, called Pivot (Microsoft Live Labs Pivot - Wikipedia, the free encyclopedia). Pivot was based on the same technology as Photosynth, and allowed you to do some amazing things with large datasets. It allowed you to start with datasets of thousands or even ten thousands of elements and drill down into or filter them on the fly, using a positively Minority Reportesque UI.

 

While this is not really that relevant from todays point of view, I still think that maybe, just maybe, this little project of mine influenced the cards-tiles interface for browsing people, places and content in Jive 5 and beyond a tiny bit.

 

Watch the video below. It starts a little slow, but gets a lot shinier around the 3 minute mark. I've provided some technical details below.

 

 

From a technology point of view this was pretty involved, due to the lack of decent APIs on the Jive side at that point. It shows how far Jive has come when it comes to APIs.

 

The process went as follows:

  • Information about content was retrieved directly from the Jive database. This included titles, content, authors, tags, ratings and the place a content was stored in. This was pretty easy and fast. The largest dataset I've tried this with was around 3000 documents.
  • Any binary content was downloaded using the legacy XML based REST API that was available in Jive 3.0 and 4.0. Openclient, the first version of the current API came in 4.5. The reason for this was that the binary content is encoded in some weird undocumented way in the database.
  • Jive native content was converted to images using a tool that came with the Pivot SDK. Basically you defined an HTML template, pumped your Jive HTML content into it, and it would render it out as an image file that Pivot could use.
  • Binary content was converted into images using the incredibly awesome Apose libraries. They allow you to take any office format and convert it into a pixel perfect image or PDF. I wish Jive would use them instead of their OpenOffice solution. Sometimes when Jive has butchered another one of my Powerpoints, I dream of writing a replacement document rendering service using Aspose ;-) We are using their technology in our SmarterPath LMS for Jive and are very, very happy with it.
  • All of the data was mangled into a Pivot collection.

This was certainly done in a batch way. Processing a 1000 document dataset took 5 to 10 minutes on a laptop. The majority of the time converting HTML and Binaries to images.

 

Being a Silverlight based technology, Pivot isn't going anywhere. Pretty sad, in my opinion. Imaging the Jive people browser allowing you to drill down from 10.000 colleagues using faceted search in real time, without any browsing or paging. *Sigh*

 

I hope you liked this little trip down nostalgia lane. I have a few more silly examples like this, that I might post. If you don't see any value in this, let me know also.

beer-pints.pngA few weeks ago we announced some awesome winners in the Jive Developer Program - 2013-14 Recap, Achievements and Winners + 2014-15 Preview announcement, including:

 

Note:  We are still waiting to hear back from some of you on your prize selection, so if you haven't told me your Hue/Pebble color yet ... best to hurry up

 

Since announcing these winners, I've been hard at work putting together some ideas on how we can structure this year's developer program, and I wanted to take a moment to share with you some of the changes for this year that I've gotten set up.

 

What Are Pints & How to Earn Them

It's simple.  In addition to earning standard Jive Community points, for each contribution below you perform in the Developer community, you will also earn Pints.  Pints ... the official status-level point system of the 2014-15 Jive Developer Program!  The following developer pint missions have already been configured and activated in the Developer Community (as of 08/05/2014):

 

  • Ask Questions
    2 Pints / Question
  • Answering Questions
    20 Pints / Question
  • Marking Correct / Helpful Answers on your Questions
    5 Pints per Question
  • Attend Developer Webinar
    50 Pints per webinar attended
  • Attend JiveWorld Developer Conference
    250 Pints
  • Developer Blogging
    50 Pints per blogpost
  • Earning Jive Developer Expertise Badges via Announcing a Smarter Way To Do Jive Developer Training, or comparable subject expertise blogging.
    150 Pints/each skill
  • Liking Content - Liking awesome documents/blogs in the Jive Developer to help promote their visibility
    1 Pint (10 Max per Day)
  • Liked Content - Liked documents/blogs in the Jive Developer can earn the author more Pints
    1 Pint (100 Max per Day)

 

Bonus Pints

In addition to the above community participation, we also aim to award Pints for participation in any of our current and future open source projects on GitHub.  Some projects to consider are GitHub4Jive and JiveAnywhereCartridges (per  Announcing Jive Anywhere Labs)

  • Submit an Issue
    5 Pints
  • Fork an active jivesoftware Project
    10 Pints
  • Issue a Pull Request
    20 Pints

 

Note: For the short-term, these points will be manually curated; however, we will look for ways to automate them in the near future.  If you feel you are not getting the points for your contributions, please feel free to @mention me.

 

 

What Can I Do With Pints

I'm still working on this one, and would love to get some more feedback from you on what incentives Jive could offer to make your participation more engaging and fun.  We are going to look into the Developer Status Levels from last year, and most likely bring those back for 2014-15; however, when it comes to prizes, incentives, etc ... we are trying to think out of the box.

 

Some ideas we've considered:

  • Physical Prizes - Apple iWatch, bt.tn Cloud Ready Button, IoT Sensors/Actuators, Raspberry Pi gear
  • JiveWorld Experience - JiveWorld Developer Discounts & Special Access / Treatment
  • Onsite Hackathon Events - This is somewhat of a new idea, but if you were to attain enough Pints, then you could earn a free hack day with Mark / Ryan, where they will come onsite and sit down with your team of developers and hack on whatever projects that suits your fancy.  Maybe even a developer dinner with your team.  Very interested to hear feedback on this one. =)

 

With all that said, its time for people to start racking up the Pints in the Developer community! 
(see the quarterly leaderboard on the Developer community homepage)

 

JiveWorld14 Developer Conference - Register Today

JiveWorld14 Developer Conference in Las Vegas at the Cosmopolitan Hotel from October 21-23.  We'll have matthewmccullough from GitHub/OSCON keynoting our developer track, our annual hackathon and midnight hack sessions and cool developer gadgets giveaways from bt.tn. =)

Screen Shot 2014-07-22 at 09.51.20.png

I recently decided to try my hand at building a Jive App with some simple integration to one of our infrastructure provisioning tools called Foreman and I found that after following the Jive Developer training (which is an excellent way to get started, by the way) I still wasn't sure how to hook my app up to a third party API and use basic authentication.

 

Foreman itself is a fantastic open source tool which allows you to orchestrate the creation and configuration (via puppet or chef) of your VM's and physical infrastructure. In my organisation we use it to enable us to rapidly deploy development environments (host groups in foreman lingo, I use environments as a classification like production, pre-prod, dev etc).

 

The problem I am trying to solve, is to have a way for developers and managers to quickly see a list of environments that exist, the virtual machines which exist inside of those host groups and any IP addresses allocated to the server from within the Jive interface. I know that some of you might be uncomfortable with merging infrastructure tools with a social platform - but it's an experiment, it could work well or it could be awful - and there is only one way to find out!

 

Prerequisites

 

Before you begin this tutorial you will need to have the jive node sdk installed, have access to the jive developer sandbox or an on-prem development instance and have access to a foreman instance. My intention is that this could be used to access any tool with a REST API inside your organisation so feel free to swap and change as appropriate.

It would also help if you are familiar with deploying Jive Node SDK Add-ons - Getting Started > Deploying a Jive Node SDK Project as an Add-On

 

Where to begin?

 

Ok, so we know that our problem is to display a list of host groups and the hosts that they contain from within a Jive App so that our developers and managers can easily access the information from a unified interface that they are familiar with. Jive provides a great API in the form of the Jive Connects which we will leverage to send connections to the third party API.

 

The third party API I need to work with is documented here: The Foreman :: API and the main functions I am interested in using are:

  • /api/hostgroups - inside foreman all of my hosts belong to their own hostgroup, so a single Jive instance belongs to a hostgroup like jive-dev1, jive-dev2 etc
  • /api/hosts - gets a list of hosts, or an individual host if an ID is specified.

 

So lets get started.

 

First, we need to use the Jive SDK to deploy a skeleton app that we can use as the base for what we are trying to do.

mkdir TutorialApp
cd TutorialApp
jive-sdk create app --name="foremanapp"
npm update
nano jiveclientconfiguration.json # Edit this file to change from localhost to my node server IP
node app.js





 

Once you have done this, you will need to upload the extension.zip file to your server  have a basic app, configured and deployed. Make sure that you can see the App in your apps drop down menu to ensure it loaded correctly.

 

Now for the fun part. Lets modify our App to change the name and also to add support for the Jive Connects API. At this point I should tell you that there is already some great documentation for using Jive Connects with Authentication at Jive Apps Developer Community: Jive Connects API - Client Application Configuration and API Usage, but don't know if it was just a lack of coffee when I tried this but I struggled to find how to use basic auth in the documentation, hence this blog post.

 

The fun stuff....

 

Update app.xml

First, lets update apps/myforemanapp/public/app.xml and change some of the metadata and add support for the Jive Connects API. I have commented the bits I modified or added. I also removed anything that wasn't used in the file that comes out of the box.

<?xml version="1.0" encoding="UTF-8"?>
<Module specificationVersion="1">
 <!-- Updated with my details -->
  <ModulePrefs title="Foreman"
               description="Basic foreman integration"
               author="Craig Reeves"
               author_affiliation="Orange Business Services"
               author_email="craig.reeves@orange.com">


    <!-- Commonly used features -->
    <Require feature="dynamic-height" />
    <Require feature="jive-core-v2" />
    <Require feature="jquery-1.6" />
    <Require feature="osapi"/>
    <Require feature="settitle"/>
    <Require feature="views" />
    <Require feature="jive-core-v3" />
    <Require feature="embedded-experiences" />
  <Require feature="actions"> 
    <Param name="action-contributions"> 
      <![CDATA[
        <action id="com.jivesoftware.profile.rtc"
            path="jive/actions/profile"
            label="Example Profile Pop-Up"
            url="https://developer.jivesoftware.com" 
            icon="images/icon16.png"
            windowSpec="left=40,top=40,width=500,height=500,toolbar=1,resizable=0"/>
      ]]> 
    </Param> 
  </Require>


 <!-- Add support for the jive-connects API and specify a service tag to load. (Tag must exist in the admin console) -->
  <Require feature="jive-connects-v1">                
<Param name="alias:connector|title:connector">jive:service://foreman/api?version=2</Param>       
</Require>


    <!-- Icons: 3 sizes, 16x16, 48x48, 128x128 -->
    <Link rel="Icon"       href="images/icon16.png" />
    <Link rel="MediumIcon" href="images/icon48.png" />
    <Link rel="LargeIcon"  href="images/icon128.png" />


  </ModulePrefs>

 <!-- Removed the initial hello view and uncommented these views: -->
  <Content type="html" view="home" href="home.html" preferred_height="400" />
  <Content type="html" view="canvas" href="canvas.html" />


</Module>





 

Update canvas.html

Next, open up apps/myforemanapp/public/canvas.html and change the content to this:

<link rel="stylesheet" href="stylesheets/main.css" type="text/css" media="screen" />
<script type="text/javascript" charset="utf-8" src="javascripts/main.js"></script>

<h2>Canvas View: Foreman</h2>

<script type="text/javascript" charset="utf-8">
loadHostGroups();
</script>
<div id="table-body"> </div>




 

The loadHostGroups() method will call the function we are about to put inside main.js to trigger the loading of the content from the remote API.

 

Update main.js

Now open up apps/myforemanapp/public/javascript/main.js and add the following code to the bottom. The code here was taken mostly from the Jive Connects API documentation:

function loadHostGroups() {
    var grouptarget = "";
    osapi.jive.connects.get({
        alias : 'connector', // This is the ALIAS for the service tag that we set up in the admin console
        headers : { 'Accept' : [ 'application/json' ] },
        href : '/hostgroups' // This is the url to the API method you want to call. We want a list of environments from /api/environments, so we use /environments here.
    }).execute(function(response) {
         if (response.error) {
// This part of the code detects if the API is restricted  and if it is, it will prompt the user to enter their credentials.
            if (response.error.code == 401) {
                // Request Jive to configure (or reconfigure) credentials for this connection
                osapi.jive.connects.reconfigure("connector", response, function(feedback) { // We need to make sure that the first parameter matches the alias value
                    loadHostGroups(); // Resubmit the failed request
            });
            }
            else {
                // Deal with an error scenario ...
            }
        }
        else {
            // response.content is an array of information for each hostgroup item
            var html = "";
            $.each(response.content.results, function(index, groupdata) {
                grouptarget = "hg_"+groupdata.id;
                html += "<h2>"+groupdata.name+"</h2>"; // Generate appropriate table row HTML for each host group
                html += "<div class=\""+grouptarget+"\"></div> ";
            
                loadHosts(groupdata.id,grouptarget);
            });
            $("#table-body").html(html);
            gadgets.window.adjustHeight();
        }
    })
}
function loadHosts(hostgroupid,grouptarget) {

    osapi.jive.connects.get({
        alias : 'connector',
        headers : { 'Accept' : [ 'application/json' ] },
        params : { 'search' : [ 'hostgroup_id='+hostgroupid ] },
        href : '/hosts'
    }).execute(function(response) {
         if (response.error) {
            if (response.error.code == 401) {
                // Request Jive to configure (or reconfigure) credentials for this connection
                osapi.jive.connects.reconfigure("connector", response, function(feedback) {
                    loadHosts(hostgroupid,groupclass); // Resubmit the failed request
                });
            }
            else {
                // Deal with an error scenario ...
            }
        }
        else {
            // response.content is an array of information for each quote
            var html = "";
            $.each(response.content.results, function(index, hostdata) {
                html += "<li>"+hostdata.name+" : "+hostdata.ip+"</li>" // Generate appropriate table row HTML for each host
            });
            $("."+grouptarget).html(html);
       
            gadgets.window.adjustHeight();
        }
    })
}




 

Setting up a service tag

The code we have created looks good, but even if you upload it, you still won't get any joy from it. Thats because we now need to create the service tag definition - which tells your jive instance exactly how it needs to connect to your third party API.

 

In your Jive Admin panel (/admin/apps-services.jspa) browse to the Add-On tab, then "App Services" from the menu on the left. Click 'Add Service' and then set up your service so that it matches my screenshots below, changing the service url to match the API you want to connect to. Note that the jive service tag field is the most important - this MUST be identical else your app won't work!

Screen Shot 2014-07-22 at 11.03.09.pngScreen Shot 2014-07-22 at 11.03.16.png

We are adding HTTP Header definitions version=2 because we need to tell Foreman that we want to use version2 of their API. After you have created your service tag you should be ready to go. Because we have modified the app.xml, I find it good practice to uninstall the app, re-run node app.js to generate a new extension.zip and then to redeploy the extension.zip file to your instance.

 

Once your app has been re-deployed visit your app, go ahead and launch it through the apps menu:

Screen Shot 2014-07-22 at 12.02.03.png

You should then see a screen asking for your Foreman credentials:

Screen Shot 2014-07-22 at 12.05.04.png

Enter your credentials provided by Foreman, and then click submit. This will be the last time that you are asked for your credentials unless you change the authentication type for the service tag, or your credentials change on the third party system. Once you have done that, you should see a screen like the (ugly) one below containing a list of your host groups, hosts and their IP addresses. With a bit of polish this will be ready for our users.

Screen Shot 2014-07-22 at 12.02.17.png

 

Thanks for reading. I hope this helps some novices like me to quickly put together a remote authenticated API call.

Filter Blog