Examples of AJAXException


Examples of org.apache.jetspeed.ajax.AJAXException

                link.setHidden(!link.isHidden());                                   
            count++;
        }
        catch (Exception e)
        {
            throw new AJAXException(e);
        }       
        return count;
    }
View Full Code Here

Examples of org.apache.jetspeed.ajax.AJAXException

    {
        String name = getActionParameter(requestContext, "name");
        String language = getActionParameter(requestContext, "lang");
        String value = getActionParameter(requestContext, "value");
        if (isBlank(name) || isBlank(language))
            throw new AJAXException("Invalid Metadata: name, language invalid data.");
        Locale locale = new Locale(language);
        node.getMetadata().addField(locale, name, value);       
        return 1;
    }
View Full Code Here

Examples of org.apache.jetspeed.ajax.AJAXException

        String value = getActionParameter(requestContext, "value");
        String oldName = getActionParameter(requestContext, "oldname");
        String oldLanguage = getActionParameter(requestContext, "oldlang");

        if (isBlank(name) || isBlank(language) || isBlank(oldName) || isBlank(oldLanguage))
            throw new AJAXException("Invalid Metadata: name, language invalid data.");
               
        Collection cfields = node.getMetadata().getFields(oldName);
        if (cfields == null || cfields.size() == 0)
        {
            return insertMetadata(requestContext, resultMap, node);           
View Full Code Here

Examples of org.apache.jetspeed.ajax.AJAXException

    throws AJAXException
    {
        String name = getActionParameter(requestContext, "name");
        String language = getActionParameter(requestContext, "lang");
        if (isBlank(name) || isBlank(language))
            throw new AJAXException("Invalid Metadata: name, language invalid data.");
        Collection cfields = node.getMetadata().getFields(name);
        Collection allFields = node.getMetadata().getFields();
        if (cfields == null || cfields.size() == 0)
        {
            return 0;           
View Full Code Here

Examples of org.apache.jetspeed.ajax.AJAXException

    throws AJAXException
    {
        String name = getActionParameter(requestContext, "name");
        String kind = getActionParameter(requestContext, "kind");
        if (isBlank(name) || isBlank(kind))
            throw new AJAXException("Invalid Security Ref: name invalid data.");
        if (node.getSecurityConstraints() == null)
        {
            SecurityConstraints cons = node.newSecurityConstraints();
            node.setSecurityConstraints(cons);            
        }
View Full Code Here

Examples of org.apache.jetspeed.ajax.AJAXException

    {
        String name = getActionParameter(requestContext, "name");
        String oldName = getActionParameter(requestContext, "oldname");
        String kind = getActionParameter(requestContext, "kind");
        if (isBlank(name) || isBlank(oldName) || isBlank(kind))
            throw new AJAXException("Invalid Security Ref: name invalid data.");
        if (node.getSecurityConstraints() == null)
        {
            SecurityConstraints cons = node.newSecurityConstraints();
            node.setSecurityConstraints(cons);            
        }               
View Full Code Here

Examples of org.apache.jetspeed.ajax.AJAXException

    throws AJAXException
    {
        String name = getActionParameter(requestContext, "name");
        String kind = getActionParameter(requestContext, "kind");
        if (isBlank(name) || isBlank(kind))
            throw new AJAXException("Invalid Security Ref: name invalid data.");
        if (node.getSecurityConstraints() == null)
        {
            return 0;
        }
        if (kind.equals("Owner"))
View Full Code Here

Examples of org.apache.jetspeed.ajax.AJAXException

    protected int removeSecurityDef(RequestContext requestContext, Map resultMap, Node node)
    throws AJAXException
    {
        String id = getActionParameter(requestContext, "id");
        if (isBlank(id))
            throw new AJAXException("Invalid Security Ref: id invalid data.");
        if (node.getSecurityConstraints() == null)
        {
            return 0;
        }
        List defs = node.getSecurityConstraints().getSecurityConstraints();
View Full Code Here

Examples of org.apache.jetspeed.ajax.AJAXException

    {
        try
        {
            String type = getActionParameter(requestContext, "type");
            if (type == null)
                throw new AJAXException("Missing 'type' parameter");
            String resource = getActionParameter(requestContext, "resource");
            if (resource == null)
                throw new AJAXException("Missing 'resource' parameter");
            String actions = getActionParameter(requestContext, "actions");
            if (actions == null)
                throw new AJAXException("Missing 'actions' parameter");
           
            Permission permission = createPermissionFromClass(type, resource, actions);           
            if (pm.permissionExists(permission))
            {
                throw new AJAXException("Permission " + resource + " already exists");
            }  
           
            pm.addPermission(permission);           
            String roleNames = getActionParameter(requestContext, "roles");
            return updateRoles(permission, roleNames);
        }
        catch (SecurityException e)
        {
            throw new AJAXException(e.toString(), e);
        }       
    }
View Full Code Here

Examples of org.apache.jetspeed.ajax.AJAXException

    {
        try
        {
            String type = getActionParameter(requestContext, "type");
            if (type == null)
                throw new AJAXException("Missing 'type' parameter");
            String resource = getActionParameter(requestContext, "resource");
            if (resource == null)
                throw new AJAXException("Missing 'resource' parameter");
            String actions = getActionParameter(requestContext, "actions");
            if (actions == null)
                throw new AJAXException("Missing 'actions' parameter");
            String oldActions = getActionParameter(requestContext, "oldactions");
            if (oldActions == null)
            {
                // assume no change
                oldActions = actions;
            }
            Permission permission = null;
            if (!oldActions.equals(actions))
            {
                permission = createPermissionFromClass(type, resource, oldActions);
                pm.removePermission(permission);
                permission = createPermissionFromClass(type, resource, actions);
                pm.addPermission(permission);
            }  
            else
            {
                permission = createPermissionFromClass(type, resource, actions);
            }
            String roleNames = getActionParameter(requestContext, "roles");
            return updateRoles(permission, roleNames);
        }
        catch (SecurityException e)
        {
            throw new AJAXException(e.toString(), e);
        }       
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.