Package org.apache.jetspeed.ajax

Examples of org.apache.jetspeed.ajax.AJAXException


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


    {
        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

    {
        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))
            {
                pm.removePermission(permission);
                return 1;
            }
            return 0;
        }
        catch (SecurityException e)
        {
            throw new AJAXException(e.toString(), e);
        }
    }
View Full Code Here

    throws AJAXException
    {
        String classname = (String)this.permissionMap.get(type);
        if (classname != null)
            return classname;
        throw new AJAXException("Bad resource 'type' parameter: " + type);           
    }
View Full Code Here

            Object[] initArgs = { resource, actions };
            return (Permission)permissionConstructor.newInstance(initArgs);
        }
        catch (Exception e)
        {
            throw new AJAXException("Failed to create permission: " + type, e);
        }
    }
View Full Code Here

     
      boolean duplicateFound = isDuplicateFragment(page.getRootFragment(), portletId);
     
      // Throw an exception if a duplicate is found
      if(duplicateFound == true) {
        throw new AJAXException(portletId + " is already on the page, duplicates are not allowed");
      }
    }
View Full Code Here

                return success;
            }          
            int count = 0;
            String path = getActionParameter(requestContext, "path");
            if (path == null)
                throw new AJAXException("Missing 'path' parameter");            
            Link link = null;
            if (!method.equals("add"))
            {
                link = pageManager.getLink(path);               
            }                       
View Full Code Here

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

    {
        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

                return success;
            }          
            int count = 0;
            String path = getActionParameter(requestContext, "path");
            if (path == null)
                throw new AJAXException("Missing 'path' parameter");            
            Folder folder = null;
            if (!method.equals("add"))
            {
                folder = pageManager.getFolder(path);
            }      
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.ajax.AJAXException

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.