Package org.nuxeo.ecm.core.api

Examples of org.nuxeo.ecm.core.api.DocumentModelList


        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


        session.followTransition(publicNews.getRef(), DELETE_TRANSITION);
        assertEquals(0, getNumberOfProxy(publicNews));

        String query = "Select * from NewsItem where ecm:isProxy = 1";
        DocumentModelList proxies = session.query(query);
        assertEquals(1, proxies.size());
    }
View Full Code Here

        assertEquals(1, getNumberOfProxy(publicArticle));
        session.followTransition(publicArticle.getRef(), DELETE_TRANSITION);
        assertEquals(0, getNumberOfProxy(publicArticle));

        String query = "Select * from NewsItem where ecm:isProxy = 1";
        DocumentModelList proxies = session.query(query);
        assertEquals(0, proxies.size());
    }
View Full Code Here

            Map<String, Serializable> relationship = new HashMap<String, Serializable>();
            relationship.put(RELATIONSHIP_FIELD_ACTOR, actorId);
            relationship.put(RELATIONSHIP_FIELD_TARGET, targetId);
            relationship.put(RELATIONSHIP_FIELD_KIND, kind.toString());

            DocumentModelList relationships = relationshipsDirectory.query(relationship);
            if (relationships.isEmpty()) {
                relationshipsDirectory.createEntry(new HashMap<String, Object>(
                        relationship));
                return true;
            } else {
                return false;
View Full Code Here

            }
            if (!(kind == null || kind.isEmpty())) {
                filter.put(RELATIONSHIP_FIELD_KIND, kind.toString());
            }

            DocumentModelList relations = relationshipDirectory.query(filter,
                    filter.keySet());
            if (relations.isEmpty()) {
                log.warn("Trying to delete a relationship that doesn't exists");
                return false;
            } else {
                for (DocumentModel relation : relations) {
                    relationshipDirectory.deleteEntry(relation.getId());
View Full Code Here

TOP

Related Classes of org.nuxeo.ecm.core.api.DocumentModelList

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.