// Decompiled by DJ v3.0.0.63 Copyright 2002 Atanas Neshkov  Date: 29/09/2006 14:23:07

// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!

// Decompiler options: packimports(3) 

// Source File Name:   Q70ListasEnlazadasTag.java



package q02b.tag;



import es.ejie.frmk.infraestructura.traza.Q70TraceLevel;

import es.ejie.frmk.infraestructura.traza.Q70Traza;

import es.ejie.frmk.presentacion.iu.taglib.html.Q70BaseHandlerTag;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.jsp.JspException;

import org.apache.struts.util.RequestUtils;

import org.apache.struts.util.ResponseUtils;



public class Q02bComboTablasCodEnlazado extends Q70BaseHandlerTag{



	private static final long serialVersionUID = 1L;

	//private static final String COMPONENTE = "COMBO_FILTRO";

    private static Q70Traza tr = Q70Traza.getSingleton();

    private String javascriptCallerFunc;

    private String javascriptReturnFunc;

    private String sourceTag;

    private String targetTag;

    private String formName;

    private String table;

    private String predicateColumn;

    private boolean predicateColumnNumeric;

    private String labelColumn;

    private String valueColumn;

    private String whereClause;

    private String extraPredicate;

    private String submitMethod;

    private String technology;

    

    public Q02bComboTablasCodEnlazado()

    {

        javascriptCallerFunc = null;

        javascriptReturnFunc = "";

        sourceTag = "";

        targetTag = "";

        formName = null;

        table = null;

        predicateColumn = null;

        predicateColumnNumeric = true;

        labelColumn = null;

        valueColumn = null;

        whereClause = null;

        extraPredicate = "";

        submitMethod = "POST";

        technology = "ajax";

    }



    public String getFormName()

    {

        return formName;

    }



    public void setFormName(String s)

    {

        formName = s;

    }



    public String getPredicateColumn()

    {

        return predicateColumn;

    }



    public void setPredicateColumn(String s)

    {

        predicateColumn = s;

    }



    public boolean getPredicateColumnNumeric()

    {

        return predicateColumnNumeric;

    }



    public void setPredicateColumnNumeric(boolean flag)

    {

        predicateColumnNumeric = flag;

    }



    public String getSourceTag()

    {

        return sourceTag;

    }



    public void setSourceTag(String s)

    {

        sourceTag = s;

    }



    public String getJavascriptCallerFunc()

    {

        return javascriptCallerFunc;

    }



    public void setJavascriptCallerFunc(String s)

    {

        javascriptCallerFunc = s;

    }



    public String getJavascriptReturnFunc()

    {

        return javascriptReturnFunc;

    }



    public void setJavascriptReturnFunc(String s)

    {

        javascriptReturnFunc = s;

    }



    public String getTable()

    {

        return table;

    }



    public void setTable(String s)

    {

        table = s;

    }



    public String getLabelColumn()

    {

        return labelColumn;

    }



    public void setLabelColumn(String s)

    {

        labelColumn = s;

    }



    public String getValueColumn()

    {

        return valueColumn;

    }



    public void setValueColumn(String s)

    {

        valueColumn = s;

    }

    public String getWhereClause() {

		return whereClause;

	}



	public void setWhereClause(String whereClause) {

		this.whereClause = whereClause;

	}

    public String getTargetTag()

    {

        return targetTag;

    }



    public void setTargetTag(String s)

    {

        targetTag = s;

    }



    public String getExtraPredicate()

    {

    	if ( extraPredicate != null ){

    		extraPredicate=  extraPredicate.trim();

    	}	

    	return extraPredicate;    	

    }



    public void setExtraPredicate(String s)

    {

        extraPredicate = s;

    }



    public String getSubmitMethod()

    {

        return submitMethod;

    }



    public void setSubmitMethod(String s)

    {

        submitMethod = s;

    }



    public String getTechnology()

    {

        return technology;

    }



    public void setTechnology(String s)

    {

        technology = s;

    }



    public int doStartTag()

        throws JspException

    {

        if(tr.isTraceActive()){

            tr.trace("LISTAS_ENLAZADAS", Q70TraceLevel.DEBUG, "Generando tag de tipo " + getClass().toString());
        }
        return 1;

    }



    public int doEndTag()

        throws JspException

    {

        verifyAtributes();

        String s = Q02bJavascriptUtils.renderComboTablasCodEnlazadoHtmlCode((HttpServletRequest)pageContext.getRequest(), this);

        //String s = Q70JavascriptLib.renderListasEnlazadasHtmlCode((HttpServletRequest)pageContext.getRequest(), this);

        ResponseUtils.write(pageContext, s);

        super.putBridgeCounter();

        return 6;

    }

 







    public void release()

    {

        super.release();

    }



    private void verifyAtributes()

        throws JspException

    {

        if(0 == javascriptCallerFunc.trim().length())

        {

            JspException jspexception = new JspException("Debe especificar un valor para el atrito javascriptCallerFunc.");

            RequestUtils.saveException(pageContext, jspexception);

            throw jspexception;

        }

        if(null == javascriptReturnFunc && (null == targetTag || 0 == targetTag.trim().length()))

        {

            JspException jspexception1 = new JspException("Debe especificar un valor para el atrito targetTag.");

            RequestUtils.saveException(pageContext, jspexception1);

            throw jspexception1;

        }

        if(!submitMethod.toUpperCase().equals("POST") && !submitMethod.toUpperCase().equals("GET"))

        {

            JspException jspexception2 = new JspException("El valor del atributo submitMethod es incorrecto. Los posibles valores son: GET \363 POST.");

            RequestUtils.saveException(pageContext, jspexception2);

            throw jspexception2;

        }

        if(!getTechnology().equalsIgnoreCase("ajax") && !getTechnology().equalsIgnoreCase("iframe"))

        {

            JspException jspexception3 = new JspException("El valor del atributo technology es incorrecto. Los posibles valores son: 'ajax' \363 'iframe'.");

            RequestUtils.saveException(pageContext, jspexception3);

            throw jspexception3;

        } else

        {

            return;

        }

    }



	



    



}