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

Examples of org.apache.roller.weblogger.webservices.adminprotocol.sdk.WeblogEntrySet


        return ues;
    }
   
    protected static WeblogEntrySet getSampleWeblogEntrySet() {
        WeblogEntry we = getSampleWeblogEntry();
        WeblogEntrySet wes = new WeblogEntrySet(getEndpointUrl());
        wes.setEntries(new WeblogEntry[] { we });
       
        return wes;
    }
View Full Code Here


import org.apache.roller.weblogger.webservices.adminapi.AappTest;
import org.jdom.JDOMException;

public class WeblogEntryTest extends AappTest {
    public void testEquals() {
        WeblogEntrySet wes1 = getSampleWeblogEntrySet();
        WeblogEntrySet wes2 = getSampleWeblogEntrySet();
       
        assertEquals(wes1, wes2);
    }
View Full Code Here

        assertEquals(wes1, wes2);
    }
   
    public void testDocumentMarshal() {
        try {
            WeblogEntrySet wes1 = getSampleWeblogEntrySet();
            Document d = wes1.toDocument();
           
            WeblogEntrySet wes2 = new WeblogEntrySet(d, getEndpointUrl());
           
            assertEquals(wes1, wes2);
        } catch (UnexpectedRootElementException uree) {
            fail(uree.getMessage());
        }
View Full Code Here

        }
    }
   
    public void testStreamMarshal() {
        try {
            WeblogEntrySet wes1 = getSampleWeblogEntrySet();
            String s = wes1.toString();
            InputStream stream = new ByteArrayInputStream(s.getBytes("UTF-8"));
           
            WeblogEntrySet wes2 = new WeblogEntrySet(stream, getEndpointUrl());
           
            assertEquals(wes1, wes2);
        } catch (UnexpectedRootElementException uree) {
            fail(uree.getMessage());
        } catch (IOException ioe) {
View Full Code Here

    public RollerWeblogHandler(HttpServletRequest request) throws HandlerException {
        super(request);
    }
   
    protected EntrySet getEntrySet(Document d) throws UnexpectedRootElementException {
        return new WeblogEntrySet(d, getUrlPrefix());
    }
View Full Code Here

        if (uds == null) {
            throw new NullPointerException("ERROR: Null user data not allowed");
        }
        try {
            UserManager umgr = WebloggerFactory.getWeblogger().getUserManager();
            WeblogEntrySet wes = new WeblogEntrySet(getUrlPrefix());
            List entries = new ArrayList();
            for (int i = 0; i < uds.length; i++) {
                User ud = uds[i];
                List<WeblogPermission> perms = umgr.getWeblogPermissions(ud);
                for (WeblogPermission perm : perms) {
                    Weblog wd = perm.getWeblog();
                    WeblogEntry we = toWeblogEntry(wd);
                    entries.add(we);
                }
            }
            wes.setEntries((Entry[])entries.toArray(new Entry[0]));
            return wes;
           
        } catch (WebloggerException ex) {
            throw new InternalException("ERROR retrieving users weblogs", ex);
        }
View Full Code Here

    private WeblogEntrySet toWeblogEntrySet(Weblog[] wds) throws HandlerException {
        if (wds == null) {
            throw new NullPointerException("ERROR: Null website datas not allowed");
        }
       
        WeblogEntrySet wes = new WeblogEntrySet(getUrlPrefix());
        List entries = new ArrayList();
        for (int i = 0; i < wds.length; i++) {
            WeblogEntry we = toWeblogEntry(wds[i]);
            entries.add(we);
        }
        wes.setEntries((Entry[])entries.toArray(new Entry[0]));
       
        return wes;
    }
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.webservices.adminprotocol.sdk.WeblogEntrySet

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.