Monday 25 February 2013

Singleton Design Pattern

http://java.dzone.com/articles/singleton-design-pattern-%E2%80%93

iReport Designer v4.1.1 Release Notes

http://community.jaspersoft.com/wiki/ireport-designer-v411-release-notes

Primefaces + JSF + Facelets

Create JSF + Primefaces Web Application

My tutorial is about how to use Eclipse + Maven + JSF + Primefaces and create easily and quickly a basic framework for a web application.
This tutorial is divided in the following chapters: 
- Create a Maven Project
- Install the JSF libraries
- Install Primefaces libraries
- Extend web.xml
- Test page
- Create and deploy the Web Application

Create a Maven Project

First we create a Maven project with Eclipse.
For this purpose we go to Eclipse on File -> New -> Maven Project
Maybe for some of you this option is not available. This is only the case, if you have not installed Maven plugin for Eclipse. I use Eclipse M2E.
First we select that we want to create a Maven Project.
At the next window, we click Next, since we are not interested in these settings.
On the next window we write in the box with the name filter: "webapp". Of course, without the quotes!
Here we select the following entry from the list of results and click Next.
Group ID: org.apache.maven.archetype
Artifact Id archetpye-maven-webapp
Next, we will be asked to enter for the project, the group id and artifact Id. If you are interested what this means exactly, please refer to Maven.
After we have completed the values we click Finish!
Thus we have now created a simple framework for a Web Application. But it lacks the JSF and the Pimefaces support, which will now install successively.

Install JSF libraries 

To use the JSF in Web Application we need to tell the application that we want to use JSF.
We gain this when entering into the Maven POM file (to be found in path) the JSF libraries. The following list shows how the POM file looks after entering the JSF libraries.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>de.ertantoker</groupId>
 <artifactId>blog</artifactId>
 <packaging>war</packaging>
 <version>0.0.1-SNAPSHOT</version>
 <name>blog Maven Webapp</name>
 <url>http://maven.apache.org</url>
 <dependencies>
  <!-- JSF libraries -->
  <dependency>
   <groupId>com.sun.faces</groupId>
   <artifactId>jsf-api</artifactId>
   <version>2.1.7</version>
  </dependency>
  <dependency>
   <groupId>com.sun.faces</groupId>
   <artifactId>jsf-impl</artifactId>
   <version>2.1.7</version>
  </dependency>

  <dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>3.8.1</version>
   <scope>test</scope>
  </dependency>
 </dependencies>
 <build>
  <finalName>blog</finalName>
 </build>


</project>

Install Primefaces libraries 

As a next step we will install the Primefaces Libraries in the Project. We can again achieve this with Maven, by entering the Primefaces Libraries in the POM file. We only have to ensure that the Primefaces repository is also shown. This is necessary because Primefaces can not be found on any of the standard Maven repositories.
After entering the repository and the Primefaces Library the POM file is as follows:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>de.ertantoker</groupId>
 <artifactId>blog</artifactId>
 <packaging>war</packaging>
 <version>0.0.1-SNAPSHOT</version>
 <name>blog Maven Webapp</name>
 <url>http://maven.apache.org</url>
 <repositories>
  <repository>
   <id>prime-repo</id>
   <name>Prime Repo</name>
   <url>http://repository.primefaces.org</url>
  </repository>
 </repositories>
 <dependencies>
  <!-- JSF libraries -->
  <dependency>
   <groupId>com.sun.faces</groupId>
   <artifactId>jsf-api</artifactId>
   <version>2.1.7</version>
  </dependency>
  <dependency>
   <groupId>com.sun.faces</groupId>
   <artifactId>jsf-impl</artifactId>
   <version>2.1.7</version>
  </dependency>

  <!-- Primefaces libraries -->
  <dependency>
   <groupId>org.primefaces</groupId>
   <artifactId>primefaces</artifactId>
   <version>3.4</version>
  </dependency>

  <dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>3.8.1</version>
   <scope>test</scope>
  </dependency>
 </dependencies>
 <build>
  <finalName>blog</finalName>
 </build>
</project>
Now Primefaces and JSF are available for the Web Application.

Expand web.xml 

In order that the Web Application can also use JSF, we must enter the FacesServlet in the web.xml file. The file can be found as follows "/ src / main / webapp / WEB-INF / web.xml"
The Maven archetype with which we have created a Web Application framework was unfortunately not up to date. Therefore, I have completely recreated the web.xml with the following values:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 id="WebApp_ID" version="2.5">

 <display-name>PrimeFaces Web Application</display-name>

 <!-- Welcome -->
 <welcome-file-list>
  <welcome-file>index.xhtml</welcome-file>
 </welcome-file-list>

 <!-- JSF Servlet -->
 <servlet>
  <servlet-name>Faces Servlet</servlet-name>
  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
 </servlet>

 <servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.xhtml</url-pattern>
 </servlet-mapping>

</web-app>
Please take care that you later use a servlet container or application server that supports the servlet specification 2.5. In the generated web.xml release 2.3 was mentioned as specification.
Thus the JSF servlet is entered

Create Test Page 

Next we will create a simple test page, where we will use a default JSF component and a Primefaces component.
The test page is intentionally designed simply, because in the tutorial it is not about how to create JSF + Primefaces pages, but about how to create a Maven + JSF + Primefaces Project.
In my other tutorials on my blog I will provide you some more examples how to create JSF + Primefaces Appaplikationen.
We now create in ROOT directory (/ src / main / webapp /) of the web application a test page with the name index.xhtml.
The test page looks like this:

<html xmlns="http://www.w3c.org/1999/xhtml"
 xmlns:h="http://java.sun.com/jsf/html"
 xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
 <div>
  <p>This is a default JSF button</p>
  <h:commandButton value="JSF Button" />
 </div>
 <div>
  <p>This is a Primefaces button with icon</p>
  <p:button icon="star" value="Primeface Button"/>
 </div>
</h:body>
</html>
.
On the test page, a standard JSF button and a Primefaces button has been placed.

Create and deploy the Web Application

Next, we will create the web application. Thanks to Maven we can comfortable create the web application. For this we need nothing more than a Maven installation or if you want to start it with Eclipse one Maven plug-in, which already includes Maven.
For more information about Maven please refer to the website of Maven.
The application is created with the following command.
mvn clean package
The web application is saved by default under the following directory:
/ target / blog.war
If you have given your project a different Artifact ID, then you will find a WAR file with the name which you have registered as Artifact Id.
Finally, only the deployment of the web application remains. I will use Tocat 7 for the deployment. There is no question that you can deploy the web application on other servlet containers and application servers but you should make sure that they also support the corresponding servlet version, which is entered in the web.xml.
The deployment will take place as follows. You start the Tomcat servlet container and copy the "blog.war" (The name can vary, see above) in %TOMCAT_HOME% / webapp /
Thus the Application is deployed automatically.
Next we call in our browser of choice, the following URL: 
http://localhost:8080/blog/index.xhtml (note the 8080 is only a default Tomcat installation, depending on the installation, the port number can vary)
Now if you see a website like this, you did everything right :-)

Collie

Collie is a Javascript library that helps to create highly optimized animations and games using HTML 5. Collie runs on both PC and mobile using HTML 5 canvas and DOM.
 http://jindo.dev.naver.com/collie/

Friday 22 February 2013

Thursday 21 February 2013

vectorlooza

If you're a fan of cool projects for the design community, please take a minute to support the Vectorlooza App: http://catarse.me/en/vectorlooza

Tuesday 19 February 2013

Drupal modules which disable page cache

http://2bits.com/articles/beware-drupal-modules-disable-page-cache.html

The Startup Kids

The Startup Kids is a documentary about young web entrepreneurs in the U.S. and Europe. It contains interviews with the founders of Vimeo, Soundcloud, Kiip, InDinero, Dropbox, Foodspotting and many others who talk about how they started their company and their lives as an entrepreneur.
http://thestartupkids.com/ 

Saturday 16 February 2013

http://blokkfont.com

 BLOKK is a font for quick mock-ups and wireframing for clients who do not understand latin. http://blokkfont.com/

Friday 15 February 2013

Docverter

Convert plain text documents written in HTML, Markdown, or LaTeX to PDF, Docx, RTF or ePub with a simple HTTP API.
http://www.docverter.com/

Monday 11 February 2013

http://relogo.org/

rel="logo" is a proposed standard for serving and maintaining up-to-date logos for use in various media. By including a line of code on your site that links to a scalable vector logo, you make it very easy for other websites, applications, readers, clients, and stations to ensure that they are using an approved logo directly from you.
rel="logo" is a link relation tag, much like commonly used icon tags favicon or apple-touch-icon.

http://relogo.org/