Monday, March 31, 2014

Resource Library Contracts with NetBeans 8 and PrimeFaces


It is critical to organize an application in such a way that it is easy for users to navigate and perform their work.  PrimeFaces includes a layout component that makes it easy to select the most fitting layout for your application.  Assuming that the layout should be utilized across all application views, a Facelets template should be created, and the PrimeFaces layout should be configured within the template.  

To create the template within NetBeans 8.0, add a resource library contract to the application.  To do so, right-click on the “Web Pages” application directory and then choosing “New”->”Other…”, and select “JavaServer Faces” from the category menu, and finally choose “JSF Resource Library Contract” as the file type (Figure 1). 




Figure 1:  Adding Resource Library Contract within NetBeans

On the “New JSF Resource Library Contract” dialog, enter a contract name and click on the “Create Initial Template” checkbox (Figure 2).


Figure 2: New JSF Resource Library Contract

PrimeFaces offers a number of layouts to develop a user-friendly interface.  To use the layouts, declare the PrimeFaces namespace within the template, and then specify the PrimeFaces Layout component as the first element within the body of the template.  The layout component creates a complex borderLayout model, enabling the development of sophisticated user interfaces.  To add the layout component, use the <p:layout> tag, and specify attributes to customize the layout such as style along with a number of client side callback attributes.  In this post, the fullPage="true" attribute is specified to ensure that the layout spans the entire page.

A series of layout units can be specified within the layout component, and these units are used to arrange the layout in a particular order.  There are 5 different layout units:  top, left, right, top, and bottom. Each layout unit is specified with a <p:layoutUnit> element, and the position attribute indicates where the unit should be placed within the layout.  Add <ui:insert> tags into each of the <p:layout> sections as shown in Listing 1.  The code in Listing 1 specifies a full-page layout for an application.

Listing 1:  PrimeFaces Template Layout

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <h:outputStylesheet name="./css/default.css"/>
        <h:outputStylesheet name="./css/cssLayout.css"/>
        <ui:insert name="title">Acme Pools</ui:insert>
    </h:head>

    <h:body>

        <p:layout fullPage="true"> 

            <p:layoutUnit position="north" size="150" header="Acme Pools" resizable="false" closable="false" collapsible="false"> 
              <ui:insert name="top"></ui:insert>
            </p:layoutUnit> 

            <p:layoutUnit position="south" size="70" style="background-color: #dddddd" resizable="false" closable="false" collapsible="false"> 
                Copyright 2014
                <br/>
                Author: J. Juneau
            </p:layoutUnit> 

            <p:layoutUnit position="west" size="200" header="Navigation" resizable="false" closable="false" collapsible="true"> 
                <ui:insert name="left"/> 
            </p:layoutUnit> 

     

            <p:layoutUnit position="center"> 
                <ui:insert name="content">Content</ui:insert>
            </p:layoutUnit> 

        </p:layout> 

    </h:body>

</html>
After applying the template to the index view, it will resemble the layout shown in Figure 3.


Figure 3:  PrimeFaces Page Layout

The layout in the example utilizes custom animation to hide the navigation pane, and PrimeFaces provides this functionality without any additional configuration.  As you can see, PrimeFaces and NetBeans 8.0 make it easy to generate a sophisticated user layout.


Friday, March 21, 2014

GlassFish 4 - Let's Help as a Community

We know that GlassFish 4 works with JDK8, but it has not yet been officially sanctioned.  Let's help out as a community and test out GlassFish 4 using the latest nightly builds, and submit any issues that arise.  The more feedback that is provided, the more solid the next release of GlassFish will be!

Here's what you can do to help:

1)  Grab a recent nightly build of GlassFish 4 from here: http://dlc.sun.com.edgesuite.net/glassfish/4.0.1/nightly/

2)  Install the build, and configure it to use your installation of Java SE 8 by doing the following:

  Set the AS_JAVA property within your 
  <glassfish-path>\glassfish\config\asenv.conf configuration file equal to your Java 8 installation. 

  On OS X, this would look like the following:

AS_JAVA="/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home"

3)  Test your Java EE applications under GlassFish 4 using Java 8, and submit any reproducible issues to the Issue Tracker:  https://java.net/jira/browse/GLASSFISH

  - Please include the steps to reproduce the issue(s) when submitting them to the tracker.  The more information, the better!

If we do our part as a community, we can help GlassFish to become more stable on Java 8, and then we should see a stable 4.x release sanctioned for use with Java 8 sometime in the future.

HelloType helloLambda = 
          (String text) -> {System.out.println("Hello " + text);};

helloLambda.hello("GlassFish 4 on JDK 8");


Sunday, March 16, 2014

Running GlassFish 4 on Java 8: Experiment with Java 8 Functionality in Java EE 7 Applications

Do you want to use the features of Java 8 with your Java EE 7 application?  It is possible to run GlassFish 4.0 under JDK 8.  To explicitly define which JDK GlassFish 4.0 uses, set the AS_JAVA property within your <glassfish-path>\glassfish\config\asenv.conf configuration file equal to your JDK 8 installation.  On OS X, this would look like the following:

AS_JAVA="/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home"

Once you've set this property and then start the GlassFish 4.0 server, it should be running under JDK 8, allowing any of the applications to utilize new Java 8 features, such as streams or lambdas.



Note:  This is for experimental use only, as Java EE 7 has not been sanctioned for use with Java 8 at the time of this post.  


I have successfully configured GlassFish 4.0 to run under Java 8 in my environment, and tested the use of streams within a Java EE 7 application without issue.  Here are some sources demonstrating basic use of streams within a CDI bean:

@Named
@SessionScoped
public class PoolController implements Serializable {
    List pools = new ArrayList();
    
    public PoolController(){
        pools.add("Pool One");
        pools.add("Pool Two");
        pools.add("Pool Three");
    }
    
    public String getPool(){
        System.out.println("The number of pools " + pools.stream().count());
        return  pools.stream().findFirst().toString();
    }

}

Friday, March 14, 2014

JavaOne 2014 Call for Proposals

The JavaOne 2014 CFP is available.  If you have an idea for a presentation that you think others will enjoy, please put in a proposal to speak at this year's JavaOne.  JavaOne is one of the world's most highly attended gatherings of Java experts.  It is the place to be if you are interested in collaborating with other Java experts...this is your chance to share your expertise!

http://www.oracle.com/javaone/call-for-papers/index.html

Thursday, December 12, 2013

Five Favorite NetBeans Features

Geertjan Wielenga invited to me to share five of my favorite NetBeans features with Oracle.  Here is the article that I wrote on those features.  When using a great IDE like NetBeans, it is hard to choose just five great features.  I've been using NetBeans quite a few years now, and it just continues to get better with each release.  If you are a developer and have not yet tried NetBeans, I suggest that you give it a try...I think you'll be pleased.

http://netbeans.dzone.com/articles/5-favorite-netbeans-features-joshjuneau

Tuesday, September 24, 2013

JavaOne 2013 - Starting Off Strong

The past two days have been packed with great sessions, and I believe that this year's JavaOne is going very well so far.  After my initial visit to the Schedule Builder, I knew this conference was going to be good.  I found it nearly impossible to choose which sessions to add to my schedule, and which ones to pass up.  There are so many good sessions to choose from, that I am hard pressed to find a time slot that does not contain at least one session that peaks my interest.  

Each of the sessions that I have attended thus far have been packed with excellent information.  It is clear that JDK 8 is a very hot topic this year.  With many sessions covering new features, such as lambda and Nashorn, JDK 8 is everywhere.  Java EE 7 is also a hot topic at this year's conference.  Sessions covering features such as JSF 2.2, JAX-RS 2.0, JMS 2.0, WebSockets, and more...the benefits of using Java EE 7 are clearly being advertised.  Perhaps some of the most widely discussed buzz around EE 7 is the HTML 5 integration.  It is also nice to see some great PrimeFaces coverage at this year's JavaOne.

NetBeans is also getting a lot of coverage this year.  I have attended sessions covering EE 7 tips and tricks with NetBeans, Project Easel, and several sessions on Java EE that demonstrated how powerful the NetBeans and GlassFish combination can be.  I enjoyed the demos of NetBeans and Project Easel being used to develop apps that scale nicely on mobile devices...complete with live debugging on an iOS device.

JavaFX is looking excellent, and the FX team is doing a great job of showing off it's power.  There are many sessions on JavaFX 8, and some great coverage of FX on Raspberry Pi.  HTML5, CSS, MultiTouch...there are countless sessions demonstrating the use of JavaFX with various technologies.

Overall, the most important part of the conference is the community.  The community is stronger than ever this year.  I've met up with so many great faces in Java over the past couple of days.  The Taylor Street cafe is a great place to meet up, and the GlassFish party at the Thirsty Bear was excellent...thanks to the GlassFish team!  The Exhibition Hall and OTN Lounge are always packed...lots of great demos and discussions.

I have the next three days packed solid of excellent Java content...looking forward to many more great sessions!  Java and the community are strong, and it is a great time to be a Java developer.

Keep up with the latest by visiting OTN at oracle.com/technetwork/java


Friday, June 07, 2013

Java EE 7 Books: Java EE 7 Recipes & Introducing Java EE 7

I have been working hard for over a year now on my most recent publication entitled 'Java EE 7 Recipes: A Problem-Solution Approach', published by Apress (May 2013).  This book covers the Java EE stack from the ground-up, and it includes coverage of EE 7 specific features, such as JSF view actions, WebSocket API, and Concurrency Utilities for Java EE.  Therefore, I feel that the book will be a good read for beginner, intermediate, and advanced Java Enterprise developers.

The first chapter begins by walking readers through recipes regarding the setup of a Java Enterprise environment, including specifics on how to install and configure Glassfish v4, a fully Java EE 7 compliant application server.  It then quickly delves into the development of Java Servlets, including coverage of newer concepts such as registering servlets without WEB-XML, and non-blocking I/O.  

Chapter 2 covers JSP from the ground-up.  Although JSP is no longer the preferred option for enterprise application development, it is still a very viable and widely used technology.  Therefore, this chapter will be handy especially for beginner and intermediate level developers so that they can have a better understanding of how JSP technology works, and where it may be the most useful.

Next, the book delves into JavaServer Faces technology, with in-depth coverage that spans four chapters (Chapter 3 - Chapter 6).  Keeping with the theme of the book, readers will learn how to develop applications with JSF, including useful tips and techniques, as well as integration with third-party libraries such as PrimeFaces.  The JSF 2.2 release (which is new with the release of EE 7), includes useful features such as the ability to invoke managed bean actions on life-cycle phase events (viewActions), and better integration with HTML5.  This book will show seasoned JSF developers how to use these new features so that they can begin integrating them into new and existing applications.

No enterprise application would be complete without database access, and Chapters 7 and 8 provide coverage for JDBC and Object-Relational Mapping via the Java Persistence API (JPA).  Chapter 7 provides coverage for utilization of JDBC technology for database access.  The chapter covers everything from obtaining a connection, to handing errors, simplifying connection management, performing CRUD operations, and execution of database stored procedures.  For those developers more interested in utilizing server-side database connection pools, etc., Chapter 8 covers the Java Persistence API.  The chapter contains vital information for working with underlying data stores via JPA including data mapping and entity creation.  It also hits upon EE 7 specific updates, including schema generation support.

Chapter 9 covers EJB technology, along with its new features via the release of EJB 3.2.  Readers will learn how to utilize EntityManagers, differences between Stateless and Stateful Session beans, how to utilize EJB via JSF, and more.  The new features covered include asynchronous message-driven beans (MDB), explicit designation of remote and local interfaces, and opting out of stateful session bean passivation.  In Chapter 10, readers will learn how to query entities using the most up-to-date features in JPQL.   

If you want to work with Java EE 7, you will most likely utilize GlassFish 4 application server since it is the first EE 7 compliant server.  Chapter 11 includes content on how to get up-and running with GlassFish v4, utilizing the administration console for application and datasource management, and setting up authentication.

One of the most popular features of Java EE beginning with the release of EE 6 has been Contexts and Dependency Injection.  Chapter 12 covers CDI in full detail, including recipes on injection, using CDI beans via JSF views, and more.  It also covers new features such as the injection of bean metadata and the new @Veto annotation for marking classes as ignored by CDI.

Have you heard about the simplification of Java Message Service (JMS) in the new 2.0 release?  Readers will learn all about the new simplified JMS API in Chapter 13, along with other JMS basics such as creation of resources, creating/sending messages, and the new message delivery delay.

Chapter 14 is a bit of an extension on Chapter 11, as it covers authentication and security for Java Enterprise applications, specifically those deployed within a GlassFish container.  Almost every enterprise application requires a login form, and this chapter covers how to create one, and also how to utilize LDAP authentication for producing single-sign on solutions.

SOAP and RESTful web services have become significant technologies for the Java EE stack.  Chapter 15 covers web services, both SOAP and REST-based services using JAX-WS and JAX-RS.  Readers will learn how to create each type of web service, and utilize the new features of JAX-RS 2.0 such as the new client API.

Java is not the only language on the block any longer (or JVM, that is).  It is not uncommon to see different languages being utilized to create entire enterprise applications for the JVM, or even for integration with existing Java EE applications.  Chapter 16 includes a few short recipes showing how one may integrate Groovy or Jython into an EE application.

Since HTML5 and the new era of web applications is upon us, the new WebSockets and JSON-P APIs for EE 7 have become of major importance.  Chapter 17 covers these new APIs, demonstrating how to create and utilize WebSockets for full-duplex communication.  The chapter includes an example calling out to a WebSocket from JavaScript.  It also demonstrates how to utilize the new JSON-P API for creating and parsing JSON.

Chapter 18 covers the use of JavaFX for creation of enterprise applications.  It demonstrates how to develop JavaFX front-end applications, and bind them to EJBs for use with data.  There is also a recipe covering the use of JavaFX with RESTful web services.

Finally, both the Concurrency Utilities for Java EE and Batch Applications APIs have been added to EE 7.  These APIs provide a standard for developing concurrent and batch applications for the enterprise. Coverage includes the creation of server-side resources (ManagedExecutorService, etc.) for concurrent application development, and creation of item-oriented batch processes.

Overall, the Java EE 7 Recipes book is perfect for those that are interested in getting up-to-speed with Java EE, including the latest features.  For those who are already experts with Java EE and are only interested in the new features, stay tuned for the release of my upcoming book entitled 'Introducing Java EE 7', to be published by Apress within the next few weeks.


Saturday, November 03, 2012

Java EE 7 by JSR

The following is a listing of JSRs that are contained in the Java EE 7 Specification.

Java EE Platform Specification - http://java.net/projects/javaee-spec/pages/Home 

JSR 107 - JCache https://github.com/jsr107/jsr107spec http://jcp.org/en/jsr/detail?id=107
JSR 236 - Community Utilities for EE http://jcp.org/en/jsr/detail?id=236
JSR 338 - JPA 2.1 http://jcp.org/en/jsr/detail?id=338
JSR 339 - JAX-RS 2.0 http://jcp.org/en/jsr/detail?id=339
JSR 340 - Servlet 3.1 http://jcp.org//en/jsr/detail?id=340
JSR 341 - EL http://jcp.org/en/jsr/detail?id=341
JSR 342 - EE 7 http://jcp.org/en/jsr/detail?id=342
JSR 343 - JMS http://jcp.org/en/jsr/detail?id=343
JSR 344 - JSF 2.2 http://www.jcp.org/en/jsr/detail?id=344
JSR 345 - EJB 3.2 http://jcp.org/en/jsr/detail?id=345
JSR 346 - CDI 1.1 http://jcp.org/aboutJava/communityprocess/pr/jsr346/index.html
JSR 349 - Bean Validation http://jcp.org/en/jsr/detail?id=349
JSR 352 - Batch Applications for the Java Platform http://jcp.org/en/jsr/detail?id=352
JSR 353 - Java API for JSON Processing http://jcp.org/en/jsr/detail?id=353
JSR 365 - WebSockets

Thursday, December 29, 2011

Java 7 Recipes: A Problem-Solution Approach

This is a quick post to mention a new book that will be published soon entitled Java 7 Recipes. I had the pleasure of leading a team of excellent authors: Carl Dea, Mark Beaty, Freddy Guime, and John O' Conner in the authoring of this book. It features a problem-solution approach demonstrating how to get up and running quickly with the Java language. The book features some of the most common questions for newbies starting to develop with Java, and provides answers in an easy-to-learn and reuse manner. It also features some of the most common intermediate and advanced problems and solutions, as well as material that is new to the Java 7 release.

Carl Dea wrote several chapters on JavaFX 2.0, and the material covers enough information to get started with JavaFX 2.0 and then delves into some advanced examples as well. If you are looking to learn the latest in Java desktop and rich internet client development, you will want to check out the chapters on JavaFX 2.0.

Mark Beaty wrote a chapter covering data structures and iteration. He is an expert in object oriented Java concepts, and this chapter covers some of the most fundamental parts of the Java language. Mark also was a technical reviewer for the book, and he did an excellent job of working through the material and solidifying it. I would also like to give a shout out to David Coffin who also performed technical review on several of the chapters...great work!

Freddy Guime is a Java expert who wrote chapters on input/output, exceptions, concurrency, unit testing, and more. Freddy has presented at JavaOne several times and his material exploits his knowledge of the Java language.

John O' Conner has been an avid Java developer for years, and is seasoned in the language. He began his career with Sun Microsystems and helped to develop the internationalization and Unicode support libraries of the core Java SE platform. He authored chapters on those topics for the book, and more.

I authored chapters varying from Strings, object orientation, numbers and dates, database development, and more. We even threw in a chapter on Android so that interested Java developers could take a look at how to develop applications for the Android platform.

Check this book out soon, or pre-order now on Amazon the Apress site. This is a must-have for any Java developer!

I am currently working on my latest Apress book entitled Java EE 7 Recipes...it should be published late next year...stay tuned for more updates on that book!

Friday, March 04, 2011

Django-Jython 1.3.0 Final Available

The Django-Jython project is proud to announce the release of Django-Jython 1.3.0 Final!

This release adds Django 1.3.x compatibility for the Oracle, MySQL, MS SQL, and PostgreSQL backends. Please test with your Django-Jython apps and provide feedback.

Project Home: http://code.google.com/p/django-jython/
Documentation: http://packages.python.org/django-jython/

Thanks to all of those who helped out with this release, your time and effort is truly appreciated!

Support for Django 1.4 is coming soon...

Thursday, March 03, 2011

Jython 2.5.2 Final Released

The Jython development team is proud to announce the release of Jython 2.5.2 final! With this release comes new features, better performance, bug fixes, etc.

For the latest release info, please visit: http://jython.org/latest.html

Thanks to all of the developers for the hard work they put into this release. Looking forward to moving onto 2.6!

Tuesday, December 21, 2010

Oracle PL/SQL Recipes

Since the beginning of my career, I have worked with Oracle databases. I began as a database administrator, monitoring performance and creating database objects. From there, I became a more advanced DBA as I began writing PL/SQL code and creating triggers, functions, packages, and procedures in the database. After a while, I became interested in web application development because I was always receiving requests for creating database reports. Why write a SQL statement and re-run it every time someone wanted to see the output, when you could write a web query that accepted parameters as input and the user could run it on their own? That is the point when I discovered how to do web application development with PL/SQL and the Oracle PL/SQL web toolkit. My good friend and colleague, Matt Arena, showed me the ropes about developing PL/SQL web applications, and it was great! Now I was able to develop web-based queries whenever I had received a request for a report.

After a while, I began to write Java stored procedures because I was developing some sophisticated PL/SQL web applications by that time and I wanted to use some features that the Java language had to offer. Of course, this all worked very well...but I soon gained interest in developing Java Server Pages (JSP) based web Java web applications because they seemed a bit more versatile then PL/SQL web applications. I learned that I could more clearly separate business logic from display code using Java technologies, and began to learn more about it. Before long, I was a full-fledged Java application developer. I was developing Java enterprise applications for Oracle database, and using PL/SQL objects to help facilitate my applications where it made sense.

That brings me to where I am today. I still develop web applications for Oracle database using Java technologies and PL/SQL. I have broadened my horizons by using great languages such as Jython. Life couldn't be much better. This past year, I decided to author a book about PL/SQL that focuses on the basics...but also goes into advanced topics such as working with PL/SQL and Java to develop advanced solutions. I brought my highly respected coworker, Matt Arena, into the book as my co-author. Matt is the most advanced PL/SQL developer that I know, and he wrote the chapters that focus on PL/SQL web application development, collections, PL/SQL jobs, and performance. He taught me, and now he is sharing his great knowledge by teaching others. I authored many chapters that focus on the PL/SQL language fundamentals, and also some advanced chapters working with PL/SQL and Java application development.

Our book is entitled, Oracle PL/SQL Recipes - A Problem-Solution Approach. I recommend you picking it up if you are an Oracle applications developer. Learning PL/SQL is a great asset to any Oracle developer's toolbox. Even if you only work with Java applications, PL/SQL can help you to develop better-performing, and highly robust Oracle solutions. A big thanks goes to Apress and the entire editorial team, including my good friend Jonathan Gennick, who has done an excellent job editing this book. I look forward to working with him again on future projects. I also thank my colleague and great friend Matt Arena for showing me the ropes with PL/SQL web application development...leading my to where I am today in my career.

Oracle PL/SQL Recipes - A Problem-Solution Approach...publishing late December 2010.

Tuesday, October 12, 2010

JavaOne and Oracle Develop 2010 - A New Experience

I took my first trip to JavaOne this year. There were many deciding factors that made me choose to make the trip this year, but perhaps the biggest reason that I attended was due to the Oracle acquisition of Sun Microsystems that took place earlier this year. I wanted to see what Oracle's viewpoint was on the Java ecosystem, and what they planned to do with it over the next several years. I must say that I was pleasantly surprised with the message that I received at the conference, I think Java is alive and very well.

I attended several sessions each day, and the conference made for a very hectic week. I had never visited San Francisco before and I must say that I found it very similar to Chicago. Being a Chicago area person myself, I found nothing overly different about San Francisco as compared to Chicago, but then again, I did not take any opportunities to go sight seeing as I was completely focused on the conference itself.

Having never been to a JavaOne conference before, i think that it was fairly well organized. Now, JavaOne was spread across a few different hotels and one large tent...and in the past I believe that it was centered in the Moscone convention center. I thought that the hotel system worked, but it did make for some rather busy shuffles from session to session. I did like the fact that I had the opportunity to go outside in between sessions though, and since the Mason St. tent was in the center of it all, I could swing by the tent on the way to another session and pick up a coffee or chat with some interesting folk. This really enhanced the experience for me.

The sessions were well thought out and worthwhile. Of course, being a Jython fan I went to as many sessions that were centered on dynamic languages on the JVM as possible. Jim Baker and myself had put in for a Jython-specific talk at this year's JavaOne and unfortunately it was turned down. Our talk was going to focus on the overall picture of bringing dynamic languages to the JVM...and Jython was going to be the example-case. I wasn't too surprised when our session was turned down as there are thousands of submissions, but when I attended the conference it was clear to see why it was turned down...there were several excellent sessions regarding dynamic languages on the JVM already. To be quite truthful, the dynamic language sessions at JavaOne covered several different languages...and I feel that the most used languages on the JVM today were nicely represented. It would have been very nice to have a session devoted to Jython specifically, but the fact is that there are so many dynamic languages on the JVM nowadays, that there was just not enough room for a session on each.

To that end, I attended an excellent JRuby session as my first JavaOne session...it really started my experience off in a great way. The presentation was given by Charles Nutter and Thomas Enebo...a couple of JRuby architects. This was a solid session that really made me want to go and download JRuby afterwards and try it out. Having not tried JRuby prior to the session, I was really focusing more on seeing another dynamic language on the JVM and getting some ideas of how they implemented it. After the presentation, it was clear to see that the JRuby team has a focused effort and is doing very well in porting the Ruby language to the JVM...excellent session.

My second session also focused on languages on the JVM...it was entitled "Multiple Languages, One Virtual Machine". This talk was given by Brian Goetz and John Rose. They did an excellent job of discussing invoke dynamic and what the future holds for dynamic languages on the JVM. It was clear to see that Oracle is putting resource behind offering many different languages on the JVM...not just Java. They are behind the invoke dynamic effort, and it will be included in JDK 7...which is due out sometime in 2011.

I attended many sessions on Java EE 6, EJB, JSF, and other enterprise technologies as I am currently using EJB3 and JSF on many of my projects at work. After attending so many sessions on the EJB 3.1 Lite and JSF 2.0 features, it is clear to see that I need to update my code to take advantage of many of the new features that are available today. It is too easy to get a formula that works and just continue to develop applications using that formula. I fell into that trap over the last couple of years, mainly due to a shortage of time for learning the new stuff. Between my authoring of the Jython book and Oracle PL/SQL Recipes, I haven't enough time to devote an hour a day to learning EJB 3.1, JSF 2.0 or CDI. However, I am making a goal for myself to learn how to migrate my EJB 3.0 code bases to take advantage of the new technologies as I can see from the JavaOne sessions that the newest implementations of the APIs are clearly more productive and easier to manage.

And then there was JavaFX. This technology has always been in the back of my mind as something that I want to learn and begin to use in my projects. I had purchased and read the JavaFX Script book by Jim Weaver a while back...excellent book. As everyone knows by now, it was announced at JavaOne that JavaFX Script will be going away and that the JavaFX API will be changing so that it can be used directly with Java code. This is HUGE news for me as a Java and Jython developer. I attended a great session by Jonathan Giles and Stephen Chin regarding the development of JavaFX applications using alternate languages. They covered JRuby, Closure, Scala, and Groovy in the session. It really looks like the new JavaFX API is going to be great and I am looking forward to writing a JavaFX application using Jython. As a matter of fact, I spoke with Stephen Chin in the Mason St. tent later on, and he was also interested in developing a Jython demo. I hope to see something soon, and plan to develop Jython and JavaFX applications when the new JavaFX API is available.

My parting session was an introduction to Scala. I am glad that I attended this session as well as I have been in the dark about this language until now. I had been hearing lots of good things about Scala, but hadn't found the time to take a look. Attending this session gave me a great overview of the language and really gave me the bug that I needed to put it on my priority list as a language to learn in the coming weeks. Now I need to learn both JRuby and Scala...my time is really going to be growing thin!

Other activities that I took part in included:

Oracle Publisher's Seminar - Since I am writing the PL/SQL Recipes book, I was able to attend this great seminar. It gave me a good opportunity to learn about some Oracle strategies from the team leads themselves, and also meet other Oracle authors.

Jython BoF - Oti Humbel and myself gave a Jython BoF on Wednesday of the conference in the Parc 55 hotel. The BoF was not very well attended, but the appreciation event was also that evening and I suspect that had something to do with it. Overall, Oti and I were able to muddle through the list of open bugs that need to be repaired prior to a Jython 2.5.2 final release. I had a great time meeting with Oti and look forward to working with him on Jython for future releases. We also met with Frank Wierzbicki, the Jython project lead and one of my co-authors for the Jython book. It was great to talk Jython for a while with a couple of the core devs, and to strategize about future Jython developments.

Keynotes - The JavaOne keynotes were okay...lots of hype around the future of Java and JavaFX. Glad I attended them for the experience, but nothing too earth shattering. My favorite keynote was the Oracle Develop keynote by Tom Kyte. I have been a big fan of Tom Kyte for several years as he is a lead in Oracle database technologies and PL/SQL. Excellent keynote with some great insight on Oracle 11gR2 and some of it's new features (some that I have not used yet!).

JavaPosse - Perhaps the highlight of the conference for me was the JavaPosse BoF and rooftop party at the Passion Cafe. I listen to the JavaPosse religiously, and finally having a chance to see the crew in person and have drinks with them after the BoF was a great experience. They are truly great people who do an excellent job with the podcast. Thanks JavaPosse crew, excellent show at JavaOne.

So JavaOne 2010 was a new experience for me. I think that it was a great experience and I would be happy to attend another JavaOne at some point in the future. I think that given the atmosphere and the dynamics of the conference, it was a new experience for even those who had attended in previous years. It is nice to see that Java is in good hands with Oracle, and I am looking forward to a bright future.

Wednesday, March 24, 2010

Working with Images Using Django on Jython

If you've tried to use Django on Jython along with an ImageField, you know well that Django on Jython does not support this field. This is because the ImageField in Django relies on the Python Imaging Library (PIL). Jython does not support the PIL since it is C based, and there is not currently a version of the PIL that has been ported to Java.

That being said, how do we make use of images in Django on Jython? Since the ImageField is not usable from Django on Jython, we need to use an alternate method for uploading and displaying images. The following is a solution I've been using for one of my applications. This is certainly not a perfect solution, nor do I think we should modify Django on Jython to support this solution out-of-the-box. However, it works and gets the job done.

In order to use images with Django on Jython, you need to make use of the FileField. Since the FileField does not display in a template as an image, it is also a requirement to tweak the template which will be displaying the images with an ordinary "img" tag. Also, to make things work nicely, it is important to code a variable...we'll call it "image_src"...with the path to the image that will be displayed. This is done within your views in views.py. Of course, images will take the name attribute of your FileField, but you must prefix that name with the path to your web server. So my solution for this is to create another variable, say PHOTO_ROOT, in the settings.py and we will set it equal to the web server's MEDIA_ROOT location.

Lots of steps to make a usable image? Not really, it may seem daunting at first glance, but it does work easily once you've got it down.

Steps for using images with Django Jython:

1) Create a FileField in your model to contain your image information. Be sure to indicate where you wish the image to be uploaded to by specifying the "upload_to" attribute.

For example, in the following case the "images" directory which is specified by the 'upload_to' attribute exists directly under the MEDIA_ROOT root:

class MyTestModel(models.Model):
photo = models.FileField(upload_to='images', blank=True)


2) Create a variable within settings.py to contain the path to your web server's MEDIA_ROOT location. Please note that this will need to be changed when you deploy to different environments (ie: development or production).


PHOTO_ROOT = 'http://localhost:8000/site_media/'


3) Add a variable to your views through which the image path will be exposed. This variable will need to contain the PHOTO_ROOT you specified in settings.py, as well as the appended file.name for the FileField containing your image. Therefore, you will need to code a line in each view you wish to expose the image through.

In order to make your UI slick, it is a good idea to use a default image for any records that may not have an image uploaded. You can assign the path for that default image to your variable if your FileField does not contain anything.


# Be sure to import your settings file
from django.conf import settings
...
# This code contains relevant portions of a detail view for displaying or modifying
# a record
def detail(request, record_id=0):
...
record = get_object_or_404(MyTestModel, pk=record_id)
form = MyForm(instance=record)

# Check to see if the FileField (photo) contains anything
if record.photo:
image_src = '%s/%s' % (settings.PHOTO_ROOT, record.photo.name)
else:
image_src = '%s/images/nophoto.jpg' % settings.PHOTO_ROOT

...
return render_to_response('detail.html',
{'form':form,
'image_src':image_src})



4) Add an "img" tag to your template in order to display your image. You must also add the "form.photo" field to the template in order to have the ability to upload an image.



some_content
...


{{ form.photo }}

<img title="Photo"
src="{{ image_src }}"/>


...
more_content


That is basically it. When you view the record initially, the default image should appear. After an image is uploaded successfully, it should replace the default image.

Wednesday, March 10, 2010

Received Author Copies of The Definitive Guide to Jython

For the past few weeks since The Definitive Guide to Jython had been published, I've been checking my mail often in anticipation of seeing our book in print for the first time. Well, today my copies finally arrived and it is great. It is excellent to read the printed copy...and it will definitely be nice to have on my desk while I'm coding some Jython.

Thanks again to all of my co-authors, the technical reviewers, editors, and everyone else involved in the publishing of the book. It is a great resource and I am glad to be a part of it. Looking forward to working on the second edition in the not too distant future!

Now, onto more coding...

Wednesday, February 03, 2010

Jython Book - Working with the Sources

The open source version of 'The Definitive Guide to Jython' (aka: Jython book) is available online, both in restructuredText format and HTML via Sphinx. Apress was good enough to send me the final versions for all of our chapters and appendicies in MS-Word format. It is my task to convert them from MS Word format into restructuredText...which is a slow and sometimes painful process.

Overview of Conversion Process

1) Open the MS-Word document in Open Office (my preference) and remove headers and footers from each page

2) Save the document in open office format

3) Try to apply the apress_odt_to_rst.py script that was donated by James Gardner. If that doesn't work, then save document in HTML format and use pandoc to convert.

Command: pandoc -t rst filename.htm > filename.rst

4) Manually parse through each rst file and repair issues (and there are usually a lot...especially with code markup and tables)

Interested in building the sources?

If you are interested in building the sources, you can check the out from bitbucket.org at the following link: http://bitbucket.org/javajuneau/jythonbook/ and then build them using Sphinx

View the Open Source Book

If you'd like to simply view the open source book, it can be found at http://jythonbook.com in Sphinx format. We of course recommend that you purchase a copy of the book from Apress to keep handy as well so that you can mark it up, make notes, etc. However, the open source version will be continually updated and it will be great for using as a quick reference while online.

Monday, February 01, 2010

The Definitive Guide to Jython Is Published

The Definitive Guide to Jython: Python for the Java Platform has been published. This is a work in which five authors: Jim Baker, Victor Ng, Leo Soto, Frank Wierzbicki, and myself, began to author early in 2009. The book covers much detail on the Jython language and it's usage. It was a much needed addition to the library of Jython books that are available today as this book focuses on Jython 2.5.1...the most current release to-date. Many methodologies that hadn't been formally documented previously, such as the object factory pattern, with-statement, django and jython, and concurrency, have been documented in detail in this text.

If you are interested in developing with Jython, I recommend you take a look at this book today. There is also an online open source version of the book that can be found at http://jythonbook.com, but all of it's contents have not yet been updated to include finalized versions of all chapters. I am working on converting the .doc formatted final versions into restructured text at this time, but it is a lengthy process.

Thanks to all of my fellow authors and to the team at Apress for all of their hard work!

Wednesday, September 16, 2009

Jython 2.5.1rc2 - zxJDBC with-statement

This past weekend (09/12/2009), the Jython developer team rolled out the second release candidate for version 2.5.1. In the release were many bug fixes and some additional features...I definitely recommend downloading it and trying it out if you haven't already done so. Thanks to all of the developers who have made this release possible.

One of the features added in this release for database work with the zxJDBC API is with-statement compatibility. Thanks to Jim Baker for updating the PyConnection and PyCursor objects in Jython so that it can now be used in the context of a with-statement. This can be useful for maintaining resources and transactional state when working with databases.

To use the new feature, you must import the closing() function from contextlib so that the connection can be bound to a variable and closed at the end of the statement. Use of this feature works as follows:


# In this example, I am connecting to a postgresql database.
# Of course, we could connect to the database of our choice so long
# as we have the appropriate JDBC driver in our CLASSPATH

>>> from __future__ import with_statement
>>> from com.ziclix.python.sql import zxJDBC
>>> from contextlib import closing
>>> jdbc_url = "jdbc:postgresql:mydatabase"
>>> username = "postgres"
>>> password = "mypass"
>>> driver = "org.postgresql.Driver"
>>> with closing(zxJDBC.connect(jdbc_url, username, password, driver)) as conn:
... with conn:
>>> # Use one or more cursors within the context of the with-statement
... with conn.cursor() as c:
... c.execute("select name from country")
... c.fetchone()
...
(u'Afghanistan',)


In the example above, I queried a database table. However, we could use the cursor in any way that we'd like within the context of the statement. Use for transaction management and if an error occurs within a transaction then everything is rolled back.


>>> with closing(zxJDBC.connect(jdbc_url, username, password, driver)) as conn:
... with conn:
... with conn.cursor() as c:
... try:
... stmt = "insert into country values (?,?)"
... # the following produces an error
... c.executemany(stmt, ['test'])
... # perform more inserts and updates
... conn.commit()
... except Exception, err:
... raise Exception("There has been a zxJDBC error")


Transaction management is taken care of such that if a statement fails, then the complete transaction is rolled back. This is very useful for transaction management. If you attempt to work with the cursor or connection outside of the statement then it will not work because the statement closes them after use. That is the beauty of using the with-statement for resource management. The with-statement is also nice for working with files and such in a similar manner.

For more information on the use of the with_statement, please visit PEP-343 or the open source Jython Book (In Progress) which will soon be updated to illustrate correct usage of with-statement context management for zxJDBC in 2.5.1.

Enjoy!

Thursday, July 02, 2009

The Definitive Guide to Jython - Open Source Version

Start reading the open source version of 'The Definitive Guide to Jython'. This book is currently being authored by Frank Wierzbicki, Jim Baker, Leo Soto, Vic Ng, and myself. It is due to be published by Apress in the fall of 2009. I am having a great time being part of the project and really appreciate the opportunity! I thank Jim Baker for contacting me in regards to the book and giving me the opportunity to become the lead author.

The book is available in restructured text format on the kenai.com website as the jythonbook project. You will find the Sphinx formatted book here for the time being, but we will migrate it to jythonbook.com in the near future. We encourage comments and suggestions.

A special thanks to James Gardner for his help on providing us with the tools to convert the book into restructured text format. I plan to have a post dedicated to my work with converting from Word to rst and vice versa sometime in the near future.

Our book is focusing on the 2.5 release of Jython, which you can download here. It goes through the Python language basics through some advanced concepts. The book then goes into Jython-specific topics such as java integration and the like.

We hope you will find this book useful. Stay tuned for more to follow on the book...

Tuesday, June 16, 2009

Jython 2.5.0 Has Been Released

Jython 2.5.0 has been released! This release includes many new language features for Jython bringing it inline with more modern releases of Python. This is a big release and I congratulate all of the developers!

Go and download today from : http://www.jython.org

Friday, April 10, 2009

Netbeans Articles

James Branam has recently turned a couple of my Python/Jython tutorials for Netbeans 6.5 into Netbeans.org articles. Check them out:

Developing a Jython App in Netbeans

Python Quickstart

If you haven't tried Netbeans out for Jython or Python development, now would be the time...it is great!

Sunday, March 29, 2009

The Definitive Guide to Jython...Fall 2009

A new Jython book will be published by Apress this fall entitled 'The Definitive Guide to Jython with Django'. Authors include Jim Baker, Frank Wierzbicki, Leo Soto, Victor Ng, and myself.

This book will be of interest to those beginning Jython and also to advanced users. We will also maintain an open source version of the book online.

I'm looking forward to working with these talented individuals and assisting in the documentation of Jython.

Tuesday, February 24, 2009

EMD Upload Error: Oracle Enterprise Management Agent

I came into work on Monday and saw that all of the databases which are running on our development database server were no longer reporting to our Oracle Grid Control. After looking at the Grid Control server, I realized that the management agent was not functioning correctly. Time to investigate...

I went to the command line and issued the following:


emctl status agent



Everything looked fine, but then I realized that the "Collection Status" indicated that it had been disabled by the collection manager. In my case, this had occurred because over the weekend I had been moving some files around and filled up one of the disks on the server completely. Realizing I had done so, I immediately removed some of those files to free up disk space. Unfortunately, this disk which filled up was the same one on which the Oracle Management Agent is installed. Being that the disk filled up and that the collection manager was not able to add the required XML files to disk, it immediately disabled itself.

The remedy: Of course, ensure that the disk has available space. Once you've done so, simply restart the management agent. It will begin working immediately.

Thursday, February 05, 2009

Developing Django-Jython Using Netbeans

If you are interested in using Django on Jython, then you will need to incorporate the Django-Jython project into your Jython installation after Django has been installed. The Django-Jython project facilitates the use of Jython's zxJDBC database infrastructure in order for Django to access database backends. At this time, the only fully supported database is Postgresql, but there are also experimental backends for using SQL Server, sqllite, and Oracle under development. In order to use Django on Jython with another database or to assist in the development of these backends, you will need to download the Django-Jython project source code and write your own backend or update one which already exists.

Working with the Django-Jython project using a text editor is one way to go, but if you are used to the automation and simplicity of using an IDE, text editing can be a painful experience. This blog will walk you through the steps of setting up an environment within Netbeans 6.5 for developing the Django-Jython project.

The process of development with Django-Jython is as follows:

1. Download source for project

2. Add/Modify source code to facilitate your needs

3. Build the source and install it into your Jython home

Number 1 above is easy enough, just visit the Django-Jython project page. However, numbers 2 and 3 are manually performed processes. You can help to automate these processes by using the power of Netbeans. Simply follow the procedure below to set up the environment:

1) Create a Python project with existing sources and name it something like "DjangoJython"




2) Add the root-level directory of the "django-jython" source folder to the "Source Root Folders" window area when creating the project, then click finish.


At this point your project will be created and you can work with the source. However, we need a way to tell the IDE to build and install the project. You can either use the command-line to do so by traversing to the project folder and issuing:

jython setup.py build, followed by, jython setup.py install

Or, you can perform have Netbeans IDE build the project for you when you invoke the "Run" process on the project by performing step 3.

3) Right-click on the project, and choose "Properties". Select the "Run" category and then enter "setup.py" as the main module and enter "install" into the application arguments text field. Now, each time you elect to "run" the project, it will cause netbeans to build and install it.




The only caveat to using this method of building and installing Django-Jython is that you will need to manually delete the "build" directory in your DjangoJython Netbeans project as well as delete the "doj" directory from your Jython installation (Jython-Path/Lib/site-packages/doj) prior to issuing "run" each time. I have found that if you do not, sometimes all of the updated modules are not reinstalled. Deleting these directories prior to running your build/install forces a new build and install to take place each time.

Now, enjoy the great development experience of Netbeans while contributing to a great project...Django-Jython! Have fun!

Wednesday, January 21, 2009

Django-Jython: Working With Experimental Database Backends - Part 1

This is the first of several blogs that I plan to publish regarding the use of experimental database backends with the Django-Jython project. In this series of blogs, I will cover the basics of how to begin using the experimental backends, as well as some details on how to create your own. At the time of this posting, only one "fully supported" backend exists for the Django-Jython project and that is for the PostgreSQL database. However, another experimental backend exists for SQLLite and there are more on the way.

In order to build and begin using the experimental backend for SQLLite (or others), you must first obtain a copy of the code, which is available on the project site, or via your command-line using the following line:

svn checkout http://django-jython.googlecode.com/svn/trunk/ django-jython-read-only

Once you've obtained the code, it is easy to build. Simply traverse into the root directory of the downloaded code which should be named "django-jython", and perform the build using the setup.py build script as such:

jython setup.py build

Now, this works nicely for a build to use the PostgreSQL backend, but it will not include the experimental backend implementations. In order to do so, you must open up the setup.py script and add the experimental backend that you wish to use within the "packages" listing as follows:


from distutils.core import setup
setup(
name = "django-jython",
version = "0.9",
packages = ['doj',
'doj.backends',
'doj.backends..zxjdbc',
'doj.backends..zxjdbc.postgresql',
'doj.backends..zxjdbc.sqllite', # Experimental backend
'doj.management',
'doj.management.commands'],
...



Once you've added this to the setup.py script, it will cause the experimental code to be built the next time the build process is invoked. Now you can begin using the new backend.

Next time I plan to delve into the process of creating your own experimental backend for the Django-Jython project!

Sunday, January 11, 2009

Jython 101 - Altering Tuple Values

Often times we use lists and tuples to hold data that will be used at some later point in an application. When we iterate through the data within them without changing it then they work without any issues. However, if we wish to change one or two of the values that are contained in a tuple then we may run into an issue because they are immutable in the Jython world. Lists are a bit different as they can be altered. If you've run into this issue with tuples and need an easy solution, then hopefully the technique which I am about to describe will help you.

The Problem

Let's say we have a tuple of parameters that we wish to pass to another Jython module at some later point. However, once the receiving function obtains the tuple of parameters, it is found that a value needs to be added to it in order to make it complete. How do we add or insert a value into a tuple if they are immutable?


The Solution


Quite easily actually, the answer is that we define a list that will take the values of the tuple and pass it on.

For instance, lets define tuple:

x = ("one", "two", "four")

print x
['one', 'two', four']


If we try to alter the tuple and insert the value "three" before the four, we receive an error:


x[2] = "three"

TypeError: can't assign to immutable object



Therefore, a great workaround is to define an empty list and populate it with the contents of the tuple. At the same time, you can add, change, or remove any elements that you wish. In the end, use the newly define list as your "new" parameter list and pass it on.



# define empty list
y = []

# iterate through tuple and populate new list

for elem in x:

# check element to see if it's contents need to be changed, or moved
# in this case, we are looking for an element with the value "four"
# so that we can insert "three" in front of it

if elem == "four":

# Insert the new element, and then the current element
y.append("three")
y.append(elem)
else:
# Insert the current element
y.append(elem)

print y # Use the new list and continue.
['one', 'two', 'three', 'four']




I hope that you find this tip for using Jython tuples useful.

Joined the Netbeans Community Docs Team

I have joined the Netbeans Community Docs team recently. This is a great program that has been put together to allow the Netbeans community to help document and provide guides for using the IDE. I hope that I am able to add some benefit to the team by providing tutorials, articles, and documentation from time to time. I am also going to be compiling and editing the monthly newsletter for the group.

Stay tuned for more Netbeans-related blog entries focused on using the IDE with all of the technologies I love...including (but not limited to) Java, JavaEE, Jython, Groovy, JavaFX, Swing, SQL...and more!

Sunday, January 04, 2009

Web Beans 1.0.0 Alpha Released

JBoss has released Web Beans 1.0.0 Alpha recently. Quoted from the Web Beans site:

"Web Beans defines a set of services for the Java EE environment that makes applications much easier to develop. Web Beans layers an enhanced lifecycle and interaction model over existing Java component types including JavaBeans and Enterprise Java Beans. As a complement to the traditional Java EE programming model, the Web Beans services provide:

* an improved lifecycle for stateful components, bound to well-defined contexts,
* a typesafe approach to dependency injection,
* interaction via an event notification facility, and
* a better approach to binding interceptors to components, along with a new kind of interceptor, called a decorator, that is more appropriate for use in solving business problems.

Web Beans is especially useful in the context of web applications, but is applicable to many different kinds of applications and may even be used in the Java SE context, in conjunction with an embeddable EJB Lite container, as defined in the EJB 3.1 specification. "

I'll be checking this out soon...

Tuesday, December 23, 2008

Jython Podcast Domain Name

Thanks to Groovymag.com, the Jython Podcast site is now available at jythonpodcast.com. If you haven't yet had a chance to read Groovymag, I suggest that you take a look if at all interested in Groovy or Grails. The magazine is an excellent resource for beginners and advanced Groovy users alike.

Thanks to Michael Kimsal and the Groovymag for the domain name.

Friday, December 19, 2008

Jython Podcast Site Ready

I finished the preliminary Jython Podcast website last week and I thought that it would be a good idea to release it to the world for your thoughts and opinions. I wanted to create and deploy the website as a Django site running on Jython. However, as it turns out I am unable to deploy a Django on Jython site to a server running on JDK 1.5 (at least I haven't figured out how to do it as yet). Therefore, I have had to postpone the deployment of the Django site until I can upgrade to JDK 1.6.

It is my plan to begin the podcast with an episode near the end of December. Hopefully once I get the first episode released, iTunes will not have any problems updating to include it.

Check out the Jython Podcast site here. I also would like to thank HostJava.net for providing the domain name and sponsoring the podcast.

Tuesday, December 02, 2008

Jython CLASSPATH

I ran into a small issue this past weekend while doing some Django development with Jython 2.5 b0. The Django scripts appeared to be running correctly until I attempted to synchronize with the database using:

jython manage.py syncdb

Each time I tried to run this against my Postgresql backend I was receiving an error stating that "org.postgresql.Driver" could not be found. In reality, that driver was already in my Jython CLASSPATH because it is installed by default when Django is set up.

The issue may be that I have too many Jython installations on my Mac now, but nonetheless, it is easy to work around. I still have not found the complete solution as yet, but as long as the "--verify" argument is passed along with the "syncdb" call then everything works out well. This is because the verify argument forces the CLASSPATH to be parsed at runtime. While the --verify argument makes it take a second or two longer to run, it should resolve issues where the CLASSPATH is not being parsed as it should.

Workaround solution:

jython --verify manage.py syncdb

Wednesday, November 19, 2008

NetCAT 6.5 Complete!

I'd like to thank all of the developers at Netbeans for hosting a great NetCAT session for the 6.5 release. It seemed that everyone on the development team played an important role in this great release and the NetCAT team members also provided meaningful feedback and assistance.

I'd recommend that anyone who is interested in having their voice heard for future releases of Netbeans should get involved in future NetCAT programs. All of us members certainly had "our say" in many features of the final product. This is a program that really goes to show how much the community can make a difference.

Thanks again to Netbeans developers and fellow NetCAT 6.5 participants.

Netbeans 6.5 GA Available

If you haven't done so already, I suggest that you go and pick up Netbeans 6.5 at this time. It is arguably the best IDE release ever. Along with the Java feature updates, this new version of the IDE includes Groovy support, compile on save, and Python support is available in EA format.

If you want to migrate your libraries from an older version of 6.5 (release candidate), simply copy the project libraries files. See this wiki article for more details.

Tuesday, November 04, 2008

Check out GroovyMag

Interested in Groovy or Grails? If you are then you'll want to check out GroovyMag.com as the first issue of GroovyMag is now available for download. Unfortunately, it looks like you have to purchase the magazine. However, the cost looks pretty reasonable and it looks as though there is a lot of good content...probably worth the $4.99, so check it out at http://www.groovymag.com/main/ to see a summary of the content.

Thursday, October 30, 2008

Netbeans 6.5 RC2

Download Netbeans 6.5 RC2 now and try it out.

If you have been using 6.5 RC1, then you will need to redo all of your settings for RC2. However, the easiest way to get around this is to copy the contents of your Netbeans user directory from RC1 into RC2. If you do this then all of your settings will be retained.

Test RC2 and give feedback to the development team (nbdev@netbeans.org) if there are issues.

Monday, October 20, 2008

Jython Monthly Newsletter

Anyone who wishes to post an article for the October distribution of Jython Monthly should place link on the following page. http://wiki.python.org/jython/JythonMonthly/Articles/October2008

Distribution of the newsletter will occur this week. Thanks in advance for all article submissions.

Wednesday, September 24, 2008

Java for Mac OS X 10.5 Update 2

Java for Mac OS X 10.5 Update 2 has been released. Mac users (with compatible machines) should go to software updates and download soon. I just installed the update and used it to run some tests with Netbeans 6.5 and the performance is much better than running on an Apple JDK 1.5 release. Things are looking good so far...

Tuesday, September 09, 2008

Groovy Datasources - Changing Hibernate Dialect - Oracle 11g

I found a funny while working with some Grails applications today. I have been developing one of my Grails applications for about 2 or 3 weeks now. I updated DataSource.groovy on Day 1 to make the application work with my development Oracle repository and all was well.

Yesterday, I migrated my development Oracle environment to 11g and my Grails application stopped functioning. I was receiving messages stating that the correct Hibernate dialect was not able to be determined. I was forced to explicitly list which dialect to use within my DataSources.groovy file and I thought I'd share.

If you migrate to Oracle 11g (from any previous release...in my case it was 10.2.0.3), and you need to specify the Hibernate dialect then you will need to add the following line to your DataSources.groovy within the DataSource block:

dialect = org.hibernate.dialect.OracleDialect

Monday, September 08, 2008

Detecting Google Chrome In Javascript

Thanks to javascript.internet.com, here is a quick post on how to detect the new Google Chrome browser from within your Javascript code.


var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;

By the way, if you are looking for some great javascript tips, take a look at javascript.internet.com as it is an excellent resource.

Monday, September 01, 2008

Having Fun with JavaFX

I finally had a chance to play around a bit with Fx over this long holiday weekend. At this point, the JavaFx script language is fairly straight forward, but I still find myself looking at examples in order to get the syntax correct when building a GUI.

http://silveiraneto.net/2008/08/11/javafx-draggable-node/

http://silveiraneto.net/2008/07/31/javafx-creating-a-sphere-with-shadow/

I will be posting some updates to this blog at a later date. As for now, I've successfully created a news ticker using JavaFX and I plan to release the source once I've worked out all of the rough edges.

More to follow...

Monday, August 25, 2008

Jython News!

Check out the latest Jython Monthly for some great news on the up and coming Jython 2.5 release. It is now in alpha stages, but it is looking great so far!

You can also read-up on using Django with Jython...good work Leo Soto! Also take this opportunity to ask all of your Jythonic questions of Jim Baker...a lead Jython developer. See newsletter for more details!

NetCAT 6.5 Update

I thought I'd give a brief update of the status on the NetCAT 6.5 testing. If you are unaware of what NetCAT is, please visit the site to learn more about it.

Thus far, it appears that Netbeans 6.5 is on track with the latest projections of a production release sometime in October. As you probably already know, the first beta release was distributed already and is available here. In the release, most of the new features are fully implemented. I will warn that there are some bugs obviously found in the release (expected because it is a beta) that could cause some minor issues in your development. For instance, the new "deploy on save" feature of Netbeans is nice but has many quirks at this time. If you are developing a JavaEE application, each time you save an XHMTL, JSP, or HTML file then the complete application is recompiled and deployed. I have found that this can lead to decreased productivity as it can cause workstation performance degradation as well as PermGen errors on the deployment application server. This is probably the largest bug I've seen since the beta release, so please do not allow it to keep you away from testing the release.

For those of you who have downloaded and tested the beta release, you already know that the IDE is looking great! Netbeans developers have been outstanding in repairing bugs and putting great new features into the IDE. Each new release of Netbeans brings it one step closer to "the only IDE you will ever need" in my book...but don't take my word, please test and see for yourself.

Before I post this blog I also want to mention that for those Grails developers in the community, Netbeans 6.5 is a must have! Productivity time is increased even more by using the combination of Grails with Netbeans. One of the advantages that Netbeans offers is the Grails plugin wizard...just right-click on your project to install or uninstall any Grails plugin. No need to make that trip to the website any longer for plugin updates!

Download 6.5 beta and enjoy...

Wednesday, August 13, 2008

Netbeans 6.5 Beta Is Available...Grab It and Test!

The Netbeans team has just released 6.5 beta. Having been testing the latest nightly builds, I think that you'll be pleased with the beta once you try it. The Groovy/Grails support is in great shape. New features have been added since M1, including a plugin manager and different application layout.

You'll also enjoy the automatic deploy on save feature. This really helps to speed up development time.

Congrats to the Netbeans team on delivering this beta of 6.5...it is looking so far.

Wednesday, August 06, 2008

Plan Your Events for Free - Gather Event Planning

Gather Event Planning is a free service that I started a few months ago to assist individuals or groups that are planning events. The service is based upon my open source reunion planning software. This service is web hosting which provides sites geared towards planning and organizing events such as reunions, meetings, or gatherings in general. Each Gather Event Planning website grants it's owner privileges to change all page content, administer mailing and guest lists, post news, etc.

Originally, I was planning to charge a minimal fee for the service in order to cover the costs of hosting. However, I've partnered up with another group to pay for the hosting and together we've produced Restoring The Roar a Chicago Blackhawks Hockey fan site. I've also partnered up with another associate who will be starting a website shortly. Gather Event Planning is now free thanks to the new partnerships.

So if you or someone you know needs to plan an event of any kind, please try out Gather Event Planning...and give me feedback!

Netbeans 6.5 - Project Properties Additions

Some of the nice new features of Netbeans 6.5 include Groovy and PHP support, automatic project deployment on save (which makes development time much quicker), and some new additions in the Project Properties menu. Allan Christensen blogs about the new Project-Based formatting option which is available. This gives you the ability to apply different formatting styles on a per-project basis.

Another nice new addition to the project properties menu is the Javascript Libraries. This allows you to choose from a set of default Javascript libraries (Yahoo User Interface, Dojo, etc) and add them to your project. This new option also gives you the ability to add your own libraries which is very handy.

Tuesday, July 29, 2008

Adding Groovy File Compilation To Any Netbeans Project

Many of you may already be aware that adding support for groovy file
compilation in any Netbeans project is easy. You can easily adjust the
build file to use the groovyc compiler. For those of you who do not know
how to do this, simply perform the following:

1) Adjust build.xml by adding the following target:

<target name="-pre-compile">
  classpath="${your.netbeans.groovy.library.classpath}" />
  <groovyc destdir="${classes.dir}"
  classpath="${ your.netbeans.groovy.library.classpath}"
  jointcompilationoptions="-j -Jsource=1.5 -Jtarget=1.5">
 
  </groovyc>
  </target>



2) Compile your project as normal!

All .groovy files will be compiled into Java...seamless integration. If you
are already using the "-pre-compile" target for another task, then name it
something else and adjust the build-impl.xml accordingly to include the new
target.

Tuesday, July 15, 2008

NetCAT 6.5 - Keeping Busy!

NetCAT 6.5 just started yesterday and I can say that there is a great group of Netbeans users from the community testing! This is sure to be a stellar release of the IDE, and if you've downloaded and tried M1 I am sure you will agree.

As Roman Strobl and Greg Sporar say...Happy Netbeaning...

Jython 2.5 Alpha Released!

Frank Wierzbicki of Sun Microsystems has just announced the release of Jython 2.5 Alpha 1. Click on the link above for the download...

More to come once I have a chance to play with it a while...

Monday, July 07, 2008

Netbeans 6.5 M1 Is Out!

Download it and start testing today! I downloaded the IDE this morning and I've been using it for most of the day. I have to say that it is in great shape! I especially love the added Groovy editor and faster startup time. Another great point is that I had no issues with importing projects and settings from 6.1.

Another great Netbeans release is on it's way!