Package org.apache.roller.webservices.adminapi.sdk

Examples of org.apache.roller.webservices.adminapi.sdk.UserEntry


    }

    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) {
            fail(je.getMessage());
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.setLocale(Locale.getDefault());
        ue.setTimezone(TimeZone.getDefault());
        ue.setPassword("foo");
       
        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.setLocale(new Locale("ms", "MY"));
        ueUpdate.setTimezone(TimeZone.getTimeZone("Asia/Kuala_Lumpur"));
        ueUpdate.setPassword("billy");
       
        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

       
        return we;
    }   
   
    protected static UserEntrySet getSampleUserEntrySet() {
        UserEntry ue = getSampleUserEntry();
        UserEntrySet ues = new UserEntrySet(getEndpointUrl());
        ues.setEntries(new UserEntry[] { ue });
       
        return ues;
    }
View Full Code Here

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

       
        return uesResponse;
    }

    protected UserEntrySet fetchSampleUser() throws IOException, JDOMException, MissingElementException, 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

        }
        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());
                }
                UserData ud = toUserData(entry);
                mgr.addUser(ud);
                getRoller().flush();
                CacheManager.invalidate(ud);
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];
                UserData ud = mgr.getUserByUserName(entry.getName());
                if (ud == null) {
                    throw new NotFoundException("ERROR: Unknown user: " + entry.getName());
                }
                updateUserData(ud, entry);
                userDatas.add(ud);
            }
            return toUserEntrySet((UserData[])userDatas.toArray(new UserData[0]));
View Full Code Here

TOP

Related Classes of org.apache.roller.webservices.adminapi.sdk.UserEntry

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.