fredag 16. september 2011

JavaZone: introducing Apache Wicket

Presentation from JavaZone 2011: http://javazone.no/incogito10/events/JavaZone%202011/sessions/Introducing%20Apache%20Wicket

Video posted to http://vimeo.com/28791557

Notes:

7 years old framework, Wicket 1.5 just released

Component oriented, using just java+html

Used by: AdScale, WalMart, MeetMoi, fabulous40...

Just html: elements linked to wicket by attributes: <p wicket:id="foo">, no imperative markup in view.

Just Java: no logic in markup, Components are POJOs, No xml

Components: Manipulate markup, Render content, Receive events (onClick)

Models: data to / from Components, transform data

Behaviors: Decorator / Adapter for Component, manipulate markup of Component, can receive events (onClick), Add Ajax unctionality to Components

Wicket projects: Apache Wicket (core, integration to Spring...), Wicket stuff (components), Seam for Apache Wicket, WiQuery (jQuery), Leg before Wicket (archetypes), Apache Isis (DDD framework), Jolira Tools, Visural Wicket (components)...

Quick start: use Maven, http://wicket.apache.org/start/quickstart.html

Some examples: Hello World, click-counter, sign-up

Navigation: Overview and some detail on: External link, Bookmarkable link, Action

Validators: Overview, simple example and list of provided validators

jQuery integration: WiQuery overview and example

JqZoom: Example, zoom on image, how to integrate

Development / Deployment mode: List differences and show some features

WicketTester: Tests components, UI, Ajax, without starting server, runs in IDE, ant, maven

New in 1.5: Html5 input types, component event bus, some new components, improved internals, simpler request cycle, and more

Component event bus: pre/post example

Wicket 6: next version, preliminary list of features. Shorter release cycle.

Q&A: How do components handle history button? Do you endorse Wicket WebBeans for rapid development?

torsdag 16. juni 2011

OpenSourcing

I recently published my project, test-data-control, on googlecode, and want to jot down some stuff before I forget.

I wanted a subversion-enabled hosting, and chose Google because I have the impression they're fast and convenient pluss I like their philosophy.

At first, I found that I had to choose a license and structure the project so that it goes nicely into Google. I had a little ponder, but chose Apache license to go easy.

Filling in the form was straight forward, but I should have drafted it before I started on the web, these fields were filed:

Project name, summary, description. version control system, license and label(s)

Gotcha: Project name and version control system can not be changed later.

 

I then proceeded to apply for Sonatype OSS Maven Repository access, so that other projects can get to this library (they even push to Maven Central). Following the Usage guide, I found I needed some more stuff, mainly in pom, and should change my groupId.

Wisdom: I should have known what it took before I first comitted project to Google, but it wasn't a big sweat.

 

All in all, the application processes were smooth and pleasan. Google project hosting was available immediately, Sonatype OSS Maven Repository access was ready for me over night (I'm on European timezone, so I guess they work when I sleep, which is a nice thought).

 

I was also surprised to experience a period of euphoria, having published something for the first time. I'd say it's worth the extra effort of preparing it and publishing it just for that feeling. Another nice thing I have experienced since I started sharing my ambitions with coworkers is that my status have increased so that I'm being used as an authority and pulled into discussions about related issues. I also get all kinds of tips now that they know I'm working on this thing. It feels like the project is starting to pull it's own weight.

The authority stamp feels a bit premature, because I feel that I need to produce a fully working system and prove it before I can claim that. I'm only glad that I did a fair bit of literature research before I came to this, so I'm usually able to answer and give some advise without making a fool of myself.

tirsdag 24. mai 2011

Meetup om testing i Framsia

Det handler om å kjøre (all) koden din, så ofte som mulig, med så gode tilbakemeldinger som mulig.

Buster.js ble presentert.

OperaDriver og ChromeDriver kommer sannsynligvis til Selenium 2 beta 4

Mange tester for html5 er skrevet i WebDriver

onsdag 18. mai 2011

Doing SW Architecture / Research Project

When researching a new tool or a framework API for use I find myself getting tired or bored after spending time doing work that will not be directly productive, and previously I have made rush decisions or didn't "go all the way", thinking that "barely sufficient" = enough.

The other day, I started thinking that different ways of revisiting such projects should add real value. preferably, there should be (at least) 1 more person with a fresh attitude who can continue from where I left, and/or do:

  • review / inspection
  • come up with new ideas
  • bring more involvement / acceptance from the whole group

If it is too hard to get 1 more person, it may be wise to simulate him by taking a break from this project and revisiting it later.

 

fredag 1. april 2011

SiteMesh

SiteMesh

From OpenSymphony.

Code can be downloaded here.

 

Overview

Web-page layout and decoration.

Aids generating consistent look/feel, navigation and layout scheme.

Can include other pages (server-side include).

J2EE, but can be used outside as well (PHP, CGI...).

Extensible.

 

 

Setting up

 

pom.xml:

<dependency>

<groupId>opensymphony</groupId>

<artifactId>sitemesh</artifactId>

<version>2.4.2</version>

</dependency>

web.xml:

<filter>

<filter-name>sitemesh</filter-name>

<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>sitemesh</filter-name>

<url-pattern>*.jsp</url-pattern>

</filter-mapping>

<filter-mapping>

<filter-name>sitemesh</filter-name>

<url-pattern>*.do</url-pattern>

</filter-mapping>

<jsp-config>

<taglib>

<taglib-uri>sitemesh-page</taglib-uri>

<taglib-location>/WEB-INF/sitemesh-page.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>sitemesh-decorator</taglib-uri>

<taglib-location>/WEB-INF/sitemesh-decorator.tld</taglib-location>

</taglib>

</jsp-config>

Copy in mentioned files (tld)

decorators.xml:

<decoratorsdefaultdir="/decorators">

<decorator name="main" page="main.jsp">

<pattern>*</pattern>

</decorator>

 

<decorator name="printable" page="printable.jsp"/>

</decorators>

 

Default logic to determine what decorator to apply, first match:

  1. Meta decorator tag in page
  2. Don't apply a decorator to frame set
  3. Url with printable=true parameter (If so, use the printable decorator.)
  4. Does the page specifically request a decorator by the decorator file name?
  5. Does the page url match a pattern in the decorators.xml file?

Can be overridden.

Decorator example

<%@taglib uri="sitemesh-decorator" prefix="decorator"%>

 

<decorator:usePageid="myPage"/>

<html>

<head>

<title>SiteMesh main - <decorator:title default="Welcome!"/></title>

 

<decorator:head/>

</head>

 

<body>

<h1>SiteMesh main <decorator:title default="Welcome!"/></h1>

<h3><a

href="mailto:<decorator:getProperty property="meta.author"

default="staff@example.com"/>">

<decorator:getProperty property="meta.author"

default="staff@example.com"/>

</a>

</h3>

<hr/>

 

<decorator:body/>

 

<p><small> (<a href="?printable=true">printable version</a>)</small></p>

</body>

</html>