• Home
  • Site Aliases
    • www.cloud-native.info
    • oracle.cloud-native.info
    • Phil-Wilkins.uk
  • About
    • Background
    • Presenting Activities
    • Internet Profile
      • LinkedIn
    • About
  • Books & Publications
    • Logging in Action with Fluentd, Kubernetes and More
      • Logging in Action with Fluentd – Book
      • Fluentd Book Resources
      • Log Generator
    • API & API Platform
      • API Useful Resources
    • Oracle Integration
      • Book Website
      • Useful Reading Sources
    • Publication Contributions
  • Resources
    • GitHub
    • Oracle Integration Site
    • Oracle Resources
    • Mindmaps Index
    • Useful Tech Resources
    • Python Setup & related stuff
  • Music
    • Music Reading

Phil (aka MP3Monster)'s Blog

~ from Technology to Music

Phil (aka MP3Monster)'s Blog

Monthly Archives: April 2015

Jumpstart your understanding of Angular.js

29 Wednesday Apr 2015

Posted by mp3monster in General, Technology

≈ Leave a comment

Tags

angular.angularJS.SPA . JavaScript, MVC, overview, technical overview, video

I came across the this video which does a good job of providing a technical overview of the Angular.js framework that is gaining a lot of attention, and uptake.

 

Although the video is 70 minutes long it is actually made up of several sections, the start points of which are:

  1. Getting Started – Single Page Application (SPA) Intro 4:38
  2. Download & very basic SPA 8:13
  3. Directives, Filters and Data Binding 9:36
  4. Views, Controllers and Scope (MVC pattern) 24:00
  5. Modules, Routes & Factories 31:06
  6. Demo of the features introduced 1:03:28
  7. Summary 1:08:52

 

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • Print
  • Pocket
  • Email
  • Tumblr
  • Reddit
  • Pinterest
  • WhatsApp
  • Skype

Like this:

Like Loading...

Push Notifications with a bit of Node.js

16 Thursday Apr 2015

Posted by mp3monster in General, NodeJS Cloud, Oracle, Technology

≈ 1 Comment

Tags

API library, HelloWorld, javascript, JDeveloper, Node, node.js, npm, Oracle, prowl, push notifications

So I have written a couple of blogs about Push Notifications with a bit of Java (see here as the post that pulls all of this together). But this time we’re going to do something similar with Node.js. This blog entry is going to position us so we can then take a simple solution and push up to the cloud – as I use Oracle a lot then we’ll be looking at the Oracle cloud as a final step.

To start we need a local instance of node.js.  Given the fact it is a small footprint we can pretty much install anywhere.  So you’ll need to download Node.JS from the official site, and install it. I’m not going to walk through the installation guidance as it is well documented elsewhere (http://blog.teamtreehouse.com/install-node-js-npm-windows for example). You do want ensure you include the NPM capability (node.js packaging & deployment tool). Make sure that Node is on your path so we can reference the binary without a lots of file paths. You also want to ensure that node.js is up and running.

Next up is to the the Prowl API library that makes interacting with prowl simple and helps illustrate the deployment framework (NPM) used by node.js. So following the link from the Prowl website or go directly here  and download the library.  If you download the zip file as I did,  you’ll find it has a folder called node-prowl-master. You need to unpack this and rename to node-prowl.  and run the command

npm install node-prowl

When I first tried to deploy the Prowl API library then I did see an error. This isn’t the API but actually the Node.js installation (atleast on my Windows platform) as you can see:

installErrorI found googling using node.js and ENOENT showed up plenty of help to solve errors. In this situation the solution was purely to create the folder. Then re-running the action without problem.

When the npm command works you’ll see something like:

npm-install

So hopefully in addition to the prerequisites described in this earlier post we should have everything ready to progress.  So I’ve continued to use JDeveloper 12c, but using the general profile and set up a web solution project.  This does create a large directory structure given we’re producing some simple Javascript. But the structure is right for a proper development effort, and lazy habits form poor practises – so lets work with it.

With the project setup, we need craft a little JavaScript.  To we’re good to go – lets just try hello world, with a tiny twist, we’ll get the hostname using a Node library with this code:

 

// our very first node program

// get info about the OS
var os = require(‘os’);

// say hello world and include the hostname
console.log(“Hello world, we’re running on ” + os.hostname());

Before we do anything else, lets be a bit clever, to allow us to run our Node script within JDeveloper.  This can be done by adding a new Tool through the Tools –> External Tools … menu. Which will display the following screen:

external-tool-setup-0

 

Asa you can see in this image I have already selected New… and walked through the configuration screens, you’ll probably want to use a configuration similar to what I have in the following steps:

external-tool-setup-1

external-tool-setup-2 external-tool-setup-3

external-tool-setup-4

With this setup in JDeveloper with the Editor focus on our JavaScript, goto the Tools menu and you’ll see your Node entry. Just click on it. We’ll then see the results in the message window, as you can see here:

Hello World in JDeveloper

Alternatively in a command window you just need to run the command from the folder with the JavaScript (or include the path):

node helloworld.js

So lets take things up a notch and send our mobile device a message.  So using the following code, we can use the prowl-api and initiate a message:

var Prowl = require(‘node-prowl’); // pull in the prowl API we deployed with NPM earlier

var prowl = new Prowl(‘your-prowl-key-here‘); //setup your API key

var now = new Date();

// ready to send the message, passing a function reference to handle the response

var message = ‘hello mobile device, the time is ‘+ now.toUTCString();
prowl.push(message, ‘NodeJS App’, prowlReplyHandler);

//function to handle the response from the prowl API lib
function prowlReplyHandler ( err, remaining )
{

if( err )
{
var errorStr = err.message;
console.log( ‘I have an error ‘ + errorStr);
}
else
{
console.log( ‘I said:’ + message+ ‘; I have ‘ + remaining + ‘ calls available’ );
}

}

Note you’ll need to replace your-prowl-key-here in the above code with you genuine API key registered with the Prowl web app. Then we can run the application, and should see:

Node JS Calling Prowl

Our mobile device will show:

prowl-node-js-mobile

 

Next steps, in the next post – run through through a cloud hosting of node.js and extend the capability to be a simple service, which will mean packaging ourselves up and other exciting things.

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • Print
  • Pocket
  • Email
  • Tumblr
  • Reddit
  • Pinterest
  • WhatsApp
  • Skype

Like this:

Like Loading...

Books Away

10 Friday Apr 2015

Posted by mp3monster in Books, General, Packt

≈ Leave a comment

Tags

Apache Camel, Apache Camel Developer's Cookbook, book, camel, mastering, Packt, Packt Publishing, review, SEDA

So aside from a horrible couple of weeks with everyone being ill and manic work loads.  Its been busy time with the books.

The final chapter review for a new Packt book on Apache Camel (Mastering Apache Camel) went back. So I’d expect the book to coming out soon.  I’d suggest this is a companion text to the exceedingly good Apache Camel Developer’s Cookbook (which I’ve blogged about previously here). The new book approaches Apache Camel more from a pure development platform mentality rather than from the integrator approach. If you’re familiar with Camel basics or want to focus on realising good pattern based integration then start with the Cookbook.  If you’re new to Camel and/or being asked to write custom Components or End Points then start with Mastering Apache Camel but go on to the  Cookbook as it should show best practise Camel integration will be applied. The Mastering Apache Camel doesn’t address advanced things such as SEDA which the Cookbook definitely does.  The Mastering book does an excellent job of covering things like Unit testing (in part because the Camel capability has developed).

 

 

As one book wraps up, another starts, with a 2nd Edition of Java EE Development with Eclipse which I expect will bring the book upto date with the latest capabilities of Eclipse and take in the JEE updates upto JEE v7; we’ll see where this takes us.

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • Print
  • Pocket
  • Email
  • Tumblr
  • Reddit
  • Pinterest
  • WhatsApp
  • Skype

Like this:

Like Loading...

Aliases

  • phil-wilkins.uk
  • cloud-native.info
  • oracle.cloud-native.info

I work for Oracle, all opinions here are my own & do not necessarily reflect the views of Oracle

Oracle Ace Director Alumni

TOGAF 9

Logging in Action

Oracle Cloud Integration Book

API Platform Book


Oracle Dev Meetup London

Categories

  • App Ideas
  • Books
    • Book Reviews
    • manning
    • Oracle Press
    • Packt
  • Enterprise architecture
  • General
    • economy
    • LinkedIn
    • Website
  • Music
    • Music Resources
    • Music Reviews
  • Photography
  • Podcasts
  • Technology
    • APIs & microservices
    • chatbots
    • Cloud
    • Cloud Native
    • Dev Meetup
    • development
      • languages
        • node.js
    • drone
    • Fluentd
    • logsimulator
    • mindmap
    • OMESA
    • Oracle
      • API Platform CS
        • tools
      • Helidon
      • ITSO & OEAF
      • Java Cloud
      • NodeJS Cloud
      • OIC – ICS
      • Oracle Cloud Native
      • OUG
    • railroad diagrams
    • TOGAF
  • xxRetired

My Other Web Content & Contributions

  • Amazon Author entry
  • API Platform
  • Dev Meetup (co-managed)
  • Fluentd Book
  • ICS Book Website
  • OMESA
  • Ora World
  • Oracle Community Directory
  • Packt Author Bio
  • Phil on Blogs.Oracle.com
  • Sessionize Profile

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 2,573 other subscribers

RSS

RSS Feed RSS - Posts

RSS Feed RSS - Comments

April 2015
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar   May »

Twitter

  • Build and deploy apps on @OracleCloud for free with Always Free Cloud Services - infrastructure, databases, observa… twitter.com/i/web/status/1…Next Tweet: 23 minutes ago
  • ✅ Speedy in-application search ✅ Secure monitoring ✅ Log analytics and visualization Check out the top new feature… twitter.com/i/web/status/1…Next Tweet: 5 hours ago
  • Check out the @NASAEarthData @NASA #IMPACT tech talk ft. Dr. Vivien Raymond from @cardiffuni @cardiffPHYSX, discuss… twitter.com/i/web/status/1…Next Tweet: 3 days ago
  • Digital sovereignty is a complex topic, and the definition and applicability can vary by region, but a central them… twitter.com/i/web/status/1…Next Tweet: 3 days ago
  • Tune into Ask the Architect on March 15 to discover how to convert apps into containerized services.… twitter.com/i/web/status/1…Next Tweet: 4 days ago
Follow @mp3monster

History

Speaker Recognition

Open Source Summit Speaker

Flickr Pics

Pembroke CastleSeven Bridge Crossing
More Photos

    Social

    • View @mp3monster’s profile on Twitter
    • View philwilkins’s profile on LinkedIn
    • View mp3monster’s profile on GitHub
    • View mp3monster’s profile on Flickr
    • View philmp3monster’s profile on Twitch
    Follow Phil (aka MP3Monster)'s Blog on WordPress.com

    Blog at WordPress.com.

    • Follow Following
      • Phil (aka MP3Monster)'s Blog
      • Join 218 other followers
      • Already have a WordPress.com account? Log in now.
      • Phil (aka MP3Monster)'s Blog
      • Customize
      • Follow Following
      • Sign up
      • Log in
      • Report this content
      • View site in Reader
      • Manage subscriptions
      • Collapse this bar
     

    Loading Comments...
     

    You must be logged in to post a comment.

      Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
      To find out more, including how to control cookies, see here: Our Cookie Policy
      %d bloggers like this: