Sign in

E-mail *, (xx@domain.com)
Password *

Register | Forgot password

Blogs

  • Bram de Kruijff
  • Ivo Ladage
  • Mark van Cuijk
  • Martin van Mierloo
  • Martijn van Berkum
  • Michel Teunissen
  • Patrick Atoon

Recent blogs

RSS - Blogs
March 9, 2010
State of OSGi in the Java world
March 4, 2010
Reach more people with Google Translate
March 3, 2010
Get My Advice
February 26, 2010
What? Where!?!
February 11, 2010
Split it!

All Blogs...


9.7: Pimped archetypes!

January 24, 2009

In the new WebManager 9.7 release, the archetypes have been pimped. The archetypes of 9.6 were based on the maven archetype plugin that has been significantly improved over the last year. Upgrading to this new plugin (which requires at least maven 2.0.7) opened up the door to many new features, like dynamic classnames and filenames. These new features allowed us to fix stuff that the archetypes previously caused to fail in the certification process, if the archetypes were used 'as-is'. But this is no more! In 9.7 you can generate your code from the archetypes and it will pass the certification process from scratch!

So what is new in 9.7?

  • A new archetype 'webmanager-scheduledjob-archetype' has been introduced. This archetype creates a scheduled job, including session management, configuration management and scheduling stuff.
  • Unit tests have been added to the archetypes
  • The 'packagename' attribute has become obsolete. Since the group id and wcb id were already provided and the package name should equal <group id>.<wcb id> by convention, the archetype now makes it so!
  • Several archetypes have been enhanced with features like property editors and validators
  • Several guideline violations have been fixed, like missing or invalid JavaDoc, missing package.html files, missing api package, lines exceeding 120 characters and improper use of Java util logging.
  • Some bugs have been fixed that were found later on in the archetypes, like the one described in Fuzzy issue 4 (see this article).
  • WCA generation is now supported by default

How do I generate code from an archetype?

First of all, you will need Maven 2.0.7 in stead of Maven 2.0.6, which was the minimum requirement for 9.6 and earlier. Now there are some minor changes in the command that is used to generate WCBs from the archetype, this is the new syntax for generating a custom element:

mvn archetype:generate 
-DinteractiveMode=false
-DarchetypeGroupId=nl.gx.webmanager.archetypes 
-DarchetypeArtifactId=webmanager-element-archetype 
-DarchetypeVersion=9.7.0-SNAPSHOT 
-DgroupId=com.gxwebmanager.helloworld 
-DartifactId=helloworldelement
-Dclassprefix=HelloWorld 
-s ..\settings.xml

 The changes are displayed in bold:

  • generate instead of create, which has been deprecated
  • -DinteractiveMode=false, if set to true enables an interactive mode in which parameters can be entered one by one
  • -Dclassprefix=HelloWorld, determines the prefix of the generated Java classes. So no more 'CustomElementController' and 'CustomElement', instead they will be named 'HelloWorldElementController' and 'HelloWorldElement' as they should.

What archetypes are available?

In 9.7, one new archetype has become available, which is the scheduled job. Below is an overview of alle archetypes available in 9.7.

webmanager-element-archetype Element component
webmanager-formcomponent-archetype Form component, provides a handler, router and validator
webmanager-mediaitem-archetype Custom media item component
webmanager-pagemetadata-archetype Page metadata component
webmanager-panel-archetype Custom panel component
webmanager-presentation-archetype Presentation component
webmanager-scheduledjob-archetype Scheduled job component
webmanager-service-archetype Service component
webmanager-servlet-archetype Servlet component
webmanager-testbundle-archetype Test bundle component
webmanager-webtvchannelmetadata-archetype Web TV Channel metadata component
webmanager-webtvgeneralmetadata-archetype Web TV general metadata component

About the Author

Return to all blogs

Ivo Ladage

Ivo Ladage is product architect and is part of one of the SCRUM-teams. Ivo has special interests in Workflow and Authorization processes and Spring MVC.

Read all Ivo's blog entries

Other blog entries:

May 7, 2009
5 Spring pittfalls - Answer issue 3
May 7, 2009
5 Spring pittfalls - Answer issue 2
January 13, 2009
5 Spring pittfalls - Answer issue 1
December 9, 2008
5 Spring pitfalls
October 22, 2008
New certification process
August 3, 2008
WebManager extensions
March 25, 2008
The day of the easter egg
March 19, 2008
Why Spring?
March 7, 2008
On the implementation of RBAC for Workflow and Authorization


Share:

del.icio.us
digg
Technorati
Slashdot
Reddit
YahooMyWeb
NewsVine
ekudos
© 2010 GX creative online development B.V.

Disclaimer

This website (GXdeveloperweb.com) may discuss or contain opinions, (sample) coding, software or other information that does not include GX official interfaces, instructions or guidelines and therefore is not supported by GX. Changes made based on this information are not supported.  GX will not be held liable for any damages caused by using or misusing the information, software, instructions, code or methods suggested on this website, and anyone using these methods does so at his/her own risk. GX offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this website, including any liability resulting from incompatibility between the content of this website and the materials and services offered by GX. By using this website you will not hold, or seek to hold, GX responsible or liable with respect to the content of this website.