May 30

All presentations at this year's JAX, the participants this time on DVD, but only via an Adobe AIR application that is based upon http://intellibook.de/special must register.

Adobe AIR is not just like Flash and resources must be carefully (such as flash as well) Once installed on the computer. A Web application would have preferred.

Some speakers were so nice to her lectures on slideshare.net to make available. In slideshare it is also the possibility to set up events, but this was not used for this year's event, so that the presentations scattered across.

I once went on a search and have the hits on the day 2010 jax summarized. If I have missed one, I have to apologize in advance and would appreciate a link in the comments.

gklinkmann written by \ \ tags: , ,

May 05
Jax 2010 logo

If I would have to build a Java web application at the moment, I would probably connected with the Spring Framework to implement. As part of Jax 2010 , Juergen Hoeller (one of the chief developers of Spring) a review, an inventory and an outlook given on Spring.

After Springsteen has played as many other frameworks and alternative technologies (such as SWT and GWT), in his view, especially in the role as a platform and standards, "enablers" a big role. , Ie frameworks that are more innovative and higher release cycles have as standards such as JPA. Rather, they offer even the possibility of new standards to integrate into existing environments.

So it is possible to work with Spring 3.0 applications using standards such as JSF 2.0 and JPA 2.0, or still on older JBoss, Websphere or Tomcat can even run installations.

This integrative role is, according to Juergen Hoeller continue to determine the path of Spring. Here for June / July 2010, version 3.1 and version 3.2 in 2011 also are provided. This will be like in the past by Milestone releases always kept close to the latest versions of the standards or are they even a small step forward.

gklinkmann written by \ \ tags: , ,

Mar 05

Those who can not only been with Grails Web applications based on Java, employs the expected JSP taglib DisplayTag be a household name.

DisplayTag it without big chins tables in Java server pages into multiple pages (paging), sort, group, and export to Excel, csv, xml and pdf.
Grails was supported "out of the box" only the paging and long time we do not use JSP tag libs in Grails, so you could map the remaining functionality either through plugins or even had to lend a hand.

Since Grails 1.1, this restriction is now lifted and combine the two, the test has long been successfully completed. Only the blog entry about it is, since even on my ToDo list. But what good will come to those (I hope :-) ).

The following steps are necessary to integrate DisplayTag in Grails:

libs

First, libraries should be DisplayTag next to the database driver copied to the lib directory.

DisplayTag configuration file

The configuration file of DisplayTag displaytag.properties be under src/java to be created. The structure of this file is in the document described by DisplayTag. For my grum project, the configuration looks like this:

  A
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
  csv excel xml pdf export. csv excel xml pdf types =
 true export. excel = true
 true export. csv = true
 true export. xml = true
 true export. pdf = true
 = org. displaytag . export . excel . DefaultHssfExportView export. excel. class = org. DisplayTag. export. excel. DefaultHssfExportView
 = org. displaytag . export . DefaultPdfExportView export. pdf. class = org. DisplayTag. export. DefaultPdfExportView
 = org. displaytag . export . DefaultRtfExportView export. rtf. class = org. DisplayTag. export. DefaultRtfExportView
 div class = "exportlinks" > Export to : { 0 } </ div > export banner = <div class = "export-left"> Export to. {0} </ div>
 list export. amount = list
 = bottom paging. banner. placement = bottom
 = No data found. basic. msg. empty_list = No data found.
 . empty_list_row =< tr class = "empty" >< td colspan = "0" > No data found. </ td ></ tr ></ tr > basic. msg. empty_list_row = <tr class = "empty"> <td colspan = "0"> No data found. </ td> </ tr> </ tr>
 =< span class = "pagelinks" >< a href = "{1}" >< strong >& lt ;& lt ;</ strong ></ a >& nbsp ;& nbsp ;& nbsp ;< a href = "{2}" >< strong >& lt ;</ strong ></ a >& nbsp ; { 0 } & nbsp ;< a href = "{3}" >< strong >& gt ;</ strong ></ a >& nbsp ;& nbsp ;& nbsp ;< a href = "{4}" >< strong >& gt ;& gt ;</ strong ></ a ></ span > paging banner full = <span class = "page left"> <a href = "{1}"> <strong> & lt;.. & lt; </ strong> </ a> & nbsp; & nbsp; & nbsp; <a href = "{2}"> <strong> & lt; gt <a href = "{3}"> <strong> &;; </ strong> </ a> & nbsp; {0} & nbsp < / strong> </ a> & nbsp; & nbsp; & nbsp; <a href = gt "{4}"> <strong> &; & gt; </ strong> </ a> </ span>
 =< span class = "pagelinks" > { 0 } & nbsp ;< a href = "{3}" >< strong >& gt ;</ strong ></ a >& nbsp ;& nbsp ;& nbsp ;< a href = "{4}" >< strong >& gt ;& gt ;</ strong ></ a ></ span > paging banner first = <span class = "page left"> {0} & nbsp;.. <a href = "{3}"> <strong> & gt; </ strong> </ a> & nbsp; & nbsp; & nbsp; <a href = "{4}"> <strong> & gt; & gt; </ strong> </ a> </ span>
 =< span class = "pagelinks" >< a href = "{1}" >< strong >& lt ;& lt ;</ strong ></ a >& nbsp ;& nbsp ;& nbsp ;< a href = "{2}" >< strong >& lt ;</ strong ></ a >& nbsp ; { 0 } </ span > paging banner last = <span class = "page left"> <a href = "{1}"> <strong> & lt;.. & lt; </ strong> </ a> & nbsp; & nbsp; & nbsp; <a href = "{2}"> <strong> & lt; </ strong> </ a> & nbsp; {0} </ span>
 =< span class = "pagebanner" > 1 Record found. Seite : </ span > paging banner one_item_found = <span class = "banner page"> page 1 record found... </ span>
 =< span class = "pagebanner" > { 0 } Records found. Seite : </ span > paging banner all_items_found = <span class = "banner page"> {0} records found Page:... </ span>
 =< span class = "pagebanner" > { 0 } Records found, show { 2 } - { 3 } . </ span >< br />< br /> paging banner some_items_found = <span class = "banner page"> {0} records found, show {2} -... {3} </ span> <br /> <br /> 

DisplayTag wrapper

Dynamic links and formatting to be implemented over the Decorator pattern in DisplayTag. The decorator is implemented in a wrapper class that is of course written in Groovy in Grails. My implementation is the class DisplaytagWrapper who created the project grum a link to the details of the user and formats the date of creation.

  A
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
  package de.koo.grum.groovy.util

 ; org.displaytag.decorator.TableDecorator import;

 TableDecorator { public class extends DisplaytagWrapper TableDecorator {
    String getLinkToUser () {
       def user = getCurrentRowObject ()
       /grum/user/show/${user.id} \" >${user.username}</a>" ; return "<a href= \" /grum/user/show/${user.id} \"> $ {user.username} </ a>";
    }
    String getUserCreatedAt () {
       def user = getCurrentRowObject ()
       . format ( "dd.MM.yyyy HH:mm" ) ; user createdAt return format ("yyyy HH: mm")..
    }
 } 

Export filters

Be set when exporting to a non-HTML format, the content type for the response to the browser. To prevent this from causing problems, a filter should be defined in the web.xml file, which counteracts the possible errors. DisplayTag brings the class override filter response is already an implementation for it with.

To Grails in changes to the web.xml to make you, the templates must be installed:

  grails install-templates 

Then there is the web.xml in the directory src/templates/war . To filter the following entries are necessary.

  A
 2
 3
 4
 5
 6
 7
 8
  <filter>
    <filter-name> Override Response Filter </ filter-name>
    <filter-class> org.displaytag.filter.ResponseOverrideFilter </ filter-class>
 </ Filter>
 <filter-mapping>
    <filter-name> Override Response Filter </ filter-name>
    <url-pattern> / * </ url-pattern>
 </ Filter-mapping> 

Integration with Groovy Server Page

If you have completed all these preparatory steps, you can finally get down to using DisplayTag in a Groovy Server Page.
In my example, user / list.gsp all user data will be displayed in tabular form. The table is by the attribute sortable sortable by first and last name (without a new database access) and, when the pagesize of the attribute partialList spread over several pages.

  A
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
  = "display" % > <% @ Taglib uri = "http://displaytag.sf.net" prefix = "display"%>  
 <html>
 ..
 defaultsort = "1" partialList = "true" <Display: table name = "user list" defaultsort = "1" partialList = "true"
 decorator = "de.koo.grum.groovy.util.DisplaytagWrapper"
 = "${pageSize}" requestURI = "/grum/user/list" size = "$ {size} result" pageSize = "$ {pagesize}" requestUri = "/ grum / user / list"
 = "0" cellspacing = "0" sort = "list" > class = "listing" cellpadding = "0" cellspacing = "0" sort = "list">
    title = "Userame" /> <display:column property = title = "linkToUser" "Userame" />						
    title = "Firstame" sortable = "true" /> <display:column property = title = "firstname" "Firstame" sortable = "true" />						
    title = "Lastname" sortable = "true" /> <display:column property = title = "lastname" "Lastname" sortable = "true" />						
    title = "Created At" sortable = "true" /> <display:column property = title = "userCreatedAt" "Created At" sortable = "true" />						
 </ Display: table>
 ... 

Additional attributes ( export , group ) may, as in the example contact data / list.gsp also export to different output formats and an array of entries are reached.

  A
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
  export = "true" defaultsort = "1" partialList = "true" <Display: table name = "contact list data" export = "true" defaultsort = "1" partialList = "true"
 decorator = "de.koo.grum.groovy.util.DisplaytagWrapper"
 = "${pageSize}" requestURI = "/grum/contactData/list" size = "$ {size} result" pageSize = "$ {pagesize}" requestUri = "/ grum / contact data / list"
 = "0" cellspacing = "0" sort = "list" > class = "listing" cellpadding = "0" cellspacing = "0" sort = "list">
     value = "contactData.csv" /> name = value = <display:setProperty "export.csv.filename" "contactData.csv" />
     value = "contactData.xls" /> name = value = <display:setProperty "export.excel.filename" "contactData.xls" />
     value = "contactData.xml" /> name = value = <display:setProperty "export.xml.filename" "contactData.xml" />
     value = "contactData.pdf" /> name = value = <display:setProperty "export.pdf.filename" "contactData.pdf" />
     value = "list" /> name = value = <display:setProperty "export.amount" "list" />

     title = "Name" sortable = "true" group = "1" /> <display:column property = title = "linkContactDataToUser" "Name" sortable = group = "true" "1" />						
     title = "type" sortable = "true" /> <display:column property = title = "type" "type" sortable = "true" />
     sortable = "true" /> <display:column property = "data" sortable = "true" />
 </ Display: table> 

Conclusion:
Once configured DisplayTag one of the greatest solutions for Java-based Web applications to be listed in tabular data. The functionality far surpasses the standard functionality of Grails. The combination of Grails and DisplayTag I will recommend this to anyone.

Links:
grum source

gklinkmann written by \ \ tags: , , ,

January 14

As an administrator, you should select when creating passwords of users that do not mean just 123,456th However, since the fantasy of an administrator is limited, you can best create one.
A Groovy class for a password generator might look like this:

  A
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
  public class {password generator
    main ( def args ) { public static void main (def args) {
       availChars def = []  
       .. 'Z' ) . each { availChars << it. toString ( ) } ('A' .. 'Z'). Each {availChars << it. ToString ()}  
       { ( 0 .. 9 ) . each { availChars << it. toString ( ) } } 3rd times {(0 .. 9). Each {availChars << it. ToString ()}}  

       length -> def generate random string = {length ->   
         = availChars. size def max = availChars. size      
         new Random ( ) def rnd = new Random ()  
         new StringBuilder ( ) def sb = new StringBuilder ()  
         sb. append ( availChars [ rnd. nextInt ( max ) ] ) } length. times {sb. append (availChars [rnd. nextInt (max)])}  
         sb. toString ()  
       }   

       { println generateRandomString ( 8 ) } 10th times {println generate random string (8)}   
    }
 } 

Source: www.chrisrauber.com

It's even easier, of course, if the contents of the main methods in the Groovy shell executes.

gklinkmann written by \ \ tags: , ,

November 28
handbrake 0.9.4

Some programs use one rather than another. Is it you, too? This genus belongs to me the free video converter HandBrake. In the new version 0.9.4, for Mac, Linux and Windows to download is ready, a lot has changed.

Just by the 64 bit version, up to 10 percent more speed to be there. In addition to performance improvements, the new version will also contain:

  • support for subtitles, which can be found in the player on and off
  • A preview feature to see how the settings affect
  • improved DVD support
  • new presets
  • and a lot more ...

In my initial tests, the 64 bit version worked very well under Snow Leopard. Just the way how to present it. :-)

gklinkmann written by \ \ tags: , , , ,