Package com.volantis.mcs.papi

Examples of com.volantis.mcs.papi.XMLWriter


        String vname, XFTextInputAttributes inputAttributes )
        throws JspTagException, IOException
    {
        HttpSession session = pageContext.getSession();
        HiddenFieldsSessionMap sessionMap = (HiddenFieldsSessionMap)session.getAttribute("_HIDDENATGFIELDS");
        XMLWriter writer = new XMLWriter(pageContext.getOut());
        try {
           
            // Type attribute is optional. If not present, it defaults to text
            if (inputAttributes.getType()==null)
            {
                inputAttributes.setType("text");
            }
           
            // Submit button... we need an XFAction instead of an XFInput
            if( ( inputAttributes.getType().equals( "submit" ) ) || ( inputAttributes.getType().equals( "reset" ) ) )
            {                               
                XFActionAttributes actionAttributes = new XFActionAttributes();               
                actionAttributes.setType( inputAttributes.getType() );
                actionAttributes.setStyleClass( inputAttributes.getStyleClass() );
                actionAttributes.setShortcut( inputAttributes.getShortcut() );
                actionAttributes.setCaption( inputAttributes.getCaption() );
                actionAttributes.setName( "i_" + vname );
                actionAttributes.setHelp( inputAttributes.getHelp() );
                actionAttributes.setPrompt( inputAttributes.getPrompt() );
                actionAttributes.setActive( "true" );
                actionAttributes.setCaptionPane( inputAttributes.getCaptionPane() );
                actionAttributes.setEntryPane( inputAttributes.getEntryPane() );

                writer.openElement(actionAttributes);
                writer.closeElement(actionAttributes);

                if (logger.isDebugEnabled()) {
                    logger.debug ( "Submit input. For group "+ getFormName(pageContext)+" setting attribute _V" + vname + " to " + inputAttributes.getName() );
                }
                sessionMap.setAttribute(getFormName(pageContext), "_V"+vname, inputAttributes.getName());
               
                // Deal with IE and image submit buttons.
                // IE sends i_button.x=anInt&i_button.y=anInt
                // Mozilla: i_button.x=anInt&i_button.y=anInt&i_button=valueOfCaptionAttribute
                // So we store a hashtable containing the name and the value of the caption               
                sessionMap.setButton(getFormName(pageContext), "i_"+vname, inputAttributes.getCaption());
               
            } else {
                if( inputAttributes.getType().equals( "hidden" ) == false )
                {
                    if (logger.isDebugEnabled()) {
                        logger.debug ( "Visible input. For group "+getFormName(pageContext)+ " setting attribute _V" + vname + " to " + inputAttributes.getName() );
                    }
                    sessionMap.setAttribute(getFormName(pageContext), "_V"+vname, inputAttributes.getName());
                   
                    inputAttributes.setName( "i_" + vname );

                    writer.openElement(inputAttributes);
                    writer.closeElement(inputAttributes);

                } else {
                    if( ( vname != null ) && (vname.length() > 0 ) )
                    {
                        if( inputAttributes.getName().startsWith( "_D" ) )
                        {
                            // _DARGS is a special case
                            if( inputAttributes.getName().equals( "_DARGS" ) )
                            {
                                if (logger.isDebugEnabled()) {
                                    logger.debug ( "Hidden input. For group "+getFormName(pageContext)+" setting attribute " + vname + " to " + inputAttributes.getInitial() );
                                }
                                sessionMap.setAttribute(getFormName(pageContext), "_DARGS", inputAttributes.getInitial());
                            } else {
                                if (logger.isDebugEnabled()) {
                                    logger.debug ( "Hidden input. For group "+getFormName(pageContext)+" setting attribute _D" + vname + " to " + inputAttributes.getName() );
                                }
                                sessionMap.setAttribute(getFormName(pageContext), "_D"+vname, inputAttributes.getName());
                            }
                        } else {                           
                            XFImplicitAttributes ia = new XFImplicitAttributes();
                            ia.setName( "i_" + vname );
                            ia.setValue( inputAttributes.getInitial() );

                            writer.openElement(ia);
                            writer.closeElement(ia);

                            if (logger.isDebugEnabled()) {
                                logger.debug ( "Hidden input. For group "+getFormName(pageContext)+" setting attribute _V" + vname + " to " + inputAttributes.getName() );
                            }
                            sessionMap.setAttribute(getFormName(pageContext), "_V"+vname, inputAttributes.getName());
                        }
                    } else {
                        if (logger.isDebugEnabled()) {
                            logger.debug ("hidden-input-undefined");
                        }
                        XFImplicitAttributes ia = new XFImplicitAttributes();
                        ia.setName( inputAttributes.getName() );
                        ia.setValue( inputAttributes.getInitial() );

                        writer.openElement(ia);
                        writer.closeElement(ia);
                                               
                    }
                }
            }
        }
View Full Code Here


        if(logger.isDebugEnabled()) {
            logger.debug ("VolantisSelectTag.renderTagAttributes( " + pTagName + " )" );
        }
        if( pTagName.equals( "select" ) ) {
            try {
                XMLWriter writer = new XMLWriter(getPageContext().getOut());
                writer.closeElement(selectAttributes);
            }
            catch (Exception ex) {
                // Had a problem so logger.debug it and throw a JspTagException to report it
                abort(ex);
                throw(new IOException("Error rendering Select tag"));
View Full Code Here

                    logger.debug ( "Select. Setting session attribute _V" + vname + " to " + selectAttributes.getName() );
                }  
                session.setAttribute( new String( "_V"+vname ), new String( selectAttributes.getName() ) );
                selectAttributes.setName( "i_" + vname );

                XMLWriter writer = new XMLWriter(getPageContext().getOut());
                writer.openElement(selectAttributes);
            }

            catch (Exception ex) {
                // Had a problem so logger.debug it and throw a JspTagException to report it
                abort(ex);
View Full Code Here

        try {
            if(logger.isDebugEnabled()){
                logger.debug ( "Adding option " + optionAttributes.getValue() + " caption is " + optionAttributes.getCaption().toString() );
            }

            XMLWriter writer = new XMLWriter(getPageContext().getOut());
            writer.openElement(optionAttributes);
            writer.closeElement(optionAttributes);                      
        }
        catch( Exception e )
        {
            abort( e );
            throw new IOException( "Error rendering option tag" );
View Full Code Here

    private static void renderInputTag( MarinerRequestContext context, PageContext pageContext,
        String vname, XFTextInputAttributes inputAttributes )
        throws IOException
    {
        HttpSession session = pageContext.getSession();
        XMLWriter writer = new XMLWriter(pageContext.getOut());
        try {
            // Submit button... we need an XFAction instead of an XFInput
            if( ( inputAttributes.getType().equals( "submit" ) ) || ( inputAttributes.getType().equals( "reset" ) ) )
            {
                if(logger.isDebugEnabled()){
                    logger.debug ( "Submit input. Setting session attribute _V" + vname + " to " + inputAttributes.getName() );
                }  
                session.setAttribute( new String( "_V"+vname ), new String( inputAttributes.getName() ) );
               
                XFActionAttributes actionAttributes = new XFActionAttributes();               
                actionAttributes.setType( inputAttributes.getType() );
                actionAttributes.setShortcut( inputAttributes.getShortcut() );
                actionAttributes.setCaption( inputAttributes.getCaption() );
                actionAttributes.setName( "i_" + vname );
                actionAttributes.setHelp( inputAttributes.getHelp() );
                actionAttributes.setPrompt( inputAttributes.getPrompt() );
                actionAttributes.setActive( "true" );
                actionAttributes.setCaptionPane( inputAttributes.getCaptionPane() );
                actionAttributes.setEntryPane( inputAttributes.getEntryPane() );

                // write the xdime to the page
                writer.openElement(actionAttributes);
                writer.closeElement(actionAttributes);

            } else {
                if( inputAttributes.getType().equals( "hidden" ) == false )
                {
                    if(logger.isDebugEnabled()){
                        logger.debug ( "Visible input. Setting session attribute _V" + vname + " to " + inputAttributes.getName() );
                    }  
                    session.setAttribute( new String( "_V"+vname ), new String( inputAttributes.getName() ) );
                    inputAttributes.setName( "i_" + vname );

                    writer.openElement(inputAttributes);
                    writer.closeElement(inputAttributes);
                } else {
                    if( ( vname != null ) && (vname.length() > 0 ) )
                    {
                        if( inputAttributes.getName().startsWith( "_D" ) )
                        {
                            // _DARGS is a special case
                            if( inputAttributes.getName().equals( "_DARGS" ) )
                            {
                                if(logger.isDebugEnabled()){
                                    logger.debug ( "Hidden input. Setting session attribute " + vname + " to " + inputAttributes.getInitial() );
                                }  
                                session.setAttribute( new String( "_DARGS" ), new String( inputAttributes.getInitial() ) );
                            } else {
                                if(logger.isDebugEnabled()){
                                    logger.debug ( "Hidden input. Setting session attribute _D" + vname + " to " + inputAttributes.getName() );
                                }  
                                session.setAttribute( new String( "_D"+vname ), new String( inputAttributes.getName() ) );
                            }
                        } else {
                            if(logger.isDebugEnabled()){
                                logger.debug ( "Hidden input. Setting session attribute _V" + vname + " to " + inputAttributes.getName() );
                            }  
                            session.setAttribute( new String( "_V"+vname ), new String( inputAttributes.getName() ) );

                            XFImplicitAttributes ia = new XFImplicitAttributes();
                            ia.setName( "i_" + vname );
                            ia.setValue( inputAttributes.getInitial() );

                            writer.openElement(ia);
                            writer.closeElement(ia);
                        }
                    } else {
                        if(logger.isDebugEnabled()){
                            logger.debug ( "Hidden input  vname is undefined" );
                        }
                        XFImplicitAttributes ia = new XFImplicitAttributes();
                        ia.setName( inputAttributes.getName() );
                        ia.setValue( inputAttributes.getInitial() );

                        writer.openElement(ia);
                        writer.closeElement(ia);
                    }
                }
            }
        }
View Full Code Here

        }
        if( pTagName.equals( "select" ) )
        {
            try
            {
                XMLWriter writer = new XMLWriter(getPageContext().getOut());
                writer.closeElement(selectAttributes);
            }
            catch (Exception ex) {
                // Had a problem so logger.debug it and throw a JspTagException to report it
                abort(ex);
                throw(new IOException("Error rendering Select tag"));
View Full Code Here

                if(logger.isDebugEnabled()){
                    logger.debug ( "Select. Setting session attribute _V" + vname + " to " + selectAttributes.getName() );
                }  
                session.setAttribute( new String( "_V"+vname ), new String( selectAttributes.getName() ) );
                selectAttributes.setName( "i_" + vname );
                XMLWriter writer = new XMLWriter(getPageContext().getOut());
                writer.openElement(selectAttributes);               
            }

            catch (Exception ex) {
                // Had a problem so log it and throw a JspTagException to report it
                abort(ex);
View Full Code Here

                session.setAttribute( new String("_URL"), new String( formAttributes.getAction().toString() ) );
               
                formAttributes.setAction( response.encodeURL( "/Remap" ) );
                formAttributes.setName( formName );

                XMLWriter writer = new XMLWriter(getPageContext().getOut());
                writer.openElement(formAttributes);
            }
            catch (Exception ex)
            {
                // Had a problem so log it and throw a JspTagException to report it
                logger.error ("unexpected-exception", ex);
View Full Code Here

                {
                    if(logger.isDebugEnabled()){
                        logger.debug ("Form tag end output starts");
                    }

                    XMLWriter writer = new XMLWriter(getPageContext().getOut());
                    writer.closeElement(formAttributes);
                }
            catch (Exception ex)
                {
                    // Had a problem so log it and throw a JspTagException to report it
                    logger.error ("unexpected-exception", ex);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.papi.XMLWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.