• 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

Tag Archives: JDeveloper

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...

Push Notifications with a Bit of Java

24 Saturday Jan 2015

Posted by mp3monster in Java Cloud, Oracle, Technology

≈ Leave a comment

Tags

12c, Apache Maven, archetype, Eclipse, IDE, IntelliJ, java, JDeveloper, jProwlAPI, maven, mvn, Oracle, Oracle Java Cloud, OTN, POM, prowl, ProwlAPI, sourceForge

So continuing from my previous posts:

  • Intro
  • Push Notifications Without Your Own Mobile App

We’re going to use the Prowl API and create the equivalent classic “Hello World” App using the push framework – but cutting out the need for Growl etc.  For this blog post we’re not going to use the Oracle Java Cloud as we need to see the code working locally and get ready to promote the code to the cloud.  Once we’ve got some code working we can look at setting up the Java Cloud environment, package and promote what we have here using our IDE into the cloud environment.

As we’re cutting Java code now – you can obviously use your own preferred IDE, I’m going to use JDeveloper 12c if for no other reason than it being a huge improvement on 11g (download here) and I’ve become somewhat disappointed with Eclipse.  Whilst talking about IDEs;  you should be aware that Oracle provide an Oracle Cloud SDK which integrates with a number of IDEs to make some of the interactions with the cloud straight forward.

The SDK provides Ant and Maven scripts to help the build and deploy process – so we will be using those later, plus command line tools to help manage other activities, a number of code examples and HTML documentation.  To setup the SDK you will need to unpack the file into a folder and add that folder into your PATH environment variables. The bundle includes a readme that contains just enough to show what is required to get unpacked and make the command line tools work.

To download from Oracle you will need to setup an Oracle Technology Network (OTN) account – so if you don’t have one now is the time to create one – there is no cost to this, we’re going to need

We could use the REST based API that is provided by the ProwlApp, but at least to start with we’re going to follow the approach using a library to make using the API very simple. By using the API provided on SourceForge (jProwlAPI). Using an API will allow us to show the use of 3rd party libraries in the cloud deployment but also follows some of the Oracle ideas of offering ‘adaptors’ to simplify integration.

So you need to download:

  • JDeveloper 12c – http://www.oracle.com/technetwork/developer-tools/jdev/downloads/index.html (if you want to use JDeveloper as shown)
  • The jProwlAPI from SourceForge
  • Oracle Cloud SDK

So with this downloaded we are going to:

Setup an new Maven based project (or copy my file structure into place and import) using a maven quickstart archtetype (org.apache.maven.archetypes:maven-archetype-quickstart) . We will probably need to modify this later to leverage the full cloud capable archetype. This will build your project environment and retrieve a bunch of plugins you might need.

Next lets take a peak inside of the jProwlAPI download. You’ll see an example bit of java that shows how to fire the API.  Rather than tinker with this we have created a small package and JUnit test as we would if writing a proper solution created with the maven archetype.

PushedHelloWorld directory structure

We also need to make the JProwlAPI jar file available to the project. So we use maven pattern, and create a folder called lib and copy the jar file into it. We then add the lib folder to project setup.

 

 

pushedhello-RunConfig

To be able to create the deployable artefact we need to load the jar file into the local repository, which we can do with a command line instruction (presuming maven is also available by your PATH variable).

mvn install:install-file -Dfile=./lib/JProwlAPI-0.5.jar -DgroupId=prowl -DartefactId=JProwlAPI -Dversion=12.1.3-0-0 -Dpackage=jar

We’ll come back to the command line in a bit, but within JDeveloper the code I have provided needs 1 change from yourself – replace the references to –YourAPIKey– in the run execute command and in the JUnit class with your own key.

JDEveloper 12c Run Config

In the the ProwlProcessor class I have included a man in method so we can just execute the class to see things working. So having done that we can then repeat by running the class via the JUnit test. You should see the same result. When we we’ve deployed or class to the cloud we can use the JUnit test to invoke the cloud.

ProwlProcessor - main method

The last step, within the IDE we have been compiling to get the class, but not creating a deployable jar file. We could do this with the IDE but we would also in a real development condition be creating artefacts via a Continuous Integration tooling which will effectively fire the maven command line like interface. So let’s do that to create the jar files, using the following command:

mvn clean package

You should then see a folder created if not already there and a jar file reflecting the values in the POM file, that we can see below.

JDeveloper 12C - view of a simple POM

So we have enough now we could in theory deploy a jar to a weblogic container and fire it from a Unit test. In the next post we’ll deploy and execute the unit test, and throw a crude front end into the mix.

Share this:

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

Like this:

Like Loading...

JDeveloper 12c

29 Tuesday Jul 2014

Posted by mp3monster in General, Oracle, Technology

≈ Leave a comment

Tags

11g, 12c, editor, JDeveloper, Oracle, SOA Suite, XSD

So I have been using JDeveloper 11g for a while and have to admit that I wasn’t a big fan finding a bit flaky and prone to crashing. The biggest driver to using it has been the fact that it offers a lot of XMLSpy like features without the stupidly high XMLSpy license costs.

With JDeveloper 12c arriving I took the opportunity to give it a go. Wow, is it so much better – quicker particularly during the startup cycle and way more reliable. The features around XSD editing haven’t significantly changed but just feels subtly easier to use.

With all the features around working with SOA Suite 12c and Weblogic 12c for core Oracle development I can imagine it is a huge step forward.

With the easier deployment of 12c getting PoC work done should be a lot easier. It’s just a shame still needs that huge 8GB footprint to do anything meaningful and my company laptop being a notebook (great for travelling with) doesn’t pack that punch and Oracle isn’t yet offering low cost SOA Suite deployments in the cloud yet.

Share this:

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

Like this:

Like Loading...

Oracle Fusion Applications Development and Extensibility Handbook Chapters 7 & 8

01 Tuesday Apr 2014

Posted by mp3monster in Book Reviews, Books, General, Oracle, Oracle Press, Technology

≈ 4 Comments

Tags

ADF, book, CRM, EBis, extension, fusion, HCM, JDeveloper, Oracle, Oracle Fusion Applications Development, Oracle Press, review

continuing with the review of  Oracle Fusion Applications Development and Extensibility Handbook (Oracle Press), Chapters 7 & 8 get into the development side of building extensions through the use of JDeveloper and the ADF framework, although this approach is not recommended for CRM if it can be helped, bu then the Page Composer is far more powerful in the CRM context.

Chapter 7 walks you quickly through the process of establishing JDeveloper so that you can get underway with the customisation. Along the way the book references the very detailed Oracle guides and shares useful tips as well (for example how to share configuration between JDeveloper instances for connecting to a Fusion apps server without having to go through reconfiguration.

As Fusion Apps uses ADF for its framework, knowledge of this is going to help you understand more easily what is going as the book is not an ADF guide and focuses upon the use of the framework providing some honest hints and observations (e.g. it is necessary to know which task flow forms the basis of any page depending upon the product the identification of this information can be easy or difficult depending on the product).  The bulk of chapter 7 is focused to guiding you through 2 scenarios for customisation.

By the end of chapter 7, although a lot of information has been shared I’d have liked to have seen a couple of things addressed, how to minimise the risk/impact of customisation so that deploying a patch doesn’t clash or has minimal impact with any customisation. It is also too easy for organisations to customise a product to the point the C in COTs far out weighs the O and T. Remember CEMLI? The second aspect I’d hoped to have seen is the incorporation of configuration control of the development changes – but this probably more one of my pet issues showing.

Chapter 8 goes into the mechanics of developing your own UI within an Fusion App, covering DB table creation, business components, UI and so on including the security framework, creation of workflow elements and so on.  I have to admit that I found this chapter easier, than the pure customisation work of chapter 7 – although that could be because the whole mechanism is a bit more discrete.

Neither chapter really take on the question of testing (integration or unit level) – I’m sure that given all the good guidance here, that the authors have a few good practises and tricks that they could share on how to make testing as simple as possible.

Aside from a couple of small points, all said and done, the book does a tremendous job of addressing an enormous subject area, and recognises that it isn’t giving you every little detail by telling you which sections of the Fusion Developers guide will provide more detailed information. Bottom line, what the book doesn’t explain you have the insight into the official Oracle online docs to go find the rest of the information (without having to plough through a 1000+ pages of developer guide).

 

See earlier chapter reviews at:

  • Chapters 1 & 2
  • Chapters 3 & 4
  • Chapters 5 & 6

Share this:

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

Like this:

Like Loading...

JDeveloper & Copying Formatted Text

13 Monday May 2013

Posted by mp3monster in General, Technology

≈ Leave a comment

Tags

JDeveloper, Plugin, Pretty formatting, XSD

 

I’ve started to use Oracle’s JDeveloper more and more, not just because I’m working with the AIA (Application Integration Architecture) Foundation Pack but also as an XSD Editor for designing interface definitions.

I’ve spent sometime trying to find a solution that can compete with XML Spy but without the huge price tag.  I’ve tried OxygenXML, Eclipse, Visual Studio among others and concluded that its very good for a free tool. Perhaps still not as good as XMLSpy – but thats the difference between an IDE and a dedicated XSD/XML tool.

image JDeveloper design view- with a lot of similarities to XMLSpy in presentation

You might think, that to use JDeveloper I have to commit to using the Oracle technology stack (and the big price tag that comes with), but this isn’t the case.

Not to mention Oracle have very much caught up with the Open Source World of Maven, there is a growing library of plugins both Official and Open Source covering a plethora of things from JUnit integration to Python & Groovy language  syntaxes.

One of the nice things with XMLSpy and VisualStudio is the ability to copy into other documents the pretty formatted text (colour coded syntax etc) – making schemas or code fragments easier to look at in a document.  However out of the box JDeveloper doesn’t do this out of the box. But it would seem that this capability wasn’t just wanted by me, so an extension has been written Chris Hughes that solves this problem called jdev-copyashtml.


<?xmlversion="1.0"encoding="ISO-8859-1"?><xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:elementname="shiporder"><xs:complexType><xs:sequence><xs:elementname="orderperson"type="xs:string"/><xs:elementname="shipto"><xs:complexType><xs:sequence><xs:elementname="name"type="xs:string"/><xs:elementname="address"type="xs:string"/><xs:elementname="city"type="xs:string"/><xs:elementname="country"type="xs:string"/></xs:sequence></xs:complexType></xs:element><xs:elementname="item"maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:elementname="title"type="xs:string"/><xs:elementname="note"type="xs:string"minOccurs="0"/><xs:elementname="quantity"type="xs:positiveInteger"/><xs:elementname="price"type="xs:decimal"/></xs:sequence></xs:complexType></xs:element></xs:sequence><xs:attributename="orderid"type="xs:string"use="required"/></xs:complexType></xs:element></xs:schema>

 

Once downloaded go to Help –> Check for Updates and step through so you can then choose your download – as shown.

image

Once installed you’ll need to restart JDeveloper.  To then configure to plugin to work as you want go to Tools –> Preferences… Where you should be able to find Copy As HTML/RTF in the left menu tree to get the options to configure the plugin behaviour.

image

If you’re going from Windows application to another then you want the Rich Text Format setting.  After that rather than Ctrl+C its Ctrl+H to copy and carry the pretty formatting/colours etc.

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

March 2023
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Feb    

Twitter

  • Learn how @OracleCloud can help you improve the efficiency of your business operations at the upcoming Level Up eve… twitter.com/i/web/status/1…Next Tweet: 19 hours ago
  • Join Juan Loaiza for the Data Strategies Day keynote at Level Up to learn how to eliminate complexity by leveraging… twitter.com/i/web/status/1…Next Tweet: 1 day ago
  • RT @WunderlichRd: Great post by @mp3monster around how APIs are relevant in so many industries! lnkd.in/eshagCDKNext Tweet: 1 day ago
  • King’s College Hospital London in Dubai announces a strategic collaboration with Oracle Cerner to help accelerate i… twitter.com/i/web/status/1…Next Tweet: 1 day ago
  • Catch the @Oracle and @NVIDIA teams at #GDC23, as they'll be collaborating to bring the full NVIDIA accelerated com… twitter.com/i/web/status/1…Next Tweet: 1 day 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: