es.mcu.yingo.campos.html
Class GeneradorHtmlEnlace

java.lang.Object
  extended by es.mcu.yingo.campos.html.GeneradorHtmlEnlace
All Implemented Interfaces:
GeneradorHtml, org.springframework.context.ApplicationContextAware

public class GeneradorHtmlEnlace
extends java.lang.Object
implements GeneradorHtml, org.springframework.context.ApplicationContextAware

Generador HTML que genera un enlace HTML a patir de atributo href que es la URL base y el valor del campo.
Es muy util para crear enlaces de detalle en los resultados de las tareas de búsquedas.

Author:
miguel.esteban
See Also:
Map

Field Summary
private  org.springframework.context.ApplicationContext applicationContext
          Objeto para obtener el contexto y poder realizar la internacionalización del texto
private  java.lang.String etiquetasHtmlPosEnlace
          Etiqueta HTML a colocar por detrás del enlace.
private  java.lang.String etiquetasHtmlPreEnlace
          Etiqueta HTML a colocar por delante del enlace.
private  java.lang.String href
          Atributo que define la dirección del enlace por defecto
private  java.lang.String target
          El 'target' del enlace HTML para que se abra en la misma ventana, en una nueva, en un marco diferencte, etc...
private  java.lang.String textoEnlaceDefecto
          Texto por defecto que tendrá el enlace
 
Fields inherited from interface es.mcu.yingo.campos.html.GeneradorHtml
BUSCA, MODIFICA, MUESTRA, NUEVO
 
Constructor Summary
GeneradorHtmlEnlace()
           
 
Method Summary
 org.springframework.context.ApplicationContext getApplicationContext()
           
 java.lang.String getEtiquetasHtmlPosEnlace()
           
 java.lang.String getEtiquetasHtmlPreEnlace()
           
 java.lang.String getHref()
           
 java.lang.String getHTML(int tipo, java.lang.String id, java.lang.Object value, java.lang.String codExpediente, java.util.Locale locale)
          Devuelve el código HTML generado, esto es la representación en formato html del campo.
 java.lang.String getTarget()
           
 java.lang.String getTextoEnlaceDefecto()
           
private  java.lang.String obtenerEnlaceDesdeMap(java.util.Map valorMap, java.util.Locale locale)
          Obtiene el html del enlace de la información del Map Como texto el valor de la clave 'textoEnlace' si esta existierá, sino sería el valor cargado en el atributo textoEnlaceDefecto Como dirección base del enlace tendra el valor internacionalizado de la clave 'href'.
private  java.lang.String obtenerEnlaceDesdeString(java.lang.String valorString, java.util.Locale locale)
          Obtiene el html del enlace cuando lo que se le pasa es un tipo String.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setEtiquetasHtmlPosEnlace(java.lang.String etiquetasHtmlPosEnlace)
           
 void setEtiquetasHtmlPreEnlace(java.lang.String etiquetasHtmlPreEnlace)
           
 void setHref(java.lang.String href)
           
 void setTarget(java.lang.String target)
           
 void setTextoEnlaceDefecto(java.lang.String textoEnlaceDefecto)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

applicationContext

private org.springframework.context.ApplicationContext applicationContext
Objeto para obtener el contexto y poder realizar la internacionalización del texto


href

private java.lang.String href
Atributo que define la dirección del enlace por defecto


textoEnlaceDefecto

private java.lang.String textoEnlaceDefecto
Texto por defecto que tendrá el enlace


target

private java.lang.String target
El 'target' del enlace HTML para que se abra en la misma ventana, en una nueva, en un marco diferencte, etc...


etiquetasHtmlPreEnlace

private java.lang.String etiquetasHtmlPreEnlace
Etiqueta HTML a colocar por delante del enlace. Por defecto


etiquetasHtmlPosEnlace

private java.lang.String etiquetasHtmlPosEnlace
Etiqueta HTML a colocar por detrás del enlace. Por defecto

Constructor Detail

GeneradorHtmlEnlace

public GeneradorHtmlEnlace()
Method Detail

getHTML

public java.lang.String getHTML(int tipo,
                                java.lang.String id,
                                java.lang.Object value,
                                java.lang.String codExpediente,
                                java.util.Locale locale)
                         throws java.lang.Exception
Description copied from interface: GeneradorHtml
Devuelve el código HTML generado, esto es la representación en formato html del campo. Según como se realice cada implementación se puede mostrar campos de texto, listas desplegables, etc. Incluso campos más elaborados, como pueden ser applets, o cualquier otro tipo de campo.

Specified by:
getHTML in interface GeneradorHtml
Returns:
Throws:
java.lang.Exception

obtenerEnlaceDesdeString

private java.lang.String obtenerEnlaceDesdeString(java.lang.String valorString,
                                                  java.util.Locale locale)
Obtiene el html del enlace cuando lo que se le pasa es un tipo String. Si el texto del enlace por defecto está definido este será el texto del enlace sino será el valor del campo.

Parameters:
valorString -
locale -
Returns:

obtenerEnlaceDesdeMap

private java.lang.String obtenerEnlaceDesdeMap(java.util.Map valorMap,
                                               java.util.Locale locale)
Obtiene el html del enlace de la información del Map

Parameters:
valorMap -
locale -
Returns:

getApplicationContext

public org.springframework.context.ApplicationContext getApplicationContext()
Returns:
Devuelve el atributo applicationContext

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Parameters:
applicationContext - Carga el atributo applicationContext

getHref

public java.lang.String getHref()
Returns:
Devuelve el atributo href

setHref

public void setHref(java.lang.String href)
Parameters:
href - Carga el atributo href

getTarget

public java.lang.String getTarget()
Returns:
Devuelve el atributo target

setTarget

public void setTarget(java.lang.String target)
Parameters:
target - Carga el atributo target

getTextoEnlaceDefecto

public java.lang.String getTextoEnlaceDefecto()
Returns:
Devuelve el atributo textoEnlaceDefecto

setTextoEnlaceDefecto

public void setTextoEnlaceDefecto(java.lang.String textoEnlaceDefecto)
Parameters:
textoEnlaceDefecto - Carga el atributo textoEnlaceDefecto

getEtiquetasHtmlPosEnlace

public java.lang.String getEtiquetasHtmlPosEnlace()
Returns:
Devuelve el atributo etiquetasHtmlPosEnlace

setEtiquetasHtmlPosEnlace

public void setEtiquetasHtmlPosEnlace(java.lang.String etiquetasHtmlPosEnlace)
Parameters:
etiquetasHtmlPosEnlace - Carga el atributo etiquetasHtmlPosEnlace

getEtiquetasHtmlPreEnlace

public java.lang.String getEtiquetasHtmlPreEnlace()
Returns:
Devuelve el atributo etiquetasHtmlPreEnlace

setEtiquetasHtmlPreEnlace

public void setEtiquetasHtmlPreEnlace(java.lang.String etiquetasHtmlPreEnlace)
Parameters:
etiquetasHtmlPreEnlace - Carga el atributo etiquetasHtmlPreEnlace