Over a million developers have joined DZone.

Starting with the Pivot Starter Kit in NetBeans IDE

DZone's Guide to

Starting with the Pivot Starter Kit in NetBeans IDE

· Java Zone ·
Free Resource

The CMS developers love. Open Source, API-first and Enterprise-grade. Try BloomReach CMS for free.

The Pivot Starter Kit that was announced today is really a cool thing. A complete demo application for newbies to Pivot. I downloaded it and imported it into the IDE (a.k.a. 'I opened it as a free-form project'):

Note: The code in the two files shown above is listed in the Pivot Starter Kit announcement on Javalobby.

I used a free-form project because the demo application comes with its own build.xml file. (A different approach would have been to open the demo application as a 'Java Project with Existing Sources' and to then copy the demo's build.xml over the one created by the IDE.) Here's the free-form project template:

When you're clicking through the wizard and selecting your sources, you can also map project commands to Ant targets from the demo's build.xml file:

To be able to use the IDE's editor features, you also need to register the demo app's libraries in the project's Properties dialog:

Then add a run target, which the demo app's build.xml doesn't provide:

<target name="run" depends="build">
    <java classpathref="project.class.path" classname="pivot.wtk.DesktopApplicationContext">
        <arg value="pivot.starter.StarterApplication"/>

You can now right-click the project and choose 'Clean', 'Build', and 'Run', which will call the Ant targets in the build.xml file.

Finally, run the application and you'll have this:

Or run the application as an applet (note the 'draggable' parameter below, for JDK 6 Update 10, in a browser to which that applies, such as FireFox 3):

<title>Pivot Starter Application</title>
<body style="margin:0px; padding:0px">
<applet code="pivot.wtk.BrowserApplicationContext$HostApplet"
width="100%" height="100%">
<param name="applicationClassName" value="pivot.starter.StarterApplication">
<param name="image" value="spinner3-bluey.gif">
<param name="centerimage" value="true">
<param name="boxborder" value="false">
<param name="draggable" value="true">

In both cases, when you click the button, you get this response (below in an applet):

Then, now that you have your sample up and running, continue your journey into Pivot by taking the Pivot tutorial!

BloomReach CMS: the API-first CMS of the future. Open-source & enterprise-grade. - As a Java developer, you will feel at home using Maven builds and your favorite IDE (e.g. Eclipse or IntelliJ) and continuous integration server (e.g. Jenkins). Manage your Java objects using Spring Framework, write your templates in JSP or Freemarker. Try for free.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}