Package org.nuxeo.ecm.core.api

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


    public String navigateToCollaborationView() throws ClientException {
        DocumentModel currentDocument = navigationContext.getCurrentDocument();
        if (isSocialWorkspace(currentDocument)) {
            SocialWorkspace socialWorkspace = toSocialWorkspace(currentDocument);
            DocumentModel dashboardSpacesRoot = documentManager.getDocument(new PathRef(
                    socialWorkspace.getDashboardSpacesRootPath()));
            webActions.setCurrentTabIds(SocialWorkspaceActions.MAIN_TABS_COLLABORATION);
            return navigationContext.navigateToDocument(dashboardSpacesRoot,
                    COLLABORATION_VIEW_ID);
        } else if (isSocialDocument(currentDocument)) {
View Full Code Here


            throws ClientException {
        DocumentModel currentDocument = navigationContext.getCurrentDocument();

        SocialWorkspace socialWorkspace = socialWorkspaceService.getDetachedSocialWorkspace(currentDocument);
        if (socialWorkspace != null) {
            DocumentModel dashboardSpacesRoot = documentManager.getDocument(new PathRef(
                    socialWorkspace.getDashboardSpacesRootPath()));
            return navigationContext.navigateToDocument(dashboardSpacesRoot,
                    listingView);
        } else {
            return navigationContext.navigateToDocument(currentDocument);
View Full Code Here

            return currentDoc.getRef();
        }

        SocialWorkspace socialWorkspace = socialWorkspaceActions.getSocialWorkspace();
        if (NEWS_ITEM_TYPE.equals(type)) {
            return new PathRef(socialWorkspace.getNewsItemsRootPath());
        }

        if (SOCIAL_WORKSPACE_TYPE.equals(type)) {
            return socialWorkspaceActions.getSocialWorkspaceContainer().getRef();
        }
View Full Code Here

                    "Given document is not into a social workspace");
        }
    }

    protected DocumentModel getPrivateSection() throws ClientException {
        DocumentRef pathRef = new PathRef(
                socialWorkspace.getPrivateSectionPath());
        if (privateSocialSection == null) {
            privateSocialSection = getSession().getDocument(pathRef);
        }
        return privateSocialSection;
View Full Code Here

        }
        return privateSocialSection;
    }

    protected DocumentModel getPublicSection() throws ClientException {
        DocumentRef pathRef = new PathRef(
                socialWorkspace.getPublicSectionPath());
        if (publicSocialSection == null) {
            publicSocialSection = getSession().getDocument(pathRef);
        }
        return publicSocialSection;
View Full Code Here

    }

    @Override
    public DocumentModel getSocialWorkspaceContainer(CoreSession session) {
        try {
            return session.getDocument(new PathRef(
                    socialWorkspaceContainer.getPath()));
        } catch (ClientException e) {
            throw new ClientRuntimeException(e);
        }
    }
View Full Code Here

    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

        }
    }

    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

        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

        }
    }

    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

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.