Package org.nuxeo.ecm.automation

Examples of org.nuxeo.ecm.automation.OperationContext


    protected static PaginableDocumentModelList getChildren(DocumentModel doc,
            int pageSize, int page) throws Exception {
        CoreSession session = doc.getCoreSession();

        OperationContext ctx = new OperationContext(session);
        OperationChain chain = new OperationChain("getChildren");

        String query = "SELECT * FROM Document "
                + "WHERE ecm:mixinType != 'HiddenInNavigation' "
                + "AND ecm:isCheckedInVersion = 0 "
View Full Code Here


    protected static PaginableDocumentModelList search(DocumentModel doc,
            int pageSize, int page, String queryText) throws Exception {
        CoreSession session = doc.getCoreSession();

        OperationContext ctx = new OperationContext(session);
        OperationChain chain = new OperationChain("search");

        String escapedQueryText = NXQLQueryBuilder.prepareStringLiteral(
                queryText.trim(), false, true);
View Full Code Here

        if (sw == null) {
            log.info("Event is handling a non social workspace document");
            return;
        }

        OperationContext ctx = new OperationContext(docCtx.getCoreSession());
        ctx.setInput(docCtx.getSourceDocument());
        ctx.put("addedMembers", buildPrincipalsString(addedMembers));
        ctx.put("removedMembers", buildPrincipalsString(removedMembers));

        Expression from = Scripting.newExpression("Env[\"mail.from\"]");
        // join both list to remove email of directly affected members
        addedMembers.addAll(removedMembers);
        StringList to = buildRecipientsList(sw, addedMembers);
View Full Code Here

    protected AutomationService automationService;

    @Test
    public void shouldAddAMiniMessage() throws Exception {
        try (CoreSession newSession = openSessionAs("Leela")) {
            OperationContext ctx = new OperationContext(newSession);
            assertNotNull(ctx);

            OperationChain chain = new OperationChain(
                    "testMiniMessageOperation");
            chain.add(AddMiniMessage.ID).set("message",
View Full Code Here

    }

    @Test
    public void shouldGetNoMiniMessage() throws Exception {
        try (CoreSession newSession = openSessionAs("Leela")) {
            OperationContext ctx = new OperationContext(newSession);
            assertNotNull(ctx);

            OperationChain chain = new OperationChain(
                    "testMiniMessageOperation");
            chain.add(GetMiniMessages.ID);
View Full Code Here

    @SuppressWarnings("unchecked")
    public void shouldGetPaginatedMiniMessages() throws Exception {
        initializeSomeMiniMessagesAndRelations();
        try (CoreSession newSession = openSessionAs("Leela")) {

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

            OperationChain chain = new OperationChain(
                    "testMiniMessageOperation");
            chain.add(GetMiniMessages.ID);
View Full Code Here

            List<MiniMessage> messages = miniMessageService.getMiniMessageFrom(
                    benderActivityObject, 0, 0);
            assertEquals(5, messages.size());
            MiniMessage miniMessage = messages.get(0);

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

            OperationChain chain = new OperationChain(
                    "testMiniMessageOperation");
            chain.add(RemoveMiniMessage.ID).set("miniMessageId",
View Full Code Here

            List<MiniMessage> messages = miniMessageService.getMiniMessageFrom(
                    benderActivityObject, 0, 0);
            assertEquals(5, messages.size());
            MiniMessage miniMessage = messages.get(0);

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

            OperationChain chain = new OperationChain(
                    "testMiniMessageOperation");
            chain.add(RemoveMiniMessage.ID).set("miniMessageId",
View Full Code Here

        Framework.getLocalService(EventService.class).waitForAsyncCompletion();
    }

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

        OperationChain chain = new OperationChain("fakeChain");
        OperationParameters oParams = new OperationParameters(
                SocialProviderOperation.ID);
View Full Code Here

        assertEquals(1, result.size()); // return only the public article
    }

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

        OperationChain chain = new OperationChain("fakeChain");
        OperationParameters oParams = new OperationParameters(
                SocialProviderOperation.ID);
View Full Code Here

TOP

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

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.