Ok, this is really just a teaser post as I will divulge the process used to get my Blue Mix URL rating widget into the WebSphere Commerce Composer framework a bit later.
I will say, now that the widget is in a real application I was able to test out some more use cases and fix a few bugs to make sure the widget is re-usable across a site. In this use case I am using it to rate products. I made a few changes to the NodeRED flow including adding more data saved for some future ideas I have. Here is the current block of data saved in the MongoDB for each rating received:
"date": "Wed, 30 Jul 2014 18:31:35 GMT",
Notice I added “date“, “host” and “cookie” to the output. The date is actually filled in by the server for consistency and the cookie is a time stamp saved in the shopper browser for the page using HTML5 storage. I figure I will be able to use this data for reporting later and possibly as a WebSphere Commerce precision marketing action to get me a list of “top products” for a given domain.
The next addition I made was if the browser already rated a product (cookie + URL) is already stored into the database send back a piece of data in the response of the “getRating” call to notify the browser to not let that person vote again. I really like how I can just connect nodes together conditionally and essentially introduce some complex decision making flows into the mix. Here you can see my decision “Check for cookie” and then ultimately append the flag in the “Check for already voted” function:
Here is the Check for already voted function:
The next step in my Node-RED application on BlueMix is to create some user interface that calls the services I defined in my Node-RED flow sheet. If you recall from the last post, I created two services:
- /postrating – which will post a rating for a given url
- /rating – which retrieves the average rating for the url
In this next video I create a basic jQuery user interface that allows the user to click on a star and register their rating for the given page. There are no checks and balances in the application as of yet – ie. I can click as many times as I want so I can test my services.
This is the first part of a new application I am creating using Node-RED on BlueMix. With very little programming, I show how you can get a basic URL rating application up and running very quickly using Node-RED. In this first part I focus on the two primary web services, posting a rating and getting a rating for a URL.
Originally from Ryan Baxters blog here.
You can watch today’s Bluemix Virtual Meetup on mobile cloud services live at 10 AM EST on YouTube. There are 3 options for watching.
- Watch out on the YouTube page.
- Watch on the Google+ page. If you watch on Google+ you will be able to ask questions.
- Watch right here
These are currently the most viewed videos on YouTube about the IBM BlueMix platform:
Not sure if anyone noticed this but the Node-RED boilerplate application on BlueMix now uses the Cloudant NoSQL database service for storage. The beta version used Mongo:
In this tip of the day I show how easy it is to setup your IBM BlueMix and Jazz Hub project in the Eclipse client for editing. This will allow you to edit your project off-line and take advantage of the many plugins the Eclipse client has to offer.