Package org.nuxeo.ecm.core.api

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


        }
    }

    private static void makePublicDashboardUnreadable(CoreSession session,
            SocialWorkspace socialWorkspace) throws ClientException {
        PathRef dashboardSpacesRootRef = new PathRef(
                socialWorkspace.getDashboardSpacesRootPath());
        DocumentModel dashboardSpacesRoot = session.getDocument(dashboardSpacesRootRef);
        ACP acp = dashboardSpacesRoot.getACP();
        acp.removeACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
        dashboardSpacesRoot.setACP(acp, true);
        session.saveDocument(dashboardSpacesRoot);

        PathRef privateDashboardSpaceRef = new PathRef(
                socialWorkspace.getPrivateDashboardSpacePath());
        DocumentModel privateDashboardSpace = session.getDocument(privateDashboardSpaceRef);
        acp = privateDashboardSpace.getACP();
        acp.removeACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
        privateDashboardSpace.setACP(acp, true);
View Full Code Here


            this.contextPath = contextPath;
        }

        @Override
        public void run() throws ClientException {
            DocumentRef docRef = new PathRef(contextPath);
            if (session.exists(docRef)) {
                DocumentModel doc = session.getDocument(docRef);
                documentActivityObject = ActivityHelper.createDocumentActivityObject(doc);
            }
        }
View Full Code Here

            DocumentModel contextDocument, String spaceName,
            Map<String, String> parameters) throws SpaceException {
        try {
            if (isSocialWorkspace(contextDocument)) {
                SocialWorkspace socialWorkspace = toSocialWorkspace(contextDocument);
                DocumentModel doc = session.getDocument(new PathRef(
                        socialWorkspace.getPrivateDashboardSpacePath()));
                return doc.getAdapter(Space.class);
            } else {
                // assume dashboard spaces root
                DocumentModel doc = session.getDocument(new PathRef(
                        contextDocument.getPathAsString() + "/"
                                + PRIVATE_DASHBOARD_SPACE_NAME));
                return doc.getAdapter(Space.class);
            }
        } catch (ClientException e) {
View Full Code Here

    protected Space getOrCreateSpace(CoreSession session,
            Map<String, String> parameters) throws ClientException {
        DocumentModel socialWorkspaceContainer = getSocialWorkspaceService().getSocialWorkspaceContainer(
                session);
        DocumentRef collaborationDashboardSpaceRef = new PathRef(
                socialWorkspaceContainer.getPathAsString(),
                COLLABORATION_DASHBOARD_SPACE_NAME);
        if (session.exists(collaborationDashboardSpaceRef)) {
            DocumentModel collaborationDashboardSpace = session.getDocument(collaborationDashboardSpaceRef);
            return collaborationDashboardSpace.getAdapter(Space.class);
View Full Code Here

            DocumentModel contextDocument, String spaceName,
            Map<String, String> parameters) throws SpaceException {
        try {
            if (isSocialWorkspace(contextDocument)) {
                SocialWorkspace socialWorkspace = toSocialWorkspace(contextDocument);
                DocumentModel doc = session.getDocument(new PathRef(
                        socialWorkspace.getPublicDashboardSpacePath()));
                return doc.getAdapter(Space.class);
            } else {
                // assume dashboard spaces root
                DocumentModel doc = session.getDocument(new PathRef(
                        contextDocument.getPathAsString() + "/"
                                + PUBLIC_DASHBOARD_SPACE_NAME));
                return doc.getAdapter(Space.class);
            }
        } catch (ClientException e) {
View Full Code Here

        Long targetLimit = null;
        if (limit != null) {
            targetLimit = limit.longValue();
        }

        DocumentModel doc = session.getDocument(new PathRef(contextPath));
        if (StringUtils.isBlank(activityStreamName)) {
            // assume we are on a Social workspace
            activityStreamName = "socialWorkspaceWallActivityStream";
        }
View Full Code Here

        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

        activity.setPublishedDate(now.plusHours(4).toDate());
        activityStreamService.addActivity(activity);
    }

    protected void createDocumentsWithBender() throws ClientException {
        DocumentModel workspacesDocument = session.getDocument(new PathRef(
                "/default-domain/workspaces"));
        ACP acp = workspacesDocument.getACP();
        ACL acl = acp.getOrCreateACL();
        acl.add(new ACE("Bender", EVERYTHING, true));
        acl.add(new ACE("Leela", READ, true));
View Full Code Here

                socialWorkspaceDoc.getRef(), EVERYTHING));
    }

    @Test
    public void testPublicSocialWorkspaceRights() throws Exception {
        PathRef publicSectionPathRef = new PathRef(
                socialWorkspace.getPublicSectionPath());
        assertTrue(session.exists(publicSectionPathRef));
        assertNotNull(session.getDocument(publicSectionPathRef));
        PathRef publicDashboardPathRef = new PathRef(
                socialWorkspace.getPublicDashboardSpacePath());
        assertTrue(session.exists(publicDashboardPathRef));
        assertNotNull(session.getDocument(publicDashboardPathRef));

        // public section
View Full Code Here

                publicDashboardPathRef, EVERYTHING));
    }

    @Test
    public void testPrivateSocialWorkspaceRights() throws Exception {
        PathRef privateSectionPathRef = new PathRef(
                socialWorkspace.getPrivateSectionPath());
        assertTrue(session.exists(privateSectionPathRef));
        assertNotNull(session.getDocument(privateSectionPathRef));
        PathRef privateDashboardPathRef = new PathRef(
                socialWorkspace.getPrivateDashboardSpacePath());
        assertTrue(session.exists(privateDashboardPathRef));
        assertNotNull(session.getDocument(privateDashboardPathRef));

        // private section
View Full Code Here

TOP

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

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.