Portal Pack 3.0.4 - For NetBeans 6.9 & Liferay 6 Developers

Community Blogs September 6, 2010 By satya ranjan

If you are a NetBeans user and always wanted to try Portal Pack with latest NetBeans 6.9 and LIferay 6, here is the good news.

So there is a new version Portal Pack 3.0.4 available at Portal Pack project site. This version supports NetBeans 6.9 and Liferay 6.

You can check this blog for more details

http://ranjansatya.wordpress.com/2010/09/01/portal-pack-3-0-4-is-available-now/

 

Where's Portal Pack Project site !!!

Community Blogs November 24, 2009 By satya ranjan

The Portal Pack project site (http://portalpack.netbeans.org) is down for last few days because of the netbeans.org migration. But in case you need Portal Pack's binaries urgently,  here is the new location for Portal Pack project http://contrib.netbeans.org/portalpack/. We have filed a bug to set the redirect for http://portalpack.netbeans.org to this new location. Once that bug is fixed, you should be able to access the Portal Pack project site using the old url http://portalpack.netbeans.org .

For more details check this issue

https://netbeans.org/bugzilla/show_bug.cgi?id=176226

Portal Pack JSF Portlet (Woodstock) Page Navigation Issue - workaround

Community Blogs May 29, 2009 By satya ranjan

There is an issue with JSF Portlet (Woodstock portlet) with page navigation created by Portal Pack 3.x and running on Liferay Server. So if you have page navigation inside jsf portlet, then no component in the portlet is shown when try to navigate to the a second page.But if you reload the page, the portlet is shown properly. This behaviour is there only with Firefox, but it works fine with IE.

So the detail steps to reproduce this issue  are

  1. Create a JSF portlet app using portal pack that uses page naviagation (say from page1 to page2)
  2. Deploy the portlet app
  3. Click on some botton in page1 to naviagate to page

Issue:Page2 of the JSF portlet is not rendered untill a referesh.Issue not seen in IE..

So now the good news is, there's a workaround

From the jsf jsp page remove webuiAll="true" attribute from <webuijsf:themeLinks....../> tag. Everything works perfectly in Firefox & IE after removing this attribute.

Try out Portal Pack 3.0.1

Community Blogs May 13, 2009 By satya ranjan

The Portal Pack 3.0.1 final is now available for download. Though this is a minor release, but there are few key new features added in this release. Also for this release, we got a valuable contribution from community ( "Liferay 5.2.x on JBOSS 5.x support" ) and thanks to John Platts for this contribution.

Here are the list of new features added in this release :

  • Directory Deployment & Deploy on Save for Portlet Application

Using "Directory Deployment and Deploy on Save" feature, you don't need to redeploy your application any more during development time. Any change in any file, you just need to save it and the rest is taken care by the IDE. If a java file is  changed and saved, it is automatically compiled and the application is reloaded to reflect the new change. So just refresh your browser and see the change. This is also true for jsp, javascript, html and even portlet.xml .

You can enable/disable Directory Deployment in the Server Config Panel. By default  Directory Deployment  is not enabled. You need to enable "Directory Deployment" to use "Deploy on Save" feature. You can also disable only "Deploy on Save" feature.

  • Liferay Theme Development

Now using Portal Pack, you can create and edit Liferay Theme plug-ins. You need to select the "Run In Developer Mode" check box in server config panel in NetBeans. By doing so NetBeans will be able to start the Liferay server in developer mode which is required during theme development.

To create a a Liferay Theme Application

> Create a Web App

> Right click on the project > New > Others > WebSpace/Liferay Plugins > Import/Create New Theme . This will import the classic theme files from the liferay server installation to your project.

> Enable the directory deployment in the server config panel and deploy the theme. 

CSS Editing

NetBeans provides a good CSS editor for developers. You can see the preview of the style inside NetBeans only. To use css editing feature effectively in NetBeans, open Windows > Others > CSS Preview ,  Windows > Other > CSS Style Builder and Windows > Navigating > Navigator windows while editing a css file.

> Change CSS using NetBeans CSS builder.

> No need to redeploy the theme again and again if the "Directory Deployment enabled" is selected. Deploy it once and select it in Liferay Portal. Then just change the CSS in NetBeans CSS editor , save it and refresh your browser to see the output.

Velocity (VM) templates editing

Portal Pack 3.0.1 provides code completion for VM variables defined by Liferay Portal Server. In any vm files in a theme application, you can use "ctrl + space" to get the code completion help for vm variables. 

  • Liferay Hook Plug-ins Support

Portal Pack 3.0.1 also provides support for different type of Hooks application. Check out  Chetan's blog for more details on Hook Plug-in Support

  • Liferay 5.2.x on JBOSS 5 Support

Now if you are using Liferay 5.x bundle on JBOSS 5 then you can use Portal Pack for the portlet development. This plug-in supports portlet deployment and server start/stop in both normal & debug mode from IDE. But the "Directory Deployment" is not yet supported with JBOSS bundle.

Portal Pack now supports Liferay Tomcat/GlassFish/JBOSS bundle.

 

Portal Pack : Write Database Portlet using Service Builder Plug-in

Community Blogs March 16, 2009 By satya ranjan

The service builder framework in Liferay represents the database layer and all the interactions with database are done through service builder infrastructure. So in this blog, I will explain how you can use service builder framework inside your custom portlet using NetBeans 6.5 & Portal Pack 3.0. To use service builder framework, you first need to create a service xml and then generate the required code. The Portal Pack here helps you by providing a nice GUI editor for service.xml file where you can define the entities or database structures and from the same GUI you can generate the services code which can be used inside your portlet.

I have taken an example of Simple Form Submission Portlet here. Using this portlet you can submit customer details which will be stored inside liferay's database and the same portlet will also show the no of customer records present in the database.

First create a Webapplication with "Portlet Support" framework and add a new Portlet to it. Now you need to create the service.xml file. Let's create the portlet application as "CustomerApp" and a portlet "CustomerPortlet" inside it.

Creating the service.xml File

After creating a portlet application, you need to create a service.xml file inside the portlet application.

To Create a service.xml File

  1. From the CustomerApp application, right click on Web Pages and select New > Others > Web Space/Liferay Plugins > Service Builder XML

  2. Enter the file name as service. Make sure the "Folder" is selected as web. Then click Finish.

  3. The service.xml file is created inside the web directory and the IDE opens the service.xml inside the editor area.

You can see two tabs "Design" and "XML" in the editor. The "Design" tab helps the user to add/modify entities through GUI and using "XML", user can directly modify the xml.

Fig: 1


Now we are ready to add entities to our service xml.

To Create Entity

  1. Click on "Add" button.

    The Service Definition window appears. 

  2. Specify the Entity Name as "CustomerDtls" and table name as "CustomerDtls". The Entity name and table name doesn't need to be same.

  3. Now Click "Add". So a new entity called "CustomerDtls" is now created.
  4. Change the default Package Path name to com.sample.customer and namespace to "customer". The namespace should be unique for every portlet application. No two portlet applications should have the same namespace.

Add Columns

After creating an entity, you need to add columns for that entity. So to create columns for an entity

  • Select an entity. 
  • Click "Add" under the Columns tab as shown in the Fig : 3.
 

Fig : 3
  • The Column Details window appears. 
  • Specify the Name of the column as "id" and the column type as long. You can choose the column type as String, Double, and Date from the drop down list. 
  • Select the Primary Key checkbox and click Add. So for this entity, id is the primary key. A column is created with the Column Name as id and type as long
  • Add two more columns with column name name, age with types String, int respectively. 
  • You can see that there are three columns created for the "CustomerDtls" entity. (Fig: 4)
Note: There should be atleast one primary key defined for an entity.
 

                                                    Fig : 4

Add Finder Methods

You can also add your custom finder methods to the entity from "Finders" tab. In "Finders" tab, click "Add Finder" to add finder methods. It provides a GUI where you can select different columns required for your finder methods.(Fig. 5)



Fig. 5

Generating Services

  • From the service.xml GUI editor, click the "Generate Services" button. 
  • You can see the creation of classes, services, and data models that are required for the database interaction. The service api classes are generated under $project/services directory and added to the project classpath. You should not do any modification in those classes as those will be overwritten next time when you run "Generate Service". But the implementation classes which can be modified by the user, are added to the project source path and you can modify them as you want. But after modifying anything in the service implementation classes, you need to run "Generate Service" again.
  • By default the generated service api jar will be bundled inside the portlet war file. But if you want other applications to access your services then the service api jar file needs to be there in the server classpath. You can do that by changing the preference which can be accessed by clicking on "Preferences" button. (Fig: 6)

Fig: 6
  • Now in the GUI editor, click the Local Methods tab. This tab lists local method defined in the local service implementation. Now you can select "Go to Source"  to go the local service implementation. In our example this is "CustomerDtlsLocalServiceImpl.java" file. But we don't need to add any local method for our current example.

Creating the View Page for Customer Portlet

  • From the Projects pane, click the CustomerPortlet_view.jsp file. 
  • Add code to the CustomerPortlet_view.jsp file to create a HTML form to specify the id,name and age of a customer. This jsp also shows the no of customers in the database. Replace the CustomerPortlet_view.jsp code with following code snippets.
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ page import="javax.portlet.*"%>
<%@ page import="com.example.customer.service.*"%>
<%@ page import="com.example.customer.model.*"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>

<portlet:defineObjects />
<%PortletPreferences prefs = renderRequest.getPreferences();%>
<table>
<form method="POST" action="<portlet:actionURL/>">

    <tr>
        <td>Customer ID:</td>
        <td><Input type="text" name="id"/></td>
    </tr>
    <tr>
        <td>Name:</td>
        <td><Input type="text" name="name"/></td>
    </tr>
    <tr>
        <td>Age:</td>
        <td><Input type="text" name="age"/></td>
    </tr>
    <tr>
        <td><Input type="submit"/></td>
    </tr>
</form>
</table>
<H3> No of Customers in Database :
    <%
        out.println(CustomerDtlsLocalServiceUtil.getCustomerDtlsesCount());
    %>
</H3>

 

  • From the Projects pane, click the CustomerPortlet.java file under the com.test package. Add the following code to processAction method. This method gets the data from the browser and add customer details to the database.
public void processAction(ActionRequest request, ActionResponse response) throws PortletException,IOException {
     
        try {
            long id = Long.parseLong(request.getParameter("id"));
            String name = request.getParameter("name");
            int age = Integer.parseInt(request.getParameter("age"));
            CustomerDtls customer = CustomerDtlsLocalServiceUtil.createCustomerDtls(id);
            customer.setId(id);
            customer.setName(name);
            customer.setAge(age);
            CustomerDtlsLocalServiceUtil.addCustomerDtls(customer);
            System.out.println("Added");
        } catch (Exception ex) {
            ex.printStackTrace();
           
        }
    }

 

Deploy And Test

So we are now ready to deploy the portlet application. Right click on the portlet project and select "Deploy" to deploy the portlet on Liferay Portal Server. I am assuming you have selected "Liferay Portal Server"  as runtime for the portlet application. The required table is created automatically during the deployment time, so ideally you don't need to create the table manually. But incase you get "Table not Found Exception" while accessing the portlet, you can run the generated table.sql manually to create the required tables. The table.sql can be found under "WEB-INF/sql" directory.

Now access your liferay portal from the browser and add the new "CustomerPortlet" to a page. You can see a simple form for customer data and below that no of customers in database which is initially "0". Now try to add a customer and after successful addition of data to the database, the "No of Customers in Database" will be changed to 1.
 
Fig: 7

Portal Pack 3.0 : Available for download !!!

Community Blogs February 18, 2009 By satya ranjan

Portal pack 3.0The Portal Pack 3.0 is now available for download. With lots of new features and bug fixes, the Portal Pack 3.0 is out there to make portlet development easier than before. This version is compatible with NetBeans 6.5 IDE.

 

Some of the Key Features in Portal Pack 3.0
  • Support for JSR 286 specification
  • Eventing Storyboard for JSR 286 Eventing
  • Visual Portlet Builder plug-in to build JSF portlet using WYSIWYG editor.
  • Portlets with Spring MVC framework
  • Write Portlets with different languages like Ruby/PHP/Groovy which can be deployed on Liferay Portal Server and Sun GlassFish Web Space Server 10.0.
  • Use Liferay's service builder framework inside your portlet. A new advanced Service XML editor is introduced to help you define and generate services.
  • Use Liferay's service apis directly to write advanced portlets.
  • Use Taglibs provided by Liferay directly inside your Portlet. For example : You can use rich ui taglibs provided by Liferay inside your Portlet, so that your portlet will look similar to other UI in the portal page.
  • Directory deployment : Using new directory deployment feature, you can quickly develop and test your application without redeploying your portlet application again and again. So no need to deploy your portlet when you are changing JSPs, HTML, javascripts etc etc... Also if you are developing portlets using PHP/Ruby/Groovy languages then you need to deploy the portlet only once during development cycle. During development, just change the PHP/Ruby/Groovy script and refesh the browser to see the output.

The deployment support in this release has been extended to support the following servers

Here's the link to the  quick start guide for Portal Pack 3.0 . So try out this new Portal Pack 3.0  !!!

We have already started working on the next update for Portal Pack. Your feedback for the existing features and suggestions for any new features are most welcome. So you may see your suggested feature in the next update release of Portal Pack.

Portlet Development On Liferay Using Portal Pack 3.0 M2

Community Blogs November 9, 2008 By satya ranjan

The Portal Pack 3.0 M2 is now available for download. These plug-ins are supported on NetBeans 6.5 Beta or later. 

 

Highlights of the new features added in this release are :

  • Separate instance type called "Liferay Portal Server"
  • Integration with Liferay Portal Server 5.1.x running on Glassfish V2/V3 and Tomcat 5.x/6.x
  • Support for Spring MVC Portlet : Using this plug-in, user can develop a portlet using spring webmvc portlet framework.
  • Service Builder Plug-in : This plug-in provides liferay's service builder capabilities inside NetBeans IDE. Using this plug-in, user can generate and use services inside their portlets created by NetBeans Portal Pack. This plug-in also helps developer to write a database portlet quickly using service builder infrastructure. User can modify a service xml either through standard xml editor or through advance design editor for service xml.
  • Liferay Taglib Palette : A new jsp palette has been added to help developer to use Liferay specific taglibs inside their JSPs. Currently it supports all Journal taglibs through this palette.  But all other Liferay specific taglibs are also exposed to the portlets, so that user can add them manually to their jsp code.
  • Liferay's Service API and taglibs can be directly used inside NetBeans created portlet. All required libraries are automatically added to the project's compile time classpath.

(Service XML Editor. Click on the image to enlarge)

Portal Pack 3.0 M1 : Now supports Liferay 5.1.1 Portal Server

Community Blogs September 2, 2008 By satya ranjan

What is Portal Pack ?

Portal Pack project provides a set of plug-in(s) for NetBeans (IDE) which support full life-cycle of portlet application development inside NetBeans. Using this tool portlet developers can develop, package, deploy and test portlet inside their NetBeans IDE. Portal Pack supports both JSR-168/286 portlets.

Some of the major features supported by Portal Pack :

  • Full support for both JSR 168/JSR 286 specification
  • An eventing storyboard to define and assign JSR 286 Events graphically.
  • Visual Portlet Builder to develop JSF portlets using WYSIWYG editor
  • Portlet deployment support on various Portal Servers.

Portal Pack 3.0 Milestone 1

Portal Pack 3.0 Milestone 1 has been released recently. This version of Portal Pack has support for Liferay 5.1/5.1.1 portal server installed on both Glassfish V2/V3 and Tomcat 5.x server.

Some New Features in this release :

  • Support for Liferay Portal Server 
    • Portlet deployment/undeployment  on Liferay 5.1/5.1.1 Server.
    • It supports Liferay installed on Glassfish V2/V3 and Tomcat 5.x .  The Liferay on Tomcat 6.x support is coming in the next milestone release of Portal Pack.
    • Liferay Server can be started/stopped from the  IDE. (This support is only available for Windows OS, but other OS like Solaris/Linux/Mac will be supported in the next milestone release.)
    • Portlet debugging is also supported.
    • You need to select "WebSynergy Stable Build 2" as server type while configuring Liferay Portal Server inside NetBeans IDE.
  • Non Java Portlets Support : The Portal Pack 3.0 M1 also supports portlets development in non java languages. The non java portlets developed with Portal Pack can be deployed on Liferay Portal Server. The Eventing Story Board of Portal Pack can also be used to enable cross-widget communications between java/non-java widgets through public render parameters. Currently the following types of liferay non java portlets are supported
    • Ruby Portlet
    • PHP Portlet
    • Groovy Portlet

Some of the major features which are planned for the next milestone Portal Pack 3.0 M2 :

  • Spring Portlet Development  (Out of Box Spring view/form portlets, Spring Web Flow Support)
  • Liferay Service generation through NetBeans
  • Liferay on Tomcat 6.x will be supported

So try out Portal Pack 3.0 Milestone 1  !!!

Showing 8 results.
Items 20
of 1