Česky   |  Deutsch   |  English   |  Español   |  Français   |  Indonesia   |  日本語   |  한글   |  Polski   |  Português (BR)   |  Türkçe   |  中文   |  正體中文   |  Your Language  
PlanetNetbeans
Planet NetBeans is an aggregation of NetBeans related musings from all over the Blogosphere.
Feeds
[RSS 1.0 Feed] [RSS 2.0 Feed]
[FOAF Subscriptions] [OPML Subscriptions]
Do you blog about NetBeans ? Add your blog to PlanetNetBeans.
Feed Subscriptions
APIDesign - Blogs (feed)
Carsten Zerbst's Weblog (feed)
Winston Prakash's Weblog (feed)
NetBeans – Michael's blog (feed)
DukeScript (feed)
ProNetBeans (feed)
David R. Heffelfinger (feed)
Paulo Canedo » NetBeans English (feed)
Anchialas' Java Blog (feed)
markiewb's blog (feed)
Need to find a title (feed)
Category: NetBeans | Software and Science (feed)
Roger Searjeant's blog (feed)
Inspiration and Expression » Netbeans (feed)
Adam Bien (feed)
Bernhard's Weblog (feed)
Michel Graciano's Weblog (feed)
Ramon.Ramos (feed)
Ozone and Programming » netbeans (feed)
NetBeans Ruminations » NetBeans (feed)
NetBeans – Java PDF Blog (feed)
Arun Gupta, Miles to go ... (feed)
Geertjan's Blog (feed)
.JARa's Bilingual Weblog (feed)
JavaFX Composer (feed)
The Java Jungle (feed)
Jesse Glick (feed)
Martin Grebac (feed)
The NetBeans Community Podcast (feed)
NetBeans Profiler (feed)
NetBeans for PHP (feed)
NetBeans Web Client (feed)
Rechtacek's (feed)
Virtual Steve (feed)
The Aquarium (feed)
Tinuola Awopetu (feed)
Insert Witty Irony Here (feed)
Netbeans – Gualtiero Testa (feed)
netbeans – James Selvakumar’s Blog (feed)
NetBeans – nB gUru (feed)
netbeans – Newsintegrator Blog (feed)
NetBeans – Praxis LIVE (feed)
NetBeans – TechAshram (feed)
Netbeans – There's no place like 127.0.0.1 (feed)
Anuradha (feed)
Netbeans6/6.5 my best practices (feed)
Java Evangelist John Yeary (feed)
Neil's Dev Stuff (feed)
Computer says null; (feed)
NetBeans Adventures, Java and more (feed)
NetBeans – John O'Conner (feed)
Bistro! 2.0 (feed)
NetBeans Community Docs Blog (feed)
The Netbeans Experience (feed)
NbPython/ jpydbg / pymvs (feed)
Shanbag's Blog (ರಜತ ಲೋಕ) (feed)
Wade Chandler's Programming Blog (feed)
Devlin's Lab (feed)
Big Al's Blog (feed)
Code Snakes (feed)
In perfect (spherical) shape (feed)
Van Couvering Is Not a Verb (feed)
Diego Torres Milano's blog (feed)
Vroom Framework (feed)
Messages from mrhaki (feed)
Jeff's Blog (feed)
Manikantan's Netbeans (feed)
Oliver Wahlen's Blog (feed)
Shuttle between Galaxies (feed)
Welcome to my live... (feed)
Netbeans IDE Blog by Tushar Joshi, Nagpur (feed)
Devel Blog (feed)
diamond-powder (feed)
Antonio's blog (feed)
Where's my Blog?!

Powered by:    Planet

Last updated:
May 25, 2016 02:05 PM
All times are UTC

Sponsored by
sponsored by Oracle

visit NetBeans website
NetBeans – Java PDF Blog - May 24, 2016 08:00 AM
3 Reasons to Attend NetBeans Day UK next week

Just some of the NetBeans Dream team

Just some of the NetBeans Dream team…that will be attending

We are running our second NetBeans Day at Greenwich University next week (tuesday 31st May). This is a free 1 day event (including refreshments). It is aimed at anyone who wants to learn more about NetBeans and Java, and improve their skills. There will be lots of others developers to meet over drinks. If you are still thinking about whether you should attend, here are 3 reasons to help you….

  1. Expert speakers. We have flown in several international experts from Europe and raided the best in the UK to provide you with a whole range of experts on a very wide range of topics inlcuding Java8, Java9, JavaEE, Angular, getting started with NetBeans.
  2. Lots to learn. All the sessions with have practical takeaways and the afternoon there will be two tracks of dedicated workshops. Topic include JavaScript, JavaEE, Angular2, a beginners guide to NetBeans.
  3. Some great swag. Free tee-shirts, books and more as giveaways or part of the free raffle.

Full details of the event and tickets are available here. See you next week…

Related Posts:

The post 3 Reasons to Attend NetBeans Day UK next week appeared first on Java PDF Blog and was written by Mark Stephens.

Geertjan's Blog - May 24, 2016 07:00 AM
Technology Evolution As Seen Through Conference Session Titles

I recently (last week) participated in JavaCro, a great Java conference in Croatia. I have participated in that event since its inception in 2012. Here are the titles of the keynotes I presented at JavaCro over the years:

  • "Unlocking the Java EE 6 Platfom" (29 - 30 May, 2012, in Tuhalj)
  • "Unlocking the Java EE platform with HTML5" (3 - 5 June, 2013, in Tuhalj)
  • "Consuming Java EE Backends in Desktop, Web, and Mobile Frontends" (12 - 13 May, 2014, in Poreč)
  • "Everything a Java EE Developer needs to know about the JavaScript Landscape" (11 - 12 May, 2015, in Rovinj)
  • "Oracle JET: Enterprise JavaScript for Visualizing Cloud Data" (18 - 20 May, 2016, in Rovinj)

More clearly than the above, the transition from fullblown Java EE to an increasingly HTML/JavaScript-centric frontend technology is hard to imagine! I think I can predict what my keynote session next year will be focused on—hybrid mobile development with Oracle JET, and related Cloud services, including REST endpoints via Java EE on the backend.

Now to think of a suitable title—maybe something like "Unlocking Mobile Devices with Oracle Cloud Solutions". 

Geertjan's Blog - May 23, 2016 09:35 PM
Locked/Unlocked Icons on Packages Matching "module-info.java" File

Here's what I'm working on in the context of Jigsaw, which kind of proves the awesomeness of the NetBeans APIs, since this is provided by an external NetBeans module. Take a look at the icons on the packages in the Projects window. Two of them have an unlocked lock icon ("com.wordlibrary" and "com.wordlibrary.spi") while the other two have a locked lock icon. The unlocked lock icons indicate that those packages have been exported via the "module-info.java" file:

Yes. Those locked/unlocked icons, and the analysis of the "module-info.java" file, all that, can be done externally via a NetBeans plugin. That's pretty awesome.

Geertjan's Blog - May 22, 2016 07:15 AM
Getting Further Modulerizing with Jigsaw in NetBeans IDE

Let's modulerize the Anagram Game using Jigsaw further than we initially did, using the Services idioms that are also part of Jigsaw, discussed in the previous blog entry.

Here's the use case, i.e., a small Anagram game: 

The category can be switched via the drop-down: 

The point of this blog entry is that "Technical" and "Animal" are both made available via service providers, each made available by a different Jigsaw module, "org.wordlibrary.technical" and "org.wordlibrary.animal":

Each of the service providers serve up an implementation of the same service, "com.wordlibrary", consumed by "com.toy anagrams".

The point is that the application is now pluggable. Simply introduce onto the module path new Jigsaw modules that implement the service and register them using their "module-info.java" class, as discussed earlier. It's all very similar to META-INF/services, except that here we're using modules instead of libraries, with all the advantages that modules bring over libraries, in particular the ability to hide the internals of a module from unintended access.

Pretty cool to have applied all the concepts discussed in the previous blog entry to a real example and it works.

Geertjan's Blog - May 21, 2016 09:30 AM
Getting Started with Java Jigsaw Services in NetBeans IDE

In the Project Jigsaw: Module System Quick-Start Guide, a section is included on Services. Idioms such as "service consumer" and "service provider" are part of the set of solutions provided by Project Jigsaw.

A full code sample is discussed in the section above, which I have successfully implemented in NetBeans IDE. Three Jigsaw modules make up the scenario—a service defined in "com.socket", a service provider defined in "org.fastsocket", and a service consumer defined in "com.greetings". 

Read this document, about the fact that "'module', 'requires', 'exports', 'to', 'uses', 'provides', and 'with' are restricted keywords", which are used in the ways described in that document in the "module-info.java" files below.

  1. Service (com.socket). Below, you see "NetworkSocketProvider", which is a pluggable API, accessed via "ServiceLoader.load" in "NetworkSocket". 

    The "module-info.java" above is as follows:

    module com.socket {
        exports com.socket;
        exports com.socket.spi;
        uses com.socket.spi.NetworkSocketProvider;
    }
    
  2. Service Provider (org.fastsocket). Below, you see an implementation of "com.socket.spi.NetworkSocketProvider" and notice that no packages are exported here.

    The "module-info.java" above is as follows:

    module org.fastsocket {
        requires com.socket;
        provides com.socket.spi.NetworkSocketProvider 
                with org.fastsocket.FastNetworkSocketProvider;
    }
    
    
  3. Service Consumer (com.greetings). Below, you see a service consumer, which needs to have the other two modules on its module classpath (while it still has "org.astro" available, which applied to an earlier sample). In NetBeans IDE, right now, the Libraries node does not visualize modules on the module path if they do not export any packages, as is the case with "org.fastsocket".

    The "module-info.java" above is as follows:

    module com.greetings {
        requires org.astro;
        requires com.socket;
    }

That's it—service provision and consumption natively built into the Java language for Jigsaw modules.

Geertjan's Blog - May 20, 2016 07:16 AM
Getting Started Modulerizing with Jigsaw in NetBeans IDE

Now that we have gone through an absolute basic scenario, yesterday, let's go ahead and modulerize an application, using Java Jigsaw to do so.

Here's the starting point, a small Java Swing application that provides an Anagram Game, which is one of the standard Java samples that comes with NetBeans IDE:

Each Java application you create with the NetBeans JDK 9 Branch Build is a Java Jigsaw module. So, I created a new Jigsaw module and moved the two Java classes you see above in the "lib" folder into the new Jigsaw module.

I put the "WordLibrary" class into a package named "api" and the "StaticWordLibrary", which extends "WordLibrary", into a package named "impl", I added a "module-info.java" file to both Jigsaw modules. In the API module, I exported the "com.toy.api" package and in the other Jigsaw module, where my Swing code is found, I required the "com.toy.api" module. In the Project Properties dialog of the Jigsaw module where my Swing code is found, I added the API module to the module path. I then had the following, which works exactly as before:

Most important of all, the Swing code is unable to use the "impl" package, since that package has not been exported. The WordLibrary class in the "api" package loads the "StaticWordLibrary" class in the "impl" package, while no other module needs to reference that "StaticWordLibrary" class directly. A key advantage in this scenario is precisely this aspect of hiding the internals of my application from others who might accidentally want to access and use these internals.

Geertjan's Blog - May 19, 2016 02:26 PM
Getting Started with Java Jigsaw Modules in NetBeans IDE

I went through the first two sections of "Project Jigsaw: Module System Quick-Start Guide" in the NetBeans JDK 9 Branch Build. In the end, I had created the Greeting module, which requires the Astro module that exports the package containing the World class, used by the Main class in the Greeting module. Click to enlarge the screenshot below, to see the various details, including the "module-info.java" graph:

Right now, NetBeans does not yet support the features described in the quick start about Jlink, packaging, and multimodule compilation. Read here all the details on the current state of JDK 9 support in NetBeans IDE:

http://wiki.netbeans.org/JDK9Support

Adam Bien - May 18, 2016 02:24 PM
Managing Break Parts For Cars With Java EE 7

Tim, please introduce yourself

Hello Adam. My name is Tim Brückner, I am 34 years old and work as IT consultant and software developer. I live close to the lovely city of Marburg (Germany). About five years ago I took the chance to start my own business (a cup of software) as a freelancer and since then I was able to build up a small team of 4 developers.

What are you building with Java EE?

We are developing a B2B platform for the automotive sector. Our application helps dealers and garages to improve the process of ordering spare parts at their suppliers. For some cars one can choose from more than 30 different brake pads for example. Looking up every brake pad at every supplier manually in order to compare them is way too much work to do and that is where our application comes into play.
The application can be used to provide quotes to customers as well as to order spare parts at various suppliers. It helps identifying and comparing parts and connects to third party software like ERP systems.
Our frontend is written in JSF using PrimeFaces. Our backend is built with Java EE 7 and Java 8 running on Wildfly. We are using Groovy to connect to the web services of spare part suppliers in order to fetch prices and check the availability of articles, as well as to place orders from within the application.
The platform provides a REST API which is used by third party companies to integrate the application into the business processes of their customers. We have written Android and iOS clients which utilize the same API.
We started building the application as a monolith, but as the number of installations rose, we decided to pull out parts of the application which could be hosted as a centralized service. So we are currently in the process of moving from a monolith to SCSs (self contained systems).
Our latest addition to the platform is the implementation of a spare parts catalogue based on TecDoc data. It is used to lookup and identify spare parts in the context of a specific car.

Can you share with us some geeky numbers like e.g. TX per seconds, heap sizes etc -- whatever Java EE devs might find interesting.

We run multiple instances of the application - one for each customer. Each instance runs on a dedicated Wildfly application server and utilizes about 2GB of heap memory average. There are currently about 50 parallel user sessions per instance. Each instance of the application holds around 11 to 16 million article entries (about 50-75GB) containing supplier specific information like prices and order numbers. The spare parts catalogue holds about 3.8 million articles and about 125GB of images and documents.

Are you happy with Java EE so far? Is Java EE productive?

I am happy with Java EE and I think Java EE is very productive. Thanks to principles like convention over configuration and context and dependency injection one can easily focus on implementing the business logic instead of writing boilerplate code. This leads to a leaner implementation of features and therefore this boosts the readability and maintainability of the code as well. Since Java EE is a vendor neutral specification it is possible to stay flexible and switch the implementation behind an API or to switch the application server (what we did). Searching for answers and help is straight forward since the spec is well documented and the community is great. Java EE is like a swiss army knife for enterprise projects: There is an API for almost every aspect of an enterprise application and the container takes care of most of the technically complex aspects like transaction management or connection pooling for example.
In terms of productivity I am a big friend of PrimeFaces. Since our customer agreed on using the PrimeFaces components we could implement most views of our application pretty easily. We did some CSS skinning though, but most of the time we do not have issues with PrimeFaces updates.

Which application servers, tools or IDEs are you using?

We started with Java EE 6 and Glassfish 3 then migrated to Java EE 7, Java 8 and Wildfly. We used Netbeans for a while (we still use the Netbeans profiler) but switched to IntelliJ about two years ago. I like both IDEs. I think Netbeans has the better Maven integration. We are using the Atlassian suite (JIRA, Confluence, Bitbucket and Bamboo) in order to stay organized, as Git repository and as CI system. We are using PostgreSQL with JPA. Redis and MongoDB are being accessed natively. Docker is the newest addition to our tool stack.

You are using the Boundary Control Entity pattern to structure your applications. What were your experiences, challenges and findings so far?

Well we committed on using BCE in our project as a rule of thumb for structuring the application. BCE works great so far, but we also had some challenges to master like for example to determine where static helpers belong which may be accessed throughout the application. Or how to handle rather technical implementations which are not part of a business component or used by multiple business components like a factory for REST clients for example. What about CDI events? We made most of them part of the boundaries since they observe them. Should REST endpoints be boundaries or access boundaries themselves? We decided to make them access boundaries since the boundary could then be used from within the JSF presentation layer as well as from within the REST endpoint without the need to use DTOs within JSF.
The most difficult part was to identify the business components and to omit cyclic dependencies between them. We are using CDI events to decouple the components.

How important are standards for you? Does your application depend on application server specific APIs?

Since we are a small team it is very important for us to focus on standards because we want to spend our time implementing features for our customer instead of evaluating vendor specific libraries or frameworks. Introducing vendor specific libraries also introduces risks. We do not have the time to maintain those libraries if they are no longer supported for example. We don't want to refactor the application with every update of a library because method signatures change. We do not want to get into dependency hell if transient dependencies of libraries clash with with the libraries implementing the Java EE APIs.
Of course it is not always possible to stick to the standard, but we try to do it whenever possible.
We are using some server specific APIs for example the ResteasyClientBuilder in order to set the timeout on the REST client and in order to use the BrowserCache feature. We are using Eclipselink as persistence provider on Wildfly instead of Hibernate and of course the Eclipselink specific properties within the persistence.xml.

Which Java EE APIs are you using in your products?

We are mainly using JSF, CDI, EJB, JPA, JAX-RS and Servlet.

Take a look at the Java EE 8 APIs. Which of the APIs are most interesting / important to you?

Security (JSR 375), JAX-RS (JSR 370), JSON-B (JSR 367), CDI (JSR 365)

Can you share any resources (blogs, etc feel free to promote yourself) with us?

Whenever I search the web in order to solve some Java EE riddle I stumble upon posts of Arjan Tjims (http://arjan-tijms.omnifaces.org) or Bauke Scholz aka Balus C (http://balusc.omnifaces.org). I like to follow the Netflix tech blog (http://techblog.netflix.com). And since server side JavaScript development becomes more and more relevant I can recommend reading the following article: https://www.toptal.com/nodejs/why-the-hell-would-i-use-node-js


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - May 17, 2016 09:45 AM
Design of 3rd Edition of NetBeans Community T-Shirt!

Periodically, like anything else, the NetBeans community t-shirt gets an update! Today the update is connected with the upcoming NetBeans Day UK, to be held at the University of Greenwich on 31 May (free tickets still available!), where everyone will get a free NetBeans community t-shirt, sponsored by a range of organizations around the world!

New additions to the t-shirt are—AirHacks, Aspose, Kodewerk, and WakaTime!

Read about the 2nd edition here and the 1st edition here!

Geertjan's Blog - May 16, 2016 07:00 AM
Getting Started with "ojFilmStrip"

I've been getting to know ojFilmStrip, one of the many awesome Oracle JET components.

Everything I'm doing with Oracle JET at the moment starts from a hybrid architecture, i.e., it starts with the Cordova-based Yeoman-generated scaffolding, via NetBeans IDE, as described here

After doing the above, i.e., I have set up a hybrid Oracle JET application, I have it running in the browser via "grunt build --platform=android", and then I started reading the Film Strip section in the Oracle JET Cookbook. With that as a starting point, I did the following:

  1. Open the "incidents.html" file (in "src/js/views") and replace everything in there with the below. The bits in bold below are added, the rest is already in the "incidents.html" file:
    <div class="oj-hybrid-padding">
        <h3>Incidents Content Area</h3>
        <div>
            <div id="filmStripDiv" class="oj-panel" style="margin: 20px;">
                <div id="filmStrip"
                     data-bind="ojComponent: {component: 'ojFilmStrip'}">
                    <!-- ko foreach: chemicals -->
                    <div class="oj-panel" style="margin: 2px;">
                        <span data-bind="text: $data"></span>
                    </div>
                    <!-- /ko -->
                </div>
            </div>
        </div>
    </div>
    
  2. Open the "incidents.js" file (in "src/js/viewModels") and add ''ojs/ojfilmstrip" to the "define" block, then add the below right below "var self=this":
    self.chemicals = ko.observableArray([
        "Hydrogen",
        "Helium",
        "Lithium",
        "Beryllium",
        "Boron",
        "Carbon",
        "Nitrogen",
        "Oxygen",
        "Fluorine",
        "Neon",
        "Sodium",
        "Magnesium"
    ]);

The above is a minimal code usage from the Oracle JET Cookbook, i.e., focused only on making use of the absolute basics of the "ojFilmStrip" component. Plus, we're using an observable array because in the next part, we want to be able to add new chemicals to it and have the view update itself. Next, automatically, without refreshing, in the browser, I see this:

When I make the resolution narrower, a small subset of the chemicals remains visible and I can automatically scroll left and right:

Let's now work on letting the user programmatically update the film strip of chemicals.

  1. Add a button to "incidents.html", connected to a JavaScript function that you'll create in the next step:
    <button data-bind="click: addChemical">Add...</button>
  2. Before we add some kind of way for the user to specify the name of the chemical to add, we'll simply hardcode it.
    self.addChemical = function () {
        self.chemicals.push("Plutonium");
        $('#filmStrip').ojFilmStrip("refresh");
    }

In the above, I need to add the "refresh" because of the reasons described in this article. However, once the chemicals get to the end of the visible strip, the entire content of the strip disappears, i.e., the strip goes blank. It's some kind of refresh problem because when I change the resolution and click the arrows a few times, the content comes back again. The instructions for using "destroy" don't work for me.

Once the above works, i.e., I have tried this in the desktop browser as well as on my Android device, I'll have a great sample scenario for integrating the Android device camera into a cool Oracle JET component. 

Geertjan's Blog - May 14, 2016 11:17 AM
Using the YoOracleJET NetBeans Plugin for iOS

When you use the YoOracleJET NetBeans plugin, which is a set of tools for doing hybrid OracleJET development in NetBeans IDE, you'll find a few "gotchas" when working on Mac OSX, i.e., you're creating iOS apps in this scenario.

The error you'll get while using the iOS project templates in NetBeans IDE, i.e., provided by the YoOracleJET plugin, is as follows:

env: node: No such file or directory

I googled around with the error above and came to this page.

As a result, I recommend you run the following commands on the Mac OSX command line BEFORE you use the iOS project templates provided by the YoOracleJET plugin:

sudo ln -s /usr/local/bin/node /usr/bin/node
sudo ln -s /usr/local/bin/cordova /usr/bin/grunt
sudo ln -s /usr/local/bin/cordova /usr/bin/cordova

Also make sure all the tools, i.e., Bower, Grunt, Node, NPM, and Yeoman are registered in  the Options window, which is under "Preferences" in the most left menu (named "NetBeans") on Mac OS X. The "Search" buttons won't work, just type in the paths or browse to them.

For me, they were as follows:


And, here with the Darcula look & feel:

Make sure that Bower, Grunt, Node, NPM, and Yeoman are all set in the Options window. (The "Yeoman" tab is not visible in the two Darcula screenshots above, though you can see it in the screenshot above that, the tab on the right of the HTML/JS category, but only if you have the YoOracleJET plugin installed.) Then go to the New Project dialog and use one of the iOS project templates provided by the YoOracleJET plugin.

Don't worry at all about error messages like these, which are simply related to not having Xcode installed, and have no impact at all:

xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
WARN: Skipping following platform as the test command returned an error - ios => xcrun simctl help create with 72 
Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

You'll need to run "cordova platform add ios" on the command line, in the "hybrid" folder of your application (see step 3 in the previous blog entry about this), since there's no way to do this from within NetBeans IDE. Then run "grunt build --platform=ios" (on the command line or in NetBeans IDE) and "grunt serve --platform=ios --web=true" (on the command line or in NetBeans IDE).

Also, if you're serving from NetBeans IDE, you'll be asked to browse to the location of the "index.html" file when you serve up the application, which should look as follows:

You now have a starting point for creating iOS applications via Oracle JET in NetBeans IDE. Read further here, where you can see how easily you can serve to your connected device via "--destination=device", instead of "--web=true".

Geertjan's Blog - May 13, 2016 07:00 AM
Working with the Oracle JET Yeoman Generator on Mac OS X 10.9.5

Let's get further with iOS hybrid mobile development, i.e., on Mac OS X (in my case, 10.9.5, my wife's computer, just don't tell her about all the stuff I am installing on it now).

  1. Since we've got Yeoman and several other tools, including Node.js, already installed, we can easily install the Yeoman generator for Oracle JET: 'npm -g install generator-oraclejet'.

  2. Next, run 'yo oraclejet:hybrid hybridiosdrawer --platform=ios --template=navDrawer', where you can replace 'hybridiosdrawer' with any other project name you like.

  3. Once the process completes, go into the newly created 'hybridiosdrawer' (or whatever you've named the project) folder and then go into the 'hybrid' folder. In that folder, i.e., in 'hybrid', run 'cordova platform add ios'.

  4. After which you can run 'grunt build --platform=ios' in the main folder, i.e., on 'hybridiosdrawer'. Just ignore the warning, if you get it, relating to Xcode.

  5. The final step is 'grunt serve --platform=ios --web=true', which should open the browser and display your new application, together with a navigation drawer on the left, when you make the browser small enough to resemble the resolution of a mobile device.

I noticed one or two small problems along the way and ended up doing a lot of the above via NetBeans IDE 8.1, which I'll cover in the next part.

Geertjan's Blog - May 12, 2016 07:00 AM
Installing Cordova and Yeoman on Mac OS X 10.9.5

Let's set up Cordova on Mac OS X 10.9.5, after which we'll set up Yeoman, in preparation for setting up the Yeoman generator for Oracle JET so that we can create hybrid Oracle JET applications via Yeoman, after which we can work on setting up the YoNetBeans plugin for iOS.

I'm starting out as a complete newbie to all of this on Mac OS X which, in fact, is my wife's computer.

  1. Start by learning about the command line: http://blog.teamtreehouse.com/introduction-to-the-mac-os-x-command-line

  2. Next, install Node.js. After installation, run 'npm' (without the quotes) on the command line, to make sure that Node.js has been installed. You should see Node.js-related output when you do this.

  3. Next, use 'npm' to install Cordova. Note that I needed to add 'sudo' in front of 'npm install -g cordova' (as well as the other 'npm' commands that follow) and then provide my password. After installation, run 'cordova' (without the quotes) on the command line, to make sure that Cordova has been installed. You should see Cordova-related output when you do this.

  4. Next, use 'npm' to install Yeoman and the other tools needed to work with Oracle JET, i.e., Grunt, Bower, Git, and Grunt-Cli. During the first step on that page, I see in the command prompt that my 'npm' (which I had installed 3 minutes earlier) is outdated and that I need to run 'npm install -g npm'. After doing that, 'npm -g install yo grunt bower git grunt-cli' works fine and all those tools, i.e., Yeoman, Grunt, Bower, Git, and Grunt-Cli are now successfuly installed. After installation, run 'yo' (without the quotes) on the command line, to make sure that Yeoman has been installed. You should see Yeoman-related output when you do this.

That's it, you've set up everything needed to use the toolchain that forms the basis of Oracle JET. Next, we'll work on setting up Oracle JET itself.

NetBeans for PHP - May 12, 2016 06:19 AM
PHP 7: How can I help with testing?

Hi all, this blog post is kind of  related to the previous blog posts about PHP 7 support in NetBeans 8.2 (Part 1, Part 2). Today, we will tell you how you can help with testing this support and believe us, everyone of you is important for us and your help is more than welcome!

Luckily, it is very simple because there are no specific instructions! :) Simply, test (use) PHP 7 support in NetBeans if possible (yes, we know that it can be quite soon for using PHP 7 in production but still, we are developers and we love to play with a new things, right?) as well as the existing features (to ensure that nothing is broken) in NetBeans development version (it is a good idea to download a fresh build from time to time, we fix a lot of bugs every day). This would help us a lot because there are so many situations that can happen that it is not possible for us to test them all, unfortunately. Please, report all issues together with exact steps to reproduce in NetBeans Bugzilla (component php, subcomponent Editor; unfortunately, currently down for maintenance).

Thank you!

DukeScript - May 12, 2016 04:59 AM
Demo of our new Presenters!

We’ve recently announced new desktop presenters for DukeScript. The old desktop presenter, that we still use as the default is based on the JavaFX WebView component, a component based on webkit. The benefit of this is, that you can easily embed DukeScript in any JavaFX or Swing application.

But unfortunately JavaFX isn’t updated very often, so we’re stuck with an outdated version of webkit. Especially the Canvas implementation is not very good.

The new “webkit”-Presenter uses a current version of Webkit, so the rendering is much better. Here’s a comparison of the DukeScript Charts API in the default presenter and in the new webkit presenter:

Adam Bien - May 12, 2016 04:17 AM
The Public Java EE 8 Mail Archives

A compilation of links to the public mail archives of the various Java EE 8 specifications. Your daily, composite digest:

  1. https://java.net/projects/javaee-spec/lists/users/archive
  2. JCache Mailing List
  3. https://java.net/projects/jsonb-spec/lists/users/archive
  4. https://java.net/projects/mvc-spec/lists/users/archive
  5. https://java.net/projects/javaee-mgmt/lists/users/archive
  6. https://java.net/projects/javaee-security-spec/lists/users/archive
  7. https://java.net/projects/javaserverfaces-spec-public/lists/users/archive
  8. https://java.net/projects/jax-rs-spec/lists/users/archive
  9. https://java.net/projects/servlet-spec/lists/users/archive
  10. https://java.net/projects/jms-spec/lists/users/archive
  11. http://lists.jboss.org/pipermail/cdi-dev/
  12. https://java.net/projects/portletspec3/lists/jsr362-observers/archive
  13. https://java.net/projects/websocket-spec/lists/users/archive
  14. https://java.net/projects/json-processing-spec/lists/users/archive
  15. https://java.net/projects/jbatch/lists/public/archive
  16. http://lists.jboss.org/pipermail/beanvalidation-dev/
  17. https://java.net/projects/ejb-spec/lists/users/archive
  18. https://java.net/projects/jpa-spec/lists/users/archive
  19. https://java.net/projects/el-spec/lists/users/archive
  20. https://java.net/projects/concurrency-ee-spec/lists/users/archive
  21. https://java.net/projects/connector-spec/lists/users/archive
  22. https://java.net/projects/jta-spec/lists/users/archive
  23. https://java.net/projects/jsp/lists/users/archive
  24. https://java.net/projects/jax-ws/lists/users/archive

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Real World Java EE Workshops [Airport Munich]>

markiewb's blog - May 11, 2016 10:18 PM
Eclipse formatter for Java – Compatibility fork 4.4

As you already know, I provide a NetBeans plugin to format your Java code using the Eclipse formatter engine. Currently the 4.5.x engine is embedded.

But there were several complaints that this version does not format the same way as it does using the previous version. There is a reason for that: The Eclipse formatter has been changed in an incompatible way [1]. Other formatter plugins like the one for Intellj Idea are also affected [2]

But here is a good news for all the brave NetBeans Java developers, who are still in such an environment of 4.4.x Eclipse installations: Now I provide a 4.4-fork of my own plugin. It has the same features and issues like the 4.5 plugin, but it uses the other engine and the plugin has been updated to be installed side by side to the original plugin.

2016-05-09_22h45_51

The plugin is already available from the update center from within your NetBeans IDE. Or you can download it from the plugin page [3] or from github [4].

2016-05-12_00h16_22

[1] http://eclipse-n-mati.blogspot.de/2015/06/eclipse-mars-how-to-switch-back-to.html
[2] https://github.com/krasa/EclipseCodeFormatter/issues/51
[3] http://plugins.netbeans.org/plugin/64061
[4] https://github.com/markiewb/eclipsecodeformatter_for_netbeans

 

 


NetBeans for PHP - May 11, 2016 09:22 AM
Symfony support improved

Hi all, today we will show you our improved support for Symfony which will be part of NetBeans 8.2.

Some time ago, Symfony 3 was released so its support has been added to NetBeans. And because Symfony 3 is not much different from Symfony 2, we just extended our existing support instead of creating a completely new one. However, NetBeans recognizes the proper version of the Symfony you use in your project, of course:

Symfony 3 support

It means that all features that work in Symfony 2 work now for Symfony 3 as well. But not only that, we have added a completely new functionality - Navigate to Action/View. So, now you can navigate from your views (Twig files) to the relevant actions in your controller and vice versa (applies for both Symfony 2 and Symfony 3):

Symfony, navigate to view

Symfony, navigate to action

That's all for today, as always, please test it and report all the issues or enhancements you find in NetBeans Bugzilla (component php, subcomponent Symfony). You can also leave a comment here (please notice that the comments are moderated so they will not appear here immediately) but reporting issues is strongly preferred.

Adam Bien - May 11, 2016 09:11 AM
Simplest Possible REST Client

To access the Simplest Possible REST Endpoint from Java, you will have to implement some code:


import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;

  final String URI = "http://localhost:8080/hello-rest/resources/message";
		//...
        Client client = ClientBuilder.newClient();
        String result = client.target(URI).
                request().
                get(String.class);
        assertThat(result, containsString("duke"));

For server-to-server communication no additional dependency is required. If you are using the client as test driver, you will have to declare the dependency to the SPI of you choice e.g.


<dependency>
  <groupId>org.glassfish.jersey.core</groupId>
  <artifactId>jersey-client</artifactId>
  <version>2.21</version>
</dependency>

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - May 11, 2016 07:00 AM
Plugging into Devices with Oracle JET on Cordova (Part 2)

Now let's add real content to the scenario from the previous blog entry.

We start by pushing images from the camera into an observable array:

self.pics = ko.observableArray();
self.takePicture = function () {
    navigator.camera.getPicture(
            uploadPhoto,
            function (err) {},
            {
                quality: 50,
                destinationType: Camera.DestinationType.FILE_URI
            }
    );
};
function uploadPhoto(imageURI) {
    self.pics.push(imageURI);
};

Then, for each pic, bind the "src" attribute of an "input" element to $data, which is the current item from the for each:

<button data-bind="click: takePicture">Take Pictures of Incident</button>
<br/><br/>
<ul data-bind="foreach: pics">
    <li style="list-style: none">
        <input type="image"
               style="border:1px solid black"
               data-bind="attr:{src: $data}"
               width="250"
               height="250"
               alt="No picture taken."/>
    </li>
</ul>

Here's the result, where you can see my device via the Droid@Screen plugin installed into my NetBeans IDE 8.1:

The code above is really a port of the earlier AngularJS scenario created sometime ago that does the same thing. Seriously, much easier and simpler to understand above than via AngularJS.

Adam Bien - May 10, 2016 07:06 AM
Guardians, Tenants, NIO 2, BPM, Docker and Service Discovery, or 26th airhacks.tv

New record: >130 viewers from all over the world watched live the 26th edition of airhacks.tv discussing questions from various topics:

Any questions left? Ask now: https://gist.github.com/ and join the conversation at each first Monday of the month at 6 P.M. live. No registration or any other commitment required.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - May 10, 2016 07:00 AM
Plugging into Devices with Oracle JET on Cordova (Part 1)

In a previous blog entry, I discussed how to create AngularJS applications that access the native resources on devices, such as the camera on Android, via Cordova. Let's now do the same thing with an Oracle JET application. Start by using Yeoman to scaffold your hybrid (i.e. Cordova-based) Oracle JET application. Now you're good to go with the instructions that follow.

Take the following steps:

  1. In the "hybrid" folder in your application, you'll find a file named "config.xml", which is the central configuration file for all your Cordova-related work. Underneath the Cordova Whitelist plugin, add the Cordova Camera plugin, as shown below:
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <plugin name="cordova-plugin-camera" spec="1" />
    <access origin="*" />
    Then build the application, as shown in the earlier YouTube clip on this topic, i.e., "grunt build --platform android" and you'll find the "cordova-plugin-camera" folder has been added for you:



  2. Open the "incidents.html" file, which is in "src/js/views", and add a button that has its "click" event bound to a function named "takePicture":
    <button data-bind="click: takePicture">Take Picture!</button>
    
  3. Open the "incidents.js" file, which is in "src/js/viewModels", and add the function that you referenced in your HTML file, making use of the Cordova Camera API:
    self.takePicture = function () {
        navigator.camera.getPicture(
            function (imageURI) {
                //to be done
            },
            function (err) {
                //to be done
            },
            {
                quality: 50,
                destinationType: Camera.DestinationType.FILE_URI
            }
        );
    };

When you serve up the application to the device, using "serve --platform=android --destination=device", you'll be able to click the button and start the camera. After you take a picture, nothing happens, though that's the point of this blog entry—simply to show you how to connect to a resource on a device, subsequent blog entries will show subsequent steps.

Adam Bien - May 09, 2016 07:35 AM
26th Airhacks Q&A: Java EE Guardians, Microservices, Highperformance JSF, Microservices Challenges

Today (Monday) at 6 pm CET I will discuss the following topics:

  1. Java EE 8 News, the guardians and the background
  2. JSF 2, NIO, asynchronous programming, performance and 2k concurrent users
  3. Injecting subtypes and delayed execution
  4. Character encoding and JAX-RS
  5. How to deal with shared business methods (IBAN)
  6. Subjective opinions about BPM with objective arguments
  7. JPA entity injection and merging best practices
  8. Multitenancy in Java EE
  9. How to pass tenant information with the request?
  10. How to migrate away from RichFaces?
  11. Source code analysis for transaction processing
  12. Where to put BaseEntity in ECB?
  13. Redeployment in Docker
  14. Distributed service discovery, distributed transactions, logging and debugging and microservices

Ask questions during the show via twitter mentioning me: http://twitter.com/AdamBien (@AdamBien) or using the hashtag: #airhacks, or the built-in chat http://www.ustream.tv/channel/adambien. You can join the Q&A session live each first Monday of month, 6 P.M at airhacks.io or http://www.ustream.tv/channel/adambien

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Real World Java EE Workshops [Airport Munich]>

Geertjan's Blog - May 09, 2016 07:00 AM
Adding a Page to a Hybrid Oracle JET Application

By default, the "navDrawer" template for hybrid (i.e., Cordova-based) Oracle JET applications looks like this, with collapsed/expanded offcanvas component on the left/right:

Now, let's add a new page to it and include it in the navigation and router.

Take the following steps:

  1. Start by adding a new JavaScript file in 'src/js/viewModels' and a new HTML file in 'src/js/views'. We'll imagine we're adding a new page for reporting, so name the files 'reports.js' and 'reports.html'. In NetBeans IDE 8.1 with the Oracle JET Support plugin installed, use the "New Empty JET Module" template to create these two files.



  2. Rewrite the 'reports.html' file to the following, which follows the same structure as all the other HTML file in 'src/js/views':
    <div class="oj-hybrid-padding">
      <h3>Reports Content Area</h3>
      <div>
          To change the content of this section, you will make edits
          to the reports.html file located in the /js/views folder.
      </div>
    </div>
  3. Open 'src/js/appController.js' and add your new page to the router:
    // Router setup
    self.router = oj.Router.rootInstance;
    self.router.configure({
     'dashboard': {label: 'Dashboard', isDefault: true},
     'incidents': {label: 'Incidents'},
     'customers': {label: 'Customers'},
     'suppliers': {label: 'Suppliers'},
     'reports': {label: 'Reports'},
     'profile': {label: 'Profile'}
    });
  4. Again in 'src/js/appController.js', add the new page to the navigation:
    var navData = [
     {name: 'Dashboard', id: 'dashboard',
       iconClass: 'oj-navigationlist-item-icon demo-icon demo-dashboard-icon'},
     {name: 'Incidents', id: 'incidents',
       iconClass: 'oj-navigationlist-item-icon demo-icon demo-incidents-icon'},
     {name: 'Customers', id: 'customers',
       iconClass: 'oj-navigationlist-item-icon demo-icon demo-customers-icon'},
     {name: 'Suppliers', id: 'suppliers',
       iconClass: 'oj-navigationlist-item-icon demo-icon demo-suppliers-icon'},
     {name: 'Reports', id: 'reports',
       iconClass: 'oj-navigationlist-item-icon demo-icon demo-suppliers-icon'},
     {name: 'Profile', id: 'profile',
       iconClass: 'oj-navigationlist-item-icon demo-icon demo-profile-icon'},
    

You shouldn't need to refresh your browser (especially with the NetBeans Chrome Connector plugin installed into the Chrome browser). You should see your new page, added to the navigation and router, as follows:

Now, that wasn't much work at all.

DukeScript - May 09, 2016 04:59 AM
Smash Your Design with WebKit Presenters!

The presenters are the glue between your Java and JavaScript code in your DukeScript application. They make sure that your Java methods with JavaScriptBody annotation can properly pass their parameters to the JavaScript engine and receive results back.

The presenters make your application extremely portable. By selecting the right presenter when packaging your application you make sure it can run everywhere - on the desktop, on iOS, on Android, in a plugin-less browser, on your Raspberry PI, via JDK’s Nashorn script engine & co. Everywhere.

The Default Presenters

The HTML/Java project offers default presenter based on JavaFX WebView which is suitable for running your applications on any desktop that supports Java. However we all know the limits of JavaFX - bloated, unsupported (or at least ignored) by Oracle with JavaFX web view usually few releases behind any new advances in the WebKit technology. The aim of the DukeScript Presenters project is to fix this situation and sharpen the excellence of presentation by creating additional presenters.

The WebKit Presenter

Let’s take a look at our newly released version 1.0 of our WebKit presenter.

The WebKit presenter is an alternative presenter for your Mac OS X and Linux desktop applications - it avoids overhead of JavaFX and directly talks to native WebKit libraries giving you access to the most recent version of WebKit features and close integration with the underlying operating system - including native looking fonts and gestures.

To use this presenter follow the getting started tutorial. When your application is created open client/pom.xml and replace the existing presenter in the pom file (probably net.java.html.boot.fx) with:

<dependency>
  <groupId>com.dukescript.presenters</groupId>
  <artifactId>webkit</artifactId>
  <version>1.0</version>
</dependency>

With our native WebKit presenter the UI experience of users of your new DukeScript application will be on par with most modern WebKit browsers - for example when using the Charts API your graphs will render 100% the same and will feel as smooth as in the demo. The DukeScript Presenters are licensed under GPLv3 license, but the DukeScript Support is ready to offer you more business friendly license.

Improve UX of your DukeScript application and help the DukeScript project move forward: give WebKit presenter a try and share your experience with us!

APIDesign - Blogs - May 09, 2016 03:45 AM
Write Business Logic First, Choose UI Later!

The ControlsJS guys decided to port my MineSweeper game to their rendering technology and make it available at iOS AppStore:

Image:MineSweeperControls.jpeg

This shows how extremely portable applications written with netbeans:Html4Java APIs are! In fact you can write your application code first and because it is completely independent from the UI, you can completely revamp the UI later.

Isn't this the flexibility we always wanted? Read the whole story...

--JaroslavTulach 03:45, 9 May 2016 (UTC)

NetBeans – Michael's blog - May 08, 2016 08:50 PM
JSF composite components

Let’s assume, we use JSF to write an application which offers a simple registration form. This form queries the user for his first name, last name, and email. The page definition might be similar to the one following, but can’t we avoid the repetition of code? <h:form>   <div class="inputPart">     <h:outputLabel for="firstName"                    value="#{msg.lblFirstName}" … Continue reading "JSF composite components"

Geertjan's Blog - May 08, 2016 09:55 AM
YouTube: Hybrid Mobile Development with Cordova and Oracle JET

The promise of Oracle JET is that it makes enterprise JavaScript development a good deal easier. The primary platform for JavaScript nowadays is the browser on mobile devices.

So, the question is, how does Oracle JET facilitate mobile development? Get started answering that question here:

&amp;amp;lt;span id=&amp;amp;quot;XinhaEditingPostion&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/span&amp;amp;gt;

Direct link to the above: https://www.youtube.com/watch?v=a8yzh-Ec38I

The key resources referred to above:

NetBeans – Michael's blog - May 06, 2016 10:45 PM
Multi carets editing

NetBeans 8.2 is scheduled to be released end of summer 2016. One popular feature is called pin watches. During a debug session you may define several watches in the variable window to view the current content of a variable or value expression. With pin watches you may pin such a watch directly to the source … Continue reading "Multi carets editing"

Geertjan's Blog - May 06, 2016 07:00 AM
Generator for Hybrid Cordova-Based Oracle JET Applications (Part 3)

The "YoNetBeans" plugin is now available in the NetBeans Plugin Portal:

Get it here: http://plugins.netbeans.org/plugin/64070