Examples of PathRef


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

    private static void initializeNewsItemsRootRights(
            SocialWorkspace socialWorkspace) {
        try {
            CoreSession session = socialWorkspace.getDocument().getCoreSession();
            PathRef newsItemsRootPath = new PathRef(
                    socialWorkspace.getNewsItemsRootPath());
            DocumentModel newsItemsRoot = session.getDocument(newsItemsRootPath);

            ACP acp = newsItemsRoot.getACP();
            ACL acl = acp.getOrCreateACL(NEWS_ITEMS_ROOT_ACL_NAME);
View Full Code Here

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

        }
    }

    private void makePublicSectionReadable(CoreSession session,
            SocialWorkspace socialWorkspace) throws ClientException {
        PathRef publicSectionRef = new PathRef(
                socialWorkspace.getPublicSectionPath());
        DocumentModel publicSection = session.getDocument(publicSectionRef);

        ACP acp = publicSection.getACP();
        ACL acl = acp.getOrCreateACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
View Full Code Here

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

        acl.add(new ACE(defaultGroup, READ, true));
    }

    private void makePublicDashboardReadable(CoreSession session,
            SocialWorkspace socialWorkspace) throws ClientException {
        PathRef dashboardSpacesRootRef = new PathRef(
                socialWorkspace.getDashboardSpacesRootPath());
        DocumentModel dashboardSpacesRoot = session.getDocument(dashboardSpacesRootRef);
        ACP acp = dashboardSpacesRoot.getACP();
        ACL acl = acp.getOrCreateACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
        acl.clear();
        addReadForDefaultGroup(acl);
        dashboardSpacesRoot.setACP(acp, true);
        session.saveDocument(dashboardSpacesRoot);

        PathRef privateDashboardSpaceRef = new PathRef(
                socialWorkspace.getPrivateDashboardSpacePath());
        DocumentModel privateDashboardSpace = session.getDocument(privateDashboardSpaceRef);
        acp = privateDashboardSpace.getACP();
        acl = acp.getOrCreateACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
        addSocialWorkspaceACL(acl, socialWorkspace);
View Full Code Here

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

        }
    }

    private static void makePublicSectionUnreadable(CoreSession session,
            SocialWorkspace socialWorkspace) throws ClientException {
        PathRef publicSectionRef = new PathRef(
                socialWorkspace.getPublicSectionPath());
        DocumentModel publicSection = session.getDocument(publicSectionRef);

        ACP acp = publicSection.getACP();
        acp.removeACL(PUBLIC_SOCIAL_WORKSPACE_ACL_NAME);
View Full Code Here

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

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

            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

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

            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

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

    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

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

            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

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

        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
TOP
Copyright © 2018 www.massapi.com. 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.