30 marzo 2009

testng configuration for Seam project




I'm really getting my nickers in a twist when configuring testng in eclipse.
Actually, the best approach is through Run->Debug Configurations->TestNG.

17 marzo 2009

Installing Embedded JBoss into Standalone Tomcat 6.0

Installing Embedded JBoss into Standalone Tomcat 6.0

Embedded JBoss

EJB 3.0 y pruebas unitarias
con Maven, JUnit y Embedded JBoss


1.- instalar embedded JBoss
2.- meterlo en un repositorio maven2

Hibernate exporters

Hibernate exporters

4.4. Exporters


4.4.1. Database schema exporter ()


4.4.2. POJO java code exporter ()


4.4.3. Hibernate Mapping files exporter ()


4.4.4. Hibernate Configuration file exporter ()


4.4.5. Documentation exporter ()


4.4.6. Query exporter ()


4.4.7. Generic Hibernate metamodel exporter ()


4.4.7.1. Seam Exporter via


4.5. Using properties to configure Exporters


4.5.1. and


4.5.2. Getting access to user specific classes

seam fileupload

http://linuxbeans.blogspot.com/2007/10/image-handling-in-seam-apps-part-ii.html

Big File Upload Tutorial Using Seam

create your own stereotypes

This link contains good info how to create your own stereotypes. http://www.ibm.com/developerworks/rational/library/05/0906_dusko/

16 marzo 2009

JBoss Seam and Maven 2

JBoss Seam and Maven 2

JBoss Seam, by default, is set up to compile, package, and deploy using Ant. Many developers, however, would like to use Maven 2 to build their application. In order to make the process of configuring Maven to correctly build a Seam project easier, Lunar Logic has created a Maven Archetype that will create an empty Seam project that compiles and packages using Maven 2.

The instructions for obtaining and using the archetype are located on the Lunar Logic Blog.

The instructions don't work quite as advertised, you can, however, download the archetype and install into the local maven2 repos by hand using 'mvn install'.

Also, I am working with the publisher to determine how to find a plugin that is used by the archetype called 'jboss-as-maven2-plugin'. Currently, you can create a new project, but it fails on any mvn command because it cannot locate this plugin.

Seam and Maven - archetype and SeamGen like application

You can also try Seam Maven integration by SoftEU. It provides few archetypes and Maven profiles for easier dependencies and SeamGen like application.

Script for creating a local maven 2 repo from a seam distribution

Two tools, one goal

Two tools, one goal


The Seam distribution includes a tool named seam-gen to help you get started quickly using Seam. The tool collects information from you about your project and then uses that information to create a project structure. It can also generate a CRUD application by reverse engineering your database schema and generate various forms of stub code. In this entry, you'll learn how to get the generated project setup in Eclipse so that you can leverage the available tooling.

Two tools, one goal

There are actually two interfaces to seam-gen. The first is the commandline script named seam, which resides at the root of the Seam distribution. When we talk about seam-gen, we are usually referring to this script. There is also new project wizard in JBoss Tools (the open source project behind JBoss Developer Studio) that is a complement to this script. Both tools share the same FreeMarker templates inside the seam-gen directory of the Seam distribution to produce the Java code, Facelets views, and TestNG configuration. Aside from these common templates, the two tools work independently of one another in setting up a Seam project. The projects they generate differ in one fundamental way, though. The commandline tool produces projects that are built using Ant, while the JBoss Tools new project wizard creates projects that are build purely with Eclipse builders.

As you'd expect, when you create a project using the Eclipse plug-in, you can immediately start taking advantage of the tooling support for Seam in your project. However, like me, you may find it important to have a project that can be built outside of Eclipse using Ant. That means creating the project using the seam-gen commandline script. Don't fear that by creating the project outside of Eclipse, that the IDE is reduced to a syntax checker and Java compiler. The purpose of this article is to demonstrate how to fully activate the Seam tooling in Eclipse for projects created using the seam-gen commandline script, bringing you the best of both worlds. Plus, once the Seam tooling is activated, you can generate the CRUD application or stub code from either Eclipse or the commandline script.

Taylor - Modify Code

Modify Code




Your problem is actually easily solvable. RSA (Rational Software Architect) does that for you.

The basic issue is you view model as just a model. However, the tool you are using is viewing your code as the model. The term for it is code visualization.

You have the right idea in that model should be kept as abstract as possible. That's why RSA separated the concept of modelling from code visualization.

You just have to get something that would transform your model into other artifacts, which can be code, XML or maybe other models.

RSA provides you with the tools necessary to do that.

Posted by Archimedes Trajano on August 01, 2006 at 09:53 PM EDT #

I agree with the notion that many tools are on the code visualization side of things. And I will concede that RSA can handle this, but not without a lot of work and a lot of cash. I have used rational tools since the early Booch days through the present. You have to jump through a lot of hops, so I decided to build Taylor instead.

Anyway, my intend was to convey the idea and not so much slam the tools.

Thanks for your thoughts!

Posted by John Gilbert on August 03, 2006 at 05:56 PM EDT #

14 marzo 2009

Core Seam

Core Seam

documento PDF que explica detalladamente Seam por dentro

Arrogant Programmer

Blog de un tipo que tiene comentarios interesantes sobre Seam

Controlling reverse engineering

Controlling reverse engineering


When using the the ant task will read the database metadata and from that perform a reverse engineering of the database schema into a normal Hibernate Configuration. It is from this object e.g. >hbm2java<>

To govern this process Hibernate uses a reverse engineering strategy. A reverse engineering strategy is mainly called to provide more java like names for tables, column and foreignkeys into classes, properties and associations. It also used to provide mappings from SQL types to Hibernate types. The strategy can be customized by the user. The user can even provide its own custom reverse engineering strategy if the provided strategy is not enough, or simply just provide a small part of the strategy and delegate the rest to the default strategy.

5.1. Default reverse engineering strategy

The default strategy uses some rules for mapping JDBC artifact names to java artifact names. It also provide basic typemappings from JDBC types to Hibernate types. It is the default strategy that uses the packagename attribute to convert a table name to a fully qualified classname.

5.2. hibernate.reveng.xml file

To have fine control over the process a hibernate.reveng.xml file can be provided. In this file you can specify type mappings and table filtering. This file can be created by hand (its just basic XML) or you can use the Hibernate plugins which have a specialized editor.

Note: many databases is case-sensitive with their names and thus if you cannot make some table match and you are sure it is not excluded by a then check if the case matches; most databases stores table names in uppercase.

The following is an example of a reveng.xml. Following the example is more details about the format.

10 marzo 2009

File download support

http://in.relation.to/Bloggers/Daniel

Web applications often need to provide a link for the user to download a file, such as an expense report. Seam 2.1.2.CR1 makes the task of serving a file to the user easy and RESTful using a combination of the s:resource and s:download tags. But before we can use these tags, we need to do some simple configuration.

The s:resource tag uses Seam’s DocumentStore to serve (or push) documents. You'll need to configure this servlet in to your web.xml:

web.xml


Document Store Servlet
org.jboss.seam.document.DocumentStoreServlet


Document Store Servlet
/seam/docstore/*

Alone in a page, s:resource will act as the file download provider by defining where to get the file data and meta-data. You use it in place of HTML (not inside of HTML) since the intent is to serve the document and not a web page. Thus, the page template should look something like this.

resources.xhtml

 xmlns:s="http://jboss.com/products/seam/taglib"
data="#{fileResourceProvider.data}"
contentType="#{fileResourceProvider.contentType}"
fileName="#{fileResourceProvider.fileName}" />

  • data is the actual file data. It may be a java.util.File, an InputStream or a byte[].
  • contentType (e.g., image/jpeg)
  • filename (e.g., someFile.jpg) which will likely be displayed in the user's file download prompt

Other attributes are described in the Seam reference documentation.