[ANN] Providers 0.3 Released (includes DisplayTag tip and URL!)

2004-05-22 Thread Guillermo Meyer
http://providers.sourceforge.net/

-Original Message-
From: Guillermo Meyer [mailto:[EMAIL PROTECTED] 
Sent: Sábado, 22 de Mayo de 2004 09:24 a.m.
To: Struts Users Mailing List
Subject: [ANN] Providers 0.3 Released (includes DisplayTag tip)


Providers is a framework to be used with JSP to fill Select options in
HTML. You can use it with Struts to replace html:options tag and use
prv:options to fill the select without the need of creating a collection
in an Action. Providers is intended to help in managing select related
problems. Providers also comes with some util taglibs like
ComboSelectTag, that allows to create Dependant Drow Down Lists.

Providers 0.3 new features are:
---
-DefineTag: Allows to define a provider collection as a bean in a given
scope.
-SelectRefTag: allows to create dependencies between a tag and multiples
ones at the same time (see example)

Next release will have the following:
-
-Expresion language: providers-el taglibs.
-Use comboselect with a diferent collection for each select

Known bug (will be corrected in next release):
ComboSelectTag works wrong if Tomcat pooling tag is enabled. Try this in
web.xml:

enablePooling
false


##   - ##
##   Tip for DisplayTag users: ##
##   - ##
If you have a List to be displayed with DisplatTag and one of the fields
is an ID, you can create a provider for this field and create a
decorator to display the description:

Example:
Your collection objects have the following attributes: -userName
-idStatus

You want to display idStatus description but you haven't the value in
the collection.

This is the JSP code:


  
   

Your decorator could be as follows:

public class StatusProviderDecorator implements ColumnDecorator {
public final String decorate(Object pColumnValue) {
try {
ProviderFactory factory =
ProviderFactory.getInstance();
String valueToFormat = (String)pColumnValue;
Object obj =
factory.getProvider("status").getDescription(valueToFormat);
return obj.toString();  
} catch (Exception e) {
return obj.toString(); //default returns the
same... There was an unexpected error
}
}
}

And your provider definition:







 

You also could use this provider to display options in a page (for
example, while changing the status):





And in a detail, you could show status description given the ID:




Cheers!

Guillermo Meyer
System Engineer
EDS Argentina - Proyecto X71 Interbanking.
54.11.4322-1307

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido
exclusivamente a las personas direccionadas en el mail y puede contener
informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii)
amparada por el secreto profesional. Cualquier opinion en el contenido,
es exclusiva de su autor y no representa necesariamente la opinion de
Interbanking S.A. El acceso no autorizado, uso, reproduccion, o
divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad
ni obligacion legal alguna por cualquier informacion incorrecta o
alterada contenida en este mensaje. Si usted ha recibido este mensaje
por error, le rogamos tenga la amabilidad de destruirlo inmediatamente
junto con todas las copias del mismo, notificando al remitente. No
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni
ninguna de sus partes si usted no es el destinatario. Muchas gracias.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido
exclusivamente a las personas direccionadas en el mail y puede contener
informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii)
amparada por el secreto profesional. Cualquier opinion en el contenido,
es exclusiva de su autor y no representa necesariamente la opinion de
Interbanking S.A. El acceso no autorizado, uso, reproduccion, o
divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad
ni obligacion legal alguna por cualquier informacion incorrecta o
alterada contenida en este mensaje. Si usted ha recibido este mensaje
por error, le rogamos tenga la amabilidad de destruirlo inmediatamente
junto con todas las copias del mismo, notificando al remitente. No
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni
ninguna de sus partes si usted no es el destinatario. Muchas gracias.

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) 

[ANN] Providers 0.3 Released (includes DisplayTag tip)

2004-05-22 Thread Guillermo Meyer
Providers is a framework to be used with JSP to fill Select options in
HTML. You can use it with Struts to replace html:options tag and use
prv:options to fill the select without the need of creating a collection
in an Action.
Providers is intended to help in managing select related problems.
Providers also comes with some util taglibs like ComboSelectTag, that
allows to create Dependant Drow Down Lists.

Providers 0.3 new features are:
---
-DefineTag: Allows to define a provider collection as a bean in a given
scope.
-SelectRefTag: allows to create dependencies between a tag and multiples
ones at the same time (see example)

Next release will have the following:
-
-Expresion language: providers-el taglibs.
-Use comboselect with a diferent collection for each select

Known bug (will be corrected in next release):
ComboSelectTag works wrong if Tomcat pooling tag is enabled. Try this in
web.xml:

enablePooling
false


##   - ##
##   Tip for DisplayTag users: ##
##   - ##
If you have a List to be displayed with DisplatTag and one of the fields
is an ID, you can create a provider for this field and create a
decorator to display the description:

Example:
Your collection objects have the following attributes:
-userName
-idStatus

You want to display idStatus description but you haven't the value in
the collection.

This is the JSP code:


  
  


Your decorator could be as follows:

public class StatusProviderDecorator implements ColumnDecorator {
public final String decorate(Object pColumnValue) {
try {
ProviderFactory factory =
ProviderFactory.getInstance();
String valueToFormat = (String)pColumnValue;
Object obj =
factory.getProvider("status").getDescription(valueToFormat);
return obj.toString();  
} catch (Exception e) {
return obj.toString(); //default returns the
same... There was an unexpected error
}
}
}

And your provider definition:










You also could use this provider to display options in a page (for
example, while changing the status):





And in a detail, you could show status description given the ID:




Cheers!

Guillermo Meyer
System Engineer
EDS Argentina - Proyecto X71 Interbanking.
54.11.4322-1307

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las 
personas direccionadas en el mail y puede contener informacion (i)de propiedad 
exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier 
opinion en el contenido, es exclusiva de su autor y no representa necesariamente la 
opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion 
esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna 
por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha 
recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo 
inmediatamente junto con todas las copias del mismo, notificando al remitente. No 
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus 
partes si usted no es el destinatario. Muchas gracias.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]