Package org.apache.turbine.util

Examples of org.apache.turbine.util.ParameterParser


        throws Exception
    {
        // Name of the button.
        String theButton = null;
        // Parameter parser.
        ParameterParser pp = data.getParameters();
        // The arguments to pass to the method to execute.
        Object[] args = new Object[1];
        // The arguments to the method to find.
        Class[] classes = new Class[1];
        classes[0] = RunData.class;

        String button = pp.convert(BUTTON);

        // Loop through and find the button.
        for (Enumeration e = pp.keys() ; e.hasMoreElements() ;)
        {
            String key = (String) e.nextElement();
            if (key.startsWith(button))
            {
                theButton = formatString(key);
View Full Code Here


     * @exception Exception, a generic exception.
     */
    public void doBuild( RunData data )
        throws Exception
    {
        ParameterParser params = data.getParameters();
        String fmScreen = params.getString("template");
        params.add("template", "navigations/default_top.html");

        // Execute the Top Navigation portion for this Layout.
        ConcreteElement topNav =
            ScreenLoader.getInstance().eval ( data, "FreeMarkerScreen" );

        if ( topNav != null)
        {
            data.getPage().getBody().addElement( topNav );
        }

        // If an Action has defined a message, attempt to display it
        // here.
        if ( data.getMessage() != null )
        {
            data.getPage().getBody()
                .addElement(new P())
                .addElement(
                    new Font().setColor(HtmlColor.red)
                        .addElement(data.getMessageAsHTML()));
        }

        params.add("template", "screens/" + fmScreen);

        // Now execute the Screen portion of the page.
        ConcreteElement screen = ScreenLoader.getInstance().eval(
            data, data.getScreen() );
        if (screen != null)
            data.getPage().getBody().addElement( screen );

        // The screen should have attempted to set a Title for itself,
        // otherwise, a default title is set.
        data.getPage().getTitle().addElement(data.getTitle());

        // The screen should have attempted to set a Body bgcolor for
        // itself, otherwise, a default body bgcolor is set.
        data.getPage().getBody().setBgColor(HtmlColor.white);

        // Execute the Bottom Navigation portion for this Layout.
        params.add("template", "navigations/default_bottom.html");
        ConcreteElement bottomNav =
        ScreenLoader.getInstance().eval ( data, "FreeMarkerScreen" );

        if ( bottomNav != null)
        {
View Full Code Here

    {
        // Name of the button.
        String theButton = null;

        // ParameterParser.
        ParameterParser pp = data.getParameters();

        String button = pp.convert(BUTTON);

        // Loop through and find the button.
        for (Enumeration e = pp.keys() ; e.hasMoreElements() ;)
        {
            String key = (String) e.nextElement();
            if (key.startsWith(button))
            {
                theButton = formatString(key);
View Full Code Here

    {
        // Name of the button.
        String theButton = null;

        // ParameterParser.
        ParameterParser pp = data.getParameters();

        String button = pp.convert(BUTTON);

        // Loop through and find the button.
        for (Enumeration e = pp.keys() ; e.hasMoreElements() ;)
        {
            String key = (String) e.nextElement();
            if (key.startsWith(button))
            {
                theButton = formatString(key);
View Full Code Here

        throws TurbineException
    {
        this.data = data;
        valid_flag = true;

        ParameterParser pp = data.getParameters();
        if ( pp.containsKey(getKey()) && pp.getString(getKey()) != null )
        {
            set_flag = true;
            if (validate(pp))
            {
                // iv.reconcileNotValid(pp);
            }
        }
        else if ( pp.containsKey(getValueIfAbsent()) &&
                  pp.getString(getValueIfAbsent()) != null )
        {
            pp.add(getKey(), pp.getString(getValueIfAbsent()));
            set_flag = true;
            validate(pp);
        }

        initialized = true;
View Full Code Here

     * Removes references to this group and its fields from the
     * query parameters
     */
    public void removeFromRequest()
    {
        ParameterParser pp = data.getParameters();
        String[] groups = pp.getStrings(gid);
        if ( groups != null )
        {
            pp.remove(gid);
            for (int i=0; i<groups.length; i++)
            {
                if ( groups[i] != null && !groups[i].equals(oid) )
                {
                    pp.add(gid,groups[i]);
                }
            }
            for (int i=fieldsArray.length-1; i>=0; i--)
            {
                fieldsArray[i].removeFromRequest();
View Full Code Here

        throws TurbineException
    {
        this.data = data;
        valid_flag = true;

        ParameterParser pp = data.getParameters();
        if ( pp.containsKey(getKey()) )
        {
            set_flag = true;
            validate(pp);
        }
View Full Code Here

     * @exception Exception, a generic exception.
     */
    public void doBuild( RunData data )
        throws Exception
    {
        ParameterParser params = data.getParameters();
        String fmScreen = params.getString("template");
        params.add("template", "navigations/default_top.html");

        // Execute the Top Navigation portion for this Layout.
        ConcreteElement topNav =
            ScreenLoader.getInstance().eval ( data, "FreeMarkerScreen" );

        if ( topNav != null)
        {
            data.getPage().getBody().addElement( topNav );
        }

        // If an Action has defined a message, attempt to display it
        // here.
        if ( data.getMessage() != null )
        {
            data.getPage().getBody()
                .addElement(new P())
                .addElement(
                    new Font().setColor(HtmlColor.red)
                        .addElement(data.getMessageAsHTML()));
        }

        params.add("template", "screens/" + fmScreen);

        // Now execute the Screen portion of the page.
        ConcreteElement screen = ScreenLoader.getInstance().eval(
            data, data.getScreen() );
        if (screen != null)
            data.getPage().getBody().addElement( screen );

        // The screen should have attempted to set a Title for itself,
        // otherwise, a default title is set.
        data.getPage().getTitle().addElement(data.getTitle());

        // The screen should have attempted to set a Body bgcolor for
        // itself, otherwise, a default body bgcolor is set.
        data.getPage().getBody().setBgColor(HtmlColor.white);

        // Execute the Bottom Navigation portion for this Layout.
        params.add("template", "navigations/default_bottom.html");
        ConcreteElement bottomNav =
        ScreenLoader.getInstance().eval ( data, "FreeMarkerScreen" );

        if ( bottomNav != null)
        {
View Full Code Here

            .append( " within the screen." )
            .append( "<p>" )
            .append( "Please click " );

        message.addElement( sb.toString() );
        ParameterParser pp;
        pp = (ParameterParser)data.getUser().getTemp("prev_parameters");
        pp.remove("_session_access_counter");
        message.addElement( new A().setHref(
            new DynamicURI(data,(String)data.getUser().getTemp("prev_screen"))
                .addPathInfo( pp ).toString()).addElement("here") );
        message.addElement( " to return the the screen you were working on." );
View Full Code Here

        throws TurbineException
    {
        this.data = data;
        valid_flag = true;
       
        ParameterParser pp = data.getParameters();
        if ( pp.containsKey(getKey()) && pp.getString(getKey()) != null )
        {
            set_flag = true;
            if (validate(pp))
            {
                // iv.reconcileNotValid(pp);
            }
        }
        else if ( pp.containsKey(getValueIfAbsent()) &&
                  pp.getString(getValueIfAbsent()) != null )
        {
            pp.add(getKey(), pp.getString(getValueIfAbsent()));
            set_flag = true;
            validate(pp);
        }

        initialized = true;
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.ParameterParser

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.