Package org.apache.roller.weblogger.webservices.adminprotocol.sdk

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.MemberEntry$Permissions


       
        return wes;
    }
   
    protected static MemberEntrySet getSampleMemberEntrySet() {
        MemberEntry me = getSampleMemberEntry();
        MemberEntrySet mes = new MemberEntrySet(getEndpointUrl());
        mes.setEntries(new MemberEntry[] { me });
       
        return mes;
    }
View Full Code Here


            throw new BadRequestException("ERROR: Cannot put >1 entries per request");
        }
       
        // only one entry
        // if there's zero entries, this is a nop
        MemberEntry entry = (MemberEntry)c.getEntries()[0];
       
        MemberURI muri = (MemberURI)getUri();
       
        // get handle
        // if there's no handle in the entry, set it
        // if the entry and URI handles do not match, exception
        String handle = muri.getHandle();
        if (entry.getHandle() == null) {
            entry.setHandle(handle);
        } else if (!entry.getHandle().equals(handle)) {
            throw new BadRequestException("ERROR: URI and entry handle do not match");
        }
       
        // get username
        // if there's no name in the entry or the URI, exception
        // if there's no name in the entry, set it
        // if the names in the entry and URI do not match, exception
        String username = muri.getUsername();
        if (entry.getName() == null) {
            if (username == null) {
                throw new BadRequestException("ERROR: No user name in URI or entry");
            }
            entry.setName(username);
        } else if (username != null && !entry.getName().equals(username)) {
            throw new BadRequestException("ERROR: URI and entry user name do not match");
        }
       
        c = updateMembers((MemberEntrySet)c);
       
View Full Code Here

        try {
            UserManager mgr = getRoller().getUserManager();
           
            List<WeblogPermission> perms= new ArrayList<WeblogPermission>();
            for (int i = 0; i < c.getEntries().length; i++) {
                MemberEntry entry = (MemberEntry)c.getEntries()[i];
                User ud = getUserData(entry.getName());
                Weblog wd = getWebsiteData(entry.getHandle());
                mgr.grantWeblogPermission(wd, ud, toActionList(entry.getPermission()));
                getRoller().flush();
                CacheManager.invalidate(ud);
                CacheManager.invalidate(wd);
               
                WeblogPermission pd = mgr.getWeblogPermission(wd, ud);
View Full Code Here

    }
   
    private MemberEntrySet updateMembers(MemberEntrySet c) throws HandlerException {
        List<WeblogPermission> permissionsDatas= new ArrayList<WeblogPermission>();
        for (int i = 0; i < c.getEntries().length; i++) {
            MemberEntry entry = (MemberEntry)c.getEntries()[i];
            WeblogPermission pd = getPermissionsData(entry);
            if (pd == null) {
                throw new NotFoundException("ERROR: Permissions do not exist for weblog handle: " + entry.getHandle() + ", user name: " + entry.getName());
            }
            updatePermissionsData(pd, entry);
            permissionsDatas.add(pd);
        }
        return toMemberEntrySet(permissionsDatas);
View Full Code Here

    private MemberEntry toMemberEntry(WeblogPermission pd) throws HandlerException  {
        try {
            if (pd == null) {
                throw new NullPointerException("ERROR: Null permission data not allowed");
            }
            MemberEntry me = new MemberEntry(pd.getWeblog().getHandle(), pd.getUser().getUserName(), getUrlPrefix());
            me.setPermission(actionsToString(pd));
            return me;
           
        } catch (WebloggerException ex) {
            throw new InternalException("ERROR: getting user or weblog", ex);
        }
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.webservices.adminprotocol.sdk.MemberEntry$Permissions

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.