1/15/2014

Comparing Primefaces, ICEFaces and Richfaces with Google Trend

One thing that I´ve notices in the last two years was that primefaces pretty much eats up all the other JSF frameworks. Nearly all my clients moved away from ICEFaces towards Primefaces. So I just entered some data into Google Trends which shows us the interest of people into those technologies. As you can see, primefaces now has more than double the interest compared to ICEFaces and Richfaces combined. Well I know that it is only the search queries that people entered into google but I think that it exactly shows my work experience for 2012 and 2013: Everyone is switching to primefaces now.

Looking for primefaces support ? Contact me !

1/10/2014

How to open a modal dialog in Liferay

If you want to create modal dialogs (a popover) in liferay you can use the AlloyUI modal component. This component allows you to refer to complex DIVs and pop them over the current window. You can do this without having to reference any additional libs.

Just add this and you will see the content of the 'popupContent' popping up:


var modal = new A.Modal(
{
bodyContent: A.one('#popupContent'),
centered: true,
headerContent: '<h3>This is a header </h3>',
modal: true,
render: '#modal',
zIndex: 1100,
height: 700, 
width: 950
}
).render();

If you like this tutorial it would be very nice, if you could click on some of the google ads you see on the right side. It helps me run this block and motivates me ;)

If you have any questions, feel free to leave a comment.

1/08/2014

How to setup the activity monitoring console for Talend

I started using Talend 5.3 a few days ago and one of the things I´ve spend most of my time with was the activation of the activitiy monitoring console (AMC). Even though there is a lot of configuration out there, there is no clean documentation what to do when you have a clean Talend 5.2 installation.


This is what you have to do to activate and use it:

1) Create database tables
2) Activate it in your Talend Studio
3) Activate it in your Talend Studio AMC perspective
4) Activate it in the Talend Administration Center (TAC)


Create the AMC database tables


The AMC tables are not created by default. They don´t exist and you have to create them manually to use them. You could use files instead but then you can´t use it in your TAC´s dashboard which only works with database tables.

Thankfully, Talend already has a tutorial that shows you how to create the database tables. You just have to know where it is. Here it is :


When you´ve finished this tutorial, you will have three database tables "logcatcher", "statcatcher" and "flowmetercatcher". LogCatcher is responsible for catching Exceptions and Warnings. Use it to build your own logging service for example. StatCatcher contains logging information for the processes you run.
FlowMeterCatcher contains information for specially monitored connections (like database calls).

Activate AMC in your Talend Studio

To activate AMC in your Talend Studio you can either activate it in your project or activate it for one individual jobs only.To activate it for the complete project please click on
File -> Edit project properties -> Job Settings -> Stats & Logs.
Select all checkboxes  so that Logs, Statistics and volemetrics can be catched. Check "In Database" and configure the database connection that you want to use.

After that please check that the AMC is active for the projects that you´re working on. This can be done by activating "Use project settings".

Alternatively you can activate the AMC for several jobs only. Look under "Stas and Logs" in your job view. If you configured AMC in the project it is sufficient to check "Use project settings" here,

After you´ve done that, your Talend Studio is now able to provide monitoring infirmation. What you need to do now is to configure your Talend Studio to visualize this information.

Activate AMC in your Talend Studio AMC perspective

Enter the AMC perspective in your Studio. It doesn´t yet show logging infos and needs to point to the three database tables we´ve created earlier. Please click the following : Fenster -> Benutzervorgaben -> AMC -> Datasource Type


Check "Database" and click on "Add". Give it a name and configure the database so that it accesses the AMC Data.

After that you have your AMC Information visualized in your Talend Studio. This is something that you need to do for every user of the Talend Studio: It is not possible to synchronize it over SVN.

Configuration of the Talend Administrative Console

The Talend Administrative Console (TAC) is able to show just the same data the Talend STudio does. To be able to display it, you need to configure your database connection, first.
Click on Dashboard -> Connections and select "Add".Enter all database connection details , including the database tables.
If this doesn´t yet work, then please check if you have a "localhost" URL under Settings -> Configuration -> Dashboard.  If so, please replace it with your actual server URL or server name.

After doing so, you should now see the AMC in the TAC.




If you like this tutorial it would be very nice, if you could click on some of the google ads you see on the right side. It helps me run this block and motivates me ;)

If you have any questions, feel free to leave a comment.

1/07/2014

How to create AlloyUI reusable methods

When you are writing as much AlloyUI code as I do, you will certainly come to the situation where you want to reuse your code. Gladly, YUI3 (the foundation for AlloyUI) allows that. You can create your own modules and register them statically so you can call them from different parts of your application.


The key part is the "add" function.  It allows you to register your new module with all the methods, that you want to add. 

YUI.add('your-registered-module', function (A) {
  A.YourModuleObject = {
    yourMethod: function () {
      alert('Hello World');
  }
});

Do this at the beginning of your file and you can add your method in your code using this:
YUI().ready(
'your-registered-module',
  
  function(A) {
 A.one('#myButton').on('click', function(event) {
  A.YourModuleObject.yourMethod();
  });
Explanation: In this case we attach our hello world method to a button. When the button is clicked, our reusable method gets called and send the alert.

If you like this tutorial it would be very nice, if you could click on some of the google ads you see on the right side. It helps me run this block and motivates me ;)

If you have any questions, feel free to leave a comment.

1/06/2014

How to render a WebContent programmatically

Sometimes you might want to render a WebContent programmatically. Maybe because you want to include it in a portlet or maybe you are not able to use the liferay journal-article taglib. There is a very easy solution that you can use in every JSP portlet. I took it from the taglib, so the credit doesn´t really belong to me ;)


JournalArticleDisplay articleDisplay = 
JournalContentUtil.getDisplay(groupId, articleId, templateId, null, languageId, themeDisplay, articlePage, xmlRequest);

<%= RuntimePortletUtil.processXML(application, request, response, renderRequest, renderResponse, articleDisplay.getContent()) %>


If you have any questions, feel free to leave a comment.

How to directly link to a liferay web content

When you want to show Web Contents to your visitors and have a meaningful URL  (one that has the article´s title in it), then you should check out LIferay´s Display Pages. It allows you to assign WebContents statically to a page and then access that page through a link that has the WebContents title. Normally WebContents are not bound to any page at all, but Display Pages allow just that. This will only work in Liferay 6.1 and above. This is how you do it :

First you'll need to create a page and assign the asset publisher portlet to it. You only have to change one part in the configuration and that is  you'll need to check the box next to the option that sets the asset publisher as the default publisher for the page. 

When you are creating your Web Content you now have the possibility to select a Display Page (see right side menu).
Select the page you just created. After the WebContent has been published, you can access the page with the WebContent´s title. Example: http://localhost:8080/-/this-is-a-webcontent .

Should make SEO much easier ...