Package org.nuxeo.ecm.automation

Examples of org.nuxeo.ecm.automation.OperationParameters


    public void testSocialProviderOperation() throws Exception {
        OperationContext ctx = new OperationContext(session);
        assertNotNull(ctx);

        OperationChain chain = new OperationChain("fakeChain");
        OperationParameters oParams = new OperationParameters(
                SocialProviderOperation.ID);
        oParams.set("query", "select * from Article where ecm:isProxy = 0");
        oParams.set("contextPath", "/sws2");
        chain.add(oParams);

        DocumentModelList result = (DocumentModelList) service.run(ctx, chain);
        assertEquals(2, result.size());

        // remove current user from admins of sws2
        DocumentModel sws = session.getDocument(new PathRef("/sws2"));
        SocialWorkspace socialWorkspace = toSocialWorkspace(sws);

        oParams.set("query", "select * from Article where ecm:isProxy = 1");
        result = (DocumentModelList) service.run(ctx, chain);
        assertEquals(1, result.size()); // return only the public article
    }
View Full Code Here


    public void testOnlyPublicDocumentsParameters() throws Exception {
        OperationContext ctx = new OperationContext(session);
        assertNotNull(ctx);

        OperationChain chain = new OperationChain("fakeChain");
        OperationParameters oParams = new OperationParameters(
                SocialProviderOperation.ID);
        oParams.set("query", "select * from Article");
        oParams.set("contextPath", "/sws2");
        oParams.set("onlyPublicDocuments", "true");
        chain.add(oParams);

        DocumentModelList result = (DocumentModelList) service.run(ctx, chain);
        assertEquals(1, result.size());

        oParams.set("onlyPublicDocuments", "false");
        result = (DocumentModelList) service.run(ctx, chain);
        assertEquals(3, result.size());

        oParams.set("onlyPublicDocuments", "wrong string for a boolean");
        result = (DocumentModelList) service.run(ctx, chain);
        assertEquals(3, result.size());

    }
View Full Code Here

        OperationContext ctx = new OperationContext(session);
        assertNotNull(ctx);

        OperationChain chain = new OperationChain("fakeChain");
        OperationParameters oParams = new OperationParameters(
                GetSocialWorkspaceMembers.ID);
        oParams.set("pattern", "testU%");
        oParams.set("page", 0);
        oParams.set("pageSize", 5);
        oParams.set("contextPath", "/testSocialWorkspace");
        chain.add(oParams);

        Blob result = (Blob) automationService.run(ctx, chain);
        JSONObject o = JSONObject.fromObject(result.getString());
        JSONArray array = (JSONArray) o.get("users");
View Full Code Here

TOP

Related Classes of org.nuxeo.ecm.automation.OperationParameters

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.