Package org.apache.turbine.util

Examples of org.apache.turbine.util.ParameterParser


        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

        modelData.put("screen", data.getScreen() );
        modelData.put("action", data.getAction() );
        modelData.put("title", data.getTitle() );
        modelData.put("message", data.getMessage() );

        ParameterParser params = data.getParameters();
        Enumeration e = params.keys();
        while (e.hasMoreElements() )
        {
            String key = (String)e.nextElement();
            String[] values = params.getStrings(key);
            if (values.length==1)
            {
                modelParameters.put(key, values[0]);
            }
            else
            {
                SimpleList listModel = new SimpleList();
                modelParameters.put(key, listModel);
                for (int i=0; i<values.length; i++)
                {
                    listModel.add(values[i]);
                }
            }
        }

        if (data.getACL() != null)
        {
            Iterator roles = data.getACL().getRoles().elements();
            while (roles.hasNext() )
            {
                String key = ((Role)roles.next()).getName();
                modelRoles.put(key, true);
            }
            Iterator permissions = data.getACL().getPermissions().elements();
            while (permissions.hasNext() )
            {
                String key = ((Permission)permissions.next()).getName();
                modelPermissions.put(key, true);
            }
        }

        modelRoot.put("setTitle", new SetTitleModel(data));
        modelRoot.put("addToHead", new AddToHeadModel(data));
        modelRoot.put("addTemplatesToHead", new AddTemplatesToHeadModel(data));
        modelRoot.put("setBodyAttributes", new SetBodyAttributesModel(data));

        String templatePath = params.getString("template", null);
        if (templatePath != null)
        {
            StringTokenizer st = new StringTokenizer(templatePath, "/");
            int max = st.countTokens() - 1;
            for (int i=0; i<max; i++)
View Full Code Here

        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

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.