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

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntry$Tags


    }

    public void testEnabled() {
        try {
            UserEntrySet ues = createSampleUser();
            UserEntry ue = (UserEntry)ues.getEntries()[0];
            assertEquals(Boolean.TRUE, ue.getEnabled());
           
            ues = updateSampleUser();
            ue = (UserEntry)ues.getEntries()[0];
            assertEquals(Boolean.FALSE, ue.getEnabled());

            ues = fetchSampleUser();
            ue = (UserEntry)ues.getEntries()[0];
            assertEquals(Boolean.FALSE, ue.getEnabled());
           
        } catch (IOException ioe) {
            fail(ioe.getMessage());
            ioe.printStackTrace();
        } catch (JDOMException je) {
View Full Code Here


        }
        if (c.getEntries().length > 1) {
            throw new BadRequestException("ERROR: Cannot put >1 entries per request");
        }
       
        UserEntry entry = (UserEntry)c.getEntries()[0];
        if (entry.getName() != null && !entry.getName().equals(getUri().getEntryId())) {
            throw new BadRequestException("ERROR: Content name does not match URI name");
        }
        entry.setName(getUri().getEntryId());
        c = updateUsers((UserEntrySet)c);
       
        return c;
    }
View Full Code Here

        try {
            UserManager mgr = getRoller().getUserManager();
           
            List userDatas = new ArrayList();
            for (int i = 0; i < c.getEntries().length; i++) {
                UserEntry entry = (UserEntry)c.getEntries()[i];
                if (entry.getDateCreated() == null) {
                    // if no creation date supplied, add it
                    entry.setDateCreated(new Date());
                }
                User ud = toUserData(entry);
                mgr.addUser(ud);
                getRoller().flush();
                CacheManager.invalidate(ud);
View Full Code Here

    }
       
    private UserEntrySet updateUsers(UserEntrySet c) throws HandlerException {
        List userDatas = new ArrayList();
        for (int i = 0; i < c.getEntries().length; i++) {
            UserEntry entry = (UserEntry)c.getEntries()[i];
            User ud = getUserData(entry.getName());
            updateUserData(ud, entry);
            userDatas.add(ud);
        }
        return toUserEntrySet((User[])userDatas.toArray(new User[0]));
    }
View Full Code Here

        }
       
        // password field is not set
        // we never return password field
       
        UserEntry ue = new UserEntry(ud.getUserName(), getUrlPrefix());
        ue.setScreenName(ud.getScreenName());
        ue.setFullName(ud.getFullName());
        ue.setLocale(ud.getLocale());
        ue.setTimezone(ud.getTimeZone());
        ue.setEmailAddress(ud.getEmailAddress());
        ue.setDateCreated(ud.getDateCreated());
        ue.setEnabled(ud.getEnabled());
       
        return ue;
    }
View Full Code Here

       
        return mesResponse;
    }
   
    protected UserEntrySet deleteSampleUser(boolean test) throws IOException, JDOMException, UnexpectedRootElementException {
        UserEntry ue = getSampleUserEntry();
       
        HttpResponse res = delete(ue.getHref(), getUser(), getPassword());
        if (test) {
            assertEquals(200, res.getStatus());
        } else if (res.getStatus() != 200) {
            return null;
        }
View Full Code Here

       
        return uesResponse;
    }
   
    protected UserEntrySet fetchSampleUser() throws IOException, JDOMException, UnexpectedRootElementException {
        UserEntry ue = getSampleUserEntry();
       
        HttpResponse res = get(ue.getHref(), getUser(), getPassword());
        assertEquals(200, res.getStatus());
       
        UserEntrySet uesResponse = null;
        InputStream responseBody = res.getResponseBody();
        if (responseBody != null) {
View Full Code Here

        //System.err.println("password=" + password);
        return password;
    }
   
    protected static UserEntry getSampleUserEntry() {
        UserEntry ue = new UserEntry("foo", getEndpointUrl());
        ue.setEmailAddress("foo@bar.org");
        ue.setFullName("Foo Bar");
        ue.setScreenName("foobar");
        ue.setLocale(Locale.getDefault());
        ue.setTimezone(TimeZone.getDefault());
        ue.setPassword("foo");
        ue.setEnabled(Boolean.TRUE);
       
        return ue;
    }
View Full Code Here

        me.setPermission(MemberEntry.Permissions.AUTHOR);
        return me;
    }
   
    protected static UserEntry updateSampleUserEntry(UserEntry ue) {
        UserEntry ueUpdate = new UserEntry(ue.getName(), getEndpointUrl());
        ueUpdate.setEmailAddress("billy@bob.org");
        ueUpdate.setFullName("Billy Bob");
        ueUpdate.setScreenName("billybob");
        ueUpdate.setLocale(new Locale("ms", "MY"));
        ueUpdate.setTimezone(TimeZone.getTimeZone("Asia/Kuala_Lumpur"));
        ueUpdate.setPassword("billy");
        ueUpdate.setEnabled(Boolean.FALSE);
       
        return ueUpdate;
    }
View Full Code Here

       
        return meUpdate;
    }
   
    protected static UserEntrySet updateSampleUserEntrySet(UserEntrySet ues) {
        UserEntry ue = (UserEntry)ues.getEntries()[0];
        UserEntry ueUpdated = updateSampleUserEntry(ue);
        UserEntrySet uesUpdated = new UserEntrySet(getEndpointUrl());
        uesUpdated.setEntries(new UserEntry[] { ueUpdated });
       
        return uesUpdated;
    }
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.webservices.adminprotocol.sdk.UserEntry$Tags

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.